From 84fb1febb2e50ba9aa1c7d863eb31ab0aab52e25 Mon Sep 17 00:00:00 2001 From: "owlbot-bootstrapper[bot]" <104649659+owlbot-bootstrapper[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 10:23:42 -0700 Subject: [PATCH 01/46] feat: add initial files for google.cloud.support.v2 (#4288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: initial commit * feat: initial generation of library Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6IjQ5YzU1Mjg0YmE3ZjMyM2M4MjU2ZTljODY1MzhjOTA5NjMzMDVhMTEifQ== * Owl Bot copied code from https://github.com/googleapis/googleapis-gen/commit/49c55284ba7f323c8256e9c86538c90963305a11 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owlbot Bootstrapper Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Co-authored-by: Sofia Leon --- packages/google-cloud-support/.OwlBot.yaml | 19 + packages/google-cloud-support/.eslintignore | 7 + packages/google-cloud-support/.eslintrc.json | 3 + packages/google-cloud-support/.gitattributes | 4 + packages/google-cloud-support/.gitignore | 14 + packages/google-cloud-support/.jsdoc.js | 55 + packages/google-cloud-support/.mocharc.js | 29 + packages/google-cloud-support/.nycrc | 24 + packages/google-cloud-support/.prettierignore | 6 + packages/google-cloud-support/.prettierrc.js | 17 + .../google-cloud-support/.repo-metadata.json | 17 + .../google-cloud-support/CODE_OF_CONDUCT.md | 94 + packages/google-cloud-support/CONTRIBUTING.md | 76 + packages/google-cloud-support/LICENSE | 202 + packages/google-cloud-support/README.md | 207 + .../linkinator.config.json | 16 + packages/google-cloud-support/package.json | 73 + .../google/cloud/support/v2/actor.proto | 47 + .../google/cloud/support/v2/attachment.proto | 59 + .../cloud/support/v2/attachment_service.proto | 82 + .../protos/google/cloud/support/v2/case.proto | 158 + .../cloud/support/v2/case_service.proto | 346 + .../google/cloud/support/v2/comment.proto | 57 + .../cloud/support/v2/comment_service.proto | 107 + .../google/cloud/support/v2/escalation.proto | 53 + .../google-cloud-support/protos/protos.d.ts | 6965 ++++++ .../google-cloud-support/protos/protos.js | 18039 ++++++++++++++++ .../google-cloud-support/protos/protos.json | 1963 ++ .../google-cloud-support/samples/README.md | 248 + ...ase_attachment_service.list_attachments.js | 75 + .../generated/v2/case_service.close_case.js | 61 + .../generated/v2/case_service.create_case.js | 67 + .../v2/case_service.escalate_case.js | 65 + .../generated/v2/case_service.get_case.js | 61 + .../generated/v2/case_service.list_cases.js | 88 + ...ase_service.search_case_classifications.js | 73 + .../generated/v2/case_service.search_cases.js | 103 + .../generated/v2/case_service.update_case.js | 72 + .../v2/comment_service.create_comment.js | 66 + .../v2/comment_service.list_comments.js | 73 + ...ppet_metadata.google.cloud.support.v2.json | 519 + .../google-cloud-support/samples/package.json | 24 + .../samples/quickstart.js | 86 + .../samples/test/quickstart.js | 41 + packages/google-cloud-support/src/index.ts | 41 + .../src/v2/case_attachment_service_client.ts | 895 + ...case_attachment_service_client_config.json | 43 + .../case_attachment_service_proto_list.json | 10 + .../src/v2/case_service_client.ts | 1912 ++ .../src/v2/case_service_client_config.json | 78 + .../src/v2/case_service_proto_list.json | 10 + .../src/v2/comment_service_client.ts | 970 + .../src/v2/comment_service_client_config.json | 48 + .../src/v2/comment_service_proto_list.json | 10 + .../src/v2/gapic_metadata.json | 181 + packages/google-cloud-support/src/v2/index.ts | 21 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 50 + .../system-test/install.ts | 51 + .../test/gapic_case_attachment_service_v2.ts | 973 + .../test/gapic_case_service_v2.ts | 2175 ++ .../test/gapic_comment_service_v2.ts | 1084 + packages/google-cloud-support/tsconfig.json | 19 + .../google-cloud-support/webpack.config.js | 64 + release-please-config.json | 1 + 65 files changed, 39125 insertions(+) create mode 100644 packages/google-cloud-support/.OwlBot.yaml create mode 100644 packages/google-cloud-support/.eslintignore create mode 100644 packages/google-cloud-support/.eslintrc.json create mode 100644 packages/google-cloud-support/.gitattributes create mode 100644 packages/google-cloud-support/.gitignore create mode 100644 packages/google-cloud-support/.jsdoc.js create mode 100644 packages/google-cloud-support/.mocharc.js create mode 100644 packages/google-cloud-support/.nycrc create mode 100644 packages/google-cloud-support/.prettierignore create mode 100644 packages/google-cloud-support/.prettierrc.js create mode 100644 packages/google-cloud-support/.repo-metadata.json create mode 100644 packages/google-cloud-support/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-support/CONTRIBUTING.md create mode 100644 packages/google-cloud-support/LICENSE create mode 100644 packages/google-cloud-support/README.md create mode 100644 packages/google-cloud-support/linkinator.config.json create mode 100644 packages/google-cloud-support/package.json create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/case.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto create mode 100644 packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto create mode 100644 packages/google-cloud-support/protos/protos.d.ts create mode 100644 packages/google-cloud-support/protos/protos.js create mode 100644 packages/google-cloud-support/protos/protos.json create mode 100644 packages/google-cloud-support/samples/README.md create mode 100644 packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.close_case.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.create_case.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.get_case.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js create mode 100644 packages/google-cloud-support/samples/generated/v2/case_service.update_case.js create mode 100644 packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js create mode 100644 packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js create mode 100644 packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json create mode 100644 packages/google-cloud-support/samples/package.json create mode 100644 packages/google-cloud-support/samples/quickstart.js create mode 100644 packages/google-cloud-support/samples/test/quickstart.js create mode 100644 packages/google-cloud-support/src/index.ts create mode 100644 packages/google-cloud-support/src/v2/case_attachment_service_client.ts create mode 100644 packages/google-cloud-support/src/v2/case_attachment_service_client_config.json create mode 100644 packages/google-cloud-support/src/v2/case_attachment_service_proto_list.json create mode 100644 packages/google-cloud-support/src/v2/case_service_client.ts create mode 100644 packages/google-cloud-support/src/v2/case_service_client_config.json create mode 100644 packages/google-cloud-support/src/v2/case_service_proto_list.json create mode 100644 packages/google-cloud-support/src/v2/comment_service_client.ts create mode 100644 packages/google-cloud-support/src/v2/comment_service_client_config.json create mode 100644 packages/google-cloud-support/src/v2/comment_service_proto_list.json create mode 100644 packages/google-cloud-support/src/v2/gapic_metadata.json create mode 100644 packages/google-cloud-support/src/v2/index.ts create mode 100644 packages/google-cloud-support/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-support/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-support/system-test/install.ts create mode 100644 packages/google-cloud-support/test/gapic_case_attachment_service_v2.ts create mode 100644 packages/google-cloud-support/test/gapic_case_service_v2.ts create mode 100644 packages/google-cloud-support/test/gapic_comment_service_v2.ts create mode 100644 packages/google-cloud-support/tsconfig.json create mode 100644 packages/google-cloud-support/webpack.config.js diff --git a/packages/google-cloud-support/.OwlBot.yaml b/packages/google-cloud-support/.OwlBot.yaml new file mode 100644 index 000000000000..896a8f4ba431 --- /dev/null +++ b/packages/google-cloud-support/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/cloud/support/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-support/$1 + +api-name: cloudsupport \ No newline at end of file diff --git a/packages/google-cloud-support/.eslintignore b/packages/google-cloud-support/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-support/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-support/.eslintrc.json b/packages/google-cloud-support/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-support/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-support/.gitattributes b/packages/google-cloud-support/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-support/.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-support/.gitignore b/packages/google-cloud-support/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/packages/google-cloud-support/.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-support/.jsdoc.js b/packages/google-cloud-support/.jsdoc.js new file mode 100644 index 000000000000..83fbfba30a8a --- /dev/null +++ b/packages/google-cloud-support/.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/support', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-support/.mocharc.js b/packages/google-cloud-support/.mocharc.js new file mode 100644 index 000000000000..49e7e228701d --- /dev/null +++ b/packages/google-cloud-support/.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-support/.nycrc b/packages/google-cloud-support/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-support/.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-support/.prettierignore b/packages/google-cloud-support/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-support/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-support/.prettierrc.js b/packages/google-cloud-support/.prettierrc.js new file mode 100644 index 000000000000..1e6cec783e40 --- /dev/null +++ b/packages/google-cloud-support/.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-support/.repo-metadata.json b/packages/google-cloud-support/.repo-metadata.json new file mode 100644 index 000000000000..838f1daed1ec --- /dev/null +++ b/packages/google-cloud-support/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "cloudsupport", + "name_pretty": "Google Cloud Support API", + "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudsupport/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/support", + "api_id": "cloudsupport.googleapis.com", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudsupport" +} + diff --git a/packages/google-cloud-support/CODE_OF_CONDUCT.md b/packages/google-cloud-support/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-support/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-support/CONTRIBUTING.md b/packages/google-cloud-support/CONTRIBUTING.md new file mode 100644 index 000000000000..4e6742ae756b --- /dev/null +++ b/packages/google-cloud-support/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 Google Cloud Support 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=cloudsupport.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-support/LICENSE b/packages/google-cloud-support/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-support/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-support/README.md b/packages/google-cloud-support/README.md new file mode 100644 index 000000000000..281cf68cac11 --- /dev/null +++ b/packages/google-cloud-support/README.md @@ -0,0 +1,207 @@ +[//]: # "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 + +# [Google Cloud Support API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/support.svg)](https://www.npmjs.org/package/@google-cloud/support) + + + + +Google Cloud Support API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support/CHANGELOG.md). + +* [Google Cloud Support API Node.js Client API Reference][client-docs] +* [Google Cloud Support API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-support](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Support 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/support +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The fully qualified name of parent resource to list cases under. + */ +// const parent = 'abc123' +/** + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * Examples: + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + */ +// const filter = 'abc123' +/** + * The maximum number of cases fetched with each request. Defaults to 10. + */ +// const pageSize = 1234 +/** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ +// const pageToken = 'abc123' + +// Imports the Support library +const {CaseServiceClient} = require('@google-cloud/support').v2; + +// Instantiates a client +const supportClient = new CaseServiceClient(); + +async function callListCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await supportClient.listCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListCases(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Case_attachment_service.list_attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js,packages/google-cloud-support/samples/README.md) | +| Case_service.close_case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.close_case.js,packages/google-cloud-support/samples/README.md) | +| Case_service.create_case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.create_case.js,packages/google-cloud-support/samples/README.md) | +| Case_service.escalate_case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.escalate_case.js,packages/google-cloud-support/samples/README.md) | +| Case_service.get_case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.get_case.js,packages/google-cloud-support/samples/README.md) | +| Case_service.list_cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.list_cases.js,packages/google-cloud-support/samples/README.md) | +| Case_service.search_case_classifications | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.search_case_classifications.js,packages/google-cloud-support/samples/README.md) | +| Case_service.search_cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.search_cases.js,packages/google-cloud-support/samples/README.md) | +| Case_service.update_case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js) | [![Open in Cloud 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-support/samples/generated/v2/case_service.update_case.js,packages/google-cloud-support/samples/README.md) | +| Comment_service.create_comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js) | [![Open in Cloud 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-support/samples/generated/v2/comment_service.create_comment.js,packages/google-cloud-support/samples/README.md) | +| Comment_service.list_comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js) | [![Open in Cloud 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-support/samples/generated/v2/comment_service.list_comments.js,packages/google-cloud-support/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/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-support/samples/quickstart.js,packages/google-cloud-support/samples/README.md) | + + + +The [Google Cloud Support API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +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/support@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/cloudsupport/latest +[product-docs]: https://cloud.google.com/support/docs/reference/support-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=cloudsupport.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-support/linkinator.config.json b/packages/google-cloud-support/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-support/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-support/package.json b/packages/google-cloud-support/package.json new file mode 100644 index 000000000000..60afa8610950 --- /dev/null +++ b/packages/google-cloud-support/package.json @@ -0,0 +1,73 @@ +{ + "name": "@google-cloud/support", + "version": "0.0.0", + "description": "Google Cloud Support API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-support" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google cloudsupport", + "cloudsupport", + "Google Cloud Support API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.8" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "long": "^5.2.3", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto new file mode 100644 index 000000000000..a151278355ae --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/actor.proto @@ -0,0 +1,47 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "ActorProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// An object containing information about the effective user and +// authenticated principal responsible for an action. +message Actor { + // The name to display for the actor. If not provided, it is inferred from + // credentials supplied during case creation. When an email is provided, a + // display name must also be provided. This will be obfuscated if the user + // is a Google Support agent. + string display_name = 1; + + // The email address of the actor. If not provided, it is inferred from + // credentials supplied during case creation. If the authenticated principal + // does not have an email address, one must be provided. When a name is + // provided, an email must also be provided. This will be obfuscated if the + // user is a Google Support agent. + string email = 2; + + // Output only. Whether the actor is a Google support actor. + bool google_support = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto new file mode 100644 index 000000000000..f5894dc4be88 --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment.proto @@ -0,0 +1,59 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// Represents a file attached to a support case. +message Attachment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Attachment" + pattern: "organizations/{organization}/cases/{case}/attachments/{attachment_id}" + pattern: "projects/{project}/cases/{case}/attachments/{attachment_id}" + }; + + // Output only. The resource name of the attachment. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attachment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user who uploaded the attachment. Note, the name and email + // will be obfuscated if the attachment was uploaded by Google support. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The filename of the attachment (e.g. `"graph.jpg"`). + string filename = 4; + + // Output only. The MIME type of the attachment (e.g. text/plain). + string mime_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the attachment in bytes. + int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto new file mode 100644 index 000000000000..fd62619dadc9 --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/attachment_service.proto @@ -0,0 +1,82 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/attachment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "AttachmentServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage file attachment for Google Cloud support cases. +service CaseAttachmentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieve all attachments associated with a support case. + rpc ListAttachments(ListAttachmentsRequest) + returns (ListAttachmentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/cases/*}/attachments" + additional_bindings { + get: "/v2/{parent=organizations/*/cases/*}/attachments" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// The request message for the ListAttachments endpoint. +message ListAttachmentsRequest { + // Required. The resource name of Case object for which attachments should be + // listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of attachments fetched with each request. If not + // provided, the default is 10. The maximum page size that will be returned is + // 100. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for the ListAttachments endpoint. +message ListAttachmentsResponse { + // The list of attachments associated with the given case. + repeated Attachment attachments = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of subsequent `cases.attachments.list` requests. If + // unspecified, there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto new file mode 100644 index 000000000000..4d608a6e4e1f --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/case.proto @@ -0,0 +1,158 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A support case. +message Case { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Case" + pattern: "organizations/{organization}/cases/{case}" + pattern: "projects/{project}/cases/{case}" + }; + + // The status of a support case. + enum State { + // Case is in an unknown state. + STATE_UNSPECIFIED = 0; + + // The case has been created but no one is assigned to work on it yet. + NEW = 1; + + // The case is currently being handled by Google support. + IN_PROGRESS_GOOGLE_SUPPORT = 2; + + // Google is waiting for a response. + ACTION_REQUIRED = 3; + + // A solution has been offered for the case, but it isn't yet closed. + SOLUTION_PROVIDED = 4; + + // The case has been resolved. + CLOSED = 5; + } + + // The case Priority. P0 is most urgent and P4 the least. + enum Priority { + // Priority is undefined or has not been set yet. + PRIORITY_UNSPECIFIED = 0; + + // Extreme impact on a production service. Service is hard down. + P0 = 1; + + // Critical impact on a production service. Service is currently unusable. + P1 = 2; + + // Severe impact on a production service. Service is usable but greatly + // impaired. + P2 = 3; + + // Medium impact on a production service. Service is available, but + // moderately impaired. + P3 = 4; + + // General questions or minor issues. Production service is fully + // available. + P4 = 5; + } + + // The resource name for the case. + string name = 1; + + // The short summary of the issue reported in this case. + string display_name = 2; + + // A broad description of the issue. + string description = 3; + + // The issue classification applicable to this case. + CaseClassification classification = 4; + + // The timezone of the user who created the support case. + // It should be in a format IANA recognizes: https://www.iana.org/time-zones. + // There is no additional validation done by the API. + string time_zone = 8; + + // The email addresses to receive updates on this case. + repeated string subscriber_email_addresses = 9; + + // Output only. The current status of the support case. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was created. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this case was last updated. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The user who created the case. + // + // Note: The name and email will be obfuscated if the case was created by + // Google Support. + Actor creator = 15; + + // A user-supplied email address to send case update notifications for. This + // should only be used in BYOID flows, where we cannot infer the user's email + // address directly from their EUCs. + string contact_email = 35; + + // Whether the case is currently escalated. + bool escalated = 17; + + // Whether this case was created for internal API testing and should not be + // acted on by the support team. + bool test_case = 19; + + // The language the user has requested to receive support in. This should be a + // BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). + // If no language or an unsupported language is specified, this field defaults + // to English (en). + // + // Language selection during case creation may affect your available support + // options. For a list of supported languages and their support working hours, + // see: https://cloud.google.com/support/docs/language-working-hours + string language_code = 23; + + // The priority of this case. + Priority priority = 32; +} + +// A classification object with a product type and value. +message CaseClassification { + // The unique ID for a classification. Must be specified for case creation. + // + // To retrieve valid classification IDs for case creation, use + // `caseClassifications.search`. + string id = 3; + + // The display name of the classification. + string display_name = 4; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto new file mode 100644 index 000000000000..8a9a7566460a --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/case_service.proto @@ -0,0 +1,346 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/case.proto"; +import "google/cloud/support/v2/escalation.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CaseServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage Google Cloud support cases. +service CaseService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieve the specified case. + rpc GetCase(GetCaseRequest) returns (Case) { + option (google.api.http) = { + get: "/v2/{name=projects/*/cases/*}" + additional_bindings { get: "/v2/{name=organizations/*/cases/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieve all cases under the specified parent. + // + // Note: Listing cases under an Organization returns only the cases directly + // parented by that organization. To retrieve all cases under an organization, + // including cases parented by projects under that organization, use + // `cases.search`. + rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/cases" + additional_bindings { get: "/v2/{parent=organizations/*}/cases" } + }; + option (google.api.method_signature) = "parent"; + } + + // Search cases using the specified query. + rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/cases:search" + additional_bindings { get: "/v2/{parent=organizations/*}/cases:search" } + }; + } + + // Create a new case and associate it with the given Google Cloud Resource. + // The case object must have the following fields set: `display_name`, + // `description`, `classification`, and `priority`. + rpc CreateCase(CreateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/cases" + body: "case" + additional_bindings { + post: "/v2/{parent=organizations/*}/cases" + body: "case" + } + }; + option (google.api.method_signature) = "parent,case"; + } + + // Update the specified case. Only a subset of fields can be updated. + rpc UpdateCase(UpdateCaseRequest) returns (Case) { + option (google.api.http) = { + patch: "/v2/{case.name=projects/*/cases/*}" + body: "case" + additional_bindings { + patch: "/v2/{case.name=organizations/*/cases/*}" + body: "case" + } + }; + option (google.api.method_signature) = "case,update_mask"; + } + + // Escalate a case. Escalating a case will initiate the Google Cloud Support + // escalation management process. + // + // This operation is only available to certain Customer Care tiers. Go to + // https://cloud.google.com/support and look for 'Technical support + // escalations' in the feature list to find out which tiers are able to + // perform escalations. + rpc EscalateCase(EscalateCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{name=projects/*/cases/*}:escalate" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/cases/*}:escalate" + body: "*" + } + }; + } + + // Close the specified case. + rpc CloseCase(CloseCaseRequest) returns (Case) { + option (google.api.http) = { + post: "/v2/{name=projects/*/cases/*}:close" + body: "*" + additional_bindings { + post: "/v2/{name=organizations/*/cases/*}:close" + body: "*" + } + }; + } + + // Retrieve valid classifications to be used when creating a support case. + // The classications are hierarchical, with each classification containing + // all levels of the hierarchy, separated by " > ". For example "Technical + // Issue > Compute > Compute Engine". + rpc SearchCaseClassifications(SearchCaseClassificationsRequest) + returns (SearchCaseClassificationsResponse) { + option (google.api.http) = { + get: "/v2/caseClassifications:search" + }; + } +} + +// The request message for the GetCase endpoint. +message GetCaseRequest { + // Required. The fully qualified name of a case to be retrieved. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for the CreateCase endpoint. +message CreateCaseRequest { + // Required. The name of the Google Cloud Resource under which the case should + // be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The case to be created. + Case case = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for the ListCases endpoint. +message ListCasesRequest { + // Required. The fully qualified name of parent resource to list cases under. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudsupport.googleapis.com/Case" + } + ]; + + // An expression written in filter language. If non-empty, the query returns + // the cases that match the filter. Else, the query doesn't filter the cases. + // + // Filter expressions use the following fields with the operators equals (`=`) + // and `AND`: + // + // - `state`: The accepted values are `OPEN` or `CLOSED`. + // - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // + // Examples: + // + // - `state=CLOSED` + // - `state=OPEN AND creator.email="tester@example.com"` + // - `state=OPEN AND (priority=P0 OR priority=P1)` + string filter = 2; + + // The maximum number of cases fetched with each request. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 5; +} + +// The response message for the ListCases endpoint. +message ListCasesResponse { + // The list of cases associated with the Google Cloud Resource, after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of the subsequent `ListCasesRequest` message that is + // issued. If unspecified, there are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the SearchCases endpoint. +message SearchCasesRequest { + // The fully qualified name of parent resource to search cases under. + string parent = 4; + + // An expression written in filter language. + // + // A query uses the following fields with the operators equals (`=`) and + // `AND`: + // + // - `organization`: An organization name in the form + // `organizations/`. + // - `project`: A project name in the form `projects/`. + // - `state`: The accepted values are `OPEN` or `CLOSED`. + // - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + // can specify multiple values for priority using the `OR` operator. For + // example, `priority=P1 OR priority=P2`. + // - `creator.email`: The email address of the case creator. + // - `billingAccount`: A billing account in the form + // `billingAccounts/` + // + // You must specify either `organization` or `project`. + // + // To search across `displayName`, `description`, and comments, use a global + // restriction with no keyword or operator. For example, `"my search"`. + // + // To search only cases updated after a certain date, use `update_time` + // restricted with that particular date, time, and timezone in ISO datetime + // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + // `update_time` only supports the greater than operator (`>`). + // + // Examples: + // + // - `organization="organizations/123456789"` + // - `project="projects/my-project-id"` + // - `project="projects/123456789"` + // - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` + // - `organization="organizations/123456789" AND state=CLOSED` + // - `project="projects/my-project-id" AND creator.email="tester@example.com"` + // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + string query = 1; + + // The maximum number of cases fetched with each request. The default page + // size is 10. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for the SearchCases endpoint. +message SearchCasesResponse { + // The list of cases associated with the Google Cloud Resource, after any + // filters have been applied. + repeated Case cases = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of subsequent `SearchCaseRequest` message that is + // issued. If unspecified, there are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for the EscalateCase endpoint. +message EscalateCaseRequest { + // Required. The fully qualified name of the Case resource to be escalated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The escalation object to be sent with the escalation request. + Escalation escalation = 2; +} + +// The request message for the UpdateCase endpoint +message UpdateCaseRequest { + // Required. The case object to update. + Case case = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of attributes of the case object that should be updated + // as part of this request. Supported values are `priority`, `display_name`, + // and `subscriber_email_addresses`. If no fields are specified, all supported + // fields are updated. + // + // WARNING: If you do not provide a field mask, then you might accidentally + // clear some fields. For example, if you leave the field mask empty and do + // not provide a value for `subscriber_email_addresses`, then + // `subscriber_email_addresses` is updated to empty. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the CloseCase endpoint. +message CloseCaseRequest { + // Required. The fully qualified name of the case resource to be closed. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; +} + +// The request message for SearchCaseClassifications endpoint. +message SearchCaseClassificationsRequest { + // An expression written in the Google Cloud filter language. If non-empty, + // then only cases whose fields match the filter are returned. If empty, then + // no messages are filtered out. + string query = 1; + + // The maximum number of cases fetched with each request. + int32 page_size = 2; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 3; +} + +// The response message for SearchCaseClassifications endpoint. +message SearchCaseClassificationsResponse { + // The classifications retrieved. + repeated CaseClassification case_classifications = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of subsequent `SearchCaseClassificationsRequest` message + // that is issued. If unspecified, there are no more results to retrieve. + string next_page_token = 2; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto new file mode 100644 index 000000000000..158279e7755b --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/comment.proto @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/actor.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A comment associated with a support case. +message Comment { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Comment" + pattern: "organizations/{organization}/cases/{case}/comments/{comment}" + pattern: "projects/{project}/cases/{case}/comments/{comment}" + }; + + // Output only. The resource name for the comment. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this comment was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user or Google Support agent created this comment. + Actor creator = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full comment body. Maximum of 12800 characters. This can contain rich + // text syntax. + string body = 4; + + // Output only. DEPRECATED. An automatically generated plain text version of + // body with all rich text syntax stripped. + string plain_text_body = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto new file mode 100644 index 000000000000..17846cfea37f --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/comment_service.proto @@ -0,0 +1,107 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/support/v2/comment.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "CommentServiceProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// A service to manage comments on cases. +service CommentService { + option (google.api.default_host) = "cloudsupport.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieve all Comments associated with the Case object. + rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/cases/*}/comments" + additional_bindings { + get: "/v2/{parent=organizations/*/cases/*}/comments" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Add a new comment to the specified Case. + // The comment object must have the following fields set: body. + rpc CreateComment(CreateCommentRequest) returns (Comment) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/cases/*}/comments" + body: "comment" + additional_bindings { + post: "/v2/{parent=organizations/*/cases/*}/comments" + body: "comment" + } + }; + option (google.api.method_signature) = "parent,comment"; + } +} + +// The request message for the ListComments endpoint. +message ListCommentsRequest { + // Required. The resource name of Case object for which comments should be + // listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // The maximum number of comments fetched with each request. Defaults to 10. + int32 page_size = 4; + + // A token identifying the page of results to return. If unspecified, the + // first page is retrieved. + string page_token = 5; +} + +// The response message for the ListComments endpoint. +message ListCommentsResponse { + // The list of Comments associated with the given Case. + repeated Comment comments = 1; + + // A token to retrieve the next page of results. This should be set in the + // `page_token` field of subsequent `ListCommentsRequest` message that is + // issued. If unspecified, there are no more results to retrieve. + string next_page_token = 2; +} + +// The request message for CreateComment endpoint. +message CreateCommentRequest { + // Required. The resource name of Case to which this comment should be added. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudsupport.googleapis.com/Case" + } + ]; + + // Required. The Comment object to be added to this Case. + Comment comment = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto b/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto new file mode 100644 index 000000000000..1972df3116a4 --- /dev/null +++ b/packages/google-cloud-support/protos/google/cloud/support/v2/escalation.proto @@ -0,0 +1,53 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.support.v2; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Support.V2"; +option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; +option java_multiple_files = true; +option java_outer_classname = "EscalationProto"; +option java_package = "com.google.cloud.support.v2"; +option php_namespace = "Google\\Cloud\\Support\\V2"; +option ruby_package = "Google::Cloud::Support::V2"; + +// An escalation of a support case. +message Escalation { + // An enum detailing the possible reasons a case may be escalated. + enum Reason { + // The escalation reason is in an unknown state or has not been specified. + REASON_UNSPECIFIED = 0; + + // The case is taking too long to resolve. + RESOLUTION_TIME = 1; + + // The support agent does not have the expertise required to successfully + // resolve the issue. + TECHNICAL_EXPERTISE = 2; + + // The issue is having a significant business impact. + BUSINESS_IMPACT = 3; + } + + // Required. The reason why the Case is being escalated. + Reason reason = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. A free text description to accompany the `reason` field above. + // Provides additional context on why the case is being escalated. + string justification = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-support/protos/protos.d.ts b/packages/google-cloud-support/protos/protos.d.ts new file mode 100644 index 000000000000..34fa354a34f5 --- /dev/null +++ b/packages/google-cloud-support/protos/protos.d.ts @@ -0,0 +1,6965 @@ +// 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 support. */ + namespace support { + + /** Namespace v2. */ + namespace v2 { + + /** Properties of an Actor. */ + interface IActor { + + /** Actor displayName */ + displayName?: (string|null); + + /** Actor email */ + email?: (string|null); + + /** Actor googleSupport */ + googleSupport?: (boolean|null); + } + + /** Represents an Actor. */ + class Actor implements IActor { + + /** + * Constructs a new Actor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IActor); + + /** Actor displayName. */ + public displayName: string; + + /** Actor email. */ + public email: string; + + /** Actor googleSupport. */ + public googleSupport: boolean; + + /** + * Creates a new Actor instance using the specified properties. + * @param [properties] Properties to set + * @returns Actor instance + */ + public static create(properties?: google.cloud.support.v2.IActor): google.cloud.support.v2.Actor; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @param message Actor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IActor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Actor; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Actor; + + /** + * Verifies an Actor message. + * @param message Plain 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 Actor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Actor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Actor; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @param message Actor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Actor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Actor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Actor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Attachment. */ + interface IAttachment { + + /** Attachment name */ + name?: (string|null); + + /** Attachment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Attachment filename */ + filename?: (string|null); + + /** Attachment mimeType */ + mimeType?: (string|null); + + /** Attachment sizeBytes */ + sizeBytes?: (number|Long|string|null); + } + + /** Represents an Attachment. */ + class Attachment implements IAttachment { + + /** + * Constructs a new Attachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IAttachment); + + /** Attachment name. */ + public name: string; + + /** Attachment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Attachment creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Attachment filename. */ + public filename: string; + + /** Attachment mimeType. */ + public mimeType: string; + + /** Attachment sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** + * Creates a new Attachment instance using the specified properties. + * @param [properties] Properties to set + * @returns Attachment instance + */ + public static create(properties?: google.cloud.support.v2.IAttachment): google.cloud.support.v2.Attachment; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @param message Attachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Attachment; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Attachment; + + /** + * Verifies an Attachment message. + * @param message Plain 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 Attachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Attachment; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @param message Attachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Attachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseAttachmentService */ + class CaseAttachmentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseAttachmentService 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 CaseAttachmentService 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): CaseAttachmentService; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttachmentsResponse + */ + public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest, callback: google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback): void; + + /** + * Calls ListAttachments. + * @param request ListAttachmentsRequest message or plain object + * @returns Promise + */ + public listAttachments(request: google.cloud.support.v2.IListAttachmentsRequest): Promise; + } + + namespace CaseAttachmentService { + + /** + * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. + * @param error Error, if any + * @param [response] ListAttachmentsResponse + */ + type ListAttachmentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListAttachmentsResponse) => void; + } + + /** Properties of a ListAttachmentsRequest. */ + interface IListAttachmentsRequest { + + /** ListAttachmentsRequest parent */ + parent?: (string|null); + + /** ListAttachmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAttachmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAttachmentsRequest. */ + class ListAttachmentsRequest implements IListAttachmentsRequest { + + /** + * Constructs a new ListAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListAttachmentsRequest); + + /** ListAttachmentsRequest parent. */ + public parent: string; + + /** ListAttachmentsRequest pageSize. */ + public pageSize: number; + + /** ListAttachmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListAttachmentsRequest): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @param message ListAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Verifies a ListAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsRequest; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttachmentsResponse. */ + interface IListAttachmentsResponse { + + /** ListAttachmentsResponse attachments */ + attachments?: (google.cloud.support.v2.IAttachment[]|null); + + /** ListAttachmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttachmentsResponse. */ + class ListAttachmentsResponse implements IListAttachmentsResponse { + + /** + * Constructs a new ListAttachmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListAttachmentsResponse); + + /** ListAttachmentsResponse attachments. */ + public attachments: google.cloud.support.v2.IAttachment[]; + + /** ListAttachmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttachmentsResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListAttachmentsResponse): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @param message ListAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Verifies a ListAttachmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttachmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListAttachmentsResponse; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @param message ListAttachmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Case. */ + interface ICase { + + /** Case name */ + name?: (string|null); + + /** Case displayName */ + displayName?: (string|null); + + /** Case description */ + description?: (string|null); + + /** Case classification */ + classification?: (google.cloud.support.v2.ICaseClassification|null); + + /** Case timeZone */ + timeZone?: (string|null); + + /** Case subscriberEmailAddresses */ + subscriberEmailAddresses?: (string[]|null); + + /** Case state */ + state?: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State|null); + + /** Case createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Case contactEmail */ + contactEmail?: (string|null); + + /** Case escalated */ + escalated?: (boolean|null); + + /** Case testCase */ + testCase?: (boolean|null); + + /** Case languageCode */ + languageCode?: (string|null); + + /** Case priority */ + priority?: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority|null); + } + + /** Represents a Case. */ + class Case implements ICase { + + /** + * Constructs a new Case. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICase); + + /** Case name. */ + public name: string; + + /** Case displayName. */ + public displayName: string; + + /** Case description. */ + public description: string; + + /** Case classification. */ + public classification?: (google.cloud.support.v2.ICaseClassification|null); + + /** Case timeZone. */ + public timeZone: string; + + /** Case subscriberEmailAddresses. */ + public subscriberEmailAddresses: string[]; + + /** Case state. */ + public state: (google.cloud.support.v2.Case.State|keyof typeof google.cloud.support.v2.Case.State); + + /** Case createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Case updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Case creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Case contactEmail. */ + public contactEmail: string; + + /** Case escalated. */ + public escalated: boolean; + + /** Case testCase. */ + public testCase: boolean; + + /** Case languageCode. */ + public languageCode: string; + + /** Case priority. */ + public priority: (google.cloud.support.v2.Case.Priority|keyof typeof google.cloud.support.v2.Case.Priority); + + /** + * Creates a new Case instance using the specified properties. + * @param [properties] Properties to set + * @returns Case instance + */ + public static create(properties?: google.cloud.support.v2.ICase): google.cloud.support.v2.Case; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @param message Case message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Case message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Case; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Case; + + /** + * Verifies a Case message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Case + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Case; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @param message Case + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Case, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Case to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Case + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Case { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NEW = 1, + IN_PROGRESS_GOOGLE_SUPPORT = 2, + ACTION_REQUIRED = 3, + SOLUTION_PROVIDED = 4, + CLOSED = 5 + } + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + P0 = 1, + P1 = 2, + P2 = 3, + P3 = 4, + P4 = 5 + } + } + + /** Properties of a CaseClassification. */ + interface ICaseClassification { + + /** CaseClassification id */ + id?: (string|null); + + /** CaseClassification displayName */ + displayName?: (string|null); + } + + /** Represents a CaseClassification. */ + class CaseClassification implements ICaseClassification { + + /** + * Constructs a new CaseClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICaseClassification); + + /** CaseClassification id. */ + public id: string; + + /** CaseClassification displayName. */ + public displayName: string; + + /** + * Creates a new CaseClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns CaseClassification instance + */ + public static create(properties?: google.cloud.support.v2.ICaseClassification): google.cloud.support.v2.CaseClassification; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @param message CaseClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICaseClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CaseClassification; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CaseClassification; + + /** + * Verifies a CaseClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CaseClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CaseClassification; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @param message CaseClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CaseClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CaseClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CaseClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CaseService */ + class CaseService extends $protobuf.rpc.Service { + + /** + * Constructs a new CaseService 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 CaseService 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): CaseService; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public getCase(request: google.cloud.support.v2.IGetCaseRequest, callback: google.cloud.support.v2.CaseService.GetCaseCallback): void; + + /** + * Calls GetCase. + * @param request GetCaseRequest message or plain object + * @returns Promise + */ + public getCase(request: google.cloud.support.v2.IGetCaseRequest): Promise; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCasesResponse + */ + public listCases(request: google.cloud.support.v2.IListCasesRequest, callback: google.cloud.support.v2.CaseService.ListCasesCallback): void; + + /** + * Calls ListCases. + * @param request ListCasesRequest message or plain object + * @returns Promise + */ + public listCases(request: google.cloud.support.v2.IListCasesRequest): Promise; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCasesResponse + */ + public searchCases(request: google.cloud.support.v2.ISearchCasesRequest, callback: google.cloud.support.v2.CaseService.SearchCasesCallback): void; + + /** + * Calls SearchCases. + * @param request SearchCasesRequest message or plain object + * @returns Promise + */ + public searchCases(request: google.cloud.support.v2.ISearchCasesRequest): Promise; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public createCase(request: google.cloud.support.v2.ICreateCaseRequest, callback: google.cloud.support.v2.CaseService.CreateCaseCallback): void; + + /** + * Calls CreateCase. + * @param request CreateCaseRequest message or plain object + * @returns Promise + */ + public createCase(request: google.cloud.support.v2.ICreateCaseRequest): Promise; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest, callback: google.cloud.support.v2.CaseService.UpdateCaseCallback): void; + + /** + * Calls UpdateCase. + * @param request UpdateCaseRequest message or plain object + * @returns Promise + */ + public updateCase(request: google.cloud.support.v2.IUpdateCaseRequest): Promise; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest, callback: google.cloud.support.v2.CaseService.EscalateCaseCallback): void; + + /** + * Calls EscalateCase. + * @param request EscalateCaseRequest message or plain object + * @returns Promise + */ + public escalateCase(request: google.cloud.support.v2.IEscalateCaseRequest): Promise; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Case + */ + public closeCase(request: google.cloud.support.v2.ICloseCaseRequest, callback: google.cloud.support.v2.CaseService.CloseCaseCallback): void; + + /** + * Calls CloseCase. + * @param request CloseCaseRequest message or plain object + * @returns Promise + */ + public closeCase(request: google.cloud.support.v2.ICloseCaseRequest): Promise; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + */ + public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest, callback: google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback): void; + + /** + * Calls SearchCaseClassifications. + * @param request SearchCaseClassificationsRequest message or plain object + * @returns Promise + */ + public searchCaseClassifications(request: google.cloud.support.v2.ISearchCaseClassificationsRequest): Promise; + } + + namespace CaseService { + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. + * @param error Error, if any + * @param [response] Case + */ + type GetCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. + * @param error Error, if any + * @param [response] ListCasesResponse + */ + type ListCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. + * @param error Error, if any + * @param [response] SearchCasesResponse + */ + type SearchCasesCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. + * @param error Error, if any + * @param [response] Case + */ + type CreateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. + * @param error Error, if any + * @param [response] Case + */ + type UpdateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. + * @param error Error, if any + * @param [response] Case + */ + type EscalateCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. + * @param error Error, if any + * @param [response] Case + */ + type CloseCaseCallback = (error: (Error|null), response?: google.cloud.support.v2.Case) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. + * @param error Error, if any + * @param [response] SearchCaseClassificationsResponse + */ + type SearchCaseClassificationsCallback = (error: (Error|null), response?: google.cloud.support.v2.SearchCaseClassificationsResponse) => void; + } + + /** Properties of a GetCaseRequest. */ + interface IGetCaseRequest { + + /** GetCaseRequest name */ + name?: (string|null); + } + + /** Represents a GetCaseRequest. */ + class GetCaseRequest implements IGetCaseRequest { + + /** + * Constructs a new GetCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IGetCaseRequest); + + /** GetCaseRequest name. */ + public name: string; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IGetCaseRequest): google.cloud.support.v2.GetCaseRequest; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @param message GetCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IGetCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.GetCaseRequest; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.GetCaseRequest; + + /** + * Verifies a GetCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.GetCaseRequest; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @param message GetCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.GetCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCaseRequest. */ + interface ICreateCaseRequest { + + /** CreateCaseRequest parent */ + parent?: (string|null); + + /** CreateCaseRequest case */ + "case"?: (google.cloud.support.v2.ICase|null); + } + + /** Represents a CreateCaseRequest. */ + class CreateCaseRequest implements ICreateCaseRequest { + + /** + * Constructs a new CreateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICreateCaseRequest); + + /** CreateCaseRequest parent. */ + public parent: string; + + /** CreateCaseRequest case. */ + public case?: (google.cloud.support.v2.ICase|null); + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICreateCaseRequest): google.cloud.support.v2.CreateCaseRequest; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @param message CreateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICreateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCaseRequest; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCaseRequest; + + /** + * Verifies a CreateCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCaseRequest; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @param message CreateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CreateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesRequest. */ + interface IListCasesRequest { + + /** ListCasesRequest parent */ + parent?: (string|null); + + /** ListCasesRequest filter */ + filter?: (string|null); + + /** ListCasesRequest pageSize */ + pageSize?: (number|null); + + /** ListCasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCasesRequest. */ + class ListCasesRequest implements IListCasesRequest { + + /** + * Constructs a new ListCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCasesRequest); + + /** ListCasesRequest parent. */ + public parent: string; + + /** ListCasesRequest filter. */ + public filter: string; + + /** ListCasesRequest pageSize. */ + public pageSize: number; + + /** ListCasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListCasesRequest): google.cloud.support.v2.ListCasesRequest; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @param message ListCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesRequest; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesRequest; + + /** + * Verifies a ListCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesRequest; + + /** + * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. + * @param message ListCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCasesResponse. */ + interface IListCasesResponse { + + /** ListCasesResponse cases */ + cases?: (google.cloud.support.v2.ICase[]|null); + + /** ListCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCasesResponse. */ + class ListCasesResponse implements IListCasesResponse { + + /** + * Constructs a new ListCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCasesResponse); + + /** ListCasesResponse cases. */ + public cases: google.cloud.support.v2.ICase[]; + + /** ListCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListCasesResponse): google.cloud.support.v2.ListCasesResponse; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @param message ListCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCasesResponse; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCasesResponse; + + /** + * Verifies a ListCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCasesResponse; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @param message ListCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesRequest. */ + interface ISearchCasesRequest { + + /** SearchCasesRequest parent */ + parent?: (string|null); + + /** SearchCasesRequest query */ + query?: (string|null); + + /** SearchCasesRequest pageSize */ + pageSize?: (number|null); + + /** SearchCasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchCasesRequest. */ + class SearchCasesRequest implements ISearchCasesRequest { + + /** + * Constructs a new SearchCasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCasesRequest); + + /** SearchCasesRequest parent. */ + public parent: string; + + /** SearchCasesRequest query. */ + public query: string; + + /** SearchCasesRequest pageSize. */ + public pageSize: number; + + /** SearchCasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesRequest instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCasesRequest): google.cloud.support.v2.SearchCasesRequest; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @param message SearchCasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesRequest; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesRequest; + + /** + * Verifies a SearchCasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesRequest; + + /** + * Creates a plain object from a SearchCasesRequest message. Also converts values to other types if specified. + * @param message SearchCasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCasesResponse. */ + interface ISearchCasesResponse { + + /** SearchCasesResponse cases */ + cases?: (google.cloud.support.v2.ICase[]|null); + + /** SearchCasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCasesResponse. */ + class SearchCasesResponse implements ISearchCasesResponse { + + /** + * Constructs a new SearchCasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCasesResponse); + + /** SearchCasesResponse cases. */ + public cases: google.cloud.support.v2.ICase[]; + + /** SearchCasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCasesResponse instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCasesResponse): google.cloud.support.v2.SearchCasesResponse; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @param message SearchCasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCasesResponse; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCasesResponse; + + /** + * Verifies a SearchCasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCasesResponse; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @param message SearchCasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EscalateCaseRequest. */ + interface IEscalateCaseRequest { + + /** EscalateCaseRequest name */ + name?: (string|null); + + /** EscalateCaseRequest escalation */ + escalation?: (google.cloud.support.v2.IEscalation|null); + } + + /** Represents an EscalateCaseRequest. */ + class EscalateCaseRequest implements IEscalateCaseRequest { + + /** + * Constructs a new EscalateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IEscalateCaseRequest); + + /** EscalateCaseRequest name. */ + public name: string; + + /** EscalateCaseRequest escalation. */ + public escalation?: (google.cloud.support.v2.IEscalation|null); + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EscalateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IEscalateCaseRequest): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @param message EscalateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IEscalateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Verifies an EscalateCaseRequest message. + * @param message Plain 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 EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EscalateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.EscalateCaseRequest; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @param message EscalateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.EscalateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EscalateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCaseRequest. */ + interface IUpdateCaseRequest { + + /** UpdateCaseRequest case */ + "case"?: (google.cloud.support.v2.ICase|null); + + /** UpdateCaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCaseRequest. */ + class UpdateCaseRequest implements IUpdateCaseRequest { + + /** + * Constructs a new UpdateCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IUpdateCaseRequest); + + /** UpdateCaseRequest case. */ + public case?: (google.cloud.support.v2.ICase|null); + + /** UpdateCaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.IUpdateCaseRequest): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @param message UpdateCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IUpdateCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Verifies an UpdateCaseRequest message. + * @param message Plain 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 UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.UpdateCaseRequest; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @param message UpdateCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.UpdateCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseCaseRequest. */ + interface ICloseCaseRequest { + + /** CloseCaseRequest name */ + name?: (string|null); + } + + /** Represents a CloseCaseRequest. */ + class CloseCaseRequest implements ICloseCaseRequest { + + /** + * Constructs a new CloseCaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICloseCaseRequest); + + /** CloseCaseRequest name. */ + public name: string; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseCaseRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICloseCaseRequest): google.cloud.support.v2.CloseCaseRequest; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @param message CloseCaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICloseCaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CloseCaseRequest; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CloseCaseRequest; + + /** + * Verifies a CloseCaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseCaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CloseCaseRequest; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @param message CloseCaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CloseCaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloseCaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseCaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsRequest. */ + interface ISearchCaseClassificationsRequest { + + /** SearchCaseClassificationsRequest query */ + query?: (string|null); + + /** SearchCaseClassificationsRequest pageSize */ + pageSize?: (number|null); + + /** SearchCaseClassificationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchCaseClassificationsRequest. */ + class SearchCaseClassificationsRequest implements ISearchCaseClassificationsRequest { + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest); + + /** SearchCaseClassificationsRequest query. */ + public query: string; + + /** SearchCaseClassificationsRequest pageSize. */ + public pageSize: number; + + /** SearchCaseClassificationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsRequest instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsRequest): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @param message SearchCaseClassificationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsRequest; + + /** + * Creates a plain object from a SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchCaseClassificationsResponse. */ + interface ISearchCaseClassificationsResponse { + + /** SearchCaseClassificationsResponse caseClassifications */ + caseClassifications?: (google.cloud.support.v2.ICaseClassification[]|null); + + /** SearchCaseClassificationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchCaseClassificationsResponse. */ + class SearchCaseClassificationsResponse implements ISearchCaseClassificationsResponse { + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse); + + /** SearchCaseClassificationsResponse caseClassifications. */ + public caseClassifications: google.cloud.support.v2.ICaseClassification[]; + + /** SearchCaseClassificationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCaseClassificationsResponse instance + */ + public static create(properties?: google.cloud.support.v2.ISearchCaseClassificationsResponse): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @param message SearchCaseClassificationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ISearchCaseClassificationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCaseClassificationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.SearchCaseClassificationsResponse; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @param message SearchCaseClassificationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.SearchCaseClassificationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Escalation. */ + interface IEscalation { + + /** Escalation reason */ + reason?: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason|null); + + /** Escalation justification */ + justification?: (string|null); + } + + /** Represents an Escalation. */ + class Escalation implements IEscalation { + + /** + * Constructs a new Escalation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IEscalation); + + /** Escalation reason. */ + public reason: (google.cloud.support.v2.Escalation.Reason|keyof typeof google.cloud.support.v2.Escalation.Reason); + + /** Escalation justification. */ + public justification: string; + + /** + * Creates a new Escalation instance using the specified properties. + * @param [properties] Properties to set + * @returns Escalation instance + */ + public static create(properties?: google.cloud.support.v2.IEscalation): google.cloud.support.v2.Escalation; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @param message Escalation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IEscalation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Escalation; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Escalation; + + /** + * Verifies an Escalation message. + * @param message Plain 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 Escalation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Escalation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Escalation; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @param message Escalation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Escalation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Escalation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Escalation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Escalation { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + RESOLUTION_TIME = 1, + TECHNICAL_EXPERTISE = 2, + BUSINESS_IMPACT = 3 + } + } + + /** Properties of a Comment. */ + interface IComment { + + /** Comment name */ + name?: (string|null); + + /** Comment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator */ + creator?: (google.cloud.support.v2.IActor|null); + + /** Comment body */ + body?: (string|null); + + /** Comment plainTextBody */ + plainTextBody?: (string|null); + } + + /** Represents a Comment. */ + class Comment implements IComment { + + /** + * Constructs a new Comment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IComment); + + /** Comment name. */ + public name: string; + + /** Comment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Comment creator. */ + public creator?: (google.cloud.support.v2.IActor|null); + + /** Comment body. */ + public body: string; + + /** Comment plainTextBody. */ + public plainTextBody: string; + + /** + * Creates a new Comment instance using the specified properties. + * @param [properties] Properties to set + * @returns Comment instance + */ + public static create(properties?: google.cloud.support.v2.IComment): google.cloud.support.v2.Comment; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @param message Comment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IComment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.Comment; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.Comment; + + /** + * Verifies a Comment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Comment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.Comment; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @param message Comment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.Comment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Comment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Comment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CommentService */ + class CommentService extends $protobuf.rpc.Service { + + /** + * Constructs a new CommentService 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 CommentService 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): CommentService; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCommentsResponse + */ + public listComments(request: google.cloud.support.v2.IListCommentsRequest, callback: google.cloud.support.v2.CommentService.ListCommentsCallback): void; + + /** + * Calls ListComments. + * @param request ListCommentsRequest message or plain object + * @returns Promise + */ + public listComments(request: google.cloud.support.v2.IListCommentsRequest): Promise; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Comment + */ + public createComment(request: google.cloud.support.v2.ICreateCommentRequest, callback: google.cloud.support.v2.CommentService.CreateCommentCallback): void; + + /** + * Calls CreateComment. + * @param request CreateCommentRequest message or plain object + * @returns Promise + */ + public createComment(request: google.cloud.support.v2.ICreateCommentRequest): Promise; + } + + namespace CommentService { + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. + * @param error Error, if any + * @param [response] ListCommentsResponse + */ + type ListCommentsCallback = (error: (Error|null), response?: google.cloud.support.v2.ListCommentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. + * @param error Error, if any + * @param [response] Comment + */ + type CreateCommentCallback = (error: (Error|null), response?: google.cloud.support.v2.Comment) => void; + } + + /** Properties of a ListCommentsRequest. */ + interface IListCommentsRequest { + + /** ListCommentsRequest parent */ + parent?: (string|null); + + /** ListCommentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCommentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCommentsRequest. */ + class ListCommentsRequest implements IListCommentsRequest { + + /** + * Constructs a new ListCommentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCommentsRequest); + + /** ListCommentsRequest parent. */ + public parent: string; + + /** ListCommentsRequest pageSize. */ + public pageSize: number; + + /** ListCommentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsRequest instance + */ + public static create(properties?: google.cloud.support.v2.IListCommentsRequest): google.cloud.support.v2.ListCommentsRequest; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @param message ListCommentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCommentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsRequest; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsRequest; + + /** + * Verifies a ListCommentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsRequest; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @param message ListCommentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCommentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCommentsResponse. */ + interface IListCommentsResponse { + + /** ListCommentsResponse comments */ + comments?: (google.cloud.support.v2.IComment[]|null); + + /** ListCommentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCommentsResponse. */ + class ListCommentsResponse implements IListCommentsResponse { + + /** + * Constructs a new ListCommentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.IListCommentsResponse); + + /** ListCommentsResponse comments. */ + public comments: google.cloud.support.v2.IComment[]; + + /** ListCommentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCommentsResponse instance + */ + public static create(properties?: google.cloud.support.v2.IListCommentsResponse): google.cloud.support.v2.ListCommentsResponse; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @param message ListCommentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.IListCommentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.ListCommentsResponse; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.ListCommentsResponse; + + /** + * Verifies a ListCommentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCommentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.ListCommentsResponse; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @param message ListCommentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.ListCommentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCommentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCommentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCommentRequest. */ + interface ICreateCommentRequest { + + /** CreateCommentRequest parent */ + parent?: (string|null); + + /** CreateCommentRequest comment */ + comment?: (google.cloud.support.v2.IComment|null); + } + + /** Represents a CreateCommentRequest. */ + class CreateCommentRequest implements ICreateCommentRequest { + + /** + * Constructs a new CreateCommentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.support.v2.ICreateCommentRequest); + + /** CreateCommentRequest parent. */ + public parent: string; + + /** CreateCommentRequest comment. */ + public comment?: (google.cloud.support.v2.IComment|null); + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCommentRequest instance + */ + public static create(properties?: google.cloud.support.v2.ICreateCommentRequest): google.cloud.support.v2.CreateCommentRequest; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @param message CreateCommentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.support.v2.ICreateCommentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.support.v2.CreateCommentRequest; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.support.v2.CreateCommentRequest; + + /** + * Verifies a CreateCommentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCommentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.support.v2.CreateCommentRequest; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @param message CreateCommentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.support.v2.CreateCommentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCommentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCommentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 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 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 + } + } + + /** 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-support/protos/protos.js b/packages/google-cloud-support/protos/protos.js new file mode 100644 index 000000000000..c95501f8e56e --- /dev/null +++ b/packages/google-cloud-support/protos/protos.js @@ -0,0 +1,18039 @@ +// 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_support_protos || ($protobuf.roots._google_cloud_support_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.support = (function() { + + /** + * Namespace support. + * @memberof google.cloud + * @namespace + */ + var support = {}; + + support.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.support + * @namespace + */ + var v2 = {}; + + v2.Actor = (function() { + + /** + * Properties of an Actor. + * @memberof google.cloud.support.v2 + * @interface IActor + * @property {string|null} [displayName] Actor displayName + * @property {string|null} [email] Actor email + * @property {boolean|null} [googleSupport] Actor googleSupport + */ + + /** + * Constructs a new Actor. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Actor. + * @implements IActor + * @constructor + * @param {google.cloud.support.v2.IActor=} [properties] Properties to set + */ + function Actor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Actor displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.displayName = ""; + + /** + * Actor email. + * @member {string} email + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.email = ""; + + /** + * Actor googleSupport. + * @member {boolean} googleSupport + * @memberof google.cloud.support.v2.Actor + * @instance + */ + Actor.prototype.googleSupport = false; + + /** + * Creates a new Actor instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor=} [properties] Properties to set + * @returns {google.cloud.support.v2.Actor} Actor instance + */ + Actor.create = function create(properties) { + return new Actor(properties); + }; + + /** + * Encodes the specified Actor message. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.googleSupport != null && Object.hasOwnProperty.call(message, "googleSupport")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.googleSupport); + return writer; + }; + + /** + * Encodes the specified Actor message, length delimited. Does not implicitly {@link google.cloud.support.v2.Actor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.IActor} message Actor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Actor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Actor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Actor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 4: { + message.googleSupport = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Actor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Actor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Actor} Actor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Actor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Actor message. + * @function verify + * @memberof google.cloud.support.v2.Actor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Actor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + if (typeof message.googleSupport !== "boolean") + return "googleSupport: boolean expected"; + return null; + }; + + /** + * Creates an Actor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Actor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Actor} Actor + */ + Actor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Actor) + return object; + var message = new $root.google.cloud.support.v2.Actor(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + if (object.googleSupport != null) + message.googleSupport = Boolean(object.googleSupport); + return message; + }; + + /** + * Creates a plain object from an Actor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Actor + * @static + * @param {google.cloud.support.v2.Actor} message Actor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Actor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.email = ""; + object.googleSupport = false; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.googleSupport != null && message.hasOwnProperty("googleSupport")) + object.googleSupport = message.googleSupport; + return object; + }; + + /** + * Converts this Actor to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Actor + * @instance + * @returns {Object.} JSON object + */ + Actor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Actor + * @function getTypeUrl + * @memberof google.cloud.support.v2.Actor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Actor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Actor"; + }; + + return Actor; + })(); + + v2.Attachment = (function() { + + /** + * Properties of an Attachment. + * @memberof google.cloud.support.v2 + * @interface IAttachment + * @property {string|null} [name] Attachment name + * @property {google.protobuf.ITimestamp|null} [createTime] Attachment createTime + * @property {google.cloud.support.v2.IActor|null} [creator] Attachment creator + * @property {string|null} [filename] Attachment filename + * @property {string|null} [mimeType] Attachment mimeType + * @property {number|Long|null} [sizeBytes] Attachment sizeBytes + */ + + /** + * Constructs a new Attachment. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Attachment. + * @implements IAttachment + * @constructor + * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set + */ + function Attachment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attachment name. + * @member {string} name + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.name = ""; + + /** + * Attachment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.createTime = null; + + /** + * Attachment creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.creator = null; + + /** + * Attachment filename. + * @member {string} filename + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.filename = ""; + + /** + * Attachment mimeType. + * @member {string} mimeType + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.mimeType = ""; + + /** + * Attachment sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.support.v2.Attachment + * @instance + */ + Attachment.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Attachment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment=} [properties] Properties to set + * @returns {google.cloud.support.v2.Attachment} Attachment instance + */ + Attachment.create = function create(properties) { + return new Attachment(properties); + }; + + /** + * Encodes the specified Attachment message. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.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.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeBytes); + return writer; + }; + + /** + * Encodes the specified Attachment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Attachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.IAttachment} message Attachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Attachment(); + 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.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.filename = reader.string(); + break; + } + case 5: { + message.mimeType = reader.string(); + break; + } + case 6: { + message.sizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Attachment} Attachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attachment message. + * @function verify + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attachment.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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + 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) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates an Attachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Attachment} Attachment + */ + Attachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Attachment) + return object; + var message = new $root.google.cloud.support.v2.Attachment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Attachment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Attachment.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.filename != null) + message.filename = String(object.filename); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Attachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {google.cloud.support.v2.Attachment} message Attachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.filename = ""; + object.mimeType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + return object; + }; + + /** + * Converts this Attachment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Attachment + * @instance + * @returns {Object.} JSON object + */ + Attachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attachment + * @function getTypeUrl + * @memberof google.cloud.support.v2.Attachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Attachment"; + }; + + return Attachment; + })(); + + v2.CaseAttachmentService = (function() { + + /** + * Constructs a new CaseAttachmentService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseAttachmentService + * @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 CaseAttachmentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseAttachmentService; + + /** + * Creates new CaseAttachmentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CaseAttachmentService + * @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 {CaseAttachmentService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseAttachmentService|listAttachments}. + * @memberof google.cloud.support.v2.CaseAttachmentService + * @typedef ListAttachmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListAttachmentsResponse} [response] ListAttachmentsResponse + */ + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @param {google.cloud.support.v2.CaseAttachmentService.ListAttachmentsCallback} callback Node-style callback called with the error, if any, and ListAttachmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseAttachmentService.prototype.listAttachments = function listAttachments(request, callback) { + return this.rpcCall(listAttachments, $root.google.cloud.support.v2.ListAttachmentsRequest, $root.google.cloud.support.v2.ListAttachmentsResponse, request, callback); + }, "name", { value: "ListAttachments" }); + + /** + * Calls ListAttachments. + * @function listAttachments + * @memberof google.cloud.support.v2.CaseAttachmentService + * @instance + * @param {google.cloud.support.v2.IListAttachmentsRequest} request ListAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseAttachmentService; + })(); + + v2.ListAttachmentsRequest = (function() { + + /** + * Properties of a ListAttachmentsRequest. + * @memberof google.cloud.support.v2 + * @interface IListAttachmentsRequest + * @property {string|null} [parent] ListAttachmentsRequest parent + * @property {number|null} [pageSize] ListAttachmentsRequest pageSize + * @property {string|null} [pageToken] ListAttachmentsRequest pageToken + */ + + /** + * Constructs a new ListAttachmentsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListAttachmentsRequest. + * @implements IListAttachmentsRequest + * @constructor + * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set + */ + function ListAttachmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.parent = ""; + + /** + * ListAttachmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageSize = 0; + + /** + * ListAttachmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + */ + ListAttachmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest instance + */ + ListAttachmentsRequest.create = function create(properties) { + return new ListAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListAttachmentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.IListAttachmentsRequest} message ListAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListAttachmentsRequest} ListAttachmentsRequest + */ + ListAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListAttachmentsRequest) + return object; + var message = new $root.google.cloud.support.v2.ListAttachmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {google.cloud.support.v2.ListAttachmentsRequest} message ListAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListAttachmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsRequest"; + }; + + return ListAttachmentsRequest; + })(); + + v2.ListAttachmentsResponse = (function() { + + /** + * Properties of a ListAttachmentsResponse. + * @memberof google.cloud.support.v2 + * @interface IListAttachmentsResponse + * @property {Array.|null} [attachments] ListAttachmentsResponse attachments + * @property {string|null} [nextPageToken] ListAttachmentsResponse nextPageToken + */ + + /** + * Constructs a new ListAttachmentsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListAttachmentsResponse. + * @implements IListAttachmentsResponse + * @constructor + * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set + */ + function ListAttachmentsResponse(properties) { + this.attachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttachmentsResponse attachments. + * @member {Array.} attachments + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.attachments = $util.emptyArray; + + /** + * ListAttachmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + */ + ListAttachmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttachmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse instance + */ + ListAttachmentsResponse.create = function create(properties) { + return new ListAttachmentsResponse(properties); + }; + + /** + * Encodes the specified ListAttachmentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachments != null && message.attachments.length) + for (var i = 0; i < message.attachments.length; ++i) + $root.google.cloud.support.v2.Attachment.encode(message.attachments[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 ListAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListAttachmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.IListAttachmentsResponse} message ListAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.cloud.support.v2.Attachment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttachmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttachmentsResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttachmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (!Array.isArray(message.attachments)) + return "attachments: array expected"; + for (var i = 0; i < message.attachments.length; ++i) { + var error = $root.google.cloud.support.v2.Attachment.verify(message.attachments[i]); + if (error) + return "attachments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListAttachmentsResponse} ListAttachmentsResponse + */ + ListAttachmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListAttachmentsResponse) + return object; + var message = new $root.google.cloud.support.v2.ListAttachmentsResponse(); + if (object.attachments) { + if (!Array.isArray(object.attachments)) + throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: array expected"); + message.attachments = []; + for (var i = 0; i < object.attachments.length; ++i) { + if (typeof object.attachments[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListAttachmentsResponse.attachments: object expected"); + message.attachments[i] = $root.google.cloud.support.v2.Attachment.fromObject(object.attachments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttachmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {google.cloud.support.v2.ListAttachmentsResponse} message ListAttachmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttachmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attachments && message.attachments.length) { + object.attachments = []; + for (var j = 0; j < message.attachments.length; ++j) + object.attachments[j] = $root.google.cloud.support.v2.Attachment.toObject(message.attachments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttachmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttachmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttachmentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListAttachmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListAttachmentsResponse"; + }; + + return ListAttachmentsResponse; + })(); + + v2.Case = (function() { + + /** + * Properties of a Case. + * @memberof google.cloud.support.v2 + * @interface ICase + * @property {string|null} [name] Case name + * @property {string|null} [displayName] Case displayName + * @property {string|null} [description] Case description + * @property {google.cloud.support.v2.ICaseClassification|null} [classification] Case classification + * @property {string|null} [timeZone] Case timeZone + * @property {Array.|null} [subscriberEmailAddresses] Case subscriberEmailAddresses + * @property {google.cloud.support.v2.Case.State|null} [state] Case state + * @property {google.protobuf.ITimestamp|null} [createTime] Case createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Case updateTime + * @property {google.cloud.support.v2.IActor|null} [creator] Case creator + * @property {string|null} [contactEmail] Case contactEmail + * @property {boolean|null} [escalated] Case escalated + * @property {boolean|null} [testCase] Case testCase + * @property {string|null} [languageCode] Case languageCode + * @property {google.cloud.support.v2.Case.Priority|null} [priority] Case priority + */ + + /** + * Constructs a new Case. + * @memberof google.cloud.support.v2 + * @classdesc Represents a Case. + * @implements ICase + * @constructor + * @param {google.cloud.support.v2.ICase=} [properties] Properties to set + */ + function Case(properties) { + this.subscriberEmailAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Case name. + * @member {string} name + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.name = ""; + + /** + * Case displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.displayName = ""; + + /** + * Case description. + * @member {string} description + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.description = ""; + + /** + * Case classification. + * @member {google.cloud.support.v2.ICaseClassification|null|undefined} classification + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.classification = null; + + /** + * Case timeZone. + * @member {string} timeZone + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.timeZone = ""; + + /** + * Case subscriberEmailAddresses. + * @member {Array.} subscriberEmailAddresses + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.subscriberEmailAddresses = $util.emptyArray; + + /** + * Case state. + * @member {google.cloud.support.v2.Case.State} state + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.state = 0; + + /** + * Case createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.createTime = null; + + /** + * Case updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.updateTime = null; + + /** + * Case creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.creator = null; + + /** + * Case contactEmail. + * @member {string} contactEmail + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.contactEmail = ""; + + /** + * Case escalated. + * @member {boolean} escalated + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.escalated = false; + + /** + * Case testCase. + * @member {boolean} testCase + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.testCase = false; + + /** + * Case languageCode. + * @member {string} languageCode + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.languageCode = ""; + + /** + * Case priority. + * @member {google.cloud.support.v2.Case.Priority} priority + * @memberof google.cloud.support.v2.Case + * @instance + */ + Case.prototype.priority = 0; + + /** + * Creates a new Case instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase=} [properties] Properties to set + * @returns {google.cloud.support.v2.Case} Case instance + */ + Case.create = function create(properties) { + return new Case(properties); + }; + + /** + * Encodes the specified Case message. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.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.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.support.v2.CaseClassification.encode(message.classification, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + if (message.subscriberEmailAddresses != null && message.subscriberEmailAddresses.length) + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.subscriberEmailAddresses[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.escalated != null && Object.hasOwnProperty.call(message, "escalated")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.escalated); + if (message.testCase != null && Object.hasOwnProperty.call(message, "testCase")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.testCase); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.languageCode); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.priority); + if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.contactEmail); + return writer; + }; + + /** + * Encodes the specified Case message, length delimited. Does not implicitly {@link google.cloud.support.v2.Case.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.ICase} message Case message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Case.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Case message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Case(); + 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.classification = $root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + case 9: { + if (!(message.subscriberEmailAddresses && message.subscriberEmailAddresses.length)) + message.subscriberEmailAddresses = []; + message.subscriberEmailAddresses.push(reader.string()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 35: { + message.contactEmail = reader.string(); + break; + } + case 17: { + message.escalated = reader.bool(); + break; + } + case 19: { + message.testCase = reader.bool(); + break; + } + case 23: { + message.languageCode = reader.string(); + break; + } + case 32: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Case message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Case + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Case} Case + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Case.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Case message. + * @function verify + * @memberof google.cloud.support.v2.Case + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Case.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.classification != null && message.hasOwnProperty("classification")) { + var error = $root.google.cloud.support.v2.CaseClassification.verify(message.classification); + if (error) + return "classification." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.subscriberEmailAddresses != null && message.hasOwnProperty("subscriberEmailAddresses")) { + if (!Array.isArray(message.subscriberEmailAddresses)) + return "subscriberEmailAddresses: array expected"; + for (var i = 0; i < message.subscriberEmailAddresses.length; ++i) + if (!$util.isString(message.subscriberEmailAddresses[i])) + return "subscriberEmailAddresses: string[] expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + if (!$util.isString(message.contactEmail)) + return "contactEmail: string expected"; + if (message.escalated != null && message.hasOwnProperty("escalated")) + if (typeof message.escalated !== "boolean") + return "escalated: boolean expected"; + if (message.testCase != null && message.hasOwnProperty("testCase")) + if (typeof message.testCase !== "boolean") + return "testCase: boolean expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Case message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Case + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Case} Case + */ + Case.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Case) + return object; + var message = new $root.google.cloud.support.v2.Case(); + 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.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.support.v2.Case.classification: object expected"); + message.classification = $root.google.cloud.support.v2.CaseClassification.fromObject(object.classification); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.subscriberEmailAddresses) { + if (!Array.isArray(object.subscriberEmailAddresses)) + throw TypeError(".google.cloud.support.v2.Case.subscriberEmailAddresses: array expected"); + message.subscriberEmailAddresses = []; + for (var i = 0; i < object.subscriberEmailAddresses.length; ++i) + message.subscriberEmailAddresses[i] = String(object.subscriberEmailAddresses[i]); + } + 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 "NEW": + case 1: + message.state = 1; + break; + case "IN_PROGRESS_GOOGLE_SUPPORT": + case 2: + message.state = 2; + break; + case "ACTION_REQUIRED": + case 3: + message.state = 3; + break; + case "SOLUTION_PROVIDED": + case 4: + message.state = 4; + break; + case "CLOSED": + case 5: + message.state = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Case.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.support.v2.Case.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Case.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.contactEmail != null) + message.contactEmail = String(object.contactEmail); + if (object.escalated != null) + message.escalated = Boolean(object.escalated); + if (object.testCase != null) + message.testCase = Boolean(object.testCase); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "P0": + case 1: + message.priority = 1; + break; + case "P1": + case 2: + message.priority = 2; + break; + case "P2": + case 3: + message.priority = 3; + break; + case "P3": + case 4: + message.priority = 4; + break; + case "P4": + case 5: + message.priority = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Case message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Case + * @static + * @param {google.cloud.support.v2.Case} message Case + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Case.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriberEmailAddresses = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.classification = null; + object.timeZone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.creator = null; + object.escalated = false; + object.testCase = false; + object.languageCode = ""; + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + object.contactEmail = ""; + } + 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.classification != null && message.hasOwnProperty("classification")) + object.classification = $root.google.cloud.support.v2.CaseClassification.toObject(message.classification, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.subscriberEmailAddresses && message.subscriberEmailAddresses.length) { + object.subscriberEmailAddresses = []; + for (var j = 0; j < message.subscriberEmailAddresses.length; ++j) + object.subscriberEmailAddresses[j] = message.subscriberEmailAddresses[j]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.support.v2.Case.State[message.state] === undefined ? message.state : $root.google.cloud.support.v2.Case.State[message.state] : message.state; + 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.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.escalated != null && message.hasOwnProperty("escalated")) + object.escalated = message.escalated; + if (message.testCase != null && message.hasOwnProperty("testCase")) + object.testCase = message.testCase; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.cloud.support.v2.Case.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.support.v2.Case.Priority[message.priority] : message.priority; + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + object.contactEmail = message.contactEmail; + return object; + }; + + /** + * Converts this Case to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Case + * @instance + * @returns {Object.} JSON object + */ + Case.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Case + * @function getTypeUrl + * @memberof google.cloud.support.v2.Case + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Case.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Case"; + }; + + /** + * State enum. + * @name google.cloud.support.v2.Case.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NEW=1 NEW value + * @property {number} IN_PROGRESS_GOOGLE_SUPPORT=2 IN_PROGRESS_GOOGLE_SUPPORT value + * @property {number} ACTION_REQUIRED=3 ACTION_REQUIRED value + * @property {number} SOLUTION_PROVIDED=4 SOLUTION_PROVIDED value + * @property {number} CLOSED=5 CLOSED value + */ + Case.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW"] = 1; + values[valuesById[2] = "IN_PROGRESS_GOOGLE_SUPPORT"] = 2; + values[valuesById[3] = "ACTION_REQUIRED"] = 3; + values[valuesById[4] = "SOLUTION_PROVIDED"] = 4; + values[valuesById[5] = "CLOSED"] = 5; + return values; + })(); + + /** + * Priority enum. + * @name google.cloud.support.v2.Case.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} P0=1 P0 value + * @property {number} P1=2 P1 value + * @property {number} P2=3 P2 value + * @property {number} P3=4 P3 value + * @property {number} P4=5 P4 value + */ + Case.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "P0"] = 1; + values[valuesById[2] = "P1"] = 2; + values[valuesById[3] = "P2"] = 3; + values[valuesById[4] = "P3"] = 4; + values[valuesById[5] = "P4"] = 5; + return values; + })(); + + return Case; + })(); + + v2.CaseClassification = (function() { + + /** + * Properties of a CaseClassification. + * @memberof google.cloud.support.v2 + * @interface ICaseClassification + * @property {string|null} [id] CaseClassification id + * @property {string|null} [displayName] CaseClassification displayName + */ + + /** + * Constructs a new CaseClassification. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseClassification. + * @implements ICaseClassification + * @constructor + * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set + */ + function CaseClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseClassification id. + * @member {string} id + * @memberof google.cloud.support.v2.CaseClassification + * @instance + */ + CaseClassification.prototype.id = ""; + + /** + * CaseClassification displayName. + * @member {string} displayName + * @memberof google.cloud.support.v2.CaseClassification + * @instance + */ + CaseClassification.prototype.displayName = ""; + + /** + * Creates a new CaseClassification instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification=} [properties] Properties to set + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification instance + */ + CaseClassification.create = function create(properties) { + return new CaseClassification(properties); + }; + + /** + * Encodes the specified CaseClassification message. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified CaseClassification message, length delimited. Does not implicitly {@link google.cloud.support.v2.CaseClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.ICaseClassification} message CaseClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CaseClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseClassification message. + * @function verify + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseClassification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a CaseClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CaseClassification} CaseClassification + */ + CaseClassification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CaseClassification) + return object; + var message = new $root.google.cloud.support.v2.CaseClassification(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a CaseClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {google.cloud.support.v2.CaseClassification} message CaseClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this CaseClassification to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CaseClassification + * @instance + * @returns {Object.} JSON object + */ + CaseClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseClassification + * @function getTypeUrl + * @memberof google.cloud.support.v2.CaseClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CaseClassification"; + }; + + return CaseClassification; + })(); + + v2.CaseService = (function() { + + /** + * Constructs a new CaseService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CaseService + * @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 CaseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CaseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CaseService; + + /** + * Creates new CaseService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CaseService + * @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 {CaseService} RPC service. Useful where requests and/or responses are streamed. + */ + CaseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|getCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef GetCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.GetCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.getCase = function getCase(request, callback) { + return this.rpcCall(getCase, $root.google.cloud.support.v2.GetCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "GetCase" }); + + /** + * Calls GetCase. + * @function getCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IGetCaseRequest} request GetCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|listCases}. + * @memberof google.cloud.support.v2.CaseService + * @typedef ListCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListCasesResponse} [response] ListCasesResponse + */ + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object + * @param {google.cloud.support.v2.CaseService.ListCasesCallback} callback Node-style callback called with the error, if any, and ListCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.listCases = function listCases(request, callback) { + return this.rpcCall(listCases, $root.google.cloud.support.v2.ListCasesRequest, $root.google.cloud.support.v2.ListCasesResponse, request, callback); + }, "name", { value: "ListCases" }); + + /** + * Calls ListCases. + * @function listCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IListCasesRequest} request ListCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCases}. + * @memberof google.cloud.support.v2.CaseService + * @typedef SearchCasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.SearchCasesResponse} [response] SearchCasesResponse + */ + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @param {google.cloud.support.v2.CaseService.SearchCasesCallback} callback Node-style callback called with the error, if any, and SearchCasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCases = function searchCases(request, callback) { + return this.rpcCall(searchCases, $root.google.cloud.support.v2.SearchCasesRequest, $root.google.cloud.support.v2.SearchCasesResponse, request, callback); + }, "name", { value: "SearchCases" }); + + /** + * Calls SearchCases. + * @function searchCases + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCasesRequest} request SearchCasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|createCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef CreateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.CreateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.createCase = function createCase(request, callback) { + return this.rpcCall(createCase, $root.google.cloud.support.v2.CreateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "CreateCase" }); + + /** + * Calls CreateCase. + * @function createCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICreateCaseRequest} request CreateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|updateCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef UpdateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.UpdateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.updateCase = function updateCase(request, callback) { + return this.rpcCall(updateCase, $root.google.cloud.support.v2.UpdateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "UpdateCase" }); + + /** + * Calls UpdateCase. + * @function updateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IUpdateCaseRequest} request UpdateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|escalateCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef EscalateCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.EscalateCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.escalateCase = function escalateCase(request, callback) { + return this.rpcCall(escalateCase, $root.google.cloud.support.v2.EscalateCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "EscalateCase" }); + + /** + * Calls EscalateCase. + * @function escalateCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.IEscalateCaseRequest} request EscalateCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|closeCase}. + * @memberof google.cloud.support.v2.CaseService + * @typedef CloseCaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Case} [response] Case + */ + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @param {google.cloud.support.v2.CaseService.CloseCaseCallback} callback Node-style callback called with the error, if any, and Case + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.closeCase = function closeCase(request, callback) { + return this.rpcCall(closeCase, $root.google.cloud.support.v2.CloseCaseRequest, $root.google.cloud.support.v2.Case, request, callback); + }, "name", { value: "CloseCase" }); + + /** + * Calls CloseCase. + * @function closeCase + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ICloseCaseRequest} request CloseCaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CaseService|searchCaseClassifications}. + * @memberof google.cloud.support.v2.CaseService + * @typedef SearchCaseClassificationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} [response] SearchCaseClassificationsResponse + */ + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @param {google.cloud.support.v2.CaseService.SearchCaseClassificationsCallback} callback Node-style callback called with the error, if any, and SearchCaseClassificationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CaseService.prototype.searchCaseClassifications = function searchCaseClassifications(request, callback) { + return this.rpcCall(searchCaseClassifications, $root.google.cloud.support.v2.SearchCaseClassificationsRequest, $root.google.cloud.support.v2.SearchCaseClassificationsResponse, request, callback); + }, "name", { value: "SearchCaseClassifications" }); + + /** + * Calls SearchCaseClassifications. + * @function searchCaseClassifications + * @memberof google.cloud.support.v2.CaseService + * @instance + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} request SearchCaseClassificationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CaseService; + })(); + + v2.GetCaseRequest = (function() { + + /** + * Properties of a GetCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IGetCaseRequest + * @property {string|null} [name] GetCaseRequest name + */ + + /** + * Constructs a new GetCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a GetCaseRequest. + * @implements IGetCaseRequest + * @constructor + * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set + */ + function GetCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.GetCaseRequest + * @instance + */ + GetCaseRequest.prototype.name = ""; + + /** + * Creates a new GetCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest instance + */ + GetCaseRequest.create = function create(properties) { + return new GetCaseRequest(properties); + }; + + /** + * Encodes the specified GetCaseRequest message. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.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 GetCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.GetCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.IGetCaseRequest} message GetCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.GetCaseRequest(); + 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 GetCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCaseRequest.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 GetCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.GetCaseRequest} GetCaseRequest + */ + GetCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.GetCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.GetCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {google.cloud.support.v2.GetCaseRequest} message GetCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCaseRequest.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 GetCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.GetCaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.GetCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.GetCaseRequest"; + }; + + return GetCaseRequest; + })(); + + v2.CreateCaseRequest = (function() { + + /** + * Properties of a CreateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface ICreateCaseRequest + * @property {string|null} [parent] CreateCaseRequest parent + * @property {google.cloud.support.v2.ICase|null} ["case"] CreateCaseRequest case + */ + + /** + * Constructs a new CreateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CreateCaseRequest. + * @implements ICreateCaseRequest + * @constructor + * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set + */ + function CreateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCaseRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype.parent = ""; + + /** + * CreateCaseRequest case. + * @member {google.cloud.support.v2.ICase|null|undefined} case + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + */ + CreateCaseRequest.prototype["case"] = null; + + /** + * Creates a new CreateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest instance + */ + CreateCaseRequest.create = function create(properties) { + return new CreateCaseRequest(properties); + }; + + /** + * Encodes the specified CreateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.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["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2.Case.encode(message["case"], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.ICreateCaseRequest} message CreateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message["case"] = $root.google.cloud.support.v2.Case.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCaseRequest.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["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2.Case.verify(message["case"]); + if (error) + return "case." + error; + } + return null; + }; + + /** + * Creates a CreateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CreateCaseRequest} CreateCaseRequest + */ + CreateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CreateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.CreateCaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2.CreateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); + } + return message; + }; + + /** + * Creates a plain object from a CreateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {google.cloud.support.v2.CreateCaseRequest} message CreateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object["case"] = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); + return object; + }; + + /** + * Converts this CreateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CreateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CreateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CreateCaseRequest"; + }; + + return CreateCaseRequest; + })(); + + v2.ListCasesRequest = (function() { + + /** + * Properties of a ListCasesRequest. + * @memberof google.cloud.support.v2 + * @interface IListCasesRequest + * @property {string|null} [parent] ListCasesRequest parent + * @property {string|null} [filter] ListCasesRequest filter + * @property {number|null} [pageSize] ListCasesRequest pageSize + * @property {string|null} [pageToken] ListCasesRequest pageToken + */ + + /** + * Constructs a new ListCasesRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCasesRequest. + * @implements IListCasesRequest + * @constructor + * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set + */ + function ListCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.parent = ""; + + /** + * ListCasesRequest filter. + * @member {string} filter + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.filter = ""; + + /** + * ListCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageSize = 0; + + /** + * ListCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + */ + ListCasesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest instance + */ + ListCasesRequest.create = function create(properties) { + return new ListCasesRequest(properties); + }; + + /** + * Encodes the specified ListCasesRequest message. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.IListCasesRequest} message ListCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCasesRequest} ListCasesRequest + */ + ListCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCasesRequest) + return object; + var message = new $root.google.cloud.support.v2.ListCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {google.cloud.support.v2.ListCasesRequest} message ListCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCasesRequest"; + }; + + return ListCasesRequest; + })(); + + v2.ListCasesResponse = (function() { + + /** + * Properties of a ListCasesResponse. + * @memberof google.cloud.support.v2 + * @interface IListCasesResponse + * @property {Array.|null} [cases] ListCasesResponse cases + * @property {string|null} [nextPageToken] ListCasesResponse nextPageToken + */ + + /** + * Constructs a new ListCasesResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCasesResponse. + * @implements IListCasesResponse + * @constructor + * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set + */ + function ListCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.cases = $util.emptyArray; + + /** + * ListCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + */ + ListCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse instance + */ + ListCasesResponse.create = function create(properties) { + return new ListCasesResponse(properties); + }; + + /** + * Encodes the specified ListCasesResponse message. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2.Case.encode(message.cases[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 ListCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.IListCasesResponse} message ListCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCasesResponse} ListCasesResponse + */ + ListCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCasesResponse) + return object; + var message = new $root.google.cloud.support.v2.ListCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {google.cloud.support.v2.ListCasesResponse} message ListCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCasesResponse"; + }; + + return ListCasesResponse; + })(); + + v2.SearchCasesRequest = (function() { + + /** + * Properties of a SearchCasesRequest. + * @memberof google.cloud.support.v2 + * @interface ISearchCasesRequest + * @property {string|null} [parent] SearchCasesRequest parent + * @property {string|null} [query] SearchCasesRequest query + * @property {number|null} [pageSize] SearchCasesRequest pageSize + * @property {string|null} [pageToken] SearchCasesRequest pageToken + */ + + /** + * Constructs a new SearchCasesRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCasesRequest. + * @implements ISearchCasesRequest + * @constructor + * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set + */ + function SearchCasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.parent = ""; + + /** + * SearchCasesRequest query. + * @member {string} query + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.query = ""; + + /** + * SearchCasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageSize = 0; + + /** + * SearchCasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + */ + SearchCasesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchCasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest instance + */ + SearchCasesRequest.create = function create(properties) { + return new SearchCasesRequest(properties); + }; + + /** + * Encodes the specified SearchCasesRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + 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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified SearchCasesRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.ISearchCasesRequest} message SearchCasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.query = 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 SearchCasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesRequest message. + * @function verify + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesRequest.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchCasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCasesRequest} SearchCasesRequest + */ + SearchCasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCasesRequest) + return object; + var message = new $root.google.cloud.support.v2.SearchCasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + 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 SearchCasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {google.cloud.support.v2.SearchCasesRequest} message SearchCasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.parent = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this SearchCasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCasesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesRequest"; + }; + + return SearchCasesRequest; + })(); + + v2.SearchCasesResponse = (function() { + + /** + * Properties of a SearchCasesResponse. + * @memberof google.cloud.support.v2 + * @interface ISearchCasesResponse + * @property {Array.|null} [cases] SearchCasesResponse cases + * @property {string|null} [nextPageToken] SearchCasesResponse nextPageToken + */ + + /** + * Constructs a new SearchCasesResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCasesResponse. + * @implements ISearchCasesResponse + * @constructor + * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set + */ + function SearchCasesResponse(properties) { + this.cases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCasesResponse cases. + * @member {Array.} cases + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.cases = $util.emptyArray; + + /** + * SearchCasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + */ + SearchCasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse instance + */ + SearchCasesResponse.create = function create(properties) { + return new SearchCasesResponse(properties); + }; + + /** + * Encodes the specified SearchCasesResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cases != null && message.cases.length) + for (var i = 0; i < message.cases.length; ++i) + $root.google.cloud.support.v2.Case.encode(message.cases[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 SearchCasesResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.ISearchCasesResponse} message SearchCasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cases && message.cases.length)) + message.cases = []; + message.cases.push($root.google.cloud.support.v2.Case.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCasesResponse message. + * @function verify + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cases != null && message.hasOwnProperty("cases")) { + if (!Array.isArray(message.cases)) + return "cases: array expected"; + for (var i = 0; i < message.cases.length; ++i) { + var error = $root.google.cloud.support.v2.Case.verify(message.cases[i]); + if (error) + return "cases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCasesResponse} SearchCasesResponse + */ + SearchCasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCasesResponse) + return object; + var message = new $root.google.cloud.support.v2.SearchCasesResponse(); + if (object.cases) { + if (!Array.isArray(object.cases)) + throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: array expected"); + message.cases = []; + for (var i = 0; i < object.cases.length; ++i) { + if (typeof object.cases[i] !== "object") + throw TypeError(".google.cloud.support.v2.SearchCasesResponse.cases: object expected"); + message.cases[i] = $root.google.cloud.support.v2.Case.fromObject(object.cases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {google.cloud.support.v2.SearchCasesResponse} message SearchCasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cases && message.cases.length) { + object.cases = []; + for (var j = 0; j < message.cases.length; ++j) + object.cases[j] = $root.google.cloud.support.v2.Case.toObject(message.cases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCasesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCasesResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCasesResponse"; + }; + + return SearchCasesResponse; + })(); + + v2.EscalateCaseRequest = (function() { + + /** + * Properties of an EscalateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IEscalateCaseRequest + * @property {string|null} [name] EscalateCaseRequest name + * @property {google.cloud.support.v2.IEscalation|null} [escalation] EscalateCaseRequest escalation + */ + + /** + * Constructs a new EscalateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents an EscalateCaseRequest. + * @implements IEscalateCaseRequest + * @constructor + * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set + */ + function EscalateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EscalateCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.name = ""; + + /** + * EscalateCaseRequest escalation. + * @member {google.cloud.support.v2.IEscalation|null|undefined} escalation + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + */ + EscalateCaseRequest.prototype.escalation = null; + + /** + * Creates a new EscalateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest instance + */ + EscalateCaseRequest.create = function create(properties) { + return new EscalateCaseRequest(properties); + }; + + /** + * Encodes the specified EscalateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.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.escalation != null && Object.hasOwnProperty.call(message, "escalation")) + $root.google.cloud.support.v2.Escalation.encode(message.escalation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EscalateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.EscalateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.IEscalateCaseRequest} message EscalateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EscalateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.EscalateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.escalation = $root.google.cloud.support.v2.Escalation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EscalateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EscalateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EscalateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EscalateCaseRequest.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.escalation != null && message.hasOwnProperty("escalation")) { + var error = $root.google.cloud.support.v2.Escalation.verify(message.escalation); + if (error) + return "escalation." + error; + } + return null; + }; + + /** + * Creates an EscalateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.EscalateCaseRequest} EscalateCaseRequest + */ + EscalateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.EscalateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.EscalateCaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.escalation != null) { + if (typeof object.escalation !== "object") + throw TypeError(".google.cloud.support.v2.EscalateCaseRequest.escalation: object expected"); + message.escalation = $root.google.cloud.support.v2.Escalation.fromObject(object.escalation); + } + return message; + }; + + /** + * Creates a plain object from an EscalateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {google.cloud.support.v2.EscalateCaseRequest} message EscalateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EscalateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.escalation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.escalation != null && message.hasOwnProperty("escalation")) + object.escalation = $root.google.cloud.support.v2.Escalation.toObject(message.escalation, options); + return object; + }; + + /** + * Converts this EscalateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + EscalateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EscalateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.EscalateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EscalateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.EscalateCaseRequest"; + }; + + return EscalateCaseRequest; + })(); + + v2.UpdateCaseRequest = (function() { + + /** + * Properties of an UpdateCaseRequest. + * @memberof google.cloud.support.v2 + * @interface IUpdateCaseRequest + * @property {google.cloud.support.v2.ICase|null} ["case"] UpdateCaseRequest case + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCaseRequest updateMask + */ + + /** + * Constructs a new UpdateCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents an UpdateCaseRequest. + * @implements IUpdateCaseRequest + * @constructor + * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set + */ + function UpdateCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCaseRequest case. + * @member {google.cloud.support.v2.ICase|null|undefined} case + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype["case"] = null; + + /** + * UpdateCaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + */ + UpdateCaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest instance + */ + UpdateCaseRequest.create = function create(properties) { + return new UpdateCaseRequest(properties); + }; + + /** + * Encodes the specified UpdateCaseRequest message. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + $root.google.cloud.support.v2.Case.encode(message["case"], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.UpdateCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.IUpdateCaseRequest} message UpdateCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.UpdateCaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message["case"] = $root.google.cloud.support.v2.Case.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["case"] != null && message.hasOwnProperty("case")) { + var error = $root.google.cloud.support.v2.Case.verify(message["case"]); + if (error) + return "case." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.UpdateCaseRequest} UpdateCaseRequest + */ + UpdateCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.UpdateCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.UpdateCaseRequest(); + if (object["case"] != null) { + if (typeof object["case"] !== "object") + throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.case: object expected"); + message["case"] = $root.google.cloud.support.v2.Case.fromObject(object["case"]); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.support.v2.UpdateCaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {google.cloud.support.v2.UpdateCaseRequest} message UpdateCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object["case"] = null; + object.updateMask = null; + } + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = $root.google.cloud.support.v2.Case.toObject(message["case"], options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.UpdateCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.UpdateCaseRequest"; + }; + + return UpdateCaseRequest; + })(); + + v2.CloseCaseRequest = (function() { + + /** + * Properties of a CloseCaseRequest. + * @memberof google.cloud.support.v2 + * @interface ICloseCaseRequest + * @property {string|null} [name] CloseCaseRequest name + */ + + /** + * Constructs a new CloseCaseRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CloseCaseRequest. + * @implements ICloseCaseRequest + * @constructor + * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set + */ + function CloseCaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseCaseRequest name. + * @member {string} name + * @memberof google.cloud.support.v2.CloseCaseRequest + * @instance + */ + CloseCaseRequest.prototype.name = ""; + + /** + * Creates a new CloseCaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest instance + */ + CloseCaseRequest.create = function create(properties) { + return new CloseCaseRequest(properties); + }; + + /** + * Encodes the specified CloseCaseRequest message. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.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 CloseCaseRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CloseCaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.ICloseCaseRequest} message CloseCaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseCaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseCaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CloseCaseRequest(); + 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 CloseCaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseCaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseCaseRequest message. + * @function verify + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseCaseRequest.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 CloseCaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CloseCaseRequest} CloseCaseRequest + */ + CloseCaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CloseCaseRequest) + return object; + var message = new $root.google.cloud.support.v2.CloseCaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CloseCaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {google.cloud.support.v2.CloseCaseRequest} message CloseCaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseCaseRequest.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 CloseCaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CloseCaseRequest + * @instance + * @returns {Object.} JSON object + */ + CloseCaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseCaseRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CloseCaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseCaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CloseCaseRequest"; + }; + + return CloseCaseRequest; + })(); + + v2.SearchCaseClassificationsRequest = (function() { + + /** + * Properties of a SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2 + * @interface ISearchCaseClassificationsRequest + * @property {string|null} [query] SearchCaseClassificationsRequest query + * @property {number|null} [pageSize] SearchCaseClassificationsRequest pageSize + * @property {string|null} [pageToken] SearchCaseClassificationsRequest pageToken + */ + + /** + * Constructs a new SearchCaseClassificationsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCaseClassificationsRequest. + * @implements ISearchCaseClassificationsRequest + * @constructor + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set + */ + function SearchCaseClassificationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsRequest query. + * @member {string} query + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.query = ""; + + /** + * SearchCaseClassificationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageSize = 0; + + /** + * SearchCaseClassificationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + */ + SearchCaseClassificationsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchCaseClassificationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest instance + */ + SearchCaseClassificationsRequest.create = function create(properties) { + return new SearchCaseClassificationsRequest(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsRequest message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + 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 SearchCaseClassificationsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsRequest} message SearchCaseClassificationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = 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 SearchCaseClassificationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsRequest message. + * @function verify + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchCaseClassificationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCaseClassificationsRequest} SearchCaseClassificationsRequest + */ + SearchCaseClassificationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsRequest) + return object; + var message = new $root.google.cloud.support.v2.SearchCaseClassificationsRequest(); + if (object.query != null) + message.query = String(object.query); + 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 SearchCaseClassificationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {google.cloud.support.v2.SearchCaseClassificationsRequest} message SearchCaseClassificationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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 SearchCaseClassificationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCaseClassificationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsRequest"; + }; + + return SearchCaseClassificationsRequest; + })(); + + v2.SearchCaseClassificationsResponse = (function() { + + /** + * Properties of a SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2 + * @interface ISearchCaseClassificationsResponse + * @property {Array.|null} [caseClassifications] SearchCaseClassificationsResponse caseClassifications + * @property {string|null} [nextPageToken] SearchCaseClassificationsResponse nextPageToken + */ + + /** + * Constructs a new SearchCaseClassificationsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a SearchCaseClassificationsResponse. + * @implements ISearchCaseClassificationsResponse + * @constructor + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set + */ + function SearchCaseClassificationsResponse(properties) { + this.caseClassifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCaseClassificationsResponse caseClassifications. + * @member {Array.} caseClassifications + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.caseClassifications = $util.emptyArray; + + /** + * SearchCaseClassificationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + */ + SearchCaseClassificationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchCaseClassificationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse instance + */ + SearchCaseClassificationsResponse.create = function create(properties) { + return new SearchCaseClassificationsResponse(properties); + }; + + /** + * Encodes the specified SearchCaseClassificationsResponse message. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caseClassifications != null && message.caseClassifications.length) + for (var i = 0; i < message.caseClassifications.length; ++i) + $root.google.cloud.support.v2.CaseClassification.encode(message.caseClassifications[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 SearchCaseClassificationsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.SearchCaseClassificationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.ISearchCaseClassificationsResponse} message SearchCaseClassificationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCaseClassificationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.caseClassifications && message.caseClassifications.length)) + message.caseClassifications = []; + message.caseClassifications.push($root.google.cloud.support.v2.CaseClassification.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCaseClassificationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCaseClassificationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCaseClassificationsResponse message. + * @function verify + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCaseClassificationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caseClassifications != null && message.hasOwnProperty("caseClassifications")) { + if (!Array.isArray(message.caseClassifications)) + return "caseClassifications: array expected"; + for (var i = 0; i < message.caseClassifications.length; ++i) { + var error = $root.google.cloud.support.v2.CaseClassification.verify(message.caseClassifications[i]); + if (error) + return "caseClassifications." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchCaseClassificationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.SearchCaseClassificationsResponse} SearchCaseClassificationsResponse + */ + SearchCaseClassificationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.SearchCaseClassificationsResponse) + return object; + var message = new $root.google.cloud.support.v2.SearchCaseClassificationsResponse(); + if (object.caseClassifications) { + if (!Array.isArray(object.caseClassifications)) + throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: array expected"); + message.caseClassifications = []; + for (var i = 0; i < object.caseClassifications.length; ++i) { + if (typeof object.caseClassifications[i] !== "object") + throw TypeError(".google.cloud.support.v2.SearchCaseClassificationsResponse.caseClassifications: object expected"); + message.caseClassifications[i] = $root.google.cloud.support.v2.CaseClassification.fromObject(object.caseClassifications[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchCaseClassificationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {google.cloud.support.v2.SearchCaseClassificationsResponse} message SearchCaseClassificationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCaseClassificationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.caseClassifications = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.caseClassifications && message.caseClassifications.length) { + object.caseClassifications = []; + for (var j = 0; j < message.caseClassifications.length; ++j) + object.caseClassifications[j] = $root.google.cloud.support.v2.CaseClassification.toObject(message.caseClassifications[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchCaseClassificationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchCaseClassificationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCaseClassificationsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.SearchCaseClassificationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCaseClassificationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.SearchCaseClassificationsResponse"; + }; + + return SearchCaseClassificationsResponse; + })(); + + v2.Escalation = (function() { + + /** + * Properties of an Escalation. + * @memberof google.cloud.support.v2 + * @interface IEscalation + * @property {google.cloud.support.v2.Escalation.Reason|null} [reason] Escalation reason + * @property {string|null} [justification] Escalation justification + */ + + /** + * Constructs a new Escalation. + * @memberof google.cloud.support.v2 + * @classdesc Represents an Escalation. + * @implements IEscalation + * @constructor + * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set + */ + function Escalation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Escalation reason. + * @member {google.cloud.support.v2.Escalation.Reason} reason + * @memberof google.cloud.support.v2.Escalation + * @instance + */ + Escalation.prototype.reason = 0; + + /** + * Escalation justification. + * @member {string} justification + * @memberof google.cloud.support.v2.Escalation + * @instance + */ + Escalation.prototype.justification = ""; + + /** + * Creates a new Escalation instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation=} [properties] Properties to set + * @returns {google.cloud.support.v2.Escalation} Escalation instance + */ + Escalation.create = function create(properties) { + return new Escalation(properties); + }; + + /** + * Encodes the specified Escalation message. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reason); + if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.justification); + return writer; + }; + + /** + * Encodes the specified Escalation message, length delimited. Does not implicitly {@link google.cloud.support.v2.Escalation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.IEscalation} message Escalation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Escalation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Escalation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Escalation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.reason = reader.int32(); + break; + } + case 5: { + message.justification = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Escalation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Escalation} Escalation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Escalation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Escalation message. + * @function verify + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Escalation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.justification != null && message.hasOwnProperty("justification")) + if (!$util.isString(message.justification)) + return "justification: string expected"; + return null; + }; + + /** + * Creates an Escalation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Escalation} Escalation + */ + Escalation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Escalation) + return object; + var message = new $root.google.cloud.support.v2.Escalation(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "RESOLUTION_TIME": + case 1: + message.reason = 1; + break; + case "TECHNICAL_EXPERTISE": + case 2: + message.reason = 2; + break; + case "BUSINESS_IMPACT": + case 3: + message.reason = 3; + break; + } + if (object.justification != null) + message.justification = String(object.justification); + return message; + }; + + /** + * Creates a plain object from an Escalation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {google.cloud.support.v2.Escalation} message Escalation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Escalation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + object.justification = ""; + } + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.support.v2.Escalation.Reason[message.reason] === undefined ? message.reason : $root.google.cloud.support.v2.Escalation.Reason[message.reason] : message.reason; + if (message.justification != null && message.hasOwnProperty("justification")) + object.justification = message.justification; + return object; + }; + + /** + * Converts this Escalation to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Escalation + * @instance + * @returns {Object.} JSON object + */ + Escalation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Escalation + * @function getTypeUrl + * @memberof google.cloud.support.v2.Escalation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Escalation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Escalation"; + }; + + /** + * Reason enum. + * @name google.cloud.support.v2.Escalation.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} RESOLUTION_TIME=1 RESOLUTION_TIME value + * @property {number} TECHNICAL_EXPERTISE=2 TECHNICAL_EXPERTISE value + * @property {number} BUSINESS_IMPACT=3 BUSINESS_IMPACT value + */ + Escalation.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOLUTION_TIME"] = 1; + values[valuesById[2] = "TECHNICAL_EXPERTISE"] = 2; + values[valuesById[3] = "BUSINESS_IMPACT"] = 3; + return values; + })(); + + return Escalation; + })(); + + v2.Comment = (function() { + + /** + * Properties of a Comment. + * @memberof google.cloud.support.v2 + * @interface IComment + * @property {string|null} [name] Comment name + * @property {google.protobuf.ITimestamp|null} [createTime] Comment createTime + * @property {google.cloud.support.v2.IActor|null} [creator] Comment creator + * @property {string|null} [body] Comment body + * @property {string|null} [plainTextBody] Comment plainTextBody + */ + + /** + * Constructs a new Comment. + * @memberof google.cloud.support.v2 + * @classdesc Represents a Comment. + * @implements IComment + * @constructor + * @param {google.cloud.support.v2.IComment=} [properties] Properties to set + */ + function Comment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Comment name. + * @member {string} name + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.name = ""; + + /** + * Comment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.createTime = null; + + /** + * Comment creator. + * @member {google.cloud.support.v2.IActor|null|undefined} creator + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.creator = null; + + /** + * Comment body. + * @member {string} body + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.body = ""; + + /** + * Comment plainTextBody. + * @member {string} plainTextBody + * @memberof google.cloud.support.v2.Comment + * @instance + */ + Comment.prototype.plainTextBody = ""; + + /** + * Creates a new Comment instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment=} [properties] Properties to set + * @returns {google.cloud.support.v2.Comment} Comment instance + */ + Comment.create = function create(properties) { + return new Comment(properties); + }; + + /** + * Encodes the specified Comment message. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.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.creator != null && Object.hasOwnProperty.call(message, "creator")) + $root.google.cloud.support.v2.Actor.encode(message.creator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.body); + if (message.plainTextBody != null && Object.hasOwnProperty.call(message, "plainTextBody")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plainTextBody); + return writer; + }; + + /** + * Encodes the specified Comment message, length delimited. Does not implicitly {@link google.cloud.support.v2.Comment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.IComment} message Comment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Comment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Comment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.Comment(); + 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.creator = $root.google.cloud.support.v2.Actor.decode(reader, reader.uint32()); + break; + } + case 4: { + message.body = reader.string(); + break; + } + case 5: { + message.plainTextBody = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Comment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.Comment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.Comment} Comment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Comment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Comment message. + * @function verify + * @memberof google.cloud.support.v2.Comment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Comment.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.creator != null && message.hasOwnProperty("creator")) { + var error = $root.google.cloud.support.v2.Actor.verify(message.creator); + if (error) + return "creator." + error; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + if (!$util.isString(message.plainTextBody)) + return "plainTextBody: string expected"; + return null; + }; + + /** + * Creates a Comment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.Comment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.Comment} Comment + */ + Comment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.Comment) + return object; + var message = new $root.google.cloud.support.v2.Comment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.support.v2.Comment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) { + if (typeof object.creator !== "object") + throw TypeError(".google.cloud.support.v2.Comment.creator: object expected"); + message.creator = $root.google.cloud.support.v2.Actor.fromObject(object.creator); + } + if (object.body != null) + message.body = String(object.body); + if (object.plainTextBody != null) + message.plainTextBody = String(object.plainTextBody); + return message; + }; + + /** + * Creates a plain object from a Comment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.Comment + * @static + * @param {google.cloud.support.v2.Comment} message Comment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Comment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = null; + object.body = ""; + object.plainTextBody = ""; + } + 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.creator != null && message.hasOwnProperty("creator")) + object.creator = $root.google.cloud.support.v2.Actor.toObject(message.creator, options); + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.plainTextBody != null && message.hasOwnProperty("plainTextBody")) + object.plainTextBody = message.plainTextBody; + return object; + }; + + /** + * Converts this Comment to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.Comment + * @instance + * @returns {Object.} JSON object + */ + Comment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Comment + * @function getTypeUrl + * @memberof google.cloud.support.v2.Comment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Comment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.Comment"; + }; + + return Comment; + })(); + + v2.CommentService = (function() { + + /** + * Constructs a new CommentService service. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CommentService + * @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 CommentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CommentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CommentService; + + /** + * Creates new CommentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.support.v2.CommentService + * @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 {CommentService} RPC service. Useful where requests and/or responses are streamed. + */ + CommentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|listComments}. + * @memberof google.cloud.support.v2.CommentService + * @typedef ListCommentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.ListCommentsResponse} [response] ListCommentsResponse + */ + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object + * @param {google.cloud.support.v2.CommentService.ListCommentsCallback} callback Node-style callback called with the error, if any, and ListCommentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.listComments = function listComments(request, callback) { + return this.rpcCall(listComments, $root.google.cloud.support.v2.ListCommentsRequest, $root.google.cloud.support.v2.ListCommentsResponse, request, callback); + }, "name", { value: "ListComments" }); + + /** + * Calls ListComments. + * @function listComments + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.IListCommentsRequest} request ListCommentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.support.v2.CommentService|createComment}. + * @memberof google.cloud.support.v2.CommentService + * @typedef CreateCommentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.support.v2.Comment} [response] Comment + */ + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @param {google.cloud.support.v2.CommentService.CreateCommentCallback} callback Node-style callback called with the error, if any, and Comment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CommentService.prototype.createComment = function createComment(request, callback) { + return this.rpcCall(createComment, $root.google.cloud.support.v2.CreateCommentRequest, $root.google.cloud.support.v2.Comment, request, callback); + }, "name", { value: "CreateComment" }); + + /** + * Calls CreateComment. + * @function createComment + * @memberof google.cloud.support.v2.CommentService + * @instance + * @param {google.cloud.support.v2.ICreateCommentRequest} request CreateCommentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CommentService; + })(); + + v2.ListCommentsRequest = (function() { + + /** + * Properties of a ListCommentsRequest. + * @memberof google.cloud.support.v2 + * @interface IListCommentsRequest + * @property {string|null} [parent] ListCommentsRequest parent + * @property {number|null} [pageSize] ListCommentsRequest pageSize + * @property {string|null} [pageToken] ListCommentsRequest pageToken + */ + + /** + * Constructs a new ListCommentsRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCommentsRequest. + * @implements IListCommentsRequest + * @constructor + * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set + */ + function ListCommentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.parent = ""; + + /** + * ListCommentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageSize = 0; + + /** + * ListCommentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + */ + ListCommentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCommentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest instance + */ + ListCommentsRequest.create = function create(properties) { + return new ListCommentsRequest(properties); + }; + + /** + * Encodes the specified ListCommentsRequest message. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.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 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCommentsRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.IListCommentsRequest} message ListCommentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsRequest message. + * @function verify + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCommentsRequest} ListCommentsRequest + */ + ListCommentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCommentsRequest) + return object; + var message = new $root.google.cloud.support.v2.ListCommentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {google.cloud.support.v2.ListCommentsRequest} message ListCommentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCommentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCommentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCommentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCommentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsRequest"; + }; + + return ListCommentsRequest; + })(); + + v2.ListCommentsResponse = (function() { + + /** + * Properties of a ListCommentsResponse. + * @memberof google.cloud.support.v2 + * @interface IListCommentsResponse + * @property {Array.|null} [comments] ListCommentsResponse comments + * @property {string|null} [nextPageToken] ListCommentsResponse nextPageToken + */ + + /** + * Constructs a new ListCommentsResponse. + * @memberof google.cloud.support.v2 + * @classdesc Represents a ListCommentsResponse. + * @implements IListCommentsResponse + * @constructor + * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set + */ + function ListCommentsResponse(properties) { + this.comments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCommentsResponse comments. + * @member {Array.} comments + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.comments = $util.emptyArray; + + /** + * ListCommentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + */ + ListCommentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCommentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse=} [properties] Properties to set + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse instance + */ + ListCommentsResponse.create = function create(properties) { + return new ListCommentsResponse(properties); + }; + + /** + * Encodes the specified ListCommentsResponse message. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.comments != null && message.comments.length) + for (var i = 0; i < message.comments.length; ++i) + $root.google.cloud.support.v2.Comment.encode(message.comments[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 ListCommentsResponse message, length delimited. Does not implicitly {@link google.cloud.support.v2.ListCommentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.IListCommentsResponse} message ListCommentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCommentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.ListCommentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.comments && message.comments.length)) + message.comments = []; + message.comments.push($root.google.cloud.support.v2.Comment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCommentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCommentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCommentsResponse message. + * @function verify + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCommentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.comments != null && message.hasOwnProperty("comments")) { + if (!Array.isArray(message.comments)) + return "comments: array expected"; + for (var i = 0; i < message.comments.length; ++i) { + var error = $root.google.cloud.support.v2.Comment.verify(message.comments[i]); + if (error) + return "comments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCommentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.ListCommentsResponse} ListCommentsResponse + */ + ListCommentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.ListCommentsResponse) + return object; + var message = new $root.google.cloud.support.v2.ListCommentsResponse(); + if (object.comments) { + if (!Array.isArray(object.comments)) + throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: array expected"); + message.comments = []; + for (var i = 0; i < object.comments.length; ++i) { + if (typeof object.comments[i] !== "object") + throw TypeError(".google.cloud.support.v2.ListCommentsResponse.comments: object expected"); + message.comments[i] = $root.google.cloud.support.v2.Comment.fromObject(object.comments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCommentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {google.cloud.support.v2.ListCommentsResponse} message ListCommentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCommentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.comments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.comments && message.comments.length) { + object.comments = []; + for (var j = 0; j < message.comments.length; ++j) + object.comments[j] = $root.google.cloud.support.v2.Comment.toObject(message.comments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCommentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.ListCommentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCommentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCommentsResponse + * @function getTypeUrl + * @memberof google.cloud.support.v2.ListCommentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCommentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.ListCommentsResponse"; + }; + + return ListCommentsResponse; + })(); + + v2.CreateCommentRequest = (function() { + + /** + * Properties of a CreateCommentRequest. + * @memberof google.cloud.support.v2 + * @interface ICreateCommentRequest + * @property {string|null} [parent] CreateCommentRequest parent + * @property {google.cloud.support.v2.IComment|null} [comment] CreateCommentRequest comment + */ + + /** + * Constructs a new CreateCommentRequest. + * @memberof google.cloud.support.v2 + * @classdesc Represents a CreateCommentRequest. + * @implements ICreateCommentRequest + * @constructor + * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set + */ + function CreateCommentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCommentRequest parent. + * @member {string} parent + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.parent = ""; + + /** + * CreateCommentRequest comment. + * @member {google.cloud.support.v2.IComment|null|undefined} comment + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + */ + CreateCommentRequest.prototype.comment = null; + + /** + * Creates a new CreateCommentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest=} [properties] Properties to set + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest instance + */ + CreateCommentRequest.create = function create(properties) { + return new CreateCommentRequest(properties); + }; + + /** + * Encodes the specified CreateCommentRequest message. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.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.comment != null && Object.hasOwnProperty.call(message, "comment")) + $root.google.cloud.support.v2.Comment.encode(message.comment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCommentRequest message, length delimited. Does not implicitly {@link google.cloud.support.v2.CreateCommentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.ICreateCommentRequest} message CreateCommentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCommentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.support.v2.CreateCommentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.comment = $root.google.cloud.support.v2.Comment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCommentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCommentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCommentRequest message. + * @function verify + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCommentRequest.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.comment != null && message.hasOwnProperty("comment")) { + var error = $root.google.cloud.support.v2.Comment.verify(message.comment); + if (error) + return "comment." + error; + } + return null; + }; + + /** + * Creates a CreateCommentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.support.v2.CreateCommentRequest} CreateCommentRequest + */ + CreateCommentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.support.v2.CreateCommentRequest) + return object; + var message = new $root.google.cloud.support.v2.CreateCommentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.comment != null) { + if (typeof object.comment !== "object") + throw TypeError(".google.cloud.support.v2.CreateCommentRequest.comment: object expected"); + message.comment = $root.google.cloud.support.v2.Comment.fromObject(object.comment); + } + return message; + }; + + /** + * Creates a plain object from a CreateCommentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {google.cloud.support.v2.CreateCommentRequest} message CreateCommentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCommentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.comment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = $root.google.cloud.support.v2.Comment.toObject(message.comment, options); + return object; + }; + + /** + * Converts this CreateCommentRequest to JSON. + * @function toJSON + * @memberof google.cloud.support.v2.CreateCommentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCommentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCommentRequest + * @function getTypeUrl + * @memberof google.cloud.support.v2.CreateCommentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCommentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.support.v2.CreateCommentRequest"; + }; + + return CreateCommentRequest; + })(); + + return v2; + })(); + + return support; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 {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 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.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 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.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.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[".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.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; + })(); + + 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 {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + 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]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === 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.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-support/protos/protos.json b/packages/google-cloud-support/protos/protos.json new file mode 100644 index 000000000000..5195c6b31d4e --- /dev/null +++ b/packages/google-cloud-support/protos/protos.json @@ -0,0 +1,1963 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "support": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Support.V2", + "go_package": "cloud.google.com/go/support/apiv2/supportpb;supportpb", + "java_multiple_files": true, + "java_outer_classname": "CommentServiceProto", + "java_package": "com.google.cloud.support.v2", + "php_namespace": "Google\\Cloud\\Support\\V2", + "ruby_package": "Google::Cloud::Support::V2" + }, + "nested": { + "Actor": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "email": { + "type": "string", + "id": 2 + }, + "googleSupport": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Attachment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Attachment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/attachments/{attachment_id}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "filename": { + "type": "string", + "id": 4 + }, + "mimeType": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CaseAttachmentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAttachments": { + "requestType": "ListAttachmentsRequest", + "responseType": "ListAttachmentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/attachments", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/attachments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/cases/*}/attachments", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/cases/*}/attachments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListAttachmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAttachmentsResponse": { + "fields": { + "attachments": { + "rule": "repeated", + "type": "Attachment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Case": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Case", + "(google.api.resource).pattern": "projects/{project}/cases/{case}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "classification": { + "type": "CaseClassification", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 8 + }, + "subscriberEmailAddresses": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 15 + }, + "contactEmail": { + "type": "string", + "id": 35 + }, + "escalated": { + "type": "bool", + "id": 17 + }, + "testCase": { + "type": "bool", + "id": 19 + }, + "languageCode": { + "type": "string", + "id": 23 + }, + "priority": { + "type": "Priority", + "id": 32 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NEW": 1, + "IN_PROGRESS_GOOGLE_SUPPORT": 2, + "ACTION_REQUIRED": 3, + "SOLUTION_PROVIDED": 4, + "CLOSED": 5 + } + }, + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "P0": 1, + "P1": 2, + "P2": 3, + "P3": 4, + "P4": 5 + } + } + } + }, + "CaseClassification": { + "fields": { + "id": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + } + } + }, + "CaseService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetCase": { + "requestType": "GetCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/cases/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/cases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/cases/*}", + "additional_bindings": { + "get": "/v2/{name=organizations/*/cases/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCases": { + "requestType": "ListCasesRequest", + "responseType": "ListCasesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/cases", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/cases", + "additional_bindings": { + "get": "/v2/{parent=organizations/*}/cases" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchCases": { + "requestType": "SearchCasesRequest", + "responseType": "SearchCasesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/cases:search", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*}/cases:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/cases:search", + "additional_bindings": { + "get": "/v2/{parent=organizations/*}/cases:search" + } + } + } + ] + }, + "CreateCase": { + "requestType": "CreateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/cases", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*}/cases", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "parent,case" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/cases", + "body": "case", + "additional_bindings": { + "post": "/v2/{parent=organizations/*}/cases", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "parent,case" + } + ] + }, + "UpdateCase": { + "requestType": "UpdateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).patch": "/v2/{case.name=projects/*/cases/*}", + "(google.api.http).body": "case", + "(google.api.http).additional_bindings.patch": "/v2/{case.name=organizations/*/cases/*}", + "(google.api.http).additional_bindings.body": "case", + "(google.api.method_signature)": "case,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{case.name=projects/*/cases/*}", + "body": "case", + "additional_bindings": { + "patch": "/v2/{case.name=organizations/*/cases/*}", + "body": "case" + } + } + }, + { + "(google.api.method_signature)": "case,update_mask" + } + ] + }, + "EscalateCase": { + "requestType": "EscalateCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/cases/*}:escalate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:escalate", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/cases/*}:escalate", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=organizations/*/cases/*}:escalate", + "body": "*" + } + } + } + ] + }, + "CloseCase": { + "requestType": "CloseCaseRequest", + "responseType": "Case", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/cases/*}:close", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=organizations/*/cases/*}:close", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/cases/*}:close", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=organizations/*/cases/*}:close", + "body": "*" + } + } + } + ] + }, + "SearchCaseClassifications": { + "requestType": "SearchCaseClassificationsRequest", + "responseType": "SearchCaseClassificationsResponse", + "options": { + "(google.api.http).get": "/v2/caseClassifications:search" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/caseClassifications:search" + } + } + ] + } + } + }, + "GetCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "CreateCaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "case": { + "type": "Case", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudsupport.googleapis.com/Case" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchCasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4 + }, + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchCasesResponse": { + "fields": { + "cases": { + "rule": "repeated", + "type": "Case", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "EscalateCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "escalation": { + "type": "Escalation", + "id": 2 + } + } + }, + "UpdateCaseRequest": { + "fields": { + "case": { + "type": "Case", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CloseCaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + } + } + }, + "SearchCaseClassificationsRequest": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchCaseClassificationsResponse": { + "fields": { + "caseClassifications": { + "rule": "repeated", + "type": "CaseClassification", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Escalation": { + "fields": { + "reason": { + "type": "Reason", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "justification": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "RESOLUTION_TIME": 1, + "TECHNICAL_EXPERTISE": 2, + "BUSINESS_IMPACT": 3 + } + } + } + }, + "Comment": { + "options": { + "(google.api.resource).type": "cloudsupport.googleapis.com/Comment", + "(google.api.resource).pattern": "projects/{project}/cases/{case}/comments/{comment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "Actor", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "body": { + "type": "string", + "id": 4 + }, + "plainTextBody": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CommentService": { + "options": { + "(google.api.default_host)": "cloudsupport.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListComments": { + "requestType": "ListCommentsRequest", + "responseType": "ListCommentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/cases/*}/comments", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/cases/*}/comments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/cases/*}/comments", + "additional_bindings": { + "get": "/v2/{parent=organizations/*/cases/*}/comments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateComment": { + "requestType": "CreateCommentRequest", + "responseType": "Comment", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/cases/*}/comments", + "(google.api.http).body": "comment", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/cases/*}/comments", + "(google.api.http).additional_bindings.body": "comment", + "(google.api.method_signature)": "parent,comment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/cases/*}/comments", + "body": "comment", + "additional_bindings": { + "post": "/v2/{parent=organizations/*/cases/*}/comments", + "body": "comment" + } + } + }, + { + "(google.api.method_signature)": "parent,comment" + } + ] + } + } + }, + "ListCommentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListCommentsResponse": { + "fields": { + "comments": { + "rule": "repeated", + "type": "Comment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateCommentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudsupport.googleapis.com/Case" + } + }, + "comment": { + "type": "Comment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-support/samples/README.md b/packages/google-cloud-support/samples/README.md new file mode 100644 index 000000000000..02a90a657871 --- /dev/null +++ b/packages/google-cloud-support/samples/README.md @@ -0,0 +1,248 @@ +[//]: # "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 + +# [Google Cloud Support 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) + * [Case_attachment_service.list_attachments](#case_attachment_service.list_attachments) + * [Case_service.close_case](#case_service.close_case) + * [Case_service.create_case](#case_service.create_case) + * [Case_service.escalate_case](#case_service.escalate_case) + * [Case_service.get_case](#case_service.get_case) + * [Case_service.list_cases](#case_service.list_cases) + * [Case_service.search_case_classifications](#case_service.search_case_classifications) + * [Case_service.search_cases](#case_service.search_cases) + * [Case_service.update_case](#case_service.update_case) + * [Comment_service.create_comment](#comment_service.create_comment) + * [Comment_service.list_comments](#comment_service.list_comments) + * [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 + + + +### Case_attachment_service.list_attachments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js` + + +----- + + + + +### Case_service.close_case + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.close_case.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.close_case.js` + + +----- + + + + +### Case_service.create_case + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.create_case.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.create_case.js` + + +----- + + + + +### Case_service.escalate_case + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.escalate_case.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js` + + +----- + + + + +### Case_service.get_case + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.get_case.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.get_case.js` + + +----- + + + + +### Case_service.list_cases + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.list_cases.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js` + + +----- + + + + +### Case_service.search_case_classifications + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.search_case_classifications.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js` + + +----- + + + + +### Case_service.search_cases + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.search_cases.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js` + + +----- + + + + +### Case_service.update_case + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js). + +[![Open in Cloud 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-support/samples/generated/v2/case_service.update_case.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/case_service.update_case.js` + + +----- + + + + +### Comment_service.create_comment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js). + +[![Open in Cloud 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-support/samples/generated/v2/comment_service.create_comment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js` + + +----- + + + + +### Comment_service.list_comments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js). + +[![Open in Cloud 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-support/samples/generated/v2/comment_service.list_comments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/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-support/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-support/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/support/docs/reference/support-api diff --git a/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js b/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js new file mode 100644 index 000000000000..66489a2a04f2 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.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(parent) { + // [START cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of Case object for which attachments should be + * listed. + */ + // const parent = 'abc123' + /** + * The maximum number of attachments fetched with each request. If not + * provided, the default is 10. The maximum page size that will be returned is + * 100. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseAttachmentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseAttachmentServiceClient(); + + async function callListAttachments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await supportClient.listAttachmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttachments(); + // [END cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js b/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js new file mode 100644 index 000000000000..67abe04908e3 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudsupport_v2_generated_CaseService_CloseCase_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 fully qualified name of the case resource to be closed. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCloseCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.closeCase(request); + console.log(response); + } + + callCloseCase(); + // [END cloudsupport_v2_generated_CaseService_CloseCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js b/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js new file mode 100644 index 000000000000..a41ae6b72c31 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.create_case.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(parent, case) { + // [START cloudsupport_v2_generated_CaseService_CreateCase_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 Google Cloud Resource under which the case should + * be created. + */ + // const parent = 'abc123' + /** + * Required. The case to be created. + */ + // const case = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callCreateCase() { + // Construct request + const request = { + parent, + case, + }; + + // Run request + const response = await supportClient.createCase(request); + console.log(response); + } + + callCreateCase(); + // [END cloudsupport_v2_generated_CaseService_CreateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js b/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js new file mode 100644 index 000000000000..7e01130f27f6 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.escalate_case.js @@ -0,0 +1,65 @@ +// 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 cloudsupport_v2_generated_CaseService_EscalateCase_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 fully qualified name of the Case resource to be escalated. + */ + // const name = 'abc123' + /** + * The escalation object to be sent with the escalation request. + */ + // const escalation = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callEscalateCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.escalateCase(request); + console.log(response); + } + + callEscalateCase(); + // [END cloudsupport_v2_generated_CaseService_EscalateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js b/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js new file mode 100644 index 000000000000..b00a999cefed --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.get_case.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudsupport_v2_generated_CaseService_GetCase_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 fully qualified name of a case to be retrieved. + */ + // const name = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callGetCase() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await supportClient.getCase(request); + console.log(response); + } + + callGetCase(); + // [END cloudsupport_v2_generated_CaseService_GetCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js b/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js new file mode 100644 index 000000000000..3636b535c28d --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.list_cases.js @@ -0,0 +1,88 @@ +// 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 cloudsupport_v2_generated_CaseService_ListCases_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 fully qualified name of parent resource to list cases under. + */ + // const parent = 'abc123' + /** + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * Examples: + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + */ + // const filter = 'abc123' + /** + * The maximum number of cases fetched with each request. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callListCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await supportClient.listCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCases(); + // [END cloudsupport_v2_generated_CaseService_ListCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js b/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.js new file mode 100644 index 000000000000..38ee58930784 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.search_case_classifications.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() { + // [START cloudsupport_v2_generated_CaseService_SearchCaseClassifications_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. + */ + /** + * An expression written in the Google Cloud filter language. If non-empty, + * then only cases whose fields match the filter are returned. If empty, then + * no messages are filtered out. + */ + // const query = 'abc123' + /** + * The maximum number of cases fetched with each request. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCaseClassifications() { + // Construct request + const request = { + }; + + // Run request + const iterable = await supportClient.searchCaseClassificationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCaseClassifications(); + // [END cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js b/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js new file mode 100644 index 000000000000..b2ecbeeb222f --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js @@ -0,0 +1,103 @@ +// 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() { + // [START cloudsupport_v2_generated_CaseService_SearchCases_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. + */ + /** + * The fully qualified name of parent resource to search cases under. + */ + // const parent = 'abc123' + /** + * An expression written in filter language. + * A query uses the following fields with the operators equals (`=`) and + * `AND`: + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * - `billingAccount`: A billing account in the form + * `billingAccounts/` + * You must specify either `organization` or `project`. + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * Examples: + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + */ + // const query = 'abc123' + /** + * The maximum number of cases fetched with each request. The default page + * size is 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callSearchCases() { + // Construct request + const request = { + }; + + // Run request + const iterable = await supportClient.searchCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchCases(); + // [END cloudsupport_v2_generated_CaseService_SearchCases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js b/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js new file mode 100644 index 000000000000..cad20e0964de --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/case_service.update_case.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(case) { + // [START cloudsupport_v2_generated_CaseService_UpdateCase_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 case object to update. + */ + // const case = {} + /** + * A list of attributes of the case object that should be updated + * as part of this request. Supported values are `priority`, `display_name`, + * and `subscriber_email_addresses`. If no fields are specified, all supported + * fields are updated. + * WARNING: If you do not provide a field mask, then you might accidentally + * clear some fields. For example, if you leave the field mask empty and do + * not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + */ + // const updateMask = {} + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callUpdateCase() { + // Construct request + const request = { + case, + }; + + // Run request + const response = await supportClient.updateCase(request); + console.log(response); + } + + callUpdateCase(); + // [END cloudsupport_v2_generated_CaseService_UpdateCase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js b/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js new file mode 100644 index 000000000000..418130ba764b --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js @@ -0,0 +1,66 @@ +// 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, comment) { + // [START cloudsupport_v2_generated_CommentService_CreateComment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of Case to which this comment should be added. + */ + // const parent = 'abc123' + /** + * Required. The Comment object to be added to this Case. + */ + // const comment = {} + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callCreateComment() { + // Construct request + const request = { + parent, + comment, + }; + + // Run request + const response = await supportClient.createComment(request); + console.log(response); + } + + callCreateComment(); + // [END cloudsupport_v2_generated_CommentService_CreateComment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js b/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js new file mode 100644 index 000000000000..57a9cf77acb2 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudsupport_v2_generated_CommentService_ListComments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of Case object for which comments should be + * listed. + */ + // const parent = 'abc123' + /** + * The maximum number of comments fetched with each request. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CommentServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CommentServiceClient(); + + async function callListComments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await supportClient.listCommentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListComments(); + // [END cloudsupport_v2_generated_CommentService_ListComments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json b/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json new file mode 100644 index 000000000000..68ccc9d78e62 --- /dev/null +++ b/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json @@ -0,0 +1,519 @@ +{ + "clientLibrary": { + "name": "nodejs-support", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.support.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async", + "title": "CaseAttachmentService listAttachments Sample", + "origin": "API_DEFINITION", + "description": " Retrieve all attachments associated with a support case.", + "canonical": true, + "file": "case_attachment_service.list_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListAttachmentsResponse", + "client": { + "shortName": "CaseAttachmentServiceClient", + "fullName": "google.cloud.support.v2.CaseAttachmentServiceClient" + }, + "method": { + "shortName": "ListAttachments", + "fullName": "google.cloud.support.v2.CaseAttachmentService.ListAttachments", + "service": { + "shortName": "CaseAttachmentService", + "fullName": "google.cloud.support.v2.CaseAttachmentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_GetCase_async", + "title": "CaseAttachmentService getCase Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the specified case.", + "canonical": true, + "file": "case_service.get_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2.CaseService.GetCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "GetCase", + "fullName": "google.cloud.support.v2.CaseService.GetCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_ListCases_async", + "title": "CaseAttachmentService listCases Sample", + "origin": "API_DEFINITION", + "description": " Retrieve all cases under the specified parent. Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use `cases.search`.", + "canonical": true, + "file": "case_service.list_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2.CaseService.ListCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "ListCases", + "fullName": "google.cloud.support.v2.CaseService.ListCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_SearchCases_async", + "title": "CaseAttachmentService searchCases Sample", + "origin": "API_DEFINITION", + "description": " Search cases using the specified query.", + "canonical": true, + "file": "case_service.search_cases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2.CaseService.SearchCases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.SearchCasesResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "SearchCases", + "fullName": "google.cloud.support.v2.CaseService.SearchCases", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_CreateCase_async", + "title": "CaseAttachmentService createCase Sample", + "origin": "API_DEFINITION", + "description": " Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: `display_name`, `description`, `classification`, and `priority`.", + "canonical": true, + "file": "case_service.create_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2.CaseService.CreateCase", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "case", + "type": ".google.cloud.support.v2.Case" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "CreateCase", + "fullName": "google.cloud.support.v2.CaseService.CreateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_UpdateCase_async", + "title": "CaseAttachmentService updateCase Sample", + "origin": "API_DEFINITION", + "description": " Update the specified case. Only a subset of fields can be updated.", + "canonical": true, + "file": "case_service.update_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2.CaseService.UpdateCase", + "async": true, + "parameters": [ + { + "name": "case", + "type": ".google.cloud.support.v2.Case" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "UpdateCase", + "fullName": "google.cloud.support.v2.CaseService.UpdateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_EscalateCase_async", + "title": "CaseAttachmentService escalateCase Sample", + "origin": "API_DEFINITION", + "description": " Escalate a case. Escalating a case will initiate the Google Cloud Support escalation management process. This operation is only available to certain Customer Care tiers. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which tiers are able to perform escalations.", + "canonical": true, + "file": "case_service.escalate_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2.CaseService.EscalateCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "escalation", + "type": ".google.cloud.support.v2.Escalation" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "EscalateCase", + "fullName": "google.cloud.support.v2.CaseService.EscalateCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_CloseCase_async", + "title": "CaseAttachmentService closeCase Sample", + "origin": "API_DEFINITION", + "description": " Close the specified case.", + "canonical": true, + "file": "case_service.close_case.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2.CaseService.CloseCase", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.Case", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "CloseCase", + "fullName": "google.cloud.support.v2.CaseService.CloseCase", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async", + "title": "CaseAttachmentService searchCaseClassifications Sample", + "origin": "API_DEFINITION", + "description": " Retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by \" > \". For example \"Technical Issue > Compute > Compute Engine\".", + "canonical": true, + "file": "case_service.search_case_classifications.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", + "async": true, + "parameters": [ + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.SearchCaseClassificationsResponse", + "client": { + "shortName": "CaseServiceClient", + "fullName": "google.cloud.support.v2.CaseServiceClient" + }, + "method": { + "shortName": "SearchCaseClassifications", + "fullName": "google.cloud.support.v2.CaseService.SearchCaseClassifications", + "service": { + "shortName": "CaseService", + "fullName": "google.cloud.support.v2.CaseService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CommentService_ListComments_async", + "title": "CaseAttachmentService listComments Sample", + "origin": "API_DEFINITION", + "description": " Retrieve all Comments associated with the Case object.", + "canonical": true, + "file": "comment_service.list_comments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2.CommentService.ListComments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.support.v2.ListCommentsResponse", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2.CommentServiceClient" + }, + "method": { + "shortName": "ListComments", + "fullName": "google.cloud.support.v2.CommentService.ListComments", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2.CommentService" + } + } + } + }, + { + "regionTag": "cloudsupport_v2_generated_CommentService_CreateComment_async", + "title": "CaseAttachmentService createComment Sample", + "origin": "API_DEFINITION", + "description": " Add a new comment to the specified Case. The comment object must have the following fields set: body.", + "canonical": true, + "file": "comment_service.create_comment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2.CommentService.CreateComment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "comment", + "type": ".google.cloud.support.v2.Comment" + } + ], + "resultType": ".google.cloud.support.v2.Comment", + "client": { + "shortName": "CommentServiceClient", + "fullName": "google.cloud.support.v2.CommentServiceClient" + }, + "method": { + "shortName": "CreateComment", + "fullName": "google.cloud.support.v2.CommentService.CreateComment", + "service": { + "shortName": "CommentService", + "fullName": "google.cloud.support.v2.CommentService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-support/samples/package.json b/packages/google-cloud-support/samples/package.json new file mode 100644 index 000000000000..e6a80e42d8c9 --- /dev/null +++ b/packages/google-cloud-support/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "cloudsupport-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/support": "0.0.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-support/samples/quickstart.js b/packages/google-cloud-support/samples/quickstart.js new file mode 100644 index 000000000000..27eb4da89a36 --- /dev/null +++ b/packages/google-cloud-support/samples/quickstart.js @@ -0,0 +1,86 @@ +// 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 cloudsupport_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fully qualified name of parent resource to list cases under. + */ + // const parent = 'abc123' + /** + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * Examples: + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + */ + // const filter = 'abc123' + /** + * The maximum number of cases fetched with each request. Defaults to 10. + */ + // const pageSize = 1234 + /** + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + */ + // const pageToken = 'abc123' + + // Imports the Support library + const {CaseServiceClient} = require('@google-cloud/support').v2; + + // Instantiates a client + const supportClient = new CaseServiceClient(); + + async function callListCases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await supportClient.listCasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCases(); + // [END cloudsupport_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-support/samples/test/quickstart.js b/packages/google-cloud-support/samples/test/quickstart.js new file mode 100644 index 000000000000..4fd4d70d72ed --- /dev/null +++ b/packages/google-cloud-support/samples/test/quickstart.js @@ -0,0 +1,41 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {CommentServiceClient} = require('@google-cloud/support').v2; +const cloudsupportClient = new CommentServiceClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await cloudsupportClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync(`node ./quickstart.js projects/${projectId}`, { + cwd, + }); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-support/src/index.ts b/packages/google-cloud-support/src/index.ts new file mode 100644 index 000000000000..94f915d8aa14 --- /dev/null +++ b/packages/google-cloud-support/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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; +type CaseAttachmentServiceClient = v2.CaseAttachmentServiceClient; +const CaseServiceClient = v2.CaseServiceClient; +type CaseServiceClient = v2.CaseServiceClient; +const CommentServiceClient = v2.CommentServiceClient; +type CommentServiceClient = v2.CommentServiceClient; + +export { + v2, + CaseAttachmentServiceClient, + CaseServiceClient, + CommentServiceClient, +}; +export default { + v2, + CaseAttachmentServiceClient, + CaseServiceClient, + CommentServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-support/src/v2/case_attachment_service_client.ts b/packages/google-cloud-support/src/v2/case_attachment_service_client.ts new file mode 100644 index 000000000000..6195d6dd7915 --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_attachment_service_client.ts @@ -0,0 +1,895 @@ +// 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, +} 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/v2/case_attachment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_attachment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage file attachment for Google Cloud support cases. + * @class + * @memberof v2 + */ +export class CaseAttachmentServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseAttachmentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseAttachmentServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 CaseAttachmentServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof CaseAttachmentServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listAttachments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'attachments' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CaseAttachmentService', + 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.caseAttachmentServiceStub) { + return this.caseAttachmentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CaseAttachmentService. + this.caseAttachmentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.support.v2.CaseAttachmentService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CaseAttachmentService, + 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 caseAttachmentServiceStubMethods = ['listAttachments']; + for (const methodName of caseAttachmentServiceStubMethods) { + const callPromise = this.caseAttachmentServiceStub.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.caseAttachmentServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudsupport.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 'cloudsupport.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 -- + // ------------------- + + /** + * Retrieve all attachments associated with a support case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of Case object for which attachments should be + * listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. If not + * provided, the default is 10. The maximum page size that will be returned is + * 100. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.support.v2.Attachment | Attachment}. + * 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 `listAttachmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAttachments( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.IAttachment[], + protos.google.cloud.support.v2.IListAttachmentsRequest | null, + protos.google.cloud.support.v2.IListAttachmentsResponse + ] + >; + listAttachments( + request: protos.google.cloud.support.v2.IListAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + | protos.google.cloud.support.v2.IListAttachmentsResponse + | null + | undefined, + protos.google.cloud.support.v2.IAttachment + > + ): void; + listAttachments( + request: protos.google.cloud.support.v2.IListAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + | protos.google.cloud.support.v2.IListAttachmentsResponse + | null + | undefined, + protos.google.cloud.support.v2.IAttachment + > + ): void; + listAttachments( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + | protos.google.cloud.support.v2.IListAttachmentsResponse + | null + | undefined, + protos.google.cloud.support.v2.IAttachment + >, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListAttachmentsRequest, + | protos.google.cloud.support.v2.IListAttachmentsResponse + | null + | undefined, + protos.google.cloud.support.v2.IAttachment + > + ): Promise< + [ + protos.google.cloud.support.v2.IAttachment[], + protos.google.cloud.support.v2.IListAttachmentsRequest | null, + protos.google.cloud.support.v2.IListAttachmentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listAttachments(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 resource name of Case object for which attachments should be + * listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. If not + * provided, the default is 10. The maximum page size that will be returned is + * 100. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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 google.cloud.support.v2.Attachment | Attachment} 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 `listAttachmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAttachmentsStream( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttachments.createStream( + this.innerApiCalls.listAttachments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAttachments`, 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 resource name of Case object for which attachments should be + * listed. + * @param {number} request.pageSize + * The maximum number of attachments fetched with each request. If not + * provided, the default is 10. The maximum page size that will be returned is + * 100. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.support.v2.Attachment | Attachment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/case_attachment_service.list_attachments.js + * region_tag:cloudsupport_v2_generated_CaseAttachmentService_ListAttachments_async + */ + listAttachmentsAsync( + request?: protos.google.cloud.support.v2.IListAttachmentsRequest, + 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['listAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttachments.asyncIterate( + this.innerApiCalls['listAttachments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization: string, caseParam: string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath( + organization: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath( + organization: string, + caseParam: string, + comment: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project: string, caseParam: string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath( + project: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project: string, caseParam: string, comment: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).comment; + } + + /** + * 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.caseAttachmentServiceStub && !this._terminated) { + return this.caseAttachmentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-support/src/v2/case_attachment_service_client_config.json b/packages/google-cloud-support/src/v2/case_attachment_service_client_config.json new file mode 100644 index 000000000000..cbbee7880fdc --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_attachment_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.support.v2.CaseAttachmentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-support/src/v2/case_attachment_service_proto_list.json b/packages/google-cloud-support/src/v2/case_attachment_service_proto_list.json new file mode 100644 index 000000000000..e71d41554890 --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_attachment_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/packages/google-cloud-support/src/v2/case_service_client.ts b/packages/google-cloud-support/src/v2/case_service_client.ts new file mode 100644 index 000000000000..80353c12127f --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_service_client.ts @@ -0,0 +1,1912 @@ +// 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, +} 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/v2/case_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './case_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage Google Cloud support cases. + * @class + * @memberof v2 + */ +export class CaseServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + caseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CaseServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 CaseServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CaseServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listCases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cases' + ), + searchCases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cases' + ), + searchCaseClassifications: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'caseClassifications' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CaseService', + 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.caseServiceStub) { + return this.caseServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CaseService. + this.caseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.support.v2.CaseService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CaseService, + 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 caseServiceStubMethods = [ + 'getCase', + 'listCases', + 'searchCases', + 'createCase', + 'updateCase', + 'escalateCase', + 'closeCase', + 'searchCaseClassifications', + ]; + for (const methodName of caseServiceStubMethods) { + const callPromise = this.caseServiceStub.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.caseServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudsupport.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 'cloudsupport.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 -- + // ------------------- + /** + * Retrieve the specified case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fully qualified name of a case to be retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case | Case}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/case_service.get_case.js + * region_tag:cloudsupport_v2_generated_CaseService_GetCase_async + */ + getCase( + request?: protos.google.cloud.support.v2.IGetCaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | undefined, + {} | undefined + ] + >; + getCase( + request: protos.google.cloud.support.v2.IGetCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getCase( + request: protos.google.cloud.support.v2.IGetCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getCase( + request?: protos.google.cloud.support.v2.IGetCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IGetCaseRequest | 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.getCase(request, options, callback); + } + /** + * Create a new case and associate it with the given Google Cloud Resource. + * The case object must have the following fields set: `display_name`, + * `description`, `classification`, and `priority`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Google Cloud Resource under which the case should + * be created. + * @param {google.cloud.support.v2.Case} request.case + * Required. The case to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case | Case}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/case_service.create_case.js + * region_tag:cloudsupport_v2_generated_CaseService_CreateCase_async + */ + createCase( + request?: protos.google.cloud.support.v2.ICreateCaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | undefined, + {} | undefined + ] + >; + createCase( + request: protos.google.cloud.support.v2.ICreateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + createCase( + request: protos.google.cloud.support.v2.ICreateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + createCase( + request?: protos.google.cloud.support.v2.ICreateCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICreateCaseRequest | 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.createCase(request, options, callback); + } + /** + * Update the specified case. Only a subset of fields can be updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.support.v2.Case} request.case + * Required. The case object to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of attributes of the case object that should be updated + * as part of this request. Supported values are `priority`, `display_name`, + * and `subscriber_email_addresses`. If no fields are specified, all supported + * fields are updated. + * + * WARNING: If you do not provide a field mask, then you might accidentally + * clear some fields. For example, if you leave the field mask empty and do + * not provide a value for `subscriber_email_addresses`, then + * `subscriber_email_addresses` is updated to empty. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case | Case}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/case_service.update_case.js + * region_tag:cloudsupport_v2_generated_CaseService_UpdateCase_async + */ + updateCase( + request?: protos.google.cloud.support.v2.IUpdateCaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | undefined, + {} | undefined + ] + >; + updateCase( + request: protos.google.cloud.support.v2.IUpdateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCase( + request: protos.google.cloud.support.v2.IUpdateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCase( + request?: protos.google.cloud.support.v2.IUpdateCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IUpdateCaseRequest | 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({ + 'case.name': request.case!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCase(request, options, callback); + } + /** + * Escalate a case. Escalating a case will initiate the Google Cloud Support + * escalation management process. + * + * This operation is only available to certain Customer Care tiers. Go to + * https://cloud.google.com/support and look for 'Technical support + * escalations' in the feature list to find out which tiers are able to + * perform escalations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fully qualified name of the Case resource to be escalated. + * @param {google.cloud.support.v2.Escalation} request.escalation + * The escalation object to be sent with the escalation request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case | Case}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/case_service.escalate_case.js + * region_tag:cloudsupport_v2_generated_CaseService_EscalateCase_async + */ + escalateCase( + request?: protos.google.cloud.support.v2.IEscalateCaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest | undefined, + {} | undefined + ] + >; + escalateCase( + request: protos.google.cloud.support.v2.IEscalateCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + escalateCase( + request: protos.google.cloud.support.v2.IEscalateCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + escalateCase( + request?: protos.google.cloud.support.v2.IEscalateCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.ICase, + | protos.google.cloud.support.v2.IEscalateCaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.IEscalateCaseRequest | 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.escalateCase(request, options, callback); + } + /** + * Close the specified case. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fully qualified name of the case resource to be closed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Case | Case}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/case_service.close_case.js + * region_tag:cloudsupport_v2_generated_CaseService_CloseCase_async + */ + closeCase( + request?: protos.google.cloud.support.v2.ICloseCaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | undefined, + {} | undefined + ] + >; + closeCase( + request: protos.google.cloud.support.v2.ICloseCaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + closeCase( + request: protos.google.cloud.support.v2.ICloseCaseRequest, + callback: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, + {} | null | undefined + > + ): void; + closeCase( + request?: protos.google.cloud.support.v2.ICloseCaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase, + protos.google.cloud.support.v2.ICloseCaseRequest | 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.closeCase(request, options, callback); + } + + /** + * Retrieve all cases under the specified parent. + * + * Note: Listing cases under an Organization returns only the cases directly + * parented by that organization. To retrieve all cases under an organization, + * including cases parented by projects under that organization, use + * `cases.search`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The fully qualified name of parent resource to list cases under. + * @param {string} request.filter + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * Examples: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.support.v2.Case | Case}. + * 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 `listCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCases( + request?: protos.google.cloud.support.v2.IListCasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.IListCasesRequest | null, + protos.google.cloud.support.v2.IListCasesResponse + ] + >; + listCases( + request: protos.google.cloud.support.v2.IListCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): void; + listCases( + request: protos.google.cloud.support.v2.IListCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): void; + listCases( + request?: protos.google.cloud.support.v2.IListCasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + >, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListCasesRequest, + protos.google.cloud.support.v2.IListCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.IListCasesRequest | null, + protos.google.cloud.support.v2.IListCasesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listCases(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 fully qualified name of parent resource to list cases under. + * @param {string} request.filter + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * Examples: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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 google.cloud.support.v2.Case | Case} 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 `listCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCasesStream( + request?: protos.google.cloud.support.v2.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCases.createStream( + this.innerApiCalls.listCases as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCases`, 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 fully qualified name of parent resource to list cases under. + * @param {string} request.filter + * An expression written in filter language. If non-empty, the query returns + * the cases that match the filter. Else, the query doesn't filter the cases. + * + * Filter expressions use the following fields with the operators equals (`=`) + * and `AND`: + * + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * + * Examples: + * + * - `state=CLOSED` + * - `state=OPEN AND creator.email="tester@example.com"` + * - `state=OPEN AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.support.v2.Case | Case}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/case_service.list_cases.js + * region_tag:cloudsupport_v2_generated_CaseService_ListCases_async + */ + listCasesAsync( + request?: protos.google.cloud.support.v2.IListCasesRequest, + 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['listCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCases.asyncIterate( + this.innerApiCalls['listCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search cases using the specified query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The fully qualified name of parent resource to search cases under. + * @param {string} request.query + * An expression written in filter language. + * + * A query uses the following fields with the operators equals (`=`) and + * `AND`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * - `billingAccount`: A billing account in the form + * `billingAccounts/` + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.support.v2.Case | Case}. + * 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 `searchCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchCases( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.ISearchCasesRequest | null, + protos.google.cloud.support.v2.ISearchCasesResponse + ] + >; + searchCases( + request: protos.google.cloud.support.v2.ISearchCasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): void; + searchCases( + request: protos.google.cloud.support.v2.ISearchCasesRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): void; + searchCases( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + | protos.google.cloud.support.v2.ISearchCasesResponse + | null + | undefined, + protos.google.cloud.support.v2.ICase + >, + callback?: PaginationCallback< + protos.google.cloud.support.v2.ISearchCasesRequest, + protos.google.cloud.support.v2.ISearchCasesResponse | null | undefined, + protos.google.cloud.support.v2.ICase + > + ): Promise< + [ + protos.google.cloud.support.v2.ICase[], + protos.google.cloud.support.v2.ISearchCasesRequest | null, + protos.google.cloud.support.v2.ISearchCasesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.searchCases(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 + * The fully qualified name of parent resource to search cases under. + * @param {string} request.query + * An expression written in filter language. + * + * A query uses the following fields with the operators equals (`=`) and + * `AND`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * - `billingAccount`: A billing account in the form + * `billingAccounts/` + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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 google.cloud.support.v2.Case | Case} 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 `searchCasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchCasesStream( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchCases.createStream( + this.innerApiCalls.searchCases as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchCases`, 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 + * The fully qualified name of parent resource to search cases under. + * @param {string} request.query + * An expression written in filter language. + * + * A query uses the following fields with the operators equals (`=`) and + * `AND`: + * + * - `organization`: An organization name in the form + * `organizations/`. + * - `project`: A project name in the form `projects/`. + * - `state`: The accepted values are `OPEN` or `CLOSED`. + * - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You + * can specify multiple values for priority using the `OR` operator. For + * example, `priority=P1 OR priority=P2`. + * - `creator.email`: The email address of the case creator. + * - `billingAccount`: A billing account in the form + * `billingAccounts/` + * + * You must specify either `organization` or `project`. + * + * To search across `displayName`, `description`, and comments, use a global + * restriction with no keyword or operator. For example, `"my search"`. + * + * To search only cases updated after a certain date, use `update_time` + * restricted with that particular date, time, and timezone in ISO datetime + * format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. + * `update_time` only supports the greater than operator (`>`). + * + * Examples: + * + * - `organization="organizations/123456789"` + * - `project="projects/my-project-id"` + * - `project="projects/123456789"` + * - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` + * - `organization="organizations/123456789" AND state=CLOSED` + * - `project="projects/my-project-id" AND creator.email="tester@example.com"` + * - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. The default page + * size is 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.support.v2.Case | Case}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/case_service.search_cases.js + * region_tag:cloudsupport_v2_generated_CaseService_SearchCases_async + */ + searchCasesAsync( + request?: protos.google.cloud.support.v2.ISearchCasesRequest, + 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['searchCases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchCases.asyncIterate( + this.innerApiCalls['searchCases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieve valid classifications to be used when creating a support case. + * The classications are hierarchical, with each classification containing + * all levels of the hierarchy, separated by " > ". For example "Technical + * Issue > Compute > Compute Engine". + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.query + * An expression written in the Google Cloud filter language. If non-empty, + * then only cases whose fields match the filter are returned. If empty, then + * no messages are filtered out. + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.support.v2.CaseClassification | CaseClassification}. + * 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 `searchCaseClassificationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchCaseClassifications( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.ICaseClassification[], + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest | null, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + ] + >; + searchCaseClassifications( + request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + | protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + | null + | undefined, + protos.google.cloud.support.v2.ICaseClassification + > + ): void; + searchCaseClassifications( + request: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + | protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + | null + | undefined, + protos.google.cloud.support.v2.ICaseClassification + > + ): void; + searchCaseClassifications( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + | protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + | null + | undefined, + protos.google.cloud.support.v2.ICaseClassification + >, + callback?: PaginationCallback< + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + | protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + | null + | undefined, + protos.google.cloud.support.v2.ICaseClassification + > + ): Promise< + [ + protos.google.cloud.support.v2.ICaseClassification[], + protos.google.cloud.support.v2.ISearchCaseClassificationsRequest | null, + protos.google.cloud.support.v2.ISearchCaseClassificationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.searchCaseClassifications( + 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.query + * An expression written in the Google Cloud filter language. If non-empty, + * then only cases whose fields match the filter are returned. If empty, then + * no messages are filtered out. + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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 google.cloud.support.v2.CaseClassification | CaseClassification} 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 `searchCaseClassificationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchCaseClassificationsStream( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchCaseClassifications.createStream( + this.innerApiCalls.searchCaseClassifications as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchCaseClassifications`, 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.query + * An expression written in the Google Cloud filter language. If non-empty, + * then only cases whose fields match the filter are returned. If empty, then + * no messages are filtered out. + * @param {number} request.pageSize + * The maximum number of cases fetched with each request. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.support.v2.CaseClassification | CaseClassification}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/case_service.search_case_classifications.js + * region_tag:cloudsupport_v2_generated_CaseService_SearchCaseClassifications_async + */ + searchCaseClassificationsAsync( + request?: protos.google.cloud.support.v2.ISearchCaseClassificationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchCaseClassifications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchCaseClassifications.asyncIterate( + this.innerApiCalls['searchCaseClassifications'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization: string, caseParam: string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath( + organization: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath( + organization: string, + caseParam: string, + comment: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project: string, caseParam: string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath( + project: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project: string, caseParam: string, comment: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).comment; + } + + /** + * 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.caseServiceStub && !this._terminated) { + return this.caseServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-support/src/v2/case_service_client_config.json b/packages/google-cloud-support/src/v2/case_service_client_config.json new file mode 100644 index 000000000000..a1e210879177 --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.support.v2.CaseService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetCase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchCases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EscalateCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CloseCase": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchCaseClassifications": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-support/src/v2/case_service_proto_list.json b/packages/google-cloud-support/src/v2/case_service_proto_list.json new file mode 100644 index 000000000000..e71d41554890 --- /dev/null +++ b/packages/google-cloud-support/src/v2/case_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/packages/google-cloud-support/src/v2/comment_service_client.ts b/packages/google-cloud-support/src/v2/comment_service_client.ts new file mode 100644 index 000000000000..88eeb4c03706 --- /dev/null +++ b/packages/google-cloud-support/src/v2/comment_service_client.ts @@ -0,0 +1,970 @@ +// 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, +} 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/v2/comment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './comment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service to manage comments on cases. + * @class + * @memberof v2 + */ +export class CommentServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + commentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CommentServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 CommentServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CommentServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + organizationCasePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}' + ), + organizationCaseAttachmentIdPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/attachments/{attachment_id}' + ), + organizationCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cases/{case}/comments/{comment}' + ), + projectCasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}' + ), + projectCaseAttachmentIdPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/attachments/{attachment_id}' + ), + projectCaseCommentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cases/{case}/comments/{comment}' + ), + }; + + // 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 = { + listComments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'comments' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.support.v2.CommentService', + 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.commentServiceStub) { + return this.commentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.support.v2.CommentService. + this.commentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.support.v2.CommentService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.support.v2.CommentService, + 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 commentServiceStubMethods = ['listComments', 'createComment']; + for (const methodName of commentServiceStubMethods) { + const callPromise = this.commentServiceStub.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.commentServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudsupport.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 'cloudsupport.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 -- + // ------------------- + /** + * Add a new comment to the specified Case. + * The comment object must have the following fields set: body. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of Case to which this comment should be added. + * @param {google.cloud.support.v2.Comment} request.comment + * Required. The Comment object to be added to this Case. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.support.v2.Comment | Comment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/comment_service.create_comment.js + * region_tag:cloudsupport_v2_generated_CommentService_CreateComment_async + */ + createComment( + request?: protos.google.cloud.support.v2.ICreateCommentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest | undefined, + {} | undefined + ] + >; + createComment( + request: protos.google.cloud.support.v2.ICreateCommentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest | null | undefined, + {} | null | undefined + > + ): void; + createComment( + request: protos.google.cloud.support.v2.ICreateCommentRequest, + callback: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest | null | undefined, + {} | null | undefined + > + ): void; + createComment( + request?: protos.google.cloud.support.v2.ICreateCommentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.support.v2.IComment, + | protos.google.cloud.support.v2.ICreateCommentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.support.v2.IComment, + protos.google.cloud.support.v2.ICreateCommentRequest | 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.createComment(request, options, callback); + } + + /** + * Retrieve all Comments associated with the Case object. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of Case object for which comments should be + * listed. + * @param {number} request.pageSize + * The maximum number of comments fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.support.v2.Comment | Comment}. + * 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 `listCommentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listComments( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.support.v2.IComment[], + protos.google.cloud.support.v2.IListCommentsRequest | null, + protos.google.cloud.support.v2.IListCommentsResponse + ] + >; + listComments( + request: protos.google.cloud.support.v2.IListCommentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse | null | undefined, + protos.google.cloud.support.v2.IComment + > + ): void; + listComments( + request: protos.google.cloud.support.v2.IListCommentsRequest, + callback: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse | null | undefined, + protos.google.cloud.support.v2.IComment + > + ): void; + listComments( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + | protos.google.cloud.support.v2.IListCommentsResponse + | null + | undefined, + protos.google.cloud.support.v2.IComment + >, + callback?: PaginationCallback< + protos.google.cloud.support.v2.IListCommentsRequest, + protos.google.cloud.support.v2.IListCommentsResponse | null | undefined, + protos.google.cloud.support.v2.IComment + > + ): Promise< + [ + protos.google.cloud.support.v2.IComment[], + protos.google.cloud.support.v2.IListCommentsRequest | null, + protos.google.cloud.support.v2.IListCommentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listComments(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 resource name of Case object for which comments should be + * listed. + * @param {number} request.pageSize + * The maximum number of comments fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @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 google.cloud.support.v2.Comment | Comment} 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 `listCommentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCommentsStream( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listComments.createStream( + this.innerApiCalls.listComments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listComments`, 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 resource name of Case object for which comments should be + * listed. + * @param {number} request.pageSize + * The maximum number of comments fetched with each request. Defaults to 10. + * @param {string} request.pageToken + * A token identifying the page of results to return. If unspecified, the + * first page is retrieved. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.support.v2.Comment | Comment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v2/comment_service.list_comments.js + * region_tag:cloudsupport_v2_generated_CommentService_ListComments_async + */ + listCommentsAsync( + request?: protos.google.cloud.support.v2.IListCommentsRequest, + 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['listComments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listComments.asyncIterate( + this.innerApiCalls['listComments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified organizationCase resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @returns {string} Resource name string. + */ + organizationCasePath(organization: string, caseParam: string) { + return this.pathTemplates.organizationCasePathTemplate.render({ + organization: organization, + case: caseParam, + }); + } + + /** + * Parse the organization from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).organization; + } + + /** + * Parse the case from OrganizationCase resource. + * + * @param {string} organizationCaseName + * A fully-qualified path representing organization_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseName(organizationCaseName: string) { + return this.pathTemplates.organizationCasePathTemplate.match( + organizationCaseName + ).case; + } + + /** + * Return a fully-qualified organizationCaseAttachmentId resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + organizationCaseAttachmentIdPath( + organization: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.render({ + organization: organization, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the organization from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).organization; + } + + /** + * Parse the case from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from OrganizationCaseAttachmentId resource. + * + * @param {string} organizationCaseAttachmentIdName + * A fully-qualified path representing organization_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromOrganizationCaseAttachmentIdName( + organizationCaseAttachmentIdName: string + ) { + return this.pathTemplates.organizationCaseAttachmentIdPathTemplate.match( + organizationCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified organizationCaseComment resource name string. + * + * @param {string} organization + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + organizationCaseCommentPath( + organization: string, + caseParam: string, + comment: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.render({ + organization: organization, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the organization from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).organization; + } + + /** + * Parse the case from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).case; + } + + /** + * Parse the comment from OrganizationCaseComment resource. + * + * @param {string} organizationCaseCommentName + * A fully-qualified path representing organization_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromOrganizationCaseCommentName( + organizationCaseCommentName: string + ) { + return this.pathTemplates.organizationCaseCommentPathTemplate.match( + organizationCaseCommentName + ).comment; + } + + /** + * Return a fully-qualified projectCase resource name string. + * + * @param {string} project + * @param {string} caseParam + * @returns {string} Resource name string. + */ + projectCasePath(project: string, caseParam: string) { + return this.pathTemplates.projectCasePathTemplate.render({ + project: project, + case: caseParam, + }); + } + + /** + * Parse the project from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .project; + } + + /** + * Parse the case from ProjectCase resource. + * + * @param {string} projectCaseName + * A fully-qualified path representing project_case resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseName(projectCaseName: string) { + return this.pathTemplates.projectCasePathTemplate.match(projectCaseName) + .case; + } + + /** + * Return a fully-qualified projectCaseAttachmentId resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} attachment_id + * @returns {string} Resource name string. + */ + projectCaseAttachmentIdPath( + project: string, + caseParam: string, + attachmentId: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.render({ + project: project, + case: caseParam, + attachment_id: attachmentId, + }); + } + + /** + * Parse the project from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).project; + } + + /** + * Parse the case from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).case; + } + + /** + * Parse the attachment_id from ProjectCaseAttachmentId resource. + * + * @param {string} projectCaseAttachmentIdName + * A fully-qualified path representing project_case_attachment_id resource. + * @returns {string} A string representing the attachment_id. + */ + matchAttachmentIdFromProjectCaseAttachmentIdName( + projectCaseAttachmentIdName: string + ) { + return this.pathTemplates.projectCaseAttachmentIdPathTemplate.match( + projectCaseAttachmentIdName + ).attachment_id; + } + + /** + * Return a fully-qualified projectCaseComment resource name string. + * + * @param {string} project + * @param {string} caseParam + * @param {string} comment + * @returns {string} Resource name string. + */ + projectCaseCommentPath(project: string, caseParam: string, comment: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.render({ + project: project, + case: caseParam, + comment: comment, + }); + } + + /** + * Parse the project from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).project; + } + + /** + * Parse the case from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the case. + */ + matchCaseFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).case; + } + + /** + * Parse the comment from ProjectCaseComment resource. + * + * @param {string} projectCaseCommentName + * A fully-qualified path representing project_case_comment resource. + * @returns {string} A string representing the comment. + */ + matchCommentFromProjectCaseCommentName(projectCaseCommentName: string) { + return this.pathTemplates.projectCaseCommentPathTemplate.match( + projectCaseCommentName + ).comment; + } + + /** + * 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.commentServiceStub && !this._terminated) { + return this.commentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-support/src/v2/comment_service_client_config.json b/packages/google-cloud-support/src/v2/comment_service_client_config.json new file mode 100644 index 000000000000..addf5b5e654d --- /dev/null +++ b/packages/google-cloud-support/src/v2/comment_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.cloud.support.v2.CommentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListComments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateComment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-support/src/v2/comment_service_proto_list.json b/packages/google-cloud-support/src/v2/comment_service_proto_list.json new file mode 100644 index 000000000000..e71d41554890 --- /dev/null +++ b/packages/google-cloud-support/src/v2/comment_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/support/v2/actor.proto", + "../../protos/google/cloud/support/v2/attachment.proto", + "../../protos/google/cloud/support/v2/attachment_service.proto", + "../../protos/google/cloud/support/v2/case.proto", + "../../protos/google/cloud/support/v2/case_service.proto", + "../../protos/google/cloud/support/v2/comment.proto", + "../../protos/google/cloud/support/v2/comment_service.proto", + "../../protos/google/cloud/support/v2/escalation.proto" +] diff --git a/packages/google-cloud-support/src/v2/gapic_metadata.json b/packages/google-cloud-support/src/v2/gapic_metadata.json new file mode 100644 index 000000000000..7bb73a8fbd4e --- /dev/null +++ b/packages/google-cloud-support/src/v2/gapic_metadata.json @@ -0,0 +1,181 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.support.v2", + "libraryPackage": "@google-cloud/support", + "services": { + "CaseAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseAttachmentServiceClient", + "rpcs": { + "ListAttachments": { + "methods": [ + "listAttachments", + "listAttachmentsStream", + "listAttachmentsAsync" + ] + } + } + } + } + }, + "CaseService": { + "clients": { + "grpc": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CaseServiceClient", + "rpcs": { + "GetCase": { + "methods": [ + "getCase" + ] + }, + "CreateCase": { + "methods": [ + "createCase" + ] + }, + "UpdateCase": { + "methods": [ + "updateCase" + ] + }, + "EscalateCase": { + "methods": [ + "escalateCase" + ] + }, + "CloseCase": { + "methods": [ + "closeCase" + ] + }, + "ListCases": { + "methods": [ + "listCases", + "listCasesStream", + "listCasesAsync" + ] + }, + "SearchCases": { + "methods": [ + "searchCases", + "searchCasesStream", + "searchCasesAsync" + ] + }, + "SearchCaseClassifications": { + "methods": [ + "searchCaseClassifications", + "searchCaseClassificationsStream", + "searchCaseClassificationsAsync" + ] + } + } + } + } + }, + "CommentService": { + "clients": { + "grpc": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CommentServiceClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "ListComments": { + "methods": [ + "listComments", + "listCommentsStream", + "listCommentsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-support/src/v2/index.ts b/packages/google-cloud-support/src/v2/index.ts new file mode 100644 index 000000000000..dbf7da60843e --- /dev/null +++ b/packages/google-cloud-support/src/v2/index.ts @@ -0,0 +1,21 @@ +// 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 {CaseAttachmentServiceClient} from './case_attachment_service_client'; +export {CaseServiceClient} from './case_service_client'; +export {CommentServiceClient} from './comment_service_client'; diff --git a/packages/google-cloud-support/system-test/fixtures/sample/src/index.js b/packages/google-cloud-support/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..e3778406256d --- /dev/null +++ b/packages/google-cloud-support/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 support = require('@google-cloud/support'); + +function main() { + const caseAttachmentServiceClient = new support.CaseAttachmentServiceClient(); + const caseServiceClient = new support.CaseServiceClient(); + const commentServiceClient = new support.CommentServiceClient(); +} + +main(); diff --git a/packages/google-cloud-support/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-support/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..2d4cdfd99ef6 --- /dev/null +++ b/packages/google-cloud-support/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,50 @@ +// 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 { + CaseAttachmentServiceClient, + CaseServiceClient, + CommentServiceClient, +} from '@google-cloud/support'; + +// check that the client class type name can be used +function doStuffWithCaseAttachmentServiceClient( + client: CaseAttachmentServiceClient +) { + client.close(); +} +function doStuffWithCaseServiceClient(client: CaseServiceClient) { + client.close(); +} +function doStuffWithCommentServiceClient(client: CommentServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const caseAttachmentServiceClient = new CaseAttachmentServiceClient(); + doStuffWithCaseAttachmentServiceClient(caseAttachmentServiceClient); + // check that the client instance can be created + const caseServiceClient = new CaseServiceClient(); + doStuffWithCaseServiceClient(caseServiceClient); + // check that the client instance can be created + const commentServiceClient = new CommentServiceClient(); + doStuffWithCommentServiceClient(commentServiceClient); +} + +main(); diff --git a/packages/google-cloud-support/system-test/install.ts b/packages/google-cloud-support/system-test/install.ts new file mode 100644 index 000000000000..f61fe236476b --- /dev/null +++ b/packages/google-cloud-support/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-support/test/gapic_case_attachment_service_v2.ts b/packages/google-cloud-support/test/gapic_case_attachment_service_v2.ts new file mode 100644 index 000000000000..16ec7b62c6df --- /dev/null +++ b/packages/google-cloud-support/test/gapic_case_attachment_service_v2.ts @@ -0,0 +1,973 @@ +// 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 caseattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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('v2.CaseAttachmentServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + caseattachmentserviceModule.v2.CaseAttachmentServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + caseattachmentserviceModule.v2.CaseAttachmentServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + caseattachmentserviceModule.v2.CaseAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.caseAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.caseAttachmentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + 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 caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + 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('listAttachments', () => { + it('invokes listAttachments without error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.innerApiCalls.listAttachments = stubSimpleCall(expectedResponse); + const [response] = await client.listAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments without error using callback', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.innerApiCalls.listAttachments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttachments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.IAttachment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachments with error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttachments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAttachments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttachmentsStream without error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.descriptors.page.listAttachments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Attachment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.Attachment) => { + 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.listAttachments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAttachments, request) + ); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttachmentsStream with error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Attachment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.Attachment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAttachments, request) + ); + assert( + (client.descriptors.page.listAttachments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments without error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + generateSampleMessage(new protos.google.cloud.support.v2.Attachment()), + ]; + client.descriptors.page.listAttachments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.IAttachment[] = []; + const iterable = client.listAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAttachments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttachments with error', async () => { + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttachments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.IAttachment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAttachments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAttachments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('organizationCase', () => { + const fakePath = '/rendered/path/organizationCase'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath( + 'organizationValue', + 'caseValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCasePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = + client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseAttachmentId', () => { + const fakePath = '/rendered/path/organizationCaseAttachmentId'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath( + 'organizationValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchOrganizationFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseComment', () => { + const fakePath = '/rendered/path/organizationCaseComment'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath( + 'organizationValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = + client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = + client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = + client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCase', () => { + const fakePath = '/rendered/path/projectCase'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath('projectValue', 'caseValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseAttachmentId', () => { + const fakePath = '/rendered/path/projectCaseAttachmentId'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath( + 'projectValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = + client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = + client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseComment', () => { + const fakePath = '/rendered/path/projectCaseComment'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = + new caseattachmentserviceModule.v2.CaseAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath( + 'projectValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-support/test/gapic_case_service_v2.ts b/packages/google-cloud-support/test/gapic_case_service_v2.ts new file mode 100644 index 000000000000..42eab4b807e1 --- /dev/null +++ b/packages/google-cloud-support/test/gapic_case_service_v2.ts @@ -0,0 +1,2175 @@ +// 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 caseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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('v2.CaseServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = caseserviceModule.v2.CaseServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = caseserviceModule.v2.CaseServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = caseserviceModule.v2.CaseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new caseserviceModule.v2.CaseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + await client.initialize(); + assert(client.caseServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.caseServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.caseServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new caseserviceModule.v2.CaseServiceClient({ + 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 caseserviceModule.v2.CaseServiceClient({ + 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('getCase', () => { + it('invokes getCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.GetCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.getCase = stubSimpleCall(expectedResponse); + const [response] = await client.getCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.GetCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.getCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCase as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.GetCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCase(request), expectedError); + const actualRequest = (client.innerApiCalls.getCase as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.GetCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.GetCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCase(request), expectedError); + }); + }); + + describe('createCase', () => { + it('invokes createCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.createCase = stubSimpleCall(expectedResponse); + const [response] = await client.createCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.createCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCase(request), expectedError); + }); + }); + + describe('updateCase', () => { + it('invokes updateCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.UpdateCaseRequest', + ['case', 'name'] + ); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.updateCase = stubSimpleCall(expectedResponse); + const [response] = await client.updateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.UpdateCaseRequest', + ['case', 'name'] + ); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.updateCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.UpdateCaseRequest', + ['case', 'name'] + ); + request.case.name = defaultValue1; + const expectedHeaderRequestParams = `case.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.UpdateCaseRequest() + ); + request.case ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.UpdateCaseRequest', + ['case', 'name'] + ); + request.case.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCase(request), expectedError); + }); + }); + + describe('escalateCase', () => { + it('invokes escalateCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.EscalateCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.escalateCase = stubSimpleCall(expectedResponse); + const [response] = await client.escalateCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.EscalateCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.escalateCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.escalateCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.EscalateCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.escalateCase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.escalateCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.escalateCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes escalateCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.EscalateCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.EscalateCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.escalateCase(request), expectedError); + }); + }); + + describe('closeCase', () => { + it('invokes closeCase without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CloseCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.closeCase = stubSimpleCall(expectedResponse); + const [response] = await client.closeCase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CloseCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Case() + ); + client.innerApiCalls.closeCase = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.closeCase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CloseCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.closeCase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.closeCase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.closeCase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes closeCase with closed client', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CloseCaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CloseCaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.closeCase(request), expectedError); + }); + }); + + describe('listCases', () => { + it('invokes listCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.listCases = stubSimpleCall(expectedResponse); + const [response] = await client.listCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.listCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCasesStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.listCases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + 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.listCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCases, request) + ); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCasesStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCases, request) + ); + assert( + (client.descriptors.page.listCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.listCases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICase[] = []; + const iterable = client.listCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCases.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCases.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCases', () => { + it('invokes searchCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.searchCases = stubSimpleCall(expectedResponse); + const [response] = await client.searchCases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.innerApiCalls.searchCases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICase[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchCases = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchCases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchCases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchCasesStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.searchCases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + 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.searchCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchCases, request) + ); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchCasesStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchCasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Case[] = []; + stream.on('data', (response: protos.google.cloud.support.v2.Case) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchCases, request) + ); + assert( + (client.descriptors.page.searchCases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + generateSampleMessage(new protos.google.cloud.support.v2.Case()), + ]; + client.descriptors.page.searchCases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICase[] = []; + const iterable = client.searchCasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchCases with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.SearchCasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchCases.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchCasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchCases.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.searchCases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchCaseClassifications', () => { + it('invokes searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + ]; + client.innerApiCalls.searchCaseClassifications = + stubSimpleCall(expectedResponse); + const [response] = await client.searchCaseClassifications(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications without error using callback', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + ]; + client.innerApiCalls.searchCaseClassifications = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchCaseClassifications( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.ICaseClassification[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchCaseClassifications = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.searchCaseClassifications(request), + expectedError + ); + }); + + it('invokes searchCaseClassificationsStream without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + ]; + client.descriptors.page.searchCaseClassifications.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.CaseClassification[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.CaseClassification) => { + 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.searchCaseClassifications + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.searchCaseClassifications, request) + ); + }); + + it('invokes searchCaseClassificationsStream with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchCaseClassificationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.CaseClassification[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.CaseClassification) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.searchCaseClassifications + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.searchCaseClassifications, request) + ); + }); + + it('uses async iteration with searchCaseClassifications without error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + generateSampleMessage( + new protos.google.cloud.support.v2.CaseClassification() + ), + ]; + client.descriptors.page.searchCaseClassifications.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.ICaseClassification[] = + []; + const iterable = client.searchCaseClassificationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchCaseClassifications + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with searchCaseClassifications with error', async () => { + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.SearchCaseClassificationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchCaseClassifications.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchCaseClassificationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.ICaseClassification[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchCaseClassifications + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCase', () => { + const fakePath = '/rendered/path/organizationCase'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath( + 'organizationValue', + 'caseValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCasePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = + client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseAttachmentId', () => { + const fakePath = '/rendered/path/organizationCaseAttachmentId'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath( + 'organizationValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchOrganizationFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseComment', () => { + const fakePath = '/rendered/path/organizationCaseComment'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath( + 'organizationValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = + client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = + client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = + client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCase', () => { + const fakePath = '/rendered/path/projectCase'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath('projectValue', 'caseValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseAttachmentId', () => { + const fakePath = '/rendered/path/projectCaseAttachmentId'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath( + 'projectValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = + client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = + client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseComment', () => { + const fakePath = '/rendered/path/projectCaseComment'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = new caseserviceModule.v2.CaseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath( + 'projectValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-support/test/gapic_comment_service_v2.ts b/packages/google-cloud-support/test/gapic_comment_service_v2.ts new file mode 100644 index 000000000000..3120b593fbcd --- /dev/null +++ b/packages/google-cloud-support/test/gapic_comment_service_v2.ts @@ -0,0 +1,1084 @@ +// 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 commentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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('v2.CommentServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + commentserviceModule.v2.CommentServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + commentserviceModule.v2.CommentServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = commentserviceModule.v2.CommentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new commentserviceModule.v2.CommentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + await client.initialize(); + assert(client.commentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.commentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.commentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new commentserviceModule.v2.CommentServiceClient({ + 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 commentserviceModule.v2.CommentServiceClient({ + 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('createComment', () => { + it('invokes createComment without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCommentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Comment() + ); + client.innerApiCalls.createComment = stubSimpleCall(expectedResponse); + const [response] = await client.createComment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment without error using callback', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCommentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.support.v2.Comment() + ); + client.innerApiCalls.createComment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createComment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.IComment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCommentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createComment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createComment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createComment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createComment with closed client', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.CreateCommentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.CreateCommentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createComment(request), expectedError); + }); + }); + + describe('listComments', () => { + it('invokes listComments without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.innerApiCalls.listComments = stubSimpleCall(expectedResponse); + const [response] = await client.listComments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments without error using callback', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.innerApiCalls.listComments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listComments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.support.v2.IComment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listComments with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listComments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listComments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listComments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCommentsStream without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.descriptors.page.listComments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Comment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.Comment) => { + 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.listComments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listComments, request) + ); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCommentsStream with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCommentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.support.v2.Comment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.support.v2.Comment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listComments, request) + ); + assert( + (client.descriptors.page.listComments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments without error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + generateSampleMessage(new protos.google.cloud.support.v2.Comment()), + ]; + client.descriptors.page.listComments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.support.v2.IComment[] = []; + const iterable = client.listCommentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listComments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listComments with error', async () => { + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.support.v2.ListCommentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.support.v2.ListCommentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listComments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCommentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.support.v2.IComment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listComments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listComments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('organizationCase', () => { + const fakePath = '/rendered/path/organizationCase'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCasePath', () => { + const result = client.organizationCasePath( + 'organizationValue', + 'caseValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCasePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseName', () => { + const result = + client.matchOrganizationFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseName', () => { + const result = client.matchCaseFromOrganizationCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.organizationCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseAttachmentId', () => { + const fakePath = '/rendered/path/organizationCaseAttachmentId'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationCaseAttachmentIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationCaseAttachmentIdPath', () => { + const result = client.organizationCaseAttachmentIdPath( + 'organizationValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchOrganizationFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchCaseFromOrganizationCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromOrganizationCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromOrganizationCaseAttachmentIdName( + fakePath + ); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.organizationCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationCaseComment', () => { + const fakePath = '/rendered/path/organizationCaseComment'; + const expectedParameters = { + organization: 'organizationValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCaseCommentPath', () => { + const result = client.organizationCaseCommentPath( + 'organizationValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationCaseCommentName', () => { + const result = + client.matchOrganizationFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromOrganizationCaseCommentName', () => { + const result = + client.matchCaseFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromOrganizationCaseCommentName', () => { + const result = + client.matchCommentFromOrganizationCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.organizationCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCase', () => { + const fakePath = '/rendered/path/projectCase'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCasePath', () => { + const result = client.projectCasePath('projectValue', 'caseValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseName', () => { + const result = client.matchProjectFromProjectCaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseName', () => { + const result = client.matchCaseFromProjectCaseName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + (client.pathTemplates.projectCasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseAttachmentId', () => { + const fakePath = '/rendered/path/projectCaseAttachmentId'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + attachment_id: 'attachmentIdValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseAttachmentIdPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseAttachmentIdPath', () => { + const result = client.projectCaseAttachmentIdPath( + 'projectValue', + 'caseValue', + 'attachmentIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseAttachmentIdName', () => { + const result = + client.matchProjectFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseAttachmentIdName', () => { + const result = + client.matchCaseFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttachmentIdFromProjectCaseAttachmentIdName', () => { + const result = + client.matchAttachmentIdFromProjectCaseAttachmentIdName(fakePath); + assert.strictEqual(result, 'attachmentIdValue'); + assert( + ( + client.pathTemplates.projectCaseAttachmentIdPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCaseComment', () => { + const fakePath = '/rendered/path/projectCaseComment'; + const expectedParameters = { + project: 'projectValue', + case: 'caseValue', + comment: 'commentValue', + }; + const client = new commentserviceModule.v2.CommentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCaseCommentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCaseCommentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCaseCommentPath', () => { + const result = client.projectCaseCommentPath( + 'projectValue', + 'caseValue', + 'commentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCaseCommentName', () => { + const result = client.matchProjectFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCaseFromProjectCaseCommentName', () => { + const result = client.matchCaseFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'caseValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCommentFromProjectCaseCommentName', () => { + const result = client.matchCommentFromProjectCaseCommentName(fakePath); + assert.strictEqual(result, 'commentValue'); + assert( + ( + client.pathTemplates.projectCaseCommentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-support/tsconfig.json b/packages/google-cloud-support/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-support/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-support/webpack.config.js b/packages/google-cloud-support/webpack.config.js new file mode 100644 index 000000000000..28dbc58bf39d --- /dev/null +++ b/packages/google-cloud-support/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: 'CaseAttachmentService', + filename: './case-attachment-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 191027ffae44..7a4bd793f1d7 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -140,6 +140,7 @@ "packages/google-cloud-confidentialcomputing": {}, "packages/google-ai-generativelanguage": {}, "packages/google-cloud-storageinsights": {}, + "packages/google-cloud-support": {}, "packages/google-maps-places": {} }, "plugins": [ From 2688cf85670f5cdeea88b5d266145626a6cea0ae Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 10:43:29 -0700 Subject: [PATCH 02/46] chore: release main (#4292) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release main * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .release-please-manifest.json | 3 ++- changelog.json | 19 ++++++++++++++++++- packages/google-cloud-support/CHANGELOG.md | 8 ++++++++ packages/google-cloud-support/package.json | 2 +- ...ppet_metadata.google.cloud.support.v2.json | 2 +- .../google-cloud-support/samples/package.json | 2 +- 6 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-support/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dc95355b6e12..645184a11a75 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -139,5 +139,6 @@ "packages/google-cloud-confidentialcomputing": "0.1.0", "packages/google-ai-generativelanguage": "0.2.0", "packages/google-cloud-storageinsights": "0.1.1", - "packages/google-maps-places": "0.1.0" + "packages/google-maps-places": "0.1.0", + "packages/google-cloud-support": "0.1.0" } diff --git a/changelog.json b/changelog.json index 7c903088b772..0ddd8c4e0422 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,23 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "84fb1febb2e50ba9aa1c7d863eb31ab0aab52e25", + "message": "Add initial files for google.cloud.support.v2", + "issues": [ + "4288" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/support", + "id": "4cc13bbb-f300-4a0f-8c9d-93caec5d50d4", + "createTime": "2023-05-22T17:28:11.924Z" + }, { "changes": [ { @@ -9685,5 +9702,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2023-05-20T02:26:24.513Z" + "updateTime": "2023-05-22T17:28:11.924Z" } \ No newline at end of file diff --git a/packages/google-cloud-support/CHANGELOG.md b/packages/google-cloud-support/CHANGELOG.md new file mode 100644 index 000000000000..4fb62f6170b4 --- /dev/null +++ b/packages/google-cloud-support/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-05-22) + + +### Features + +* Add initial files for google.cloud.support.v2 ([#4288](https://github.com/googleapis/google-cloud-node/issues/4288)) ([84fb1fe](https://github.com/googleapis/google-cloud-node/commit/84fb1febb2e50ba9aa1c7d863eb31ab0aab52e25)) diff --git a/packages/google-cloud-support/package.json b/packages/google-cloud-support/package.json index 60afa8610950..d0ce95363664 100644 --- a/packages/google-cloud-support/package.json +++ b/packages/google-cloud-support/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/support", - "version": "0.0.0", + "version": "0.1.0", "description": "Google Cloud Support API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json b/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json index 68ccc9d78e62..3e8caee92e83 100644 --- a/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json +++ b/packages/google-cloud-support/samples/generated/v2/snippet_metadata.google.cloud.support.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-support", - "version": "0.0.0", + "version": "0.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-support/samples/package.json b/packages/google-cloud-support/samples/package.json index e6a80e42d8c9..da1691066958 100644 --- a/packages/google-cloud-support/samples/package.json +++ b/packages/google-cloud-support/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/support": "0.0.0" + "@google-cloud/support": "^0.1.0" }, "devDependencies": { "c8": "^7.1.0", From 24eee28460784c703de89f135b86056608365f38 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Mon, 22 May 2023 13:42:14 -0700 Subject: [PATCH 03/46] build: fix publishing script (#4293) * build: fix publishing script --- .kokoro/common.cfg | 4 ++-- .kokoro/release/publish.cfg | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index b14ecedd6303..57aa751f5d00 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -16,9 +16,9 @@ build_file: "google-cloud-node/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/google-cloud-node/.kokoro/test.sh" -} \ No newline at end of file +} diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg index e5f79848e711..106adbfba29c 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -18,7 +18,7 @@ build_file: "google-cloud-node/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { @@ -36,4 +36,4 @@ action { regex: "github/google-cloud-node/**/package-lock.json" strip_prefix: "github/google-cloud-node" } -} \ No newline at end of file +} From 0a9ded22b9c536eb402101ddf09d97379f49cc52 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 23 May 2023 06:47:11 -0700 Subject: [PATCH 04/46] docs: update the list of available APIs (#4294) --- README.md | 2 ++ libraries.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/README.md b/README.md index e8d98d13b6a4..bd3ed9694eb2 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,11 @@ applications that interact with individual Google Cloud services: | [Life Sciences](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lifesciences) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/life-sciences)](https://npm.im/@google-cloud/life-sciences) | | [Network Security API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networksecurity) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/network-security)](https://npm.im/@google-cloud/network-security) | | [Phishing Protection](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-phishingprotection) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/phishing-protection)](https://npm.im/@google-cloud/phishing-protection) | +| [Places API (New)](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/places)](https://npm.im/@googlemaps/places) | | [Private Catalog](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privatecatalog) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/private-catalog)](https://npm.im/@google-cloud/private-catalog) | | [Public Certificate Authority](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-security-publicca) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/publicca)](https://npm.im/@google-cloud/publicca) | | [Storage Insights API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-storageinsights) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storageinsights)](https://npm.im/@google-cloud/storageinsights) | +| [Support API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/support)](https://npm.im/@google-cloud/support) | | [Trace](https://github.com/googleapis/cloud-trace-nodejs) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/trace-agent)](https://npm.im/@google-cloud/trace-agent) | | [Workstations API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workstations) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/workstations)](https://npm.im/@google-cloud/workstations) | diff --git a/libraries.json b/libraries.json index 5e18d7b29d3f..1eac6f7a8100 100644 --- a/libraries.json +++ b/libraries.json @@ -2738,6 +2738,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-phishingprotection", "support_documentation": "https://cloud.google.com/phishing-protection/docs/getting-support" }, + { + "name": "places", + "name_pretty": "Places API (New)", + "product_documentation": "https://developers.google.com/maps/documentation/places/web-service/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/places/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@googlemaps/places", + "api_id": "places.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "places", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places", + "support_documentation": "https://developers.google.com/maps/documentation/places/web-service/docs/getting-support" + }, { "name": "cloudprivatecatalog", "name_pretty": "Private Catalog", @@ -2792,6 +2810,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-storageinsights", "support_documentation": "https://cloud.google.com/storage/docs/getting-support" }, + { + "name": "cloudsupport", + "name_pretty": "Support API", + "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudsupport/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/support", + "api_id": "cloudsupport.googleapis.com", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudsupport", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support", + "support_documentation": "https://cloud.google.com/support/docs/getting-support" + }, { "name": "trace", "name_pretty": "Trace", From e39f9b0cb286dbf034353e266e438be10dabac6e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 May 2023 21:26:12 +0200 Subject: [PATCH 05/46] fix(deps): update dependency @octokit/rest to v19.0.8 (#4278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@octokit/rest](https://togithub.com/octokit/rest.js) | [`19.0.0` -> `19.0.8`](https://renovatebot.com/diffs/npm/@octokit%2frest/19.0.0/19.0.8) | [![age](https://badges.renovateapi.com/packages/npm/@octokit%2frest/19.0.8/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@octokit%2frest/19.0.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@octokit%2frest/19.0.8/compatibility-slim/19.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@octokit%2frest/19.0.8/confidence-slim/19.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
octokit/rest.js ### [`v19.0.8`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.8) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.7...v19.0.8) ##### Bug Fixes - **deps:** bump plugin versions ([#​292](https://togithub.com/octokit/rest.js/issues/292)) ([9b047a0](https://togithub.com/octokit/rest.js/commit/9b047a0fdf9a4e8e26401e1dbe08f5376acf4f83)), closes [#​290](https://togithub.com/octokit/rest.js/issues/290) ### [`v19.0.7`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.7) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.6...v19.0.7) ##### Bug Fixes - **deps:** update dependency [@​octokit/plugin-rest-endpoint-methods](https://togithub.com/octokit/plugin-rest-endpoint-methods) to v7 ([#​258](https://togithub.com/octokit/rest.js/issues/258)) ([22bf083](https://togithub.com/octokit/rest.js/commit/22bf083978834ad3e8cb592a9b4dcc822fe08460)) ### [`v19.0.6`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.6) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.5...v19.0.6) ##### Bug Fixes - **deps:** update dependency [@​octokit/plugin-paginate-rest](https://togithub.com/octokit/plugin-paginate-rest) to v6 ([#​257](https://togithub.com/octokit/rest.js/issues/257)) ([322d82b](https://togithub.com/octokit/rest.js/commit/322d82b92dcf59819abc4bf0673a005f80c9e42e)) ### [`v19.0.5`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.5) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.4...v19.0.5) ##### Bug Fixes - **deps:** update `@octokit/plugin-paginate-rest` to v5 ([#​220](https://togithub.com/octokit/rest.js/issues/220)) ([9debac2](https://togithub.com/octokit/rest.js/commit/9debac2265791e52198cb5b1634c888c5b897f9e)) ### [`v19.0.4`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.4) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.3...v19.0.4) ##### Bug Fixes - **deps:** update dependency [@​octokit/plugin-paginate-rest](https://togithub.com/octokit/plugin-paginate-rest) to v4 ([#​187](https://togithub.com/octokit/rest.js/issues/187)) ([4e18c8d](https://togithub.com/octokit/rest.js/commit/4e18c8d80a95ec21b56637beb195cc8296293551)) ### [`v19.0.3`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.3) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.2...v19.0.3) ##### Bug Fixes - **deps:** update dependency [@​octokit/plugin-paginate-rest](https://togithub.com/octokit/plugin-paginate-rest) to v3 ([#​161](https://togithub.com/octokit/rest.js/issues/161)) ([670f477](https://togithub.com/octokit/rest.js/commit/670f477941a7b4a2653e57e7965da3dd0b862034)) ### [`v19.0.2`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.2) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.1...v19.0.2) ##### Bug Fixes - **deps:** update dependency [@​octokit/plugin-rest-endpoint-methods](https://togithub.com/octokit/plugin-rest-endpoint-methods) to v6 ([#​162](https://togithub.com/octokit/rest.js/issues/162)) ([310c738](https://togithub.com/octokit/rest.js/commit/310c738d2924bd5ee83b164c32c48d0add418839)) ### [`v19.0.1`](https://togithub.com/octokit/rest.js/releases/tag/v19.0.1) [Compare Source](https://togithub.com/octokit/rest.js/compare/v19.0.0...v19.0.1) ##### Bug Fixes - **deps:** update dependency [@​octokit/core](https://togithub.com/octokit/core) to v4 ([#​160](https://togithub.com/octokit/rest.js/issues/160)) ([0b8f202](https://togithub.com/octokit/rest.js/commit/0b8f202044473887d8f0128a5e5e38878a641536))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-cloud-node). --- containers/node-bootstrap-container/package.json | 2 +- packages/gapic-node-templating/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/node-bootstrap-container/package.json b/containers/node-bootstrap-container/package.json index 6f38db418071..ab0bea604e6e 100644 --- a/containers/node-bootstrap-container/package.json +++ b/containers/node-bootstrap-container/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/googleapis/google-cloud-node#readme", "dependencies": { - "@octokit/rest": "19.0.0" + "@octokit/rest": "19.0.8" }, "devDependencies": { "mocha": "^9.0.0", diff --git a/packages/gapic-node-templating/package.json b/packages/gapic-node-templating/package.json index c53e4c260944..70f59d74b700 100644 --- a/packages/gapic-node-templating/package.json +++ b/packages/gapic-node-templating/package.json @@ -39,7 +39,7 @@ }, "dependencies": { "@google-cloud/storage": "^6.1.0", - "@octokit/rest": "19.0.0", + "@octokit/rest": "19.0.8", "js-yaml": "^4.1.0", "nunjucks": "^3.2.3", "yargs": "^17.5.1" From e4680bce73dee7bc2097f94bb372fe30384a1fde Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 23 May 2023 12:53:10 -0700 Subject: [PATCH 06/46] Update CODEOWNERS (#4295) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 58aa717d3979..dd0c889a1a9f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,4 +6,4 @@ # The yoshi-nodejs team is the default owner for nodejs repositories. -* @googleapis/jsteam +* @googleapis/jsteam @yoshi-approver From b6ae70ddcc50fc3bfd1abbb347b25e0bfcafccf0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 May 2023 22:04:33 +0200 Subject: [PATCH 07/46] fix(deps): update dependency recast to ^0.23.0 (#4277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [recast](https://togithub.com/benjamn/recast) | [`^0.22.0` -> `^0.23.0`](https://renovatebot.com/diffs/npm/recast/0.22.0/0.23.2) | [![age](https://badges.renovateapi.com/packages/npm/recast/0.23.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/recast/0.23.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/recast/0.23.2/compatibility-slim/0.22.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/recast/0.23.2/confidence-slim/0.22.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
benjamn/recast ### [`v0.23.2`](https://togithub.com/benjamn/recast/compare/v0.23.1...v0.23.2) [Compare Source](https://togithub.com/benjamn/recast/compare/v0.23.1...v0.23.2) ### [`v0.23.1`](https://togithub.com/benjamn/recast/compare/v0.23.0...v0.23.1) [Compare Source](https://togithub.com/benjamn/recast/compare/v0.23.0...v0.23.1) ### [`v0.23.0`](https://togithub.com/benjamn/recast/compare/v0.22.0...v0.23.0) [Compare Source](https://togithub.com/benjamn/recast/compare/v0.22.0...v0.23.0)
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-cloud-node). --- packages/typeless-sample-bot/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typeless-sample-bot/package.json b/packages/typeless-sample-bot/package.json index 1016b7f3bef3..64d9442dc0e7 100644 --- a/packages/typeless-sample-bot/package.json +++ b/packages/typeless-sample-bot/package.json @@ -33,7 +33,7 @@ "@babel/traverse": "^7.18.10", "chalk": "^5.0.1", "debug": "^4.3.4", - "recast": "^0.22.0", + "recast": "^0.23.0", "yargs": "^17.4.1" }, "devDependencies": { From afe224112bed2a049662e3b999be891bd0fdf76b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 May 2023 16:02:25 +0200 Subject: [PATCH 08/46] fix(deps): update dependency @octokit/rest to v19.0.11 (#4297) --- containers/node-bootstrap-container/package.json | 2 +- packages/gapic-node-templating/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/node-bootstrap-container/package.json b/containers/node-bootstrap-container/package.json index ab0bea604e6e..eb922669a356 100644 --- a/containers/node-bootstrap-container/package.json +++ b/containers/node-bootstrap-container/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/googleapis/google-cloud-node#readme", "dependencies": { - "@octokit/rest": "19.0.8" + "@octokit/rest": "19.0.11" }, "devDependencies": { "mocha": "^9.0.0", diff --git a/packages/gapic-node-templating/package.json b/packages/gapic-node-templating/package.json index 70f59d74b700..65ccb439e85e 100644 --- a/packages/gapic-node-templating/package.json +++ b/packages/gapic-node-templating/package.json @@ -39,7 +39,7 @@ }, "dependencies": { "@google-cloud/storage": "^6.1.0", - "@octokit/rest": "19.0.8", + "@octokit/rest": "19.0.11", "js-yaml": "^4.1.0", "nunjucks": "^3.2.3", "yargs": "^17.5.1" From 2c5e862c151f5e0294b3933808388a5f7e83cf62 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 09:36:15 -0400 Subject: [PATCH 09/46] feat: [language] Added client library support for ModerateText in the Natural Language API (V1) (#4298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added client library support for ModerateText in the Natural Language API (V1Beta2) PiperOrigin-RevId: 534975458 Source-Link: https://github.com/googleapis/googleapis/commit/392db1d5b03abe71647a69b28ea84b212a9978a9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/df98b94b1218af16109fe3e1aef329732779c0a9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxhbmd1YWdlLy5Pd2xCb3QueWFtbCIsImgiOiJkZjk4Yjk0YjEyMThhZjE2MTA5ZmUzZTFhZWYzMjk3MzI3NzljMGE5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Added client library support for ModerateText in the Natural Language API (V1) PiperOrigin-RevId: 534992604 Source-Link: https://github.com/googleapis/googleapis/commit/2400facb5e4d93de884e58d38656b707df43fffa Source-Link: https://github.com/googleapis/googleapis-gen/commit/32caa580131b05b880fa3b802ca0c21179881733 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxhbmd1YWdlLy5Pd2xCb3QueWFtbCIsImgiOiIzMmNhYTU4MDEzMWIwNWI4ODBmYTNiODAyY2EwYzIxMTc5ODgxNzMzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- packages/google-cloud-language/README.md | 33 +- .../cloud/language/v1/language_service.proto | 30 +- .../language/v1beta2/language_service.proto | 88 +- .../google-cloud-language/protos/protos.d.ts | 454 + .../google-cloud-language/protos/protos.js | 11900 +++++++++------- .../google-cloud-language/protos/protos.json | 98 + .../google-cloud-language/samples/README.md | 36 +- .../v1/language_service.moderate_text.js | 61 + ...pet_metadata.google.cloud.language.v1.json | 40 + .../v1beta2/language_service.moderate_text.js | 61 + ...etadata.google.cloud.language.v1beta2.json | 40 + .../src/v1/gapic_metadata.json | 10 + .../src/v1/language_service_client.ts | 82 + .../v1/language_service_client_config.json | 4 + .../src/v1beta2/gapic_metadata.json | 10 + .../src/v1beta2/language_service_client.ts | 94 +- .../language_service_client_config.json | 4 + .../test/gapic_language_service_v1.ts | 83 + .../test/gapic_language_service_v1beta2.ts | 83 + 19 files changed, 7738 insertions(+), 5473 deletions(-) create mode 100644 packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js create mode 100644 packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js diff --git a/packages/google-cloud-language/README.md b/packages/google-cloud-language/README.md index 258d5fa3629f..51db1306bcc1 100644 --- a/packages/google-cloud-language/README.md +++ b/packages/google-cloud-language/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Natural Language: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Natural Language: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-language) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/language.svg)](https://www.npmjs.org/package/@google-cloud/language) @@ -87,24 +87,25 @@ async function quickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-language/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_entities.js,samples/README.md) | -| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_entity_sentiment.js,samples/README.md) | -| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_sentiment.js,samples/README.md) | -| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_syntax.js,samples/README.md) | -| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.annotate_text.js,samples/README.md) | -| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.classify_text.js,samples/README.md) | -| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_entities.js,samples/README.md) | -| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js,samples/README.md) | -| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_sentiment.js,samples/README.md) | -| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_syntax.js,samples/README.md) | -| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.annotate_text.js,samples/README.md) | -| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.classify_text.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/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-language/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/test/quickstart.test.js,samples/README.md) | +| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_entities.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_entity_sentiment.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_sentiment.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.analyze_syntax.js,packages/google-cloud-language/samples/README.md) | +| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.annotate_text.js,packages/google-cloud-language/samples/README.md) | +| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.classify_text.js,packages/google-cloud-language/samples/README.md) | +| Language_service.moderate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js) | [![Open in Cloud 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-language/samples/generated/v1/language_service.moderate_text.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_entities.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_sentiment.js,packages/google-cloud-language/samples/README.md) | +| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.analyze_syntax.js,packages/google-cloud-language/samples/README.md) | +| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.annotate_text.js,packages/google-cloud-language/samples/README.md) | +| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.classify_text.js,packages/google-cloud-language/samples/README.md) | +| Language_service.moderate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js) | [![Open in Cloud 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-language/samples/generated/v1beta2/language_service.moderate_text.js,packages/google-cloud-language/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/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-language/samples/quickstart.js,packages/google-cloud-language/samples/README.md) | diff --git a/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto b/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto index 361a024ca07c..d34240827c37 100644 --- a/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto +++ b/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto @@ -92,6 +92,15 @@ service LanguageService { option (google.api.method_signature) = "document"; } + // Moderates a document for harmful and sensitive categories. + rpc ModerateText(ModerateTextRequest) returns (ModerateTextResponse) { + option (google.api.http) = { + post: "/v1/documents:moderateText" + body: "*" + }; + option (google.api.method_signature) = "document"; + } + // A convenience method that provides all the features that analyzeSentiment, // analyzeEntities, and analyzeSyntax provide in one call. rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) { @@ -966,8 +975,7 @@ message TextSpan { // Represents a category returned from the text classifier. message ClassificationCategory { - // The name of the category representing the document, from the [predefined - // taxonomy](https://cloud.google.com/natural-language/docs/categories). + // The name of the category representing the document. string name = 1; // The classifier's confidence of the category. Number represents how certain @@ -1118,6 +1126,18 @@ message ClassifyTextResponse { repeated ClassificationCategory categories = 1; } +// The document moderation request message. +message ModerateTextRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The document moderation response message. +message ModerateTextResponse { + // Harmful and sensitive categories representing the input document. + repeated ClassificationCategory moderation_categories = 1; +} + // The request message for the text annotation API, which can perform multiple // analysis types (sentiment, entities, and syntax) in one call. message AnnotateTextRequest { @@ -1139,6 +1159,9 @@ message AnnotateTextRequest { // Classify the full document into categories. bool classify_text = 6; + // Moderate the document for harmful and sensitive categories. + bool moderate_text = 11; + // The model options to use for classification. Defaults to v1 options // if not specified. Only used if `classify_text` is set to true. ClassificationModelOptions classification_model_options = 10; @@ -1182,4 +1205,7 @@ message AnnotateTextResponse { // Categories identified in the input document. repeated ClassificationCategory categories = 6; + + // Harmful and sensitive categories identified in the input document. + repeated ClassificationCategory moderation_categories = 7; } diff --git a/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto b/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto index 49c6c0dd1e20..95c169be0805 100644 --- a/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto +++ b/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -34,7 +34,8 @@ service LanguageService { "https://www.googleapis.com/auth/cloud-platform"; // Analyzes the sentiment of the provided text. - rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { + rpc AnalyzeSentiment(AnalyzeSentimentRequest) + returns (AnalyzeSentimentResponse) { option (google.api.http) = { post: "/v1beta2/documents:analyzeSentiment" body: "*" @@ -46,7 +47,8 @@ service LanguageService { // Finds named entities (currently proper names and common nouns) in the text // along with entity types, salience, mentions for each entity, and // other properties. - rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { + rpc AnalyzeEntities(AnalyzeEntitiesRequest) + returns (AnalyzeEntitiesResponse) { option (google.api.http) = { post: "/v1beta2/documents:analyzeEntities" body: "*" @@ -55,9 +57,12 @@ service LanguageService { option (google.api.method_signature) = "document"; } - // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes - // sentiment associated with each entity and its mentions. - rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { + // Finds entities, similar to + // [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] + // in the text and analyzes sentiment associated with each entity and its + // mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) + returns (AnalyzeEntitySentimentResponse) { option (google.api.http) = { post: "/v1beta2/documents:analyzeEntitySentiment" body: "*" @@ -87,6 +92,15 @@ service LanguageService { option (google.api.method_signature) = "document"; } + // Moderates a document for harmful and sensitive categories. + rpc ModerateText(ModerateTextRequest) returns (ModerateTextResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:moderateText" + body: "*" + }; + option (google.api.method_signature) = "document"; + } + // A convenience method that provides all syntax, sentiment, entity, and // classification features in one call. rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) { @@ -170,8 +184,8 @@ message Sentence { TextSpan text = 1; // For calls to [AnalyzeSentiment][] or if - // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to - // true, this field will contain the sentiment for the sentence. + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] + // is set to true, this field will contain the sentiment for the sentence. Sentiment sentiment = 2; } @@ -310,9 +324,9 @@ message Entity { repeated EntityMention mentions = 5; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the aggregate sentiment expressed for this - // entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the aggregate sentiment expressed + // for this entity in the provided document. Sentiment sentiment = 6; } @@ -960,9 +974,9 @@ message EntityMention { Type type = 2; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the sentiment expressed for this mention of - // the entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the sentiment expressed for this + // mention of the entity in the provided document. Sentiment sentiment = 3; } @@ -972,14 +986,15 @@ message TextSpan { string content = 1; // The API calculates the beginning offset of the content in the original - // document according to the [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the API request. + // document according to the + // [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the + // API request. int32 begin_offset = 2; } // Represents a category returned from the text classifier. message ClassificationCategory { - // The name of the category representing the document, from the [predefined - // taxonomy](https://cloud.google.com/natural-language/docs/categories). + // The name of the category representing the document. string name = 1; // The classifier's confidence of the category. Number represents how certain @@ -990,9 +1005,7 @@ message ClassificationCategory { // Model options available for classification requests. message ClassificationModelOptions { // Options for the V1 model. - message V1Model { - - } + message V1Model {} // Options for the V2 model. message V2Model { @@ -1043,7 +1056,8 @@ message AnalyzeSentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1beta2.Document.language] + // field for more details. string language = 2; // The sentiment for all the sentences in the document. @@ -1066,7 +1080,8 @@ message AnalyzeEntitySentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1beta2.Document.language] + // field for more details. string language = 2; } @@ -1086,7 +1101,8 @@ message AnalyzeEntitiesResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1beta2.Document.language] + // field for more details. string language = 2; } @@ -1109,7 +1125,8 @@ message AnalyzeSyntaxResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1beta2.Document.language] + // field for more details. string language = 3; } @@ -1129,12 +1146,24 @@ message ClassifyTextResponse { repeated ClassificationCategory categories = 1; } +// The document moderation request message. +message ModerateTextRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The document moderation response message. +message ModerateTextResponse { + // Harmful and sensitive categories representing the input document. + repeated ClassificationCategory moderation_categories = 1; +} + // The request message for the text annotation API, which can perform multiple // analysis types (sentiment, entities, and syntax) in one call. message AnnotateTextRequest { // All available features for sentiment, syntax, and semantic analysis. // Setting each one to true will enable that specific analysis for the input. - // Next ID: 11 + // Next ID: 12 message Features { // Extract syntax information. bool extract_syntax = 1; @@ -1154,6 +1183,9 @@ message AnnotateTextRequest { // taxonomy](https://cloud.google.com/natural-language/docs/categories). bool classify_text = 6; + // Moderate the document for harmful and sensitive categories. + bool moderate_text = 11; + // The model options to use for classification. Defaults to v1 options // if not specified. Only used if `classify_text` is set to true. ClassificationModelOptions classification_model_options = 10; @@ -1191,9 +1223,13 @@ message AnnotateTextResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1beta2.Document.language] + // field for more details. string language = 5; // Categories identified in the input document. repeated ClassificationCategory categories = 6; + + // Harmful and sensitive categories identified in the input document. + repeated ClassificationCategory moderation_categories = 8; } diff --git a/packages/google-cloud-language/protos/protos.d.ts b/packages/google-cloud-language/protos/protos.d.ts index b639cf2281a1..a98922018417 100644 --- a/packages/google-cloud-language/protos/protos.d.ts +++ b/packages/google-cloud-language/protos/protos.d.ts @@ -116,6 +116,20 @@ export namespace google { */ public classifyText(request: google.cloud.language.v1.IClassifyTextRequest): Promise; + /** + * Calls ModerateText. + * @param request ModerateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModerateTextResponse + */ + public moderateText(request: google.cloud.language.v1.IModerateTextRequest, callback: google.cloud.language.v1.LanguageService.ModerateTextCallback): void; + + /** + * Calls ModerateText. + * @param request ModerateTextRequest message or plain object + * @returns Promise + */ + public moderateText(request: google.cloud.language.v1.IModerateTextRequest): Promise; + /** * Calls AnnotateText. * @param request AnnotateTextRequest message or plain object @@ -168,6 +182,13 @@ export namespace google { */ type ClassifyTextCallback = (error: (Error|null), response?: google.cloud.language.v1.ClassifyTextResponse) => void; + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|moderateText}. + * @param error Error, if any + * @param [response] ModerateTextResponse + */ + type ModerateTextCallback = (error: (Error|null), response?: google.cloud.language.v1.ModerateTextResponse) => void; + /** * Callback as used by {@link google.cloud.language.v1.LanguageService|annotateText}. * @param error Error, if any @@ -2937,6 +2958,200 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModerateTextRequest. */ + interface IModerateTextRequest { + + /** ModerateTextRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + } + + /** Represents a ModerateTextRequest. */ + class ModerateTextRequest implements IModerateTextRequest { + + /** + * Constructs a new ModerateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IModerateTextRequest); + + /** ModerateTextRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** + * Creates a new ModerateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModerateTextRequest instance + */ + public static create(properties?: google.cloud.language.v1.IModerateTextRequest): google.cloud.language.v1.ModerateTextRequest; + + /** + * Encodes the specified ModerateTextRequest message. Does not implicitly {@link google.cloud.language.v1.ModerateTextRequest.verify|verify} messages. + * @param message ModerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IModerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModerateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.ModerateTextRequest.verify|verify} messages. + * @param message ModerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IModerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModerateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ModerateTextRequest; + + /** + * Decodes a ModerateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ModerateTextRequest; + + /** + * Verifies a ModerateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModerateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ModerateTextRequest; + + /** + * Creates a plain object from a ModerateTextRequest message. Also converts values to other types if specified. + * @param message ModerateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ModerateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModerateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModerateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModerateTextResponse. */ + interface IModerateTextResponse { + + /** ModerateTextResponse moderationCategories */ + moderationCategories?: (google.cloud.language.v1.IClassificationCategory[]|null); + } + + /** Represents a ModerateTextResponse. */ + class ModerateTextResponse implements IModerateTextResponse { + + /** + * Constructs a new ModerateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IModerateTextResponse); + + /** ModerateTextResponse moderationCategories. */ + public moderationCategories: google.cloud.language.v1.IClassificationCategory[]; + + /** + * Creates a new ModerateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ModerateTextResponse instance + */ + public static create(properties?: google.cloud.language.v1.IModerateTextResponse): google.cloud.language.v1.ModerateTextResponse; + + /** + * Encodes the specified ModerateTextResponse message. Does not implicitly {@link google.cloud.language.v1.ModerateTextResponse.verify|verify} messages. + * @param message ModerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IModerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModerateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.ModerateTextResponse.verify|verify} messages. + * @param message ModerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IModerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ModerateTextResponse; + + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ModerateTextResponse; + + /** + * Verifies a ModerateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModerateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ModerateTextResponse; + + /** + * Creates a plain object from a ModerateTextResponse message. Also converts values to other types if specified. + * @param message ModerateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ModerateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModerateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModerateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AnnotateTextRequest. */ interface IAnnotateTextRequest { @@ -3066,6 +3281,9 @@ export namespace google { /** Features classifyText */ classifyText?: (boolean|null); + /** Features moderateText */ + moderateText?: (boolean|null); + /** Features classificationModelOptions */ classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); } @@ -3094,6 +3312,9 @@ export namespace google { /** Features classifyText. */ public classifyText: boolean; + /** Features moderateText. */ + public moderateText: boolean; + /** Features classificationModelOptions. */ public classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); @@ -3196,6 +3417,9 @@ export namespace google { /** AnnotateTextResponse categories */ categories?: (google.cloud.language.v1.IClassificationCategory[]|null); + + /** AnnotateTextResponse moderationCategories */ + moderationCategories?: (google.cloud.language.v1.IClassificationCategory[]|null); } /** Represents an AnnotateTextResponse. */ @@ -3225,6 +3449,9 @@ export namespace google { /** AnnotateTextResponse categories. */ public categories: google.cloud.language.v1.IClassificationCategory[]; + /** AnnotateTextResponse moderationCategories. */ + public moderationCategories: google.cloud.language.v1.IClassificationCategory[]; + /** * Creates a new AnnotateTextResponse instance using the specified properties. * @param [properties] Properties to set @@ -3397,6 +3624,20 @@ export namespace google { */ public classifyText(request: google.cloud.language.v1beta2.IClassifyTextRequest): Promise; + /** + * Calls ModerateText. + * @param request ModerateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModerateTextResponse + */ + public moderateText(request: google.cloud.language.v1beta2.IModerateTextRequest, callback: google.cloud.language.v1beta2.LanguageService.ModerateTextCallback): void; + + /** + * Calls ModerateText. + * @param request ModerateTextRequest message or plain object + * @returns Promise + */ + public moderateText(request: google.cloud.language.v1beta2.IModerateTextRequest): Promise; + /** * Calls AnnotateText. * @param request AnnotateTextRequest message or plain object @@ -3449,6 +3690,13 @@ export namespace google { */ type ClassifyTextCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.ClassifyTextResponse) => void; + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|moderateText}. + * @param error Error, if any + * @param [response] ModerateTextResponse + */ + type ModerateTextCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.ModerateTextResponse) => void; + /** * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|annotateText}. * @param error Error, if any @@ -6237,6 +6485,200 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModerateTextRequest. */ + interface IModerateTextRequest { + + /** ModerateTextRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + } + + /** Represents a ModerateTextRequest. */ + class ModerateTextRequest implements IModerateTextRequest { + + /** + * Constructs a new ModerateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IModerateTextRequest); + + /** ModerateTextRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** + * Creates a new ModerateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModerateTextRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IModerateTextRequest): google.cloud.language.v1beta2.ModerateTextRequest; + + /** + * Encodes the specified ModerateTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextRequest.verify|verify} messages. + * @param message ModerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IModerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModerateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextRequest.verify|verify} messages. + * @param message ModerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IModerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModerateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ModerateTextRequest; + + /** + * Decodes a ModerateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ModerateTextRequest; + + /** + * Verifies a ModerateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModerateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ModerateTextRequest; + + /** + * Creates a plain object from a ModerateTextRequest message. Also converts values to other types if specified. + * @param message ModerateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ModerateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModerateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModerateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModerateTextResponse. */ + interface IModerateTextResponse { + + /** ModerateTextResponse moderationCategories */ + moderationCategories?: (google.cloud.language.v1beta2.IClassificationCategory[]|null); + } + + /** Represents a ModerateTextResponse. */ + class ModerateTextResponse implements IModerateTextResponse { + + /** + * Constructs a new ModerateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IModerateTextResponse); + + /** ModerateTextResponse moderationCategories. */ + public moderationCategories: google.cloud.language.v1beta2.IClassificationCategory[]; + + /** + * Creates a new ModerateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ModerateTextResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IModerateTextResponse): google.cloud.language.v1beta2.ModerateTextResponse; + + /** + * Encodes the specified ModerateTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextResponse.verify|verify} messages. + * @param message ModerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IModerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModerateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextResponse.verify|verify} messages. + * @param message ModerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IModerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ModerateTextResponse; + + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ModerateTextResponse; + + /** + * Verifies a ModerateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModerateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ModerateTextResponse; + + /** + * Creates a plain object from a ModerateTextResponse message. Also converts values to other types if specified. + * @param message ModerateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ModerateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModerateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModerateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AnnotateTextRequest. */ interface IAnnotateTextRequest { @@ -6366,6 +6808,9 @@ export namespace google { /** Features classifyText */ classifyText?: (boolean|null); + /** Features moderateText */ + moderateText?: (boolean|null); + /** Features classificationModelOptions */ classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); } @@ -6394,6 +6839,9 @@ export namespace google { /** Features classifyText. */ public classifyText: boolean; + /** Features moderateText. */ + public moderateText: boolean; + /** Features classificationModelOptions. */ public classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); @@ -6496,6 +6944,9 @@ export namespace google { /** AnnotateTextResponse categories */ categories?: (google.cloud.language.v1beta2.IClassificationCategory[]|null); + + /** AnnotateTextResponse moderationCategories */ + moderationCategories?: (google.cloud.language.v1beta2.IClassificationCategory[]|null); } /** Represents an AnnotateTextResponse. */ @@ -6525,6 +6976,9 @@ export namespace google { /** AnnotateTextResponse categories. */ public categories: google.cloud.language.v1beta2.IClassificationCategory[]; + /** AnnotateTextResponse moderationCategories. */ + public moderationCategories: google.cloud.language.v1beta2.IClassificationCategory[]; + /** * Creates a new AnnotateTextResponse instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-language/protos/protos.js b/packages/google-cloud-language/protos/protos.js index 0fe0a7fcf0ee..66058ecc5a77 100644 --- a/packages/google-cloud-language/protos/protos.js +++ b/packages/google-cloud-language/protos/protos.js @@ -263,6 +263,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|moderateText}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef ModerateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.ModerateTextResponse} [response] ModerateTextResponse + */ + + /** + * Calls ModerateText. + * @function moderateText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IModerateTextRequest} request ModerateTextRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.ModerateTextCallback} callback Node-style callback called with the error, if any, and ModerateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.moderateText = function moderateText(request, callback) { + return this.rpcCall(moderateText, $root.google.cloud.language.v1.ModerateTextRequest, $root.google.cloud.language.v1.ModerateTextResponse, request, callback); + }, "name", { value: "ModerateText" }); + + /** + * Calls ModerateText. + * @function moderateText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IModerateTextRequest} request ModerateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.language.v1.LanguageService|annotateText}. * @memberof google.cloud.language.v1.LanguageService @@ -7990,26 +8023,24 @@ return ClassifyTextResponse; })(); - v1.AnnotateTextRequest = (function() { + v1.ModerateTextRequest = (function() { /** - * Properties of an AnnotateTextRequest. + * Properties of a ModerateTextRequest. * @memberof google.cloud.language.v1 - * @interface IAnnotateTextRequest - * @property {google.cloud.language.v1.IDocument|null} [document] AnnotateTextRequest document - * @property {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null} [features] AnnotateTextRequest features - * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnnotateTextRequest encodingType + * @interface IModerateTextRequest + * @property {google.cloud.language.v1.IDocument|null} [document] ModerateTextRequest document */ /** - * Constructs a new AnnotateTextRequest. + * Constructs a new ModerateTextRequest. * @memberof google.cloud.language.v1 - * @classdesc Represents an AnnotateTextRequest. - * @implements IAnnotateTextRequest + * @classdesc Represents a ModerateTextRequest. + * @implements IModerateTextRequest * @constructor - * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set + * @param {google.cloud.language.v1.IModerateTextRequest=} [properties] Properties to set */ - function AnnotateTextRequest(properties) { + function ModerateTextRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8017,90 +8048,70 @@ } /** - * AnnotateTextRequest document. + * ModerateTextRequest document. * @member {google.cloud.language.v1.IDocument|null|undefined} document - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @instance */ - AnnotateTextRequest.prototype.document = null; - - /** - * AnnotateTextRequest features. - * @member {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null|undefined} features - * @memberof google.cloud.language.v1.AnnotateTextRequest - * @instance - */ - AnnotateTextRequest.prototype.features = null; - - /** - * AnnotateTextRequest encodingType. - * @member {google.cloud.language.v1.EncodingType} encodingType - * @memberof google.cloud.language.v1.AnnotateTextRequest - * @instance - */ - AnnotateTextRequest.prototype.encodingType = 0; + ModerateTextRequest.prototype.document = null; /** - * Creates a new AnnotateTextRequest instance using the specified properties. + * Creates a new ModerateTextRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest instance + * @param {google.cloud.language.v1.IModerateTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.ModerateTextRequest} ModerateTextRequest instance */ - AnnotateTextRequest.create = function create(properties) { - return new AnnotateTextRequest(properties); + ModerateTextRequest.create = function create(properties) { + return new ModerateTextRequest(properties); }; /** - * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * Encodes the specified ModerateTextRequest message. Does not implicitly {@link google.cloud.language.v1.ModerateTextRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {google.cloud.language.v1.IModerateTextRequest} message ModerateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotateTextRequest.encode = function encode(message, writer) { + ModerateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.cloud.language.v1.AnnotateTextRequest.Features.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingType); return writer; }; /** - * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * Encodes the specified ModerateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.ModerateTextRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {google.cloud.language.v1.IModerateTextRequest} message ModerateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + ModerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnnotateTextRequest message from the specified reader or buffer. + * Decodes a ModerateTextRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + * @returns {google.cloud.language.v1.ModerateTextRequest} ModerateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotateTextRequest.decode = function decode(reader, length) { + ModerateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ModerateTextRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -8108,14 +8119,6 @@ message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); break; } - case 2: { - message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.decode(reader, reader.uint32()); - break; - } - case 3: { - message.encodingType = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -8125,30 +8128,30 @@ }; /** - * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. + * Decodes a ModerateTextRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + * @returns {google.cloud.language.v1.ModerateTextRequest} ModerateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotateTextRequest.decodeDelimited = function decodeDelimited(reader) { + ModerateTextRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnnotateTextRequest message. + * Verifies a ModerateTextRequest message. * @function verify - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnnotateTextRequest.verify = function verify(message) { + ModerateTextRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { @@ -8156,480 +8159,322 @@ if (error) return "document." + error; } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.cloud.language.v1.AnnotateTextRequest.Features.verify(message.features); - if (error) - return "features." + error; - } - if (message.encodingType != null && message.hasOwnProperty("encodingType")) - switch (message.encodingType) { - default: - return "encodingType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } return null; }; /** - * Creates an AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ModerateTextRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + * @returns {google.cloud.language.v1.ModerateTextRequest} ModerateTextRequest */ - AnnotateTextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest) + ModerateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ModerateTextRequest) return object; - var message = new $root.google.cloud.language.v1.AnnotateTextRequest(); + var message = new $root.google.cloud.language.v1.ModerateTextRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1.ModerateTextRequest.document: object expected"); message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.features: object expected"); - message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.fromObject(object.features); - } - switch (object.encodingType) { - default: - if (typeof object.encodingType === "number") { - message.encodingType = object.encodingType; - break; - } - break; - case "NONE": - case 0: - message.encodingType = 0; - break; - case "UTF8": - case 1: - message.encodingType = 1; - break; - case "UTF16": - case 2: - message.encodingType = 2; - break; - case "UTF32": - case 3: - message.encodingType = 3; - break; - } return message; }; /** - * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. + * Creates a plain object from a ModerateTextRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static - * @param {google.cloud.language.v1.AnnotateTextRequest} message AnnotateTextRequest + * @param {google.cloud.language.v1.ModerateTextRequest} message ModerateTextRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnnotateTextRequest.toObject = function toObject(message, options) { + ModerateTextRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.document = null; - object.features = null; - object.encodingType = options.enums === String ? "NONE" : 0; - } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.toObject(message.features, options); - if (message.encodingType != null && message.hasOwnProperty("encodingType")) - object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] === undefined ? message.encodingType : $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; return object; }; /** - * Converts this AnnotateTextRequest to JSON. + * Converts this ModerateTextRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @instance * @returns {Object.} JSON object */ - AnnotateTextRequest.prototype.toJSON = function toJSON() { + ModerateTextRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnnotateTextRequest + * Gets the default type url for ModerateTextRequest * @function getTypeUrl - * @memberof google.cloud.language.v1.AnnotateTextRequest + * @memberof google.cloud.language.v1.ModerateTextRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnnotateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ModerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest"; + return typeUrlPrefix + "/google.cloud.language.v1.ModerateTextRequest"; }; - AnnotateTextRequest.Features = (function() { - - /** - * Properties of a Features. - * @memberof google.cloud.language.v1.AnnotateTextRequest - * @interface IFeatures - * @property {boolean|null} [extractSyntax] Features extractSyntax - * @property {boolean|null} [extractEntities] Features extractEntities - * @property {boolean|null} [extractDocumentSentiment] Features extractDocumentSentiment - * @property {boolean|null} [extractEntitySentiment] Features extractEntitySentiment - * @property {boolean|null} [classifyText] Features classifyText - * @property {google.cloud.language.v1.IClassificationModelOptions|null} [classificationModelOptions] Features classificationModelOptions - */ + return ModerateTextRequest; + })(); - /** - * Constructs a new Features. - * @memberof google.cloud.language.v1.AnnotateTextRequest - * @classdesc Represents a Features. - * @implements IFeatures - * @constructor - * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set - */ - function Features(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1.ModerateTextResponse = (function() { - /** - * Features extractSyntax. - * @member {boolean} extractSyntax - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.extractSyntax = false; + /** + * Properties of a ModerateTextResponse. + * @memberof google.cloud.language.v1 + * @interface IModerateTextResponse + * @property {Array.|null} [moderationCategories] ModerateTextResponse moderationCategories + */ - /** - * Features extractEntities. - * @member {boolean} extractEntities - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.extractEntities = false; + /** + * Constructs a new ModerateTextResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents a ModerateTextResponse. + * @implements IModerateTextResponse + * @constructor + * @param {google.cloud.language.v1.IModerateTextResponse=} [properties] Properties to set + */ + function ModerateTextResponse(properties) { + this.moderationCategories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Features extractDocumentSentiment. - * @member {boolean} extractDocumentSentiment - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.extractDocumentSentiment = false; + /** + * ModerateTextResponse moderationCategories. + * @member {Array.} moderationCategories + * @memberof google.cloud.language.v1.ModerateTextResponse + * @instance + */ + ModerateTextResponse.prototype.moderationCategories = $util.emptyArray; - /** - * Features extractEntitySentiment. - * @member {boolean} extractEntitySentiment - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.extractEntitySentiment = false; + /** + * Creates a new ModerateTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {google.cloud.language.v1.IModerateTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.ModerateTextResponse} ModerateTextResponse instance + */ + ModerateTextResponse.create = function create(properties) { + return new ModerateTextResponse(properties); + }; - /** - * Features classifyText. - * @member {boolean} classifyText - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.classifyText = false; + /** + * Encodes the specified ModerateTextResponse message. Does not implicitly {@link google.cloud.language.v1.ModerateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {google.cloud.language.v1.IModerateTextResponse} message ModerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModerateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moderationCategories != null && message.moderationCategories.length) + for (var i = 0; i < message.moderationCategories.length; ++i) + $root.google.cloud.language.v1.ClassificationCategory.encode(message.moderationCategories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Features classificationModelOptions. - * @member {google.cloud.language.v1.IClassificationModelOptions|null|undefined} classificationModelOptions - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - */ - Features.prototype.classificationModelOptions = null; - - /** - * Creates a new Features instance using the specified properties. - * @function create - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set - * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features instance - */ - Features.create = function create(properties) { - return new Features(properties); - }; - - /** - * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Features.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.extractSyntax != null && Object.hasOwnProperty.call(message, "extractSyntax")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.extractSyntax); - if (message.extractEntities != null && Object.hasOwnProperty.call(message, "extractEntities")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.extractEntities); - if (message.extractDocumentSentiment != null && Object.hasOwnProperty.call(message, "extractDocumentSentiment")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.extractDocumentSentiment); - if (message.extractEntitySentiment != null && Object.hasOwnProperty.call(message, "extractEntitySentiment")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.extractEntitySentiment); - if (message.classifyText != null && Object.hasOwnProperty.call(message, "classifyText")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.classifyText); - if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) - $root.google.cloud.language.v1.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Features.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ModerateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.ModerateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {google.cloud.language.v1.IModerateTextResponse} message ModerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Features message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Features.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.extractSyntax = reader.bool(); - break; - } - case 2: { - message.extractEntities = reader.bool(); - break; - } - case 3: { - message.extractDocumentSentiment = reader.bool(); - break; - } - case 4: { - message.extractEntitySentiment = reader.bool(); - break; - } - case 6: { - message.classifyText = reader.bool(); - break; - } - case 10: { - message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ModerateTextResponse} ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModerateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ModerateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.moderationCategories && message.moderationCategories.length)) + message.moderationCategories = []; + message.moderationCategories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a Features message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Features.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ModerateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ModerateTextResponse} ModerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModerateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Features message. - * @function verify - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Features.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) - if (typeof message.extractSyntax !== "boolean") - return "extractSyntax: boolean expected"; - if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) - if (typeof message.extractEntities !== "boolean") - return "extractEntities: boolean expected"; - if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) - if (typeof message.extractDocumentSentiment !== "boolean") - return "extractDocumentSentiment: boolean expected"; - if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) - if (typeof message.extractEntitySentiment !== "boolean") - return "extractEntitySentiment: boolean expected"; - if (message.classifyText != null && message.hasOwnProperty("classifyText")) - if (typeof message.classifyText !== "boolean") - return "classifyText: boolean expected"; - if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { - var error = $root.google.cloud.language.v1.ClassificationModelOptions.verify(message.classificationModelOptions); + /** + * Verifies a ModerateTextResponse message. + * @function verify + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModerateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moderationCategories != null && message.hasOwnProperty("moderationCategories")) { + if (!Array.isArray(message.moderationCategories)) + return "moderationCategories: array expected"; + for (var i = 0; i < message.moderationCategories.length; ++i) { + var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.moderationCategories[i]); if (error) - return "classificationModelOptions." + error; + return "moderationCategories." + error; } - return null; - }; + } + return null; + }; - /** - * Creates a Features message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features - */ - Features.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest.Features) - return object; - var message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); - if (object.extractSyntax != null) - message.extractSyntax = Boolean(object.extractSyntax); - if (object.extractEntities != null) - message.extractEntities = Boolean(object.extractEntities); - if (object.extractDocumentSentiment != null) - message.extractDocumentSentiment = Boolean(object.extractDocumentSentiment); - if (object.extractEntitySentiment != null) - message.extractEntitySentiment = Boolean(object.extractEntitySentiment); - if (object.classifyText != null) - message.classifyText = Boolean(object.classifyText); - if (object.classificationModelOptions != null) { - if (typeof object.classificationModelOptions !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.Features.classificationModelOptions: object expected"); - message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.fromObject(object.classificationModelOptions); + /** + * Creates a ModerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ModerateTextResponse} ModerateTextResponse + */ + ModerateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ModerateTextResponse) + return object; + var message = new $root.google.cloud.language.v1.ModerateTextResponse(); + if (object.moderationCategories) { + if (!Array.isArray(object.moderationCategories)) + throw TypeError(".google.cloud.language.v1.ModerateTextResponse.moderationCategories: array expected"); + message.moderationCategories = []; + for (var i = 0; i < object.moderationCategories.length; ++i) { + if (typeof object.moderationCategories[i] !== "object") + throw TypeError(".google.cloud.language.v1.ModerateTextResponse.moderationCategories: object expected"); + message.moderationCategories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.moderationCategories[i]); } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a Features message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {google.cloud.language.v1.AnnotateTextRequest.Features} message Features - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Features.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.extractSyntax = false; - object.extractEntities = false; - object.extractDocumentSentiment = false; - object.extractEntitySentiment = false; - object.classifyText = false; - object.classificationModelOptions = null; - } - if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) - object.extractSyntax = message.extractSyntax; - if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) - object.extractEntities = message.extractEntities; - if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) - object.extractDocumentSentiment = message.extractDocumentSentiment; - if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) - object.extractEntitySentiment = message.extractEntitySentiment; - if (message.classifyText != null && message.hasOwnProperty("classifyText")) - object.classifyText = message.classifyText; - if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) - object.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.toObject(message.classificationModelOptions, options); - return object; - }; - - /** - * Converts this Features to JSON. - * @function toJSON - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @instance - * @returns {Object.} JSON object - */ - Features.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ModerateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {google.cloud.language.v1.ModerateTextResponse} message ModerateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModerateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.moderationCategories = []; + if (message.moderationCategories && message.moderationCategories.length) { + object.moderationCategories = []; + for (var j = 0; j < message.moderationCategories.length; ++j) + object.moderationCategories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.moderationCategories[j], options); + } + return object; + }; - /** - * Gets the default type url for Features - * @function getTypeUrl - * @memberof google.cloud.language.v1.AnnotateTextRequest.Features - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Features.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest.Features"; - }; + /** + * Converts this ModerateTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ModerateTextResponse + * @instance + * @returns {Object.} JSON object + */ + ModerateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Features; - })(); + /** + * Gets the default type url for ModerateTextResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.ModerateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ModerateTextResponse"; + }; - return AnnotateTextRequest; + return ModerateTextResponse; })(); - v1.AnnotateTextResponse = (function() { + v1.AnnotateTextRequest = (function() { /** - * Properties of an AnnotateTextResponse. + * Properties of an AnnotateTextRequest. * @memberof google.cloud.language.v1 - * @interface IAnnotateTextResponse - * @property {Array.|null} [sentences] AnnotateTextResponse sentences - * @property {Array.|null} [tokens] AnnotateTextResponse tokens - * @property {Array.|null} [entities] AnnotateTextResponse entities - * @property {google.cloud.language.v1.ISentiment|null} [documentSentiment] AnnotateTextResponse documentSentiment - * @property {string|null} [language] AnnotateTextResponse language - * @property {Array.|null} [categories] AnnotateTextResponse categories + * @interface IAnnotateTextRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnnotateTextRequest document + * @property {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null} [features] AnnotateTextRequest features + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnnotateTextRequest encodingType */ /** - * Constructs a new AnnotateTextResponse. + * Constructs a new AnnotateTextRequest. * @memberof google.cloud.language.v1 - * @classdesc Represents an AnnotateTextResponse. - * @implements IAnnotateTextResponse + * @classdesc Represents an AnnotateTextRequest. + * @implements IAnnotateTextRequest * @constructor - * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set + * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set */ - function AnnotateTextResponse(properties) { - this.sentences = []; - this.tokens = []; - this.entities = []; - this.categories = []; + function AnnotateTextRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8637,157 +8482,103 @@ } /** - * AnnotateTextResponse sentences. - * @member {Array.} sentences - * @memberof google.cloud.language.v1.AnnotateTextResponse - * @instance - */ - AnnotateTextResponse.prototype.sentences = $util.emptyArray; - - /** - * AnnotateTextResponse tokens. - * @member {Array.} tokens - * @memberof google.cloud.language.v1.AnnotateTextResponse - * @instance - */ - AnnotateTextResponse.prototype.tokens = $util.emptyArray; - - /** - * AnnotateTextResponse entities. - * @member {Array.} entities - * @memberof google.cloud.language.v1.AnnotateTextResponse - * @instance - */ - AnnotateTextResponse.prototype.entities = $util.emptyArray; - - /** - * AnnotateTextResponse documentSentiment. - * @member {google.cloud.language.v1.ISentiment|null|undefined} documentSentiment - * @memberof google.cloud.language.v1.AnnotateTextResponse + * AnnotateTextRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnnotateTextRequest * @instance */ - AnnotateTextResponse.prototype.documentSentiment = null; + AnnotateTextRequest.prototype.document = null; /** - * AnnotateTextResponse language. - * @member {string} language - * @memberof google.cloud.language.v1.AnnotateTextResponse + * AnnotateTextRequest features. + * @member {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null|undefined} features + * @memberof google.cloud.language.v1.AnnotateTextRequest * @instance */ - AnnotateTextResponse.prototype.language = ""; + AnnotateTextRequest.prototype.features = null; /** - * AnnotateTextResponse categories. - * @member {Array.} categories - * @memberof google.cloud.language.v1.AnnotateTextResponse + * AnnotateTextRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnnotateTextRequest * @instance */ - AnnotateTextResponse.prototype.categories = $util.emptyArray; + AnnotateTextRequest.prototype.encodingType = 0; /** - * Creates a new AnnotateTextResponse instance using the specified properties. + * Creates a new AnnotateTextRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse instance + * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest instance */ - AnnotateTextResponse.create = function create(properties) { - return new AnnotateTextResponse(properties); + AnnotateTextRequest.create = function create(properties) { + return new AnnotateTextRequest(properties); }; /** - * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotateTextResponse.encode = function encode(message, writer) { + AnnotateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sentences != null && message.sentences.length) - for (var i = 0; i < message.sentences.length; ++i) - $root.google.cloud.language.v1.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tokens != null && message.tokens.length) - for (var i = 0; i < message.tokens.length; ++i) - $root.google.cloud.language.v1.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.language.v1.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) - $root.google.cloud.language.v1.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.language != null && Object.hasOwnProperty.call(message, "language")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.language); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - $root.google.cloud.language.v1.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.cloud.language.v1.AnnotateTextRequest.Features.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingType); return writer; }; /** - * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static - * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + AnnotateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnnotateTextResponse message from the specified reader or buffer. + * Decodes an AnnotateTextRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotateTextResponse.decode = function decode(reader, length) { + AnnotateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.sentences && message.sentences.length)) - message.sentences = []; - message.sentences.push($root.google.cloud.language.v1.Sentence.decode(reader, reader.uint32())); + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); break; } case 2: { - if (!(message.tokens && message.tokens.length)) - message.tokens = []; - message.tokens.push($root.google.cloud.language.v1.Token.decode(reader, reader.uint32())); + message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.language.v1.Entity.decode(reader, reader.uint32())); - break; - } - case 4: { - message.documentSentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); - break; - } - case 5: { - message.language = reader.string(); - break; - } - case 6: { - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); + message.encodingType = reader.int32(); break; } default: @@ -8799,648 +8590,711 @@ }; /** - * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. + * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotateTextResponse.decodeDelimited = function decodeDelimited(reader) { + AnnotateTextRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnnotateTextResponse message. + * Verifies an AnnotateTextRequest message. * @function verify - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnnotateTextResponse.verify = function verify(message) { + AnnotateTextRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sentences != null && message.hasOwnProperty("sentences")) { - if (!Array.isArray(message.sentences)) - return "sentences: array expected"; - for (var i = 0; i < message.sentences.length; ++i) { - var error = $root.google.cloud.language.v1.Sentence.verify(message.sentences[i]); - if (error) - return "sentences." + error; - } - } - if (message.tokens != null && message.hasOwnProperty("tokens")) { - if (!Array.isArray(message.tokens)) - return "tokens: array expected"; - for (var i = 0; i < message.tokens.length; ++i) { - var error = $root.google.cloud.language.v1.Token.verify(message.tokens[i]); - if (error) - return "tokens." + error; - } - } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.language.v1.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; } - if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { - var error = $root.google.cloud.language.v1.Sentiment.verify(message.documentSentiment); + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.cloud.language.v1.AnnotateTextRequest.Features.verify(message.features); if (error) - return "documentSentiment." + error; + return "features." + error; } - if (message.language != null && message.hasOwnProperty("language")) - if (!$util.isString(message.language)) - return "language: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) { - var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.categories[i]); - if (error) - return "categories." + error; + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } return null; }; /** - * Creates an AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest */ - AnnotateTextResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1.AnnotateTextResponse) + AnnotateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest) return object; - var message = new $root.google.cloud.language.v1.AnnotateTextResponse(); - if (object.sentences) { - if (!Array.isArray(object.sentences)) - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: array expected"); - message.sentences = []; - for (var i = 0; i < object.sentences.length; ++i) { - if (typeof object.sentences[i] !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: object expected"); - message.sentences[i] = $root.google.cloud.language.v1.Sentence.fromObject(object.sentences[i]); - } - } - if (object.tokens) { - if (!Array.isArray(object.tokens)) - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: array expected"); - message.tokens = []; - for (var i = 0; i < object.tokens.length; ++i) { - if (typeof object.tokens[i] !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: object expected"); - message.tokens[i] = $root.google.cloud.language.v1.Token.fromObject(object.tokens[i]); - } - } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: object expected"); - message.entities[i] = $root.google.cloud.language.v1.Entity.fromObject(object.entities[i]); - } + var message = new $root.google.cloud.language.v1.AnnotateTextRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); } - if (object.documentSentiment != null) { - if (typeof object.documentSentiment !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.documentSentiment: object expected"); - message.documentSentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.documentSentiment); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.features: object expected"); + message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.fromObject(object.features); } - if (object.language != null) - message.language = String(object.language); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) { - if (typeof object.categories[i] !== "object") - throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: object expected"); - message.categories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.categories[i]); + switch (object.encodingType) { + default: + if (typeof object.encodingType === "number") { + message.encodingType = object.encodingType; + break; } + break; + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; } return message; }; /** - * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. + * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static - * @param {google.cloud.language.v1.AnnotateTextResponse} message AnnotateTextResponse + * @param {google.cloud.language.v1.AnnotateTextRequest} message AnnotateTextRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnnotateTextResponse.toObject = function toObject(message, options) { + AnnotateTextRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sentences = []; - object.tokens = []; - object.entities = []; - object.categories = []; - } if (options.defaults) { - object.documentSentiment = null; - object.language = ""; - } - if (message.sentences && message.sentences.length) { - object.sentences = []; - for (var j = 0; j < message.sentences.length; ++j) - object.sentences[j] = $root.google.cloud.language.v1.Sentence.toObject(message.sentences[j], options); - } - if (message.tokens && message.tokens.length) { - object.tokens = []; - for (var j = 0; j < message.tokens.length; ++j) - object.tokens[j] = $root.google.cloud.language.v1.Token.toObject(message.tokens[j], options); - } - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.language.v1.Entity.toObject(message.entities[j], options); - } - if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) - object.documentSentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.documentSentiment, options); - if (message.language != null && message.hasOwnProperty("language")) - object.language = message.language; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.categories[j], options); + object.document = null; + object.features = null; + object.encodingType = options.enums === String ? "NONE" : 0; } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.toObject(message.features, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] === undefined ? message.encodingType : $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; return object; }; /** - * Converts this AnnotateTextResponse to JSON. + * Converts this AnnotateTextRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @instance * @returns {Object.} JSON object */ - AnnotateTextResponse.prototype.toJSON = function toJSON() { + AnnotateTextRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnnotateTextResponse + * Gets the default type url for AnnotateTextRequest * @function getTypeUrl - * @memberof google.cloud.language.v1.AnnotateTextResponse + * @memberof google.cloud.language.v1.AnnotateTextRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnnotateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnnotateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextResponse"; + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest"; }; - return AnnotateTextResponse; - })(); + AnnotateTextRequest.Features = (function() { - return v1; - })(); + /** + * Properties of a Features. + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @interface IFeatures + * @property {boolean|null} [extractSyntax] Features extractSyntax + * @property {boolean|null} [extractEntities] Features extractEntities + * @property {boolean|null} [extractDocumentSentiment] Features extractDocumentSentiment + * @property {boolean|null} [extractEntitySentiment] Features extractEntitySentiment + * @property {boolean|null} [classifyText] Features classifyText + * @property {boolean|null} [moderateText] Features moderateText + * @property {google.cloud.language.v1.IClassificationModelOptions|null} [classificationModelOptions] Features classificationModelOptions + */ - language.v1beta2 = (function() { + /** + * Constructs a new Features. + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @classdesc Represents a Features. + * @implements IFeatures + * @constructor + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set + */ + function Features(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Namespace v1beta2. - * @memberof google.cloud.language - * @namespace - */ - var v1beta2 = {}; + /** + * Features extractSyntax. + * @member {boolean} extractSyntax + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractSyntax = false; - v1beta2.LanguageService = (function() { + /** + * Features extractEntities. + * @member {boolean} extractEntities + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntities = false; - /** - * Constructs a new LanguageService service. - * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a LanguageService - * @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 LanguageService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (LanguageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LanguageService; + /** + * Features extractDocumentSentiment. + * @member {boolean} extractDocumentSentiment + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractDocumentSentiment = false; - /** - * Creates new LanguageService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.language.v1beta2.LanguageService - * @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 {LanguageService} RPC service. Useful where requests and/or responses are streamed. - */ - LanguageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Features extractEntitySentiment. + * @member {boolean} extractEntitySentiment + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntitySentiment = false; - /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSentiment}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef AnalyzeSentimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} [response] AnalyzeSentimentResponse - */ + /** + * Features classifyText. + * @member {boolean} classifyText + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classifyText = false; - /** - * Calls AnalyzeSentiment. - * @function analyzeSentiment - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LanguageService.prototype.analyzeSentiment = function analyzeSentiment(request, callback) { - return this.rpcCall(analyzeSentiment, $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse, request, callback); - }, "name", { value: "AnalyzeSentiment" }); + /** + * Features moderateText. + * @member {boolean} moderateText + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.moderateText = false; - /** - * Calls AnalyzeSentiment. - * @function analyzeSentiment - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Features classificationModelOptions. + * @member {google.cloud.language.v1.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classificationModelOptions = null; - /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntities}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef AnalyzeEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} [response] AnalyzeEntitiesResponse - */ + /** + * Creates a new Features instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features instance + */ + Features.create = function create(properties) { + return new Features(properties); + }; - /** - * Calls AnalyzeEntities. - * @function analyzeEntities - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitiesCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LanguageService.prototype.analyzeEntities = function analyzeEntities(request, callback) { - return this.rpcCall(analyzeEntities, $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse, request, callback); - }, "name", { value: "AnalyzeEntities" }); + /** + * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extractSyntax != null && Object.hasOwnProperty.call(message, "extractSyntax")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.extractSyntax); + if (message.extractEntities != null && Object.hasOwnProperty.call(message, "extractEntities")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.extractEntities); + if (message.extractDocumentSentiment != null && Object.hasOwnProperty.call(message, "extractDocumentSentiment")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.extractDocumentSentiment); + if (message.extractEntitySentiment != null && Object.hasOwnProperty.call(message, "extractEntitySentiment")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.extractEntitySentiment); + if (message.classifyText != null && Object.hasOwnProperty.call(message, "classifyText")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.classifyText); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.moderateText != null && Object.hasOwnProperty.call(message, "moderateText")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.moderateText); + return writer; + }; - /** - * Calls AnalyzeEntities. - * @function analyzeEntities - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntitySentiment}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef AnalyzeEntitySentimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} [response] AnalyzeEntitySentimentResponse - */ + /** + * Decodes a Features message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extractSyntax = reader.bool(); + break; + } + case 2: { + message.extractEntities = reader.bool(); + break; + } + case 3: { + message.extractDocumentSentiment = reader.bool(); + break; + } + case 4: { + message.extractEntitySentiment = reader.bool(); + break; + } + case 6: { + message.classifyText = reader.bool(); + break; + } + case 11: { + message.moderateText = reader.bool(); + break; + } + case 10: { + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls AnalyzeEntitySentiment. - * @function analyzeEntitySentiment - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LanguageService.prototype.analyzeEntitySentiment = function analyzeEntitySentiment(request, callback) { - return this.rpcCall(analyzeEntitySentiment, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse, request, callback); - }, "name", { value: "AnalyzeEntitySentiment" }); + /** + * Decodes a Features message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls AnalyzeEntitySentiment. - * @function analyzeEntitySentiment - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Verifies a Features message. + * @function verify + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Features.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + if (typeof message.extractSyntax !== "boolean") + return "extractSyntax: boolean expected"; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + if (typeof message.extractEntities !== "boolean") + return "extractEntities: boolean expected"; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + if (typeof message.extractDocumentSentiment !== "boolean") + return "extractDocumentSentiment: boolean expected"; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + if (typeof message.extractEntitySentiment !== "boolean") + return "extractEntitySentiment: boolean expected"; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + if (typeof message.classifyText !== "boolean") + return "classifyText: boolean expected"; + if (message.moderateText != null && message.hasOwnProperty("moderateText")) + if (typeof message.moderateText !== "boolean") + return "moderateText: boolean expected"; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } + return null; + }; + + /** + * Creates a Features message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + */ + Features.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest.Features) + return object; + var message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); + if (object.extractSyntax != null) + message.extractSyntax = Boolean(object.extractSyntax); + if (object.extractEntities != null) + message.extractEntities = Boolean(object.extractEntities); + if (object.extractDocumentSentiment != null) + message.extractDocumentSentiment = Boolean(object.extractDocumentSentiment); + if (object.extractEntitySentiment != null) + message.extractEntitySentiment = Boolean(object.extractEntitySentiment); + if (object.classifyText != null) + message.classifyText = Boolean(object.classifyText); + if (object.moderateText != null) + message.moderateText = Boolean(object.moderateText); + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.Features.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.fromObject(object.classificationModelOptions); + } + return message; + }; + + /** + * Creates a plain object from a Features message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.Features} message Features + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Features.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extractSyntax = false; + object.extractEntities = false; + object.extractDocumentSentiment = false; + object.extractEntitySentiment = false; + object.classifyText = false; + object.classificationModelOptions = null; + object.moderateText = false; + } + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + object.extractSyntax = message.extractSyntax; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + object.extractEntities = message.extractEntities; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + object.extractDocumentSentiment = message.extractDocumentSentiment; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + object.extractEntitySentiment = message.extractEntitySentiment; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + object.classifyText = message.classifyText; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + if (message.moderateText != null && message.hasOwnProperty("moderateText")) + object.moderateText = message.moderateText; + return object; + }; + + /** + * Converts this Features to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + * @returns {Object.} JSON object + */ + Features.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Features + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Features.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest.Features"; + }; + + return Features; + })(); + + return AnnotateTextRequest; + })(); + + v1.AnnotateTextResponse = (function() { /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSyntax}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef AnalyzeSyntaxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} [response] AnalyzeSyntaxResponse + * Properties of an AnnotateTextResponse. + * @memberof google.cloud.language.v1 + * @interface IAnnotateTextResponse + * @property {Array.|null} [sentences] AnnotateTextResponse sentences + * @property {Array.|null} [tokens] AnnotateTextResponse tokens + * @property {Array.|null} [entities] AnnotateTextResponse entities + * @property {google.cloud.language.v1.ISentiment|null} [documentSentiment] AnnotateTextResponse documentSentiment + * @property {string|null} [language] AnnotateTextResponse language + * @property {Array.|null} [categories] AnnotateTextResponse categories + * @property {Array.|null} [moderationCategories] AnnotateTextResponse moderationCategories */ /** - * Calls AnalyzeSyntax. - * @function analyzeSyntax - * @memberof google.cloud.language.v1beta2.LanguageService - * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSyntaxCallback} callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse - * @returns {undefined} - * @variation 1 + * Constructs a new AnnotateTextResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnnotateTextResponse. + * @implements IAnnotateTextResponse + * @constructor + * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set */ - Object.defineProperty(LanguageService.prototype.analyzeSyntax = function analyzeSyntax(request, callback) { - return this.rpcCall(analyzeSyntax, $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse, request, callback); - }, "name", { value: "AnalyzeSyntax" }); + function AnnotateTextResponse(properties) { + this.sentences = []; + this.tokens = []; + this.entities = []; + this.categories = []; + this.moderationCategories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls AnalyzeSyntax. - * @function analyzeSyntax - * @memberof google.cloud.language.v1beta2.LanguageService + * AnnotateTextResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AnnotateTextResponse.prototype.sentences = $util.emptyArray; /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|classifyText}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef ClassifyTextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.ClassifyTextResponse} [response] ClassifyTextResponse + * AnnotateTextResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance */ + AnnotateTextResponse.prototype.tokens = $util.emptyArray; /** - * Calls ClassifyText. - * @function classifyText - * @memberof google.cloud.language.v1beta2.LanguageService + * AnnotateTextResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance - * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.ClassifyTextCallback} callback Node-style callback called with the error, if any, and ClassifyTextResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(LanguageService.prototype.classifyText = function classifyText(request, callback) { - return this.rpcCall(classifyText, $root.google.cloud.language.v1beta2.ClassifyTextRequest, $root.google.cloud.language.v1beta2.ClassifyTextResponse, request, callback); - }, "name", { value: "ClassifyText" }); + AnnotateTextResponse.prototype.entities = $util.emptyArray; /** - * Calls ClassifyText. - * @function classifyText - * @memberof google.cloud.language.v1beta2.LanguageService + * AnnotateTextResponse documentSentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance - * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AnnotateTextResponse.prototype.documentSentiment = null; /** - * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|annotateText}. - * @memberof google.cloud.language.v1beta2.LanguageService - * @typedef AnnotateTextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.language.v1beta2.AnnotateTextResponse} [response] AnnotateTextResponse + * AnnotateTextResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance */ + AnnotateTextResponse.prototype.language = ""; /** - * Calls AnnotateText. - * @function annotateText - * @memberof google.cloud.language.v1beta2.LanguageService + * AnnotateTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance - * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object - * @param {google.cloud.language.v1beta2.LanguageService.AnnotateTextCallback} callback Node-style callback called with the error, if any, and AnnotateTextResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(LanguageService.prototype.annotateText = function annotateText(request, callback) { - return this.rpcCall(annotateText, $root.google.cloud.language.v1beta2.AnnotateTextRequest, $root.google.cloud.language.v1beta2.AnnotateTextResponse, request, callback); - }, "name", { value: "AnnotateText" }); + AnnotateTextResponse.prototype.categories = $util.emptyArray; /** - * Calls AnnotateText. - * @function annotateText - * @memberof google.cloud.language.v1beta2.LanguageService + * AnnotateTextResponse moderationCategories. + * @member {Array.} moderationCategories + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance - * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ - - return LanguageService; - })(); - - v1beta2.Document = (function() { - - /** - * Properties of a Document. - * @memberof google.cloud.language.v1beta2 - * @interface IDocument - * @property {google.cloud.language.v1beta2.Document.Type|null} [type] Document type - * @property {string|null} [content] Document content - * @property {string|null} [gcsContentUri] Document gcsContentUri - * @property {string|null} [language] Document language - * @property {string|null} [referenceWebUri] Document referenceWebUri - * @property {google.cloud.language.v1beta2.Document.BoilerplateHandling|null} [boilerplateHandling] Document boilerplateHandling - */ - - /** - * Constructs a new Document. - * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a Document. - * @implements IDocument - * @constructor - * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set - */ - function Document(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Document type. - * @member {google.cloud.language.v1beta2.Document.Type} type - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.type = 0; - - /** - * Document content. - * @member {string|null|undefined} content - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.content = null; - - /** - * Document gcsContentUri. - * @member {string|null|undefined} gcsContentUri - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.gcsContentUri = null; - - /** - * Document language. - * @member {string} language - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.language = ""; - - /** - * Document referenceWebUri. - * @member {string} referenceWebUri - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.referenceWebUri = ""; - - /** - * Document boilerplateHandling. - * @member {google.cloud.language.v1beta2.Document.BoilerplateHandling} boilerplateHandling - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Document.prototype.boilerplateHandling = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Document source. - * @member {"content"|"gcsContentUri"|undefined} source - * @memberof google.cloud.language.v1beta2.Document - * @instance - */ - Object.defineProperty(Document.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["content", "gcsContentUri"]), - set: $util.oneOfSetter($oneOfFields) - }); + AnnotateTextResponse.prototype.moderationCategories = $util.emptyArray; /** - * Creates a new Document instance using the specified properties. + * Creates a new AnnotateTextResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static - * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.Document} Document instance + * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse instance */ - Document.create = function create(properties) { - return new Document(properties); + AnnotateTextResponse.create = function create(properties) { + return new AnnotateTextResponse(properties); }; /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static - * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode + * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encode = function encode(message, writer) { + AnnotateTextResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); - if (message.gcsContentUri != null && Object.hasOwnProperty.call(message, "gcsContentUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsContentUri); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.language != null && Object.hasOwnProperty.call(message, "language")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.language); - if (message.referenceWebUri != null && Object.hasOwnProperty.call(message, "referenceWebUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceWebUri); - if (message.boilerplateHandling != null && Object.hasOwnProperty.call(message, "boilerplateHandling")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.boilerplateHandling); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.language); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.moderationCategories != null && message.moderationCategories.length) + for (var i = 0; i < message.moderationCategories.length; ++i) + $root.google.cloud.language.v1.ClassificationCategory.encode(message.moderationCategories[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static - * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode + * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encodeDelimited = function encodeDelimited(message, writer) { + AnnotateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Document message from the specified reader or buffer. + * Decodes an AnnotateTextResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.Document} Document + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decode = function decode(reader, length) { + AnnotateTextResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Document(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type = reader.int32(); + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1.Sentence.decode(reader, reader.uint32())); break; } case 2: { - message.content = reader.string(); + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1.Token.decode(reader, reader.uint32())); break; } case 3: { - message.gcsContentUri = reader.string(); + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1.Entity.decode(reader, reader.uint32())); break; } case 4: { - message.language = reader.string(); + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); break; } case 5: { - message.referenceWebUri = reader.string(); + message.language = reader.string(); break; } case 6: { - message.boilerplateHandling = reader.int32(); + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.moderationCategories && message.moderationCategories.length)) + message.moderationCategories = []; + message.moderationCategories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); break; } default: @@ -9452,516 +9306,546 @@ }; /** - * Decodes a Document message from the specified reader or buffer, length delimited. + * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.Document} Document + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decodeDelimited = function decodeDelimited(reader) { + AnnotateTextResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Document message. + * Verifies an AnnotateTextResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Document.verify = function verify(message) { + AnnotateTextResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; } - if (message.content != null && message.hasOwnProperty("content")) { - properties.source = 1; - if (!$util.isString(message.content)) - return "content: string expected"; } - if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.gcsContentUri)) - return "gcsContentUri: string expected"; + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; } if (message.language != null && message.hasOwnProperty("language")) if (!$util.isString(message.language)) return "language: string expected"; - if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) - if (!$util.isString(message.referenceWebUri)) - return "referenceWebUri: string expected"; - if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) - switch (message.boilerplateHandling) { - default: - return "boilerplateHandling: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.moderationCategories != null && message.hasOwnProperty("moderationCategories")) { + if (!Array.isArray(message.moderationCategories)) + return "moderationCategories: array expected"; + for (var i = 0; i < message.moderationCategories.length; ++i) { + var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.moderationCategories[i]); + if (error) + return "moderationCategories." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.Document} Document + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.Document) + AnnotateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextResponse) return object; - var message = new $root.google.cloud.language.v1beta2.Document(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; + var message = new $root.google.cloud.language.v1.AnnotateTextResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1.Sentence.fromObject(object.sentences[i]); } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PLAIN_TEXT": - case 1: - message.type = 1; - break; - case "HTML": - case 2: - message.type = 2; - break; } - if (object.content != null) - message.content = String(object.content); - if (object.gcsContentUri != null) - message.gcsContentUri = String(object.gcsContentUri); + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1.Token.fromObject(object.tokens[i]); + } + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1.Entity.fromObject(object.entities[i]); + } + } + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.documentSentiment); + } if (object.language != null) message.language = String(object.language); - if (object.referenceWebUri != null) - message.referenceWebUri = String(object.referenceWebUri); - switch (object.boilerplateHandling) { - default: - if (typeof object.boilerplateHandling === "number") { - message.boilerplateHandling = object.boilerplateHandling; - break; + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.categories[i]); + } + } + if (object.moderationCategories) { + if (!Array.isArray(object.moderationCategories)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.moderationCategories: array expected"); + message.moderationCategories = []; + for (var i = 0; i < object.moderationCategories.length; ++i) { + if (typeof object.moderationCategories[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.moderationCategories: object expected"); + message.moderationCategories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.moderationCategories[i]); } - break; - case "BOILERPLATE_HANDLING_UNSPECIFIED": - case 0: - message.boilerplateHandling = 0; - break; - case "SKIP_BOILERPLATE": - case 1: - message.boilerplateHandling = 1; - break; - case "KEEP_BOILERPLATE": - case 2: - message.boilerplateHandling = 2; - break; } return message; }; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. + * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static - * @param {google.cloud.language.v1beta2.Document} message Document + * @param {google.cloud.language.v1.AnnotateTextResponse} message AnnotateTextResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Document.toObject = function toObject(message, options) { + AnnotateTextResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + object.entities = []; + object.categories = []; + object.moderationCategories = []; + } if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.documentSentiment = null; object.language = ""; - object.referenceWebUri = ""; - object.boilerplateHandling = options.enums === String ? "BOILERPLATE_HANDLING_UNSPECIFIED" : 0; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.language.v1beta2.Document.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.Document.Type[message.type] : message.type; - if (message.content != null && message.hasOwnProperty("content")) { - object.content = message.content; - if (options.oneofs) - object.source = "content"; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1.Sentence.toObject(message.sentences[j], options); } - if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { - object.gcsContentUri = message.gcsContentUri; - if (options.oneofs) - object.source = "gcsContentUri"; + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1.Token.toObject(message.tokens[j], options); + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1.Entity.toObject(message.entities[j], options); } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.documentSentiment, options); if (message.language != null && message.hasOwnProperty("language")) object.language = message.language; - if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) - object.referenceWebUri = message.referenceWebUri; - if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) - object.boilerplateHandling = options.enums === String ? $root.google.cloud.language.v1beta2.Document.BoilerplateHandling[message.boilerplateHandling] === undefined ? message.boilerplateHandling : $root.google.cloud.language.v1beta2.Document.BoilerplateHandling[message.boilerplateHandling] : message.boilerplateHandling; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.categories[j], options); + } + if (message.moderationCategories && message.moderationCategories.length) { + object.moderationCategories = []; + for (var j = 0; j < message.moderationCategories.length; ++j) + object.moderationCategories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.moderationCategories[j], options); + } return object; }; /** - * Converts this Document to JSON. + * Converts this AnnotateTextResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @instance * @returns {Object.} JSON object */ - Document.prototype.toJSON = function toJSON() { + AnnotateTextResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Document + * Gets the default type url for AnnotateTextResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.Document + * @memberof google.cloud.language.v1.AnnotateTextResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnnotateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.Document"; + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextResponse"; }; - /** - * Type enum. - * @name google.cloud.language.v1beta2.Document.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PLAIN_TEXT=1 PLAIN_TEXT value - * @property {number} HTML=2 HTML value - */ - Document.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PLAIN_TEXT"] = 1; - values[valuesById[2] = "HTML"] = 2; - return values; - })(); + return AnnotateTextResponse; + })(); - /** - * BoilerplateHandling enum. - * @name google.cloud.language.v1beta2.Document.BoilerplateHandling - * @enum {number} - * @property {number} BOILERPLATE_HANDLING_UNSPECIFIED=0 BOILERPLATE_HANDLING_UNSPECIFIED value - * @property {number} SKIP_BOILERPLATE=1 SKIP_BOILERPLATE value - * @property {number} KEEP_BOILERPLATE=2 KEEP_BOILERPLATE value - */ - Document.BoilerplateHandling = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BOILERPLATE_HANDLING_UNSPECIFIED"] = 0; - values[valuesById[1] = "SKIP_BOILERPLATE"] = 1; - values[valuesById[2] = "KEEP_BOILERPLATE"] = 2; - return values; - })(); + return v1; + })(); - return Document; - })(); + language.v1beta2 = (function() { - v1beta2.Sentence = (function() { + /** + * Namespace v1beta2. + * @memberof google.cloud.language + * @namespace + */ + var v1beta2 = {}; - /** - * Properties of a Sentence. - * @memberof google.cloud.language.v1beta2 - * @interface ISentence - * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Sentence text - * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Sentence sentiment - */ + v1beta2.LanguageService = (function() { /** - * Constructs a new Sentence. + * Constructs a new LanguageService service. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a Sentence. - * @implements ISentence + * @classdesc Represents a LanguageService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set + * @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 Sentence(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function LanguageService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * Sentence text. - * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text - * @memberof google.cloud.language.v1beta2.Sentence - * @instance - */ - Sentence.prototype.text = null; + (LanguageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LanguageService; /** - * Sentence sentiment. - * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment - * @memberof google.cloud.language.v1beta2.Sentence - * @instance - */ - Sentence.prototype.sentiment = null; - - /** - * Creates a new Sentence instance using the specified properties. + * Creates new LanguageService service using the specified rpc implementation. * @function create - * @memberof google.cloud.language.v1beta2.Sentence + * @memberof google.cloud.language.v1beta2.LanguageService * @static - * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.Sentence} Sentence instance + * @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 {LanguageService} RPC service. Useful where requests and/or responses are streamed. */ - Sentence.create = function create(properties) { - return new Sentence(properties); + LanguageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSentiment}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeSentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} [response] AnalyzeSentimentResponse */ - Sentence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) - $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse + * @returns {undefined} + * @variation 1 */ - Sentence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(LanguageService.prototype.analyzeSentiment = function analyzeSentiment(request, callback) { + return this.rpcCall(analyzeSentiment, $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse, request, callback); + }, "name", { value: "AnalyzeSentiment" }); /** - * Decodes a Sentence message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.Sentence} Sentence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Sentence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); - break; - } - case 2: { - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a Sentence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.Sentence} Sentence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntities}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} [response] AnalyzeEntitiesResponse */ - Sentence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a Sentence message. - * @function verify - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitiesCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse + * @returns {undefined} + * @variation 1 */ - Sentence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) { - var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); - if (error) - return "text." + error; - } - if (message.sentiment != null && message.hasOwnProperty("sentiment")) { - var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); - if (error) - return "sentiment." + error; - } - return null; - }; + Object.defineProperty(LanguageService.prototype.analyzeEntities = function analyzeEntities(request, callback) { + return this.rpcCall(analyzeEntities, $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse, request, callback); + }, "name", { value: "AnalyzeEntities" }); /** - * Creates a Sentence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.Sentence} Sentence + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Sentence.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.Sentence) - return object; - var message = new $root.google.cloud.language.v1beta2.Sentence(); - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.language.v1beta2.Sentence.text: object expected"); - message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); - } - if (object.sentiment != null) { - if (typeof object.sentiment !== "object") - throw TypeError(".google.cloud.language.v1beta2.Sentence.sentiment: object expected"); - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); - } - return message; - }; /** - * Creates a plain object from a Sentence message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {google.cloud.language.v1beta2.Sentence} message Sentence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntitySentiment}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeEntitySentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} [response] AnalyzeEntitySentimentResponse */ - Sentence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = null; - object.sentiment = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); - if (message.sentiment != null && message.hasOwnProperty("sentiment")) - object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); - return object; - }; /** - * Converts this Sentence to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.Sentence + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1beta2.LanguageService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse + * @returns {undefined} + * @variation 1 */ - Sentence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(LanguageService.prototype.analyzeEntitySentiment = function analyzeEntitySentiment(request, callback) { + return this.rpcCall(analyzeEntitySentiment, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse, request, callback); + }, "name", { value: "AnalyzeEntitySentiment" }); /** - * Gets the default type url for Sentence - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.Sentence - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Sentence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentence"; - }; - return Sentence; - })(); + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSyntax}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeSyntaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} [response] AnalyzeSyntaxResponse + */ - /** - * EncodingType enum. - * @name google.cloud.language.v1beta2.EncodingType - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} UTF8=1 UTF8 value - * @property {number} UTF16=2 UTF16 value - * @property {number} UTF32=3 UTF32 value - */ - v1beta2.EncodingType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "UTF8"] = 1; - values[valuesById[2] = "UTF16"] = 2; - values[valuesById[3] = "UTF32"] = 3; - return values; + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSyntaxCallback} callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeSyntax = function analyzeSyntax(request, callback) { + return this.rpcCall(analyzeSyntax, $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse, request, callback); + }, "name", { value: "AnalyzeSyntax" }); + + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|classifyText}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef ClassifyTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.ClassifyTextResponse} [response] ClassifyTextResponse + */ + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.ClassifyTextCallback} callback Node-style callback called with the error, if any, and ClassifyTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.classifyText = function classifyText(request, callback) { + return this.rpcCall(classifyText, $root.google.cloud.language.v1beta2.ClassifyTextRequest, $root.google.cloud.language.v1beta2.ClassifyTextResponse, request, callback); + }, "name", { value: "ClassifyText" }); + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|moderateText}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef ModerateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.ModerateTextResponse} [response] ModerateTextResponse + */ + + /** + * Calls ModerateText. + * @function moderateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IModerateTextRequest} request ModerateTextRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.ModerateTextCallback} callback Node-style callback called with the error, if any, and ModerateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.moderateText = function moderateText(request, callback) { + return this.rpcCall(moderateText, $root.google.cloud.language.v1beta2.ModerateTextRequest, $root.google.cloud.language.v1beta2.ModerateTextResponse, request, callback); + }, "name", { value: "ModerateText" }); + + /** + * Calls ModerateText. + * @function moderateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IModerateTextRequest} request ModerateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|annotateText}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnnotateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnnotateTextResponse} [response] AnnotateTextResponse + */ + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnnotateTextCallback} callback Node-style callback called with the error, if any, and AnnotateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.annotateText = function annotateText(request, callback) { + return this.rpcCall(annotateText, $root.google.cloud.language.v1beta2.AnnotateTextRequest, $root.google.cloud.language.v1beta2.AnnotateTextResponse, request, callback); + }, "name", { value: "AnnotateText" }); + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LanguageService; })(); - v1beta2.Entity = (function() { + v1beta2.Document = (function() { /** - * Properties of an Entity. + * Properties of a Document. * @memberof google.cloud.language.v1beta2 - * @interface IEntity - * @property {string|null} [name] Entity name - * @property {google.cloud.language.v1beta2.Entity.Type|null} [type] Entity type - * @property {Object.|null} [metadata] Entity metadata - * @property {number|null} [salience] Entity salience - * @property {Array.|null} [mentions] Entity mentions - * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Entity sentiment + * @interface IDocument + * @property {google.cloud.language.v1beta2.Document.Type|null} [type] Document type + * @property {string|null} [content] Document content + * @property {string|null} [gcsContentUri] Document gcsContentUri + * @property {string|null} [language] Document language + * @property {string|null} [referenceWebUri] Document referenceWebUri + * @property {google.cloud.language.v1beta2.Document.BoilerplateHandling|null} [boilerplateHandling] Document boilerplateHandling */ /** - * Constructs a new Entity. + * Constructs a new Document. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an Entity. - * @implements IEntity + * @classdesc Represents a Document. + * @implements IDocument * @constructor - * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set */ - function Entity(properties) { - this.metadata = {}; - this.mentions = []; + function Document(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9969,168 +9853,159 @@ } /** - * Entity name. - * @member {string} name - * @memberof google.cloud.language.v1beta2.Entity + * Document type. + * @member {google.cloud.language.v1beta2.Document.Type} type + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.name = ""; + Document.prototype.type = 0; /** - * Entity type. - * @member {google.cloud.language.v1beta2.Entity.Type} type - * @memberof google.cloud.language.v1beta2.Entity + * Document content. + * @member {string|null|undefined} content + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.type = 0; + Document.prototype.content = null; /** - * Entity metadata. - * @member {Object.} metadata - * @memberof google.cloud.language.v1beta2.Entity + * Document gcsContentUri. + * @member {string|null|undefined} gcsContentUri + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.metadata = $util.emptyObject; + Document.prototype.gcsContentUri = null; /** - * Entity salience. - * @member {number} salience - * @memberof google.cloud.language.v1beta2.Entity + * Document language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.salience = 0; + Document.prototype.language = ""; /** - * Entity mentions. - * @member {Array.} mentions - * @memberof google.cloud.language.v1beta2.Entity + * Document referenceWebUri. + * @member {string} referenceWebUri + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.mentions = $util.emptyArray; + Document.prototype.referenceWebUri = ""; /** - * Entity sentiment. - * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment - * @memberof google.cloud.language.v1beta2.Entity + * Document boilerplateHandling. + * @member {google.cloud.language.v1beta2.Document.BoilerplateHandling} boilerplateHandling + * @memberof google.cloud.language.v1beta2.Document * @instance */ - Entity.prototype.sentiment = null; + Document.prototype.boilerplateHandling = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new Entity instance using the specified properties. + * Document source. + * @member {"content"|"gcsContentUri"|undefined} source + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content", "gcsContentUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static - * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.Entity} Entity instance + * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Document} Document instance */ - Entity.create = function create(properties) { - return new Entity(properties); + Document.create = function create(properties) { + return new Document(properties); }; /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static - * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode + * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encode = function encode(message, writer) { + Document.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.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); - if (message.salience != null && Object.hasOwnProperty.call(message, "salience")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.salience); - if (message.mentions != null && message.mentions.length) - for (var i = 0; i < message.mentions.length; ++i) - $root.google.cloud.language.v1beta2.EntityMention.encode(message.mentions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) - $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.gcsContentUri != null && Object.hasOwnProperty.call(message, "gcsContentUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsContentUri); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.language); + if (message.referenceWebUri != null && Object.hasOwnProperty.call(message, "referenceWebUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceWebUri); + if (message.boilerplateHandling != null && Object.hasOwnProperty.call(message, "boilerplateHandling")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.boilerplateHandling); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static - * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode + * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { + Document.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Entity message from the specified reader or buffer. + * Decodes a Document message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.Entity} Entity + * @returns {google.cloud.language.v1beta2.Document} Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decode = function decode(reader, length) { + Document.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Entity(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Document(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.type = reader.int32(); break; } case 2: { - message.type = reader.int32(); + message.content = reader.string(); break; } case 3: { - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.metadata[key] = value; + message.gcsContentUri = reader.string(); break; } case 4: { - message.salience = reader.float(); + message.language = reader.string(); break; } case 5: { - if (!(message.mentions && message.mentions.length)) - message.mentions = []; - message.mentions.push($root.google.cloud.language.v1beta2.EntityMention.decode(reader, reader.uint32())); + message.referenceWebUri = reader.string(); break; } case 6: { - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + message.boilerplateHandling = reader.int32(); break; } default: @@ -10142,35 +10017,33 @@ }; /** - * Decodes an Entity message from the specified reader or buffer, length delimited. + * Decodes a Document message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.Entity} Entity + * @returns {google.cloud.language.v1beta2.Document} Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decodeDelimited = function decodeDelimited(reader) { + Document.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Entity message. + * Verifies a Document message. * @function verify - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Entity.verify = function verify(message) { + Document.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"; + var properties = {}; if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: @@ -10178,60 +10051,50 @@ case 0: case 1: case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 9: - case 10: - case 11: - case 12: - case 13: break; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.metadata[key[i]])) - return "metadata: string{k:string} expected"; - } - if (message.salience != null && message.hasOwnProperty("salience")) - if (typeof message.salience !== "number") - return "salience: number expected"; - if (message.mentions != null && message.hasOwnProperty("mentions")) { - if (!Array.isArray(message.mentions)) - return "mentions: array expected"; - for (var i = 0; i < message.mentions.length; ++i) { - var error = $root.google.cloud.language.v1beta2.EntityMention.verify(message.mentions[i]); - if (error) - return "mentions." + error; - } + if (message.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; } - if (message.sentiment != null && message.hasOwnProperty("sentiment")) { - var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); - if (error) - return "sentiment." + error; + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsContentUri)) + return "gcsContentUri: string expected"; } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) + if (!$util.isString(message.referenceWebUri)) + return "referenceWebUri: string expected"; + if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) + switch (message.boilerplateHandling) { + default: + return "boilerplateHandling: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * Creates a Document message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.Entity} Entity + * @returns {google.cloud.language.v1beta2.Document} Document */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.Entity) + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Document) return object; - var message = new $root.google.cloud.language.v1beta2.Entity(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.language.v1beta2.Document(); switch (object.type) { default: if (typeof object.type === "number") { @@ -10239,217 +10102,170 @@ break; } break; - case "UNKNOWN": + case "TYPE_UNSPECIFIED": case 0: message.type = 0; break; - case "PERSON": + case "PLAIN_TEXT": case 1: message.type = 1; break; - case "LOCATION": + case "HTML": case 2: message.type = 2; break; - case "ORGANIZATION": - case 3: - message.type = 3; - break; - case "EVENT": - case 4: - message.type = 4; - break; - case "WORK_OF_ART": - case 5: - message.type = 5; - break; - case "CONSUMER_GOOD": - case 6: - message.type = 6; - break; - case "OTHER": - case 7: - message.type = 7; - break; - case "PHONE_NUMBER": - case 9: - message.type = 9; - break; - case "ADDRESS": - case 10: - message.type = 10; + } + if (object.content != null) + message.content = String(object.content); + if (object.gcsContentUri != null) + message.gcsContentUri = String(object.gcsContentUri); + if (object.language != null) + message.language = String(object.language); + if (object.referenceWebUri != null) + message.referenceWebUri = String(object.referenceWebUri); + switch (object.boilerplateHandling) { + default: + if (typeof object.boilerplateHandling === "number") { + message.boilerplateHandling = object.boilerplateHandling; + break; + } break; - case "DATE": - case 11: - message.type = 11; + case "BOILERPLATE_HANDLING_UNSPECIFIED": + case 0: + message.boilerplateHandling = 0; break; - case "NUMBER": - case 12: - message.type = 12; + case "SKIP_BOILERPLATE": + case 1: + message.boilerplateHandling = 1; break; - case "PRICE": - case 13: - message.type = 13; + case "KEEP_BOILERPLATE": + case 2: + message.boilerplateHandling = 2; break; } - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.language.v1beta2.Entity.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) - message.metadata[keys[i]] = String(object.metadata[keys[i]]); - } - if (object.salience != null) - message.salience = Number(object.salience); - if (object.mentions) { - if (!Array.isArray(object.mentions)) - throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: array expected"); - message.mentions = []; - for (var i = 0; i < object.mentions.length; ++i) { - if (typeof object.mentions[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: object expected"); - message.mentions[i] = $root.google.cloud.language.v1beta2.EntityMention.fromObject(object.mentions[i]); - } - } - if (object.sentiment != null) { - if (typeof object.sentiment !== "object") - throw TypeError(".google.cloud.language.v1beta2.Entity.sentiment: object expected"); - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); - } return message; }; /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. + * Creates a plain object from a Document message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static - * @param {google.cloud.language.v1beta2.Entity} message Entity + * @param {google.cloud.language.v1beta2.Document} message Document * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Entity.toObject = function toObject(message, options) { + Document.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.mentions = []; - if (options.objects || options.defaults) - object.metadata = {}; if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "UNKNOWN" : 0; - object.salience = 0; - object.sentiment = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.language = ""; + object.referenceWebUri = ""; + object.boilerplateHandling = options.enums === String ? "BOILERPLATE_HANDLING_UNSPECIFIED" : 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.language.v1beta2.Entity.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.Entity.Type[message.type] : message.type; - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = message.metadata[keys2[j]]; + object.type = options.enums === String ? $root.google.cloud.language.v1beta2.Document.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.Document.Type[message.type] : message.type; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; } - if (message.salience != null && message.hasOwnProperty("salience")) - object.salience = options.json && !isFinite(message.salience) ? String(message.salience) : message.salience; - if (message.mentions && message.mentions.length) { - object.mentions = []; - for (var j = 0; j < message.mentions.length; ++j) - object.mentions[j] = $root.google.cloud.language.v1beta2.EntityMention.toObject(message.mentions[j], options); + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + object.gcsContentUri = message.gcsContentUri; + if (options.oneofs) + object.source = "gcsContentUri"; } - if (message.sentiment != null && message.hasOwnProperty("sentiment")) - object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) + object.referenceWebUri = message.referenceWebUri; + if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) + object.boilerplateHandling = options.enums === String ? $root.google.cloud.language.v1beta2.Document.BoilerplateHandling[message.boilerplateHandling] === undefined ? message.boilerplateHandling : $root.google.cloud.language.v1beta2.Document.BoilerplateHandling[message.boilerplateHandling] : message.boilerplateHandling; return object; }; /** - * Converts this Entity to JSON. + * Converts this Document to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @instance * @returns {Object.} JSON object */ - Entity.prototype.toJSON = function toJSON() { + Document.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Entity + * Gets the default type url for Document * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.Entity + * @memberof google.cloud.language.v1beta2.Document * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.Entity"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.Document"; }; /** * Type enum. - * @name google.cloud.language.v1beta2.Entity.Type + * @name google.cloud.language.v1beta2.Document.Type * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} PERSON=1 PERSON value - * @property {number} LOCATION=2 LOCATION value - * @property {number} ORGANIZATION=3 ORGANIZATION value - * @property {number} EVENT=4 EVENT value - * @property {number} WORK_OF_ART=5 WORK_OF_ART value - * @property {number} CONSUMER_GOOD=6 CONSUMER_GOOD value - * @property {number} OTHER=7 OTHER value - * @property {number} PHONE_NUMBER=9 PHONE_NUMBER value - * @property {number} ADDRESS=10 ADDRESS value - * @property {number} DATE=11 DATE value - * @property {number} NUMBER=12 NUMBER value - * @property {number} PRICE=13 PRICE value + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PLAIN_TEXT=1 PLAIN_TEXT value + * @property {number} HTML=2 HTML value */ - Entity.Type = (function() { + Document.Type = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "PERSON"] = 1; - values[valuesById[2] = "LOCATION"] = 2; - values[valuesById[3] = "ORGANIZATION"] = 3; - values[valuesById[4] = "EVENT"] = 4; - values[valuesById[5] = "WORK_OF_ART"] = 5; - values[valuesById[6] = "CONSUMER_GOOD"] = 6; - values[valuesById[7] = "OTHER"] = 7; - values[valuesById[9] = "PHONE_NUMBER"] = 9; - values[valuesById[10] = "ADDRESS"] = 10; - values[valuesById[11] = "DATE"] = 11; - values[valuesById[12] = "NUMBER"] = 12; - values[valuesById[13] = "PRICE"] = 13; + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PLAIN_TEXT"] = 1; + values[valuesById[2] = "HTML"] = 2; return values; })(); - return Entity; + /** + * BoilerplateHandling enum. + * @name google.cloud.language.v1beta2.Document.BoilerplateHandling + * @enum {number} + * @property {number} BOILERPLATE_HANDLING_UNSPECIFIED=0 BOILERPLATE_HANDLING_UNSPECIFIED value + * @property {number} SKIP_BOILERPLATE=1 SKIP_BOILERPLATE value + * @property {number} KEEP_BOILERPLATE=2 KEEP_BOILERPLATE value + */ + Document.BoilerplateHandling = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOILERPLATE_HANDLING_UNSPECIFIED"] = 0; + values[valuesById[1] = "SKIP_BOILERPLATE"] = 1; + values[valuesById[2] = "KEEP_BOILERPLATE"] = 2; + return values; + })(); + + return Document; })(); - v1beta2.Token = (function() { + v1beta2.Sentence = (function() { /** - * Properties of a Token. + * Properties of a Sentence. * @memberof google.cloud.language.v1beta2 - * @interface IToken - * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Token text - * @property {google.cloud.language.v1beta2.IPartOfSpeech|null} [partOfSpeech] Token partOfSpeech - * @property {google.cloud.language.v1beta2.IDependencyEdge|null} [dependencyEdge] Token dependencyEdge - * @property {string|null} [lemma] Token lemma + * @interface ISentence + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Sentence text + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Sentence sentiment */ /** - * Constructs a new Token. + * Constructs a new Sentence. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a Token. - * @implements IToken + * @classdesc Represents a Sentence. + * @implements ISentence * @constructor - * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set */ - function Token(properties) { + function Sentence(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10457,100 +10273,80 @@ } /** - * Token text. + * Sentence text. * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text - * @memberof google.cloud.language.v1beta2.Token - * @instance - */ - Token.prototype.text = null; - - /** - * Token partOfSpeech. - * @member {google.cloud.language.v1beta2.IPartOfSpeech|null|undefined} partOfSpeech - * @memberof google.cloud.language.v1beta2.Token - * @instance - */ - Token.prototype.partOfSpeech = null; - - /** - * Token dependencyEdge. - * @member {google.cloud.language.v1beta2.IDependencyEdge|null|undefined} dependencyEdge - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @instance */ - Token.prototype.dependencyEdge = null; + Sentence.prototype.text = null; /** - * Token lemma. - * @member {string} lemma - * @memberof google.cloud.language.v1beta2.Token + * Sentence sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.Sentence * @instance */ - Token.prototype.lemma = ""; + Sentence.prototype.sentiment = null; /** - * Creates a new Token instance using the specified properties. + * Creates a new Sentence instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static - * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.Token} Token instance + * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Sentence} Sentence instance */ - Token.create = function create(properties) { - return new Token(properties); + Sentence.create = function create(properties) { + return new Sentence(properties); }; /** - * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static - * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode + * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Token.encode = function encode(message, writer) { + Sentence.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.text != null && Object.hasOwnProperty.call(message, "text")) $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partOfSpeech != null && Object.hasOwnProperty.call(message, "partOfSpeech")) - $root.google.cloud.language.v1beta2.PartOfSpeech.encode(message.partOfSpeech, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dependencyEdge != null && Object.hasOwnProperty.call(message, "dependencyEdge")) - $root.google.cloud.language.v1beta2.DependencyEdge.encode(message.dependencyEdge, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lemma != null && Object.hasOwnProperty.call(message, "lemma")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.lemma); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static - * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode + * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Token.encodeDelimited = function encodeDelimited(message, writer) { + Sentence.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Token message from the specified reader or buffer. + * Decodes a Sentence message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.Token} Token + * @returns {google.cloud.language.v1beta2.Sentence} Sentence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Token.decode = function decode(reader, length) { + Sentence.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Token(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentence(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10559,15 +10355,7 @@ break; } case 2: { - message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.decode(reader, reader.uint32()); - break; - } - case 3: { - message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.decode(reader, reader.uint32()); - break; - } - case 4: { - message.lemma = reader.string(); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); break; } default: @@ -10579,30 +10367,30 @@ }; /** - * Decodes a Token message from the specified reader or buffer, length delimited. + * Decodes a Sentence message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.Token} Token + * @returns {google.cloud.language.v1beta2.Sentence} Sentence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Token.decodeDelimited = function decodeDelimited(reader) { + Sentence.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Token message. + * Verifies a Sentence message. * @function verify - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Token.verify = function verify(message) { + Sentence.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.text != null && message.hasOwnProperty("text")) { @@ -10610,132 +10398,135 @@ if (error) return "text." + error; } - if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) { - var error = $root.google.cloud.language.v1beta2.PartOfSpeech.verify(message.partOfSpeech); - if (error) - return "partOfSpeech." + error; - } - if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) { - var error = $root.google.cloud.language.v1beta2.DependencyEdge.verify(message.dependencyEdge); + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); if (error) - return "dependencyEdge." + error; + return "sentiment." + error; } - if (message.lemma != null && message.hasOwnProperty("lemma")) - if (!$util.isString(message.lemma)) - return "lemma: string expected"; return null; }; /** - * Creates a Token message from a plain object. Also converts values to their respective internal types. + * Creates a Sentence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.Token} Token + * @returns {google.cloud.language.v1beta2.Sentence} Sentence */ - Token.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.Token) + Sentence.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Sentence) return object; - var message = new $root.google.cloud.language.v1beta2.Token(); + var message = new $root.google.cloud.language.v1beta2.Sentence(); if (object.text != null) { if (typeof object.text !== "object") - throw TypeError(".google.cloud.language.v1beta2.Token.text: object expected"); + throw TypeError(".google.cloud.language.v1beta2.Sentence.text: object expected"); message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); } - if (object.partOfSpeech != null) { - if (typeof object.partOfSpeech !== "object") - throw TypeError(".google.cloud.language.v1beta2.Token.partOfSpeech: object expected"); - message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.fromObject(object.partOfSpeech); - } - if (object.dependencyEdge != null) { - if (typeof object.dependencyEdge !== "object") - throw TypeError(".google.cloud.language.v1beta2.Token.dependencyEdge: object expected"); - message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.fromObject(object.dependencyEdge); + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.Sentence.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); } - if (object.lemma != null) - message.lemma = String(object.lemma); return message; }; /** - * Creates a plain object from a Token message. Also converts values to other types if specified. + * Creates a plain object from a Sentence message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static - * @param {google.cloud.language.v1beta2.Token} message Token + * @param {google.cloud.language.v1beta2.Sentence} message Sentence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Token.toObject = function toObject(message, options) { + Sentence.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.text = null; - object.partOfSpeech = null; - object.dependencyEdge = null; - object.lemma = ""; + object.sentiment = null; } if (message.text != null && message.hasOwnProperty("text")) object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); - if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) - object.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.toObject(message.partOfSpeech, options); - if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) - object.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.toObject(message.dependencyEdge, options); - if (message.lemma != null && message.hasOwnProperty("lemma")) - object.lemma = message.lemma; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); return object; }; /** - * Converts this Token to JSON. + * Converts this Sentence to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @instance * @returns {Object.} JSON object */ - Token.prototype.toJSON = function toJSON() { + Sentence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Token + * Gets the default type url for Sentence * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.Token + * @memberof google.cloud.language.v1beta2.Sentence * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Sentence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.Token"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentence"; }; - return Token; + return Sentence; })(); - v1beta2.Sentiment = (function() { + /** + * EncodingType enum. + * @name google.cloud.language.v1beta2.EncodingType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} UTF8=1 UTF8 value + * @property {number} UTF16=2 UTF16 value + * @property {number} UTF32=3 UTF32 value + */ + v1beta2.EncodingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "UTF8"] = 1; + values[valuesById[2] = "UTF16"] = 2; + values[valuesById[3] = "UTF32"] = 3; + return values; + })(); + + v1beta2.Entity = (function() { /** - * Properties of a Sentiment. + * Properties of an Entity. * @memberof google.cloud.language.v1beta2 - * @interface ISentiment - * @property {number|null} [magnitude] Sentiment magnitude - * @property {number|null} [score] Sentiment score + * @interface IEntity + * @property {string|null} [name] Entity name + * @property {google.cloud.language.v1beta2.Entity.Type|null} [type] Entity type + * @property {Object.|null} [metadata] Entity metadata + * @property {number|null} [salience] Entity salience + * @property {Array.|null} [mentions] Entity mentions + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Entity sentiment */ /** - * Constructs a new Sentiment. + * Constructs a new Entity. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a Sentiment. - * @implements ISentiment + * @classdesc Represents an Entity. + * @implements IEntity * @constructor - * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set */ - function Sentiment(properties) { + function Entity(properties) { + this.metadata = {}; + this.mentions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10743,89 +10534,168 @@ } /** - * Sentiment magnitude. - * @member {number} magnitude - * @memberof google.cloud.language.v1beta2.Sentiment + * Entity name. + * @member {string} name + * @memberof google.cloud.language.v1beta2.Entity * @instance */ - Sentiment.prototype.magnitude = 0; + Entity.prototype.name = ""; /** - * Sentiment score. - * @member {number} score - * @memberof google.cloud.language.v1beta2.Sentiment + * Entity type. + * @member {google.cloud.language.v1beta2.Entity.Type} type + * @memberof google.cloud.language.v1beta2.Entity * @instance */ - Sentiment.prototype.score = 0; + Entity.prototype.type = 0; /** - * Creates a new Sentiment instance using the specified properties. + * Entity metadata. + * @member {Object.} metadata + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.metadata = $util.emptyObject; + + /** + * Entity salience. + * @member {number} salience + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.salience = 0; + + /** + * Entity mentions. + * @member {Array.} mentions + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.mentions = $util.emptyArray; + + /** + * Entity sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.sentiment = null; + + /** + * Creates a new Entity instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static - * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment instance + * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Entity} Entity instance */ - Sentiment.create = function create(properties) { - return new Sentiment(properties); + Entity.create = function create(properties) { + return new Entity(properties); }; /** - * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static - * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sentiment.encode = function encode(message, writer) { + Entity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.salience != null && Object.hasOwnProperty.call(message, "salience")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.salience); + if (message.mentions != null && message.mentions.length) + for (var i = 0; i < message.mentions.length; ++i) + $root.google.cloud.language.v1beta2.EntityMention.encode(message.mentions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static - * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + Entity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Sentiment message from the specified reader or buffer. + * Decodes an Entity message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @returns {google.cloud.language.v1beta2.Entity} Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sentiment.decode = function decode(reader, length) { + Entity.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentiment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Entity(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } case 2: { - message.magnitude = reader.float(); + message.type = reader.int32(); break; } case 3: { - message.score = reader.float(); + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 4: { + message.salience = reader.float(); + break; + } + case 5: { + if (!(message.mentions && message.mentions.length)) + message.mentions = []; + message.mentions.push($root.google.cloud.language.v1beta2.EntityMention.decode(reader, reader.uint32())); + break; + } + case 6: { + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); break; } default: @@ -10837,142 +10707,314 @@ }; /** - * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * Decodes an Entity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @returns {google.cloud.language.v1beta2.Entity} Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sentiment.decodeDelimited = function decodeDelimited(reader) { + Entity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Sentiment message. + * Verifies an Entity message. * @function verify - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Sentiment.verify = function verify(message) { + Entity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - if (typeof message.magnitude !== "number") - return "magnitude: number expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.salience != null && message.hasOwnProperty("salience")) + if (typeof message.salience !== "number") + return "salience: number expected"; + if (message.mentions != null && message.hasOwnProperty("mentions")) { + if (!Array.isArray(message.mentions)) + return "mentions: array expected"; + for (var i = 0; i < message.mentions.length; ++i) { + var error = $root.google.cloud.language.v1beta2.EntityMention.verify(message.mentions[i]); + if (error) + return "mentions." + error; + } + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } return null; }; /** - * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * Creates an Entity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @returns {google.cloud.language.v1beta2.Entity} Entity */ - Sentiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.Sentiment) + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Entity) return object; - var message = new $root.google.cloud.language.v1beta2.Sentiment(); - if (object.magnitude != null) - message.magnitude = Number(object.magnitude); - if (object.score != null) - message.score = Number(object.score); + var message = new $root.google.cloud.language.v1beta2.Entity(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "PERSON": + case 1: + message.type = 1; + break; + case "LOCATION": + case 2: + message.type = 2; + break; + case "ORGANIZATION": + case 3: + message.type = 3; + break; + case "EVENT": + case 4: + message.type = 4; + break; + case "WORK_OF_ART": + case 5: + message.type = 5; + break; + case "CONSUMER_GOOD": + case 6: + message.type = 6; + break; + case "OTHER": + case 7: + message.type = 7; + break; + case "PHONE_NUMBER": + case 9: + message.type = 9; + break; + case "ADDRESS": + case 10: + message.type = 10; + break; + case "DATE": + case 11: + message.type = 11; + break; + case "NUMBER": + case 12: + message.type = 12; + break; + case "PRICE": + case 13: + message.type = 13; + break; + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.salience != null) + message.salience = Number(object.salience); + if (object.mentions) { + if (!Array.isArray(object.mentions)) + throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: array expected"); + message.mentions = []; + for (var i = 0; i < object.mentions.length; ++i) { + if (typeof object.mentions[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: object expected"); + message.mentions[i] = $root.google.cloud.language.v1beta2.EntityMention.fromObject(object.mentions[i]); + } + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); + } return message; }; /** - * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * Creates a plain object from an Entity message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static - * @param {google.cloud.language.v1beta2.Sentiment} message Sentiment + * @param {google.cloud.language.v1beta2.Entity} message Entity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Sentiment.toObject = function toObject(message, options) { + Entity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.mentions = []; + if (options.objects || options.defaults) + object.metadata = {}; if (options.defaults) { - object.magnitude = 0; - object.score = 0; + object.name = ""; + object.type = options.enums === String ? "UNKNOWN" : 0; + object.salience = 0; + object.sentiment = null; } - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1beta2.Entity.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.Entity.Type[message.type] : message.type; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.salience != null && message.hasOwnProperty("salience")) + object.salience = options.json && !isFinite(message.salience) ? String(message.salience) : message.salience; + if (message.mentions && message.mentions.length) { + object.mentions = []; + for (var j = 0; j < message.mentions.length; ++j) + object.mentions[j] = $root.google.cloud.language.v1beta2.EntityMention.toObject(message.mentions[j], options); + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); return object; }; /** - * Converts this Sentiment to JSON. + * Converts this Entity to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @instance * @returns {Object.} JSON object */ - Sentiment.prototype.toJSON = function toJSON() { + Entity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Sentiment + * Gets the default type url for Entity * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.Sentiment + * @memberof google.cloud.language.v1beta2.Entity * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Sentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentiment"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.Entity"; }; - return Sentiment; + /** + * Type enum. + * @name google.cloud.language.v1beta2.Entity.Type + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PERSON=1 PERSON value + * @property {number} LOCATION=2 LOCATION value + * @property {number} ORGANIZATION=3 ORGANIZATION value + * @property {number} EVENT=4 EVENT value + * @property {number} WORK_OF_ART=5 WORK_OF_ART value + * @property {number} CONSUMER_GOOD=6 CONSUMER_GOOD value + * @property {number} OTHER=7 OTHER value + * @property {number} PHONE_NUMBER=9 PHONE_NUMBER value + * @property {number} ADDRESS=10 ADDRESS value + * @property {number} DATE=11 DATE value + * @property {number} NUMBER=12 NUMBER value + * @property {number} PRICE=13 PRICE value + */ + Entity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PERSON"] = 1; + values[valuesById[2] = "LOCATION"] = 2; + values[valuesById[3] = "ORGANIZATION"] = 3; + values[valuesById[4] = "EVENT"] = 4; + values[valuesById[5] = "WORK_OF_ART"] = 5; + values[valuesById[6] = "CONSUMER_GOOD"] = 6; + values[valuesById[7] = "OTHER"] = 7; + values[valuesById[9] = "PHONE_NUMBER"] = 9; + values[valuesById[10] = "ADDRESS"] = 10; + values[valuesById[11] = "DATE"] = 11; + values[valuesById[12] = "NUMBER"] = 12; + values[valuesById[13] = "PRICE"] = 13; + return values; + })(); + + return Entity; })(); - v1beta2.PartOfSpeech = (function() { + v1beta2.Token = (function() { /** - * Properties of a PartOfSpeech. + * Properties of a Token. * @memberof google.cloud.language.v1beta2 - * @interface IPartOfSpeech - * @property {google.cloud.language.v1beta2.PartOfSpeech.Tag|null} [tag] PartOfSpeech tag - * @property {google.cloud.language.v1beta2.PartOfSpeech.Aspect|null} [aspect] PartOfSpeech aspect - * @property {google.cloud.language.v1beta2.PartOfSpeech.Case|null} ["case"] PartOfSpeech case - * @property {google.cloud.language.v1beta2.PartOfSpeech.Form|null} [form] PartOfSpeech form - * @property {google.cloud.language.v1beta2.PartOfSpeech.Gender|null} [gender] PartOfSpeech gender - * @property {google.cloud.language.v1beta2.PartOfSpeech.Mood|null} [mood] PartOfSpeech mood - * @property {google.cloud.language.v1beta2.PartOfSpeech.Number|null} [number] PartOfSpeech number - * @property {google.cloud.language.v1beta2.PartOfSpeech.Person|null} [person] PartOfSpeech person - * @property {google.cloud.language.v1beta2.PartOfSpeech.Proper|null} [proper] PartOfSpeech proper - * @property {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|null} [reciprocity] PartOfSpeech reciprocity - * @property {google.cloud.language.v1beta2.PartOfSpeech.Tense|null} [tense] PartOfSpeech tense - * @property {google.cloud.language.v1beta2.PartOfSpeech.Voice|null} [voice] PartOfSpeech voice + * @interface IToken + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Token text + * @property {google.cloud.language.v1beta2.IPartOfSpeech|null} [partOfSpeech] Token partOfSpeech + * @property {google.cloud.language.v1beta2.IDependencyEdge|null} [dependencyEdge] Token dependencyEdge + * @property {string|null} [lemma] Token lemma */ /** - * Constructs a new PartOfSpeech. + * Constructs a new Token. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a PartOfSpeech. - * @implements IPartOfSpeech + * @classdesc Represents a Token. + * @implements IToken * @constructor - * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set */ - function PartOfSpeech(properties) { + function Token(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10980,229 +11022,117 @@ } /** - * PartOfSpeech tag. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Tag} tag - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.tag = 0; - - /** - * PartOfSpeech aspect. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Aspect} aspect - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.aspect = 0; - - /** - * PartOfSpeech case. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Case} case - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype["case"] = 0; - - /** - * PartOfSpeech form. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Form} form - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.form = 0; - - /** - * PartOfSpeech gender. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Gender} gender - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.gender = 0; - - /** - * PartOfSpeech mood. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Mood} mood - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.mood = 0; - - /** - * PartOfSpeech number. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Number} number - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.number = 0; - - /** - * PartOfSpeech person. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Person} person - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @instance - */ - PartOfSpeech.prototype.person = 0; - - /** - * PartOfSpeech proper. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Proper} proper - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * Token text. + * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1beta2.Token * @instance */ - PartOfSpeech.prototype.proper = 0; + Token.prototype.text = null; /** - * PartOfSpeech reciprocity. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity} reciprocity - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * Token partOfSpeech. + * @member {google.cloud.language.v1beta2.IPartOfSpeech|null|undefined} partOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @instance */ - PartOfSpeech.prototype.reciprocity = 0; + Token.prototype.partOfSpeech = null; /** - * PartOfSpeech tense. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Tense} tense - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * Token dependencyEdge. + * @member {google.cloud.language.v1beta2.IDependencyEdge|null|undefined} dependencyEdge + * @memberof google.cloud.language.v1beta2.Token * @instance */ - PartOfSpeech.prototype.tense = 0; + Token.prototype.dependencyEdge = null; /** - * PartOfSpeech voice. - * @member {google.cloud.language.v1beta2.PartOfSpeech.Voice} voice - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * Token lemma. + * @member {string} lemma + * @memberof google.cloud.language.v1beta2.Token * @instance */ - PartOfSpeech.prototype.voice = 0; + Token.prototype.lemma = ""; /** - * Creates a new PartOfSpeech instance using the specified properties. + * Creates a new Token instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static - * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech instance + * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Token} Token instance */ - PartOfSpeech.create = function create(properties) { - return new PartOfSpeech(properties); + Token.create = function create(properties) { + return new Token(properties); }; /** - * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static - * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartOfSpeech.encode = function encode(message, writer) { + Token.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tag); - if (message.aspect != null && Object.hasOwnProperty.call(message, "aspect")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.aspect); - if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message["case"]); - if (message.form != null && Object.hasOwnProperty.call(message, "form")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.form); - if (message.gender != null && Object.hasOwnProperty.call(message, "gender")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.gender); - if (message.mood != null && Object.hasOwnProperty.call(message, "mood")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.mood); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.number); - if (message.person != null && Object.hasOwnProperty.call(message, "person")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.person); - if (message.proper != null && Object.hasOwnProperty.call(message, "proper")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.proper); - if (message.reciprocity != null && Object.hasOwnProperty.call(message, "reciprocity")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.reciprocity); - if (message.tense != null && Object.hasOwnProperty.call(message, "tense")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.tense); - if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.voice); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partOfSpeech != null && Object.hasOwnProperty.call(message, "partOfSpeech")) + $root.google.cloud.language.v1beta2.PartOfSpeech.encode(message.partOfSpeech, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dependencyEdge != null && Object.hasOwnProperty.call(message, "dependencyEdge")) + $root.google.cloud.language.v1beta2.DependencyEdge.encode(message.dependencyEdge, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lemma != null && Object.hasOwnProperty.call(message, "lemma")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.lemma); return writer; }; /** - * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static - * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartOfSpeech.encodeDelimited = function encodeDelimited(message, writer) { + Token.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartOfSpeech message from the specified reader or buffer. + * Decodes a Token message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @returns {google.cloud.language.v1beta2.Token} Token * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartOfSpeech.decode = function decode(reader, length) { + Token.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Token(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tag = reader.int32(); + message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); break; } case 2: { - message.aspect = reader.int32(); + message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.decode(reader, reader.uint32()); break; } case 3: { - message["case"] = reader.int32(); + message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.decode(reader, reader.uint32()); break; } case 4: { - message.form = reader.int32(); - break; - } - case 5: { - message.gender = reader.int32(); - break; - } - case 6: { - message.mood = reader.int32(); - break; - } - case 7: { - message.number = reader.int32(); - break; - } - case 8: { - message.person = reader.int32(); - break; - } - case 9: { - message.proper = reader.int32(); - break; - } - case 10: { - message.reciprocity = reader.int32(); - break; - } - case 11: { - message.tense = reader.int32(); - break; - } - case 12: { - message.voice = reader.int32(); + message.lemma = reader.string(); break; } default: @@ -11214,1014 +11144,400 @@ }; /** - * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. + * Decodes a Token message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @returns {google.cloud.language.v1beta2.Token} Token * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartOfSpeech.decodeDelimited = function decodeDelimited(reader) { + Token.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartOfSpeech message. + * Verifies a Token message. * @function verify - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartOfSpeech.verify = function verify(message) { + Token.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - switch (message.tag) { - default: - return "tag: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - break; - } - if (message.aspect != null && message.hasOwnProperty("aspect")) - switch (message.aspect) { - default: - return "aspect: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message["case"] != null && message.hasOwnProperty("case")) - switch (message["case"]) { - default: - return "case: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - break; - } - if (message.form != null && message.hasOwnProperty("form")) - switch (message.form) { - default: - return "form: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - break; - } - if (message.gender != null && message.hasOwnProperty("gender")) - switch (message.gender) { - default: - return "gender: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.mood != null && message.hasOwnProperty("mood")) - switch (message.mood) { - default: - return "mood: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.number != null && message.hasOwnProperty("number")) - switch (message.number) { - default: - return "number: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.person != null && message.hasOwnProperty("person")) - switch (message.person) { - default: - return "person: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.proper != null && message.hasOwnProperty("proper")) - switch (message.proper) { - default: - return "proper: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) - switch (message.reciprocity) { - default: - return "reciprocity: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.tense != null && message.hasOwnProperty("tense")) - switch (message.tense) { - default: - return "tense: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.voice != null && message.hasOwnProperty("voice")) - switch (message.voice) { - default: - return "voice: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) { + var error = $root.google.cloud.language.v1beta2.PartOfSpeech.verify(message.partOfSpeech); + if (error) + return "partOfSpeech." + error; + } + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) { + var error = $root.google.cloud.language.v1beta2.DependencyEdge.verify(message.dependencyEdge); + if (error) + return "dependencyEdge." + error; + } + if (message.lemma != null && message.hasOwnProperty("lemma")) + if (!$util.isString(message.lemma)) + return "lemma: string expected"; return null; }; /** - * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. + * Creates a Token message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @memberof google.cloud.language.v1beta2.Token * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @returns {google.cloud.language.v1beta2.Token} Token */ - PartOfSpeech.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.PartOfSpeech) + Token.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Token) return object; - var message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); - switch (object.tag) { - default: - if (typeof object.tag === "number") { - message.tag = object.tag; - break; - } - break; - case "UNKNOWN": - case 0: - message.tag = 0; - break; - case "ADJ": - case 1: - message.tag = 1; - break; - case "ADP": - case 2: - message.tag = 2; - break; - case "ADV": - case 3: - message.tag = 3; - break; - case "CONJ": - case 4: - message.tag = 4; - break; - case "DET": - case 5: - message.tag = 5; - break; - case "NOUN": - case 6: - message.tag = 6; - break; - case "NUM": - case 7: - message.tag = 7; - break; - case "PRON": - case 8: - message.tag = 8; - break; - case "PRT": - case 9: - message.tag = 9; - break; - case "PUNCT": - case 10: - message.tag = 10; - break; - case "VERB": - case 11: - message.tag = 11; - break; - case "X": - case 12: - message.tag = 12; - break; - case "AFFIX": - case 13: - message.tag = 13; - break; + var message = new $root.google.cloud.language.v1beta2.Token(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.text: object expected"); + message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); } - switch (object.aspect) { - default: - if (typeof object.aspect === "number") { - message.aspect = object.aspect; - break; - } - break; - case "ASPECT_UNKNOWN": - case 0: - message.aspect = 0; - break; - case "PERFECTIVE": - case 1: - message.aspect = 1; - break; - case "IMPERFECTIVE": - case 2: - message.aspect = 2; - break; - case "PROGRESSIVE": - case 3: - message.aspect = 3; - break; - } - switch (object["case"]) { - default: - if (typeof object["case"] === "number") { - message["case"] = object["case"]; - break; - } - break; - case "CASE_UNKNOWN": - case 0: - message["case"] = 0; - break; - case "ACCUSATIVE": - case 1: - message["case"] = 1; - break; - case "ADVERBIAL": - case 2: - message["case"] = 2; - break; - case "COMPLEMENTIVE": - case 3: - message["case"] = 3; - break; - case "DATIVE": - case 4: - message["case"] = 4; - break; - case "GENITIVE": - case 5: - message["case"] = 5; - break; - case "INSTRUMENTAL": - case 6: - message["case"] = 6; - break; - case "LOCATIVE": - case 7: - message["case"] = 7; - break; - case "NOMINATIVE": - case 8: - message["case"] = 8; - break; - case "OBLIQUE": - case 9: - message["case"] = 9; - break; - case "PARTITIVE": - case 10: - message["case"] = 10; - break; - case "PREPOSITIONAL": - case 11: - message["case"] = 11; - break; - case "REFLEXIVE_CASE": - case 12: - message["case"] = 12; - break; - case "RELATIVE_CASE": - case 13: - message["case"] = 13; - break; - case "VOCATIVE": - case 14: - message["case"] = 14; - break; + if (object.partOfSpeech != null) { + if (typeof object.partOfSpeech !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.partOfSpeech: object expected"); + message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.fromObject(object.partOfSpeech); } - switch (object.form) { - default: - if (typeof object.form === "number") { - message.form = object.form; - break; - } - break; - case "FORM_UNKNOWN": - case 0: - message.form = 0; - break; - case "ADNOMIAL": - case 1: - message.form = 1; - break; - case "AUXILIARY": - case 2: - message.form = 2; - break; - case "COMPLEMENTIZER": - case 3: - message.form = 3; - break; - case "FINAL_ENDING": - case 4: - message.form = 4; - break; - case "GERUND": - case 5: - message.form = 5; - break; - case "REALIS": - case 6: - message.form = 6; - break; - case "IRREALIS": - case 7: - message.form = 7; - break; - case "SHORT": - case 8: - message.form = 8; - break; - case "LONG": - case 9: - message.form = 9; - break; - case "ORDER": - case 10: - message.form = 10; - break; - case "SPECIFIC": - case 11: - message.form = 11; - break; + if (object.dependencyEdge != null) { + if (typeof object.dependencyEdge !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.dependencyEdge: object expected"); + message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.fromObject(object.dependencyEdge); } - switch (object.gender) { - default: - if (typeof object.gender === "number") { - message.gender = object.gender; - break; - } - break; - case "GENDER_UNKNOWN": - case 0: - message.gender = 0; - break; - case "FEMININE": - case 1: - message.gender = 1; - break; - case "MASCULINE": - case 2: - message.gender = 2; - break; - case "NEUTER": - case 3: - message.gender = 3; - break; + if (object.lemma != null) + message.lemma = String(object.lemma); + return message; + }; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {google.cloud.language.v1beta2.Token} message Token + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Token.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.partOfSpeech = null; + object.dependencyEdge = null; + object.lemma = ""; } - switch (object.mood) { - default: - if (typeof object.mood === "number") { - message.mood = object.mood; - break; - } - break; - case "MOOD_UNKNOWN": - case 0: - message.mood = 0; - break; - case "CONDITIONAL_MOOD": - case 1: - message.mood = 1; - break; - case "IMPERATIVE": - case 2: - message.mood = 2; - break; - case "INDICATIVE": - case 3: - message.mood = 3; - break; - case "INTERROGATIVE": - case 4: - message.mood = 4; - break; - case "JUSSIVE": - case 5: - message.mood = 5; - break; - case "SUBJUNCTIVE": - case 6: - message.mood = 6; - break; + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) + object.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.toObject(message.partOfSpeech, options); + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) + object.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.toObject(message.dependencyEdge, options); + if (message.lemma != null && message.hasOwnProperty("lemma")) + object.lemma = message.lemma; + return object; + }; + + /** + * Converts this Token to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Token + * @instance + * @returns {Object.} JSON object + */ + Token.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Token + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - switch (object.number) { - default: - if (typeof object.number === "number") { - message.number = object.number; - break; - } - break; - case "NUMBER_UNKNOWN": - case 0: - message.number = 0; - break; - case "SINGULAR": - case 1: - message.number = 1; - break; - case "PLURAL": - case 2: - message.number = 2; - break; - case "DUAL": - case 3: - message.number = 3; - break; - } - switch (object.person) { - default: - if (typeof object.person === "number") { - message.person = object.person; - break; - } - break; - case "PERSON_UNKNOWN": - case 0: - message.person = 0; - break; - case "FIRST": - case 1: - message.person = 1; - break; - case "SECOND": - case 2: - message.person = 2; - break; - case "THIRD": - case 3: - message.person = 3; - break; - case "REFLEXIVE_PERSON": - case 4: - message.person = 4; - break; - } - switch (object.proper) { - default: - if (typeof object.proper === "number") { - message.proper = object.proper; - break; - } - break; - case "PROPER_UNKNOWN": - case 0: - message.proper = 0; - break; - case "PROPER": - case 1: - message.proper = 1; - break; - case "NOT_PROPER": - case 2: - message.proper = 2; - break; - } - switch (object.reciprocity) { - default: - if (typeof object.reciprocity === "number") { - message.reciprocity = object.reciprocity; - break; - } - break; - case "RECIPROCITY_UNKNOWN": - case 0: - message.reciprocity = 0; - break; - case "RECIPROCAL": - case 1: - message.reciprocity = 1; - break; - case "NON_RECIPROCAL": - case 2: - message.reciprocity = 2; - break; - } - switch (object.tense) { - default: - if (typeof object.tense === "number") { - message.tense = object.tense; - break; - } - break; - case "TENSE_UNKNOWN": - case 0: - message.tense = 0; - break; - case "CONDITIONAL_TENSE": - case 1: - message.tense = 1; - break; - case "FUTURE": - case 2: - message.tense = 2; - break; - case "PAST": - case 3: - message.tense = 3; - break; - case "PRESENT": - case 4: - message.tense = 4; - break; - case "IMPERFECT": - case 5: - message.tense = 5; - break; - case "PLUPERFECT": - case 6: - message.tense = 6; - break; - } - switch (object.voice) { - default: - if (typeof object.voice === "number") { - message.voice = object.voice; - break; - } - break; - case "VOICE_UNKNOWN": - case 0: - message.voice = 0; - break; - case "ACTIVE": - case 1: - message.voice = 1; - break; - case "CAUSATIVE": - case 2: - message.voice = 2; - break; - case "PASSIVE": - case 3: - message.voice = 3; - break; - } - return message; + return typeUrlPrefix + "/google.cloud.language.v1beta2.Token"; }; + return Token; + })(); + + v1beta2.Sentiment = (function() { + /** - * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @static - * @param {google.cloud.language.v1beta2.PartOfSpeech} message PartOfSpeech - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Properties of a Sentiment. + * @memberof google.cloud.language.v1beta2 + * @interface ISentiment + * @property {number|null} [magnitude] Sentiment magnitude + * @property {number|null} [score] Sentiment score */ - PartOfSpeech.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tag = options.enums === String ? "UNKNOWN" : 0; - object.aspect = options.enums === String ? "ASPECT_UNKNOWN" : 0; - object["case"] = options.enums === String ? "CASE_UNKNOWN" : 0; - object.form = options.enums === String ? "FORM_UNKNOWN" : 0; - object.gender = options.enums === String ? "GENDER_UNKNOWN" : 0; - object.mood = options.enums === String ? "MOOD_UNKNOWN" : 0; - object.number = options.enums === String ? "NUMBER_UNKNOWN" : 0; - object.person = options.enums === String ? "PERSON_UNKNOWN" : 0; - object.proper = options.enums === String ? "PROPER_UNKNOWN" : 0; - object.reciprocity = options.enums === String ? "RECIPROCITY_UNKNOWN" : 0; - object.tense = options.enums === String ? "TENSE_UNKNOWN" : 0; - object.voice = options.enums === String ? "VOICE_UNKNOWN" : 0; - } - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tag[message.tag] === undefined ? message.tag : $root.google.cloud.language.v1beta2.PartOfSpeech.Tag[message.tag] : message.tag; - if (message.aspect != null && message.hasOwnProperty("aspect")) - object.aspect = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Aspect[message.aspect] === undefined ? message.aspect : $root.google.cloud.language.v1beta2.PartOfSpeech.Aspect[message.aspect] : message.aspect; - if (message["case"] != null && message.hasOwnProperty("case")) - object["case"] = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Case[message["case"]] === undefined ? message["case"] : $root.google.cloud.language.v1beta2.PartOfSpeech.Case[message["case"]] : message["case"]; - if (message.form != null && message.hasOwnProperty("form")) - object.form = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Form[message.form] === undefined ? message.form : $root.google.cloud.language.v1beta2.PartOfSpeech.Form[message.form] : message.form; - if (message.gender != null && message.hasOwnProperty("gender")) - object.gender = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Gender[message.gender] === undefined ? message.gender : $root.google.cloud.language.v1beta2.PartOfSpeech.Gender[message.gender] : message.gender; - if (message.mood != null && message.hasOwnProperty("mood")) - object.mood = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Mood[message.mood] === undefined ? message.mood : $root.google.cloud.language.v1beta2.PartOfSpeech.Mood[message.mood] : message.mood; - if (message.number != null && message.hasOwnProperty("number")) - object.number = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Number[message.number] === undefined ? message.number : $root.google.cloud.language.v1beta2.PartOfSpeech.Number[message.number] : message.number; - if (message.person != null && message.hasOwnProperty("person")) - object.person = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Person[message.person] === undefined ? message.person : $root.google.cloud.language.v1beta2.PartOfSpeech.Person[message.person] : message.person; - if (message.proper != null && message.hasOwnProperty("proper")) - object.proper = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Proper[message.proper] === undefined ? message.proper : $root.google.cloud.language.v1beta2.PartOfSpeech.Proper[message.proper] : message.proper; - if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) - object.reciprocity = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity[message.reciprocity] === undefined ? message.reciprocity : $root.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity[message.reciprocity] : message.reciprocity; - if (message.tense != null && message.hasOwnProperty("tense")) - object.tense = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tense[message.tense] === undefined ? message.tense : $root.google.cloud.language.v1beta2.PartOfSpeech.Tense[message.tense] : message.tense; - if (message.voice != null && message.hasOwnProperty("voice")) - object.voice = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Voice[message.voice] === undefined ? message.voice : $root.google.cloud.language.v1beta2.PartOfSpeech.Voice[message.voice] : message.voice; - return object; - }; /** - * Converts this PartOfSpeech to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.PartOfSpeech + * Constructs a new Sentiment. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a Sentiment. + * @implements ISentiment + * @constructor + * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set + */ + function Sentiment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Sentiment magnitude. + * @member {number} magnitude + * @memberof google.cloud.language.v1beta2.Sentiment * @instance - * @returns {Object.} JSON object */ - PartOfSpeech.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Sentiment.prototype.magnitude = 0; /** - * Gets the default type url for PartOfSpeech - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.PartOfSpeech - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Sentiment score. + * @member {number} score + * @memberof google.cloud.language.v1beta2.Sentiment + * @instance */ - PartOfSpeech.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.PartOfSpeech"; - }; + Sentiment.prototype.score = 0; /** - * Tag enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Tag - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ADJ=1 ADJ value - * @property {number} ADP=2 ADP value - * @property {number} ADV=3 ADV value - * @property {number} CONJ=4 CONJ value - * @property {number} DET=5 DET value - * @property {number} NOUN=6 NOUN value - * @property {number} NUM=7 NUM value - * @property {number} PRON=8 PRON value - * @property {number} PRT=9 PRT value - * @property {number} PUNCT=10 PUNCT value - * @property {number} VERB=11 VERB value - * @property {number} X=12 X value - * @property {number} AFFIX=13 AFFIX value + * Creates a new Sentiment instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment instance */ - PartOfSpeech.Tag = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ADJ"] = 1; - values[valuesById[2] = "ADP"] = 2; - values[valuesById[3] = "ADV"] = 3; - values[valuesById[4] = "CONJ"] = 4; - values[valuesById[5] = "DET"] = 5; - values[valuesById[6] = "NOUN"] = 6; - values[valuesById[7] = "NUM"] = 7; - values[valuesById[8] = "PRON"] = 8; - values[valuesById[9] = "PRT"] = 9; - values[valuesById[10] = "PUNCT"] = 10; - values[valuesById[11] = "VERB"] = 11; - values[valuesById[12] = "X"] = 12; - values[valuesById[13] = "AFFIX"] = 13; - return values; - })(); + Sentiment.create = function create(properties) { + return new Sentiment(properties); + }; /** - * Aspect enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Aspect - * @enum {number} - * @property {number} ASPECT_UNKNOWN=0 ASPECT_UNKNOWN value - * @property {number} PERFECTIVE=1 PERFECTIVE value - * @property {number} IMPERFECTIVE=2 IMPERFECTIVE value - * @property {number} PROGRESSIVE=3 PROGRESSIVE value + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PartOfSpeech.Aspect = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ASPECT_UNKNOWN"] = 0; - values[valuesById[1] = "PERFECTIVE"] = 1; - values[valuesById[2] = "IMPERFECTIVE"] = 2; - values[valuesById[3] = "PROGRESSIVE"] = 3; - return values; - })(); + Sentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + return writer; + }; /** - * Case enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Case - * @enum {number} - * @property {number} CASE_UNKNOWN=0 CASE_UNKNOWN value - * @property {number} ACCUSATIVE=1 ACCUSATIVE value - * @property {number} ADVERBIAL=2 ADVERBIAL value - * @property {number} COMPLEMENTIVE=3 COMPLEMENTIVE value - * @property {number} DATIVE=4 DATIVE value - * @property {number} GENITIVE=5 GENITIVE value - * @property {number} INSTRUMENTAL=6 INSTRUMENTAL value - * @property {number} LOCATIVE=7 LOCATIVE value - * @property {number} NOMINATIVE=8 NOMINATIVE value - * @property {number} OBLIQUE=9 OBLIQUE value - * @property {number} PARTITIVE=10 PARTITIVE value - * @property {number} PREPOSITIONAL=11 PREPOSITIONAL value - * @property {number} REFLEXIVE_CASE=12 REFLEXIVE_CASE value - * @property {number} RELATIVE_CASE=13 RELATIVE_CASE value - * @property {number} VOCATIVE=14 VOCATIVE value + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PartOfSpeech.Case = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CASE_UNKNOWN"] = 0; - values[valuesById[1] = "ACCUSATIVE"] = 1; - values[valuesById[2] = "ADVERBIAL"] = 2; - values[valuesById[3] = "COMPLEMENTIVE"] = 3; - values[valuesById[4] = "DATIVE"] = 4; - values[valuesById[5] = "GENITIVE"] = 5; - values[valuesById[6] = "INSTRUMENTAL"] = 6; - values[valuesById[7] = "LOCATIVE"] = 7; - values[valuesById[8] = "NOMINATIVE"] = 8; - values[valuesById[9] = "OBLIQUE"] = 9; - values[valuesById[10] = "PARTITIVE"] = 10; - values[valuesById[11] = "PREPOSITIONAL"] = 11; - values[valuesById[12] = "REFLEXIVE_CASE"] = 12; - values[valuesById[13] = "RELATIVE_CASE"] = 13; - values[valuesById[14] = "VOCATIVE"] = 14; - return values; - })(); + Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Form enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Form - * @enum {number} - * @property {number} FORM_UNKNOWN=0 FORM_UNKNOWN value - * @property {number} ADNOMIAL=1 ADNOMIAL value - * @property {number} AUXILIARY=2 AUXILIARY value - * @property {number} COMPLEMENTIZER=3 COMPLEMENTIZER value - * @property {number} FINAL_ENDING=4 FINAL_ENDING value - * @property {number} GERUND=5 GERUND value - * @property {number} REALIS=6 REALIS value - * @property {number} IRREALIS=7 IRREALIS value - * @property {number} SHORT=8 SHORT value - * @property {number} LONG=9 LONG value - * @property {number} ORDER=10 ORDER value - * @property {number} SPECIFIC=11 SPECIFIC value + * Decodes a Sentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartOfSpeech.Form = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORM_UNKNOWN"] = 0; - values[valuesById[1] = "ADNOMIAL"] = 1; - values[valuesById[2] = "AUXILIARY"] = 2; - values[valuesById[3] = "COMPLEMENTIZER"] = 3; - values[valuesById[4] = "FINAL_ENDING"] = 4; - values[valuesById[5] = "GERUND"] = 5; - values[valuesById[6] = "REALIS"] = 6; - values[valuesById[7] = "IRREALIS"] = 7; - values[valuesById[8] = "SHORT"] = 8; - values[valuesById[9] = "LONG"] = 9; - values[valuesById[10] = "ORDER"] = 10; - values[valuesById[11] = "SPECIFIC"] = 11; - return values; - })(); + Sentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.magnitude = reader.float(); + break; + } + case 3: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Gender enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Gender - * @enum {number} - * @property {number} GENDER_UNKNOWN=0 GENDER_UNKNOWN value - * @property {number} FEMININE=1 FEMININE value - * @property {number} MASCULINE=2 MASCULINE value - * @property {number} NEUTER=3 NEUTER value + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartOfSpeech.Gender = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GENDER_UNKNOWN"] = 0; - values[valuesById[1] = "FEMININE"] = 1; - values[valuesById[2] = "MASCULINE"] = 2; - values[valuesById[3] = "NEUTER"] = 3; - return values; - })(); + Sentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Mood enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Mood - * @enum {number} - * @property {number} MOOD_UNKNOWN=0 MOOD_UNKNOWN value - * @property {number} CONDITIONAL_MOOD=1 CONDITIONAL_MOOD value - * @property {number} IMPERATIVE=2 IMPERATIVE value - * @property {number} INDICATIVE=3 INDICATIVE value - * @property {number} INTERROGATIVE=4 INTERROGATIVE value - * @property {number} JUSSIVE=5 JUSSIVE value - * @property {number} SUBJUNCTIVE=6 SUBJUNCTIVE value + * Verifies a Sentiment message. + * @function verify + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartOfSpeech.Mood = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MOOD_UNKNOWN"] = 0; - values[valuesById[1] = "CONDITIONAL_MOOD"] = 1; - values[valuesById[2] = "IMPERATIVE"] = 2; - values[valuesById[3] = "INDICATIVE"] = 3; - values[valuesById[4] = "INTERROGATIVE"] = 4; - values[valuesById[5] = "JUSSIVE"] = 5; - values[valuesById[6] = "SUBJUNCTIVE"] = 6; - return values; - })(); + Sentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; /** - * Number enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Number - * @enum {number} - * @property {number} NUMBER_UNKNOWN=0 NUMBER_UNKNOWN value - * @property {number} SINGULAR=1 SINGULAR value - * @property {number} PLURAL=2 PLURAL value - * @property {number} DUAL=3 DUAL value - */ - PartOfSpeech.Number = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NUMBER_UNKNOWN"] = 0; - values[valuesById[1] = "SINGULAR"] = 1; - values[valuesById[2] = "PLURAL"] = 2; - values[valuesById[3] = "DUAL"] = 3; - return values; - })(); - - /** - * Person enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Person - * @enum {number} - * @property {number} PERSON_UNKNOWN=0 PERSON_UNKNOWN value - * @property {number} FIRST=1 FIRST value - * @property {number} SECOND=2 SECOND value - * @property {number} THIRD=3 THIRD value - * @property {number} REFLEXIVE_PERSON=4 REFLEXIVE_PERSON value - */ - PartOfSpeech.Person = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PERSON_UNKNOWN"] = 0; - values[valuesById[1] = "FIRST"] = 1; - values[valuesById[2] = "SECOND"] = 2; - values[valuesById[3] = "THIRD"] = 3; - values[valuesById[4] = "REFLEXIVE_PERSON"] = 4; - return values; - })(); - - /** - * Proper enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Proper - * @enum {number} - * @property {number} PROPER_UNKNOWN=0 PROPER_UNKNOWN value - * @property {number} PROPER=1 PROPER value - * @property {number} NOT_PROPER=2 NOT_PROPER value + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment */ - PartOfSpeech.Proper = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROPER_UNKNOWN"] = 0; - values[valuesById[1] = "PROPER"] = 1; - values[valuesById[2] = "NOT_PROPER"] = 2; - return values; - })(); + Sentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Sentiment) + return object; + var message = new $root.google.cloud.language.v1beta2.Sentiment(); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + if (object.score != null) + message.score = Number(object.score); + return message; + }; /** - * Reciprocity enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Reciprocity - * @enum {number} - * @property {number} RECIPROCITY_UNKNOWN=0 RECIPROCITY_UNKNOWN value - * @property {number} RECIPROCAL=1 RECIPROCAL value - * @property {number} NON_RECIPROCAL=2 NON_RECIPROCAL value + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.Sentiment} message Sentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - PartOfSpeech.Reciprocity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECIPROCITY_UNKNOWN"] = 0; - values[valuesById[1] = "RECIPROCAL"] = 1; - values[valuesById[2] = "NON_RECIPROCAL"] = 2; - return values; - })(); + Sentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.magnitude = 0; + object.score = 0; + } + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; /** - * Tense enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Tense - * @enum {number} - * @property {number} TENSE_UNKNOWN=0 TENSE_UNKNOWN value - * @property {number} CONDITIONAL_TENSE=1 CONDITIONAL_TENSE value - * @property {number} FUTURE=2 FUTURE value - * @property {number} PAST=3 PAST value - * @property {number} PRESENT=4 PRESENT value - * @property {number} IMPERFECT=5 IMPERFECT value - * @property {number} PLUPERFECT=6 PLUPERFECT value + * Converts this Sentiment to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Sentiment + * @instance + * @returns {Object.} JSON object */ - PartOfSpeech.Tense = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TENSE_UNKNOWN"] = 0; - values[valuesById[1] = "CONDITIONAL_TENSE"] = 1; - values[valuesById[2] = "FUTURE"] = 2; - values[valuesById[3] = "PAST"] = 3; - values[valuesById[4] = "PRESENT"] = 4; - values[valuesById[5] = "IMPERFECT"] = 5; - values[valuesById[6] = "PLUPERFECT"] = 6; - return values; - })(); + Sentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Voice enum. - * @name google.cloud.language.v1beta2.PartOfSpeech.Voice - * @enum {number} - * @property {number} VOICE_UNKNOWN=0 VOICE_UNKNOWN value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CAUSATIVE=2 CAUSATIVE value - * @property {number} PASSIVE=3 PASSIVE value + * Gets the default type url for Sentiment + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - PartOfSpeech.Voice = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VOICE_UNKNOWN"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CAUSATIVE"] = 2; - values[valuesById[3] = "PASSIVE"] = 3; - return values; - })(); + Sentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentiment"; + }; - return PartOfSpeech; + return Sentiment; })(); - v1beta2.DependencyEdge = (function() { + v1beta2.PartOfSpeech = (function() { /** - * Properties of a DependencyEdge. + * Properties of a PartOfSpeech. * @memberof google.cloud.language.v1beta2 - * @interface IDependencyEdge - * @property {number|null} [headTokenIndex] DependencyEdge headTokenIndex - * @property {google.cloud.language.v1beta2.DependencyEdge.Label|null} [label] DependencyEdge label + * @interface IPartOfSpeech + * @property {google.cloud.language.v1beta2.PartOfSpeech.Tag|null} [tag] PartOfSpeech tag + * @property {google.cloud.language.v1beta2.PartOfSpeech.Aspect|null} [aspect] PartOfSpeech aspect + * @property {google.cloud.language.v1beta2.PartOfSpeech.Case|null} ["case"] PartOfSpeech case + * @property {google.cloud.language.v1beta2.PartOfSpeech.Form|null} [form] PartOfSpeech form + * @property {google.cloud.language.v1beta2.PartOfSpeech.Gender|null} [gender] PartOfSpeech gender + * @property {google.cloud.language.v1beta2.PartOfSpeech.Mood|null} [mood] PartOfSpeech mood + * @property {google.cloud.language.v1beta2.PartOfSpeech.Number|null} [number] PartOfSpeech number + * @property {google.cloud.language.v1beta2.PartOfSpeech.Person|null} [person] PartOfSpeech person + * @property {google.cloud.language.v1beta2.PartOfSpeech.Proper|null} [proper] PartOfSpeech proper + * @property {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|null} [reciprocity] PartOfSpeech reciprocity + * @property {google.cloud.language.v1beta2.PartOfSpeech.Tense|null} [tense] PartOfSpeech tense + * @property {google.cloud.language.v1beta2.PartOfSpeech.Voice|null} [voice] PartOfSpeech voice */ /** - * Constructs a new DependencyEdge. + * Constructs a new PartOfSpeech. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a DependencyEdge. - * @implements IDependencyEdge + * @classdesc Represents a PartOfSpeech. + * @implements IPartOfSpeech * @constructor - * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set */ - function DependencyEdge(properties) { + function PartOfSpeech(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12229,89 +11545,229 @@ } /** - * DependencyEdge headTokenIndex. - * @member {number} headTokenIndex - * @memberof google.cloud.language.v1beta2.DependencyEdge + * PartOfSpeech tag. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Tag} tag + * @memberof google.cloud.language.v1beta2.PartOfSpeech * @instance */ - DependencyEdge.prototype.headTokenIndex = 0; + PartOfSpeech.prototype.tag = 0; /** - * DependencyEdge label. - * @member {google.cloud.language.v1beta2.DependencyEdge.Label} label - * @memberof google.cloud.language.v1beta2.DependencyEdge + * PartOfSpeech aspect. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Aspect} aspect + * @memberof google.cloud.language.v1beta2.PartOfSpeech * @instance */ - DependencyEdge.prototype.label = 0; + PartOfSpeech.prototype.aspect = 0; /** - * Creates a new DependencyEdge instance using the specified properties. - * @function create - * @memberof google.cloud.language.v1beta2.DependencyEdge - * @static - * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge instance + * PartOfSpeech case. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Case} case + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance */ - DependencyEdge.create = function create(properties) { - return new DependencyEdge(properties); - }; + PartOfSpeech.prototype["case"] = 0; /** - * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1beta2.DependencyEdge - * @static - * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * PartOfSpeech form. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Form} form + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance */ - DependencyEdge.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.headTokenIndex != null && Object.hasOwnProperty.call(message, "headTokenIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headTokenIndex); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.label); - return writer; - }; + PartOfSpeech.prototype.form = 0; /** - * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.DependencyEdge - * @static - * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * PartOfSpeech gender. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Gender} gender + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance */ - DependencyEdge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + PartOfSpeech.prototype.gender = 0; /** - * Decodes a DependencyEdge message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1beta2.DependencyEdge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DependencyEdge.decode = function decode(reader, length) { + * PartOfSpeech mood. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Mood} mood + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.mood = 0; + + /** + * PartOfSpeech number. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Number} number + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.number = 0; + + /** + * PartOfSpeech person. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Person} person + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.person = 0; + + /** + * PartOfSpeech proper. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Proper} proper + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.proper = 0; + + /** + * PartOfSpeech reciprocity. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity} reciprocity + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.reciprocity = 0; + + /** + * PartOfSpeech tense. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Tense} tense + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.tense = 0; + + /** + * PartOfSpeech voice. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Voice} voice + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.voice = 0; + + /** + * Creates a new PartOfSpeech instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech instance + */ + PartOfSpeech.create = function create(properties) { + return new PartOfSpeech(properties); + }; + + /** + * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tag); + if (message.aspect != null && Object.hasOwnProperty.call(message, "aspect")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.aspect); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message["case"]); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.form); + if (message.gender != null && Object.hasOwnProperty.call(message, "gender")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.gender); + if (message.mood != null && Object.hasOwnProperty.call(message, "mood")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.mood); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.number); + if (message.person != null && Object.hasOwnProperty.call(message, "person")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.person); + if (message.proper != null && Object.hasOwnProperty.call(message, "proper")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.proper); + if (message.reciprocity != null && Object.hasOwnProperty.call(message, "reciprocity")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.reciprocity); + if (message.tense != null && Object.hasOwnProperty.call(message, "tense")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.tense); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.voice); + return writer; + }; + + /** + * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartOfSpeech.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.DependencyEdge(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.headTokenIndex = reader.int32(); + message.tag = reader.int32(); break; } case 2: { - message.label = reader.int32(); + message.aspect = reader.int32(); + break; + } + case 3: { + message["case"] = reader.int32(); + break; + } + case 4: { + message.form = reader.int32(); + break; + } + case 5: { + message.gender = reader.int32(); + break; + } + case 6: { + message.mood = reader.int32(); + break; + } + case 7: { + message.number = reader.int32(); + break; + } + case 8: { + message.person = reader.int32(); + break; + } + case 9: { + message.proper = reader.int32(); + break; + } + case 10: { + message.reciprocity = reader.int32(); + break; + } + case 11: { + message.tense = reader.int32(); + break; + } + case 12: { + message.voice = reader.int32(); break; } default: @@ -12323,39 +11779,66 @@ }; /** - * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.DependencyEdge + * @memberof google.cloud.language.v1beta2.PartOfSpeech * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DependencyEdge.decodeDelimited = function decodeDelimited(reader) { + PartOfSpeech.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DependencyEdge message. + * Verifies a PartOfSpeech message. * @function verify - * @memberof google.cloud.language.v1beta2.DependencyEdge + * @memberof google.cloud.language.v1beta2.PartOfSpeech * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DependencyEdge.verify = function verify(message) { + PartOfSpeech.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) - if (!$util.isInteger(message.headTokenIndex)) - return "headTokenIndex: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { + if (message.tag != null && message.hasOwnProperty("tag")) + switch (message.tag) { default: - return "label: enum value expected"; + return "tag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.aspect != null && message.hasOwnProperty("aspect")) + switch (message.aspect) { + default: + return "aspect: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message["case"] != null && message.hasOwnProperty("case")) + switch (message["case"]) { + default: + return "case: enum value expected"; case 0: case 1: case 2: @@ -12371,685 +11854,2293 @@ case 12: case 13: case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - case 44: - case 45: - case 46: - case 47: - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - case 58: - case 59: - case 60: - case 61: - case 62: - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: + break; + } + if (message.form != null && message.hasOwnProperty("form")) + switch (message.form) { + default: + return "form: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.gender != null && message.hasOwnProperty("gender")) + switch (message.gender) { + default: + return "gender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mood != null && message.hasOwnProperty("mood")) + switch (message.mood) { + default: + return "mood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.number != null && message.hasOwnProperty("number")) + switch (message.number) { + default: + return "number: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.person != null && message.hasOwnProperty("person")) + switch (message.person) { + default: + return "person: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.proper != null && message.hasOwnProperty("proper")) + switch (message.proper) { + default: + return "proper: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + switch (message.reciprocity) { + default: + return "reciprocity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tense != null && message.hasOwnProperty("tense")) + switch (message.tense) { + default: + return "tense: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.voice != null && message.hasOwnProperty("voice")) + switch (message.voice) { + default: + return "voice: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; } return null; }; /** - * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.DependencyEdge + * @memberof google.cloud.language.v1beta2.PartOfSpeech * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech */ - DependencyEdge.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.DependencyEdge) + PartOfSpeech.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.PartOfSpeech) return object; - var message = new $root.google.cloud.language.v1beta2.DependencyEdge(); - if (object.headTokenIndex != null) - message.headTokenIndex = object.headTokenIndex | 0; - switch (object.label) { + var message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); + switch (object.tag) { default: - if (typeof object.label === "number") { - message.label = object.label; + if (typeof object.tag === "number") { + message.tag = object.tag; break; } break; case "UNKNOWN": case 0: - message.label = 0; + message.tag = 0; break; - case "ABBREV": + case "ADJ": case 1: - message.label = 1; + message.tag = 1; break; - case "ACOMP": + case "ADP": case 2: - message.label = 2; + message.tag = 2; break; - case "ADVCL": + case "ADV": case 3: - message.label = 3; + message.tag = 3; break; - case "ADVMOD": + case "CONJ": case 4: - message.label = 4; + message.tag = 4; break; - case "AMOD": + case "DET": case 5: - message.label = 5; + message.tag = 5; break; - case "APPOS": + case "NOUN": case 6: - message.label = 6; + message.tag = 6; break; - case "ATTR": + case "NUM": case 7: - message.label = 7; + message.tag = 7; break; - case "AUX": + case "PRON": case 8: - message.label = 8; + message.tag = 8; break; - case "AUXPASS": + case "PRT": case 9: - message.label = 9; + message.tag = 9; break; - case "CC": + case "PUNCT": case 10: - message.label = 10; + message.tag = 10; break; - case "CCOMP": + case "VERB": case 11: - message.label = 11; + message.tag = 11; break; - case "CONJ": + case "X": case 12: - message.label = 12; + message.tag = 12; break; - case "CSUBJ": + case "AFFIX": case 13: - message.label = 13; + message.tag = 13; break; - case "CSUBJPASS": - case 14: - message.label = 14; + } + switch (object.aspect) { + default: + if (typeof object.aspect === "number") { + message.aspect = object.aspect; + break; + } break; - case "DEP": - case 15: - message.label = 15; + case "ASPECT_UNKNOWN": + case 0: + message.aspect = 0; break; - case "DET": - case 16: - message.label = 16; + case "PERFECTIVE": + case 1: + message.aspect = 1; break; - case "DISCOURSE": - case 17: - message.label = 17; + case "IMPERFECTIVE": + case 2: + message.aspect = 2; break; - case "DOBJ": - case 18: - message.label = 18; + case "PROGRESSIVE": + case 3: + message.aspect = 3; break; - case "EXPL": - case 19: - message.label = 19; + } + switch (object["case"]) { + default: + if (typeof object["case"] === "number") { + message["case"] = object["case"]; + break; + } break; - case "GOESWITH": - case 20: - message.label = 20; + case "CASE_UNKNOWN": + case 0: + message["case"] = 0; break; - case "IOBJ": - case 21: - message.label = 21; + case "ACCUSATIVE": + case 1: + message["case"] = 1; break; - case "MARK": - case 22: - message.label = 22; + case "ADVERBIAL": + case 2: + message["case"] = 2; break; - case "MWE": - case 23: - message.label = 23; + case "COMPLEMENTIVE": + case 3: + message["case"] = 3; break; - case "MWV": - case 24: - message.label = 24; + case "DATIVE": + case 4: + message["case"] = 4; break; - case "NEG": - case 25: - message.label = 25; + case "GENITIVE": + case 5: + message["case"] = 5; break; - case "NN": - case 26: - message.label = 26; + case "INSTRUMENTAL": + case 6: + message["case"] = 6; break; - case "NPADVMOD": - case 27: - message.label = 27; + case "LOCATIVE": + case 7: + message["case"] = 7; break; - case "NSUBJ": - case 28: - message.label = 28; + case "NOMINATIVE": + case 8: + message["case"] = 8; break; - case "NSUBJPASS": - case 29: - message.label = 29; + case "OBLIQUE": + case 9: + message["case"] = 9; break; - case "NUM": - case 30: - message.label = 30; + case "PARTITIVE": + case 10: + message["case"] = 10; break; - case "NUMBER": - case 31: - message.label = 31; + case "PREPOSITIONAL": + case 11: + message["case"] = 11; break; - case "P": - case 32: - message.label = 32; + case "REFLEXIVE_CASE": + case 12: + message["case"] = 12; break; - case "PARATAXIS": - case 33: - message.label = 33; + case "RELATIVE_CASE": + case 13: + message["case"] = 13; break; - case "PARTMOD": - case 34: - message.label = 34; + case "VOCATIVE": + case 14: + message["case"] = 14; break; - case "PCOMP": - case 35: - message.label = 35; + } + switch (object.form) { + default: + if (typeof object.form === "number") { + message.form = object.form; + break; + } break; - case "POBJ": - case 36: - message.label = 36; + case "FORM_UNKNOWN": + case 0: + message.form = 0; break; - case "POSS": - case 37: - message.label = 37; + case "ADNOMIAL": + case 1: + message.form = 1; break; - case "POSTNEG": - case 38: - message.label = 38; + case "AUXILIARY": + case 2: + message.form = 2; break; - case "PRECOMP": - case 39: - message.label = 39; + case "COMPLEMENTIZER": + case 3: + message.form = 3; break; - case "PRECONJ": - case 40: - message.label = 40; + case "FINAL_ENDING": + case 4: + message.form = 4; break; - case "PREDET": - case 41: - message.label = 41; + case "GERUND": + case 5: + message.form = 5; break; - case "PREF": - case 42: - message.label = 42; + case "REALIS": + case 6: + message.form = 6; break; - case "PREP": - case 43: - message.label = 43; + case "IRREALIS": + case 7: + message.form = 7; break; - case "PRONL": - case 44: - message.label = 44; + case "SHORT": + case 8: + message.form = 8; break; - case "PRT": - case 45: - message.label = 45; + case "LONG": + case 9: + message.form = 9; break; - case "PS": - case 46: - message.label = 46; + case "ORDER": + case 10: + message.form = 10; break; - case "QUANTMOD": - case 47: - message.label = 47; + case "SPECIFIC": + case 11: + message.form = 11; break; - case "RCMOD": - case 48: - message.label = 48; + } + switch (object.gender) { + default: + if (typeof object.gender === "number") { + message.gender = object.gender; + break; + } break; - case "RCMODREL": - case 49: - message.label = 49; + case "GENDER_UNKNOWN": + case 0: + message.gender = 0; break; - case "RDROP": - case 50: - message.label = 50; + case "FEMININE": + case 1: + message.gender = 1; break; - case "REF": - case 51: - message.label = 51; + case "MASCULINE": + case 2: + message.gender = 2; break; - case "REMNANT": - case 52: - message.label = 52; + case "NEUTER": + case 3: + message.gender = 3; break; - case "REPARANDUM": - case 53: - message.label = 53; + } + switch (object.mood) { + default: + if (typeof object.mood === "number") { + message.mood = object.mood; + break; + } break; - case "ROOT": - case 54: - message.label = 54; + case "MOOD_UNKNOWN": + case 0: + message.mood = 0; break; - case "SNUM": - case 55: - message.label = 55; + case "CONDITIONAL_MOOD": + case 1: + message.mood = 1; break; - case "SUFF": - case 56: - message.label = 56; + case "IMPERATIVE": + case 2: + message.mood = 2; break; - case "TMOD": - case 57: - message.label = 57; + case "INDICATIVE": + case 3: + message.mood = 3; break; - case "TOPIC": - case 58: - message.label = 58; + case "INTERROGATIVE": + case 4: + message.mood = 4; break; - case "VMOD": - case 59: - message.label = 59; + case "JUSSIVE": + case 5: + message.mood = 5; break; - case "VOCATIVE": - case 60: - message.label = 60; + case "SUBJUNCTIVE": + case 6: + message.mood = 6; break; - case "XCOMP": - case 61: - message.label = 61; + } + switch (object.number) { + default: + if (typeof object.number === "number") { + message.number = object.number; + break; + } break; - case "SUFFIX": - case 62: - message.label = 62; + case "NUMBER_UNKNOWN": + case 0: + message.number = 0; break; - case "TITLE": - case 63: - message.label = 63; + case "SINGULAR": + case 1: + message.number = 1; break; - case "ADVPHMOD": - case 64: - message.label = 64; + case "PLURAL": + case 2: + message.number = 2; break; - case "AUXCAUS": - case 65: - message.label = 65; + case "DUAL": + case 3: + message.number = 3; break; - case "AUXVV": - case 66: - message.label = 66; + } + switch (object.person) { + default: + if (typeof object.person === "number") { + message.person = object.person; + break; + } break; - case "DTMOD": - case 67: - message.label = 67; + case "PERSON_UNKNOWN": + case 0: + message.person = 0; break; - case "FOREIGN": - case 68: - message.label = 68; + case "FIRST": + case 1: + message.person = 1; break; - case "KW": - case 69: - message.label = 69; + case "SECOND": + case 2: + message.person = 2; break; - case "LIST": - case 70: - message.label = 70; + case "THIRD": + case 3: + message.person = 3; break; - case "NOMC": - case 71: - message.label = 71; + case "REFLEXIVE_PERSON": + case 4: + message.person = 4; break; - case "NOMCSUBJ": - case 72: - message.label = 72; + } + switch (object.proper) { + default: + if (typeof object.proper === "number") { + message.proper = object.proper; + break; + } break; - case "NOMCSUBJPASS": - case 73: - message.label = 73; + case "PROPER_UNKNOWN": + case 0: + message.proper = 0; break; - case "NUMC": - case 74: - message.label = 74; + case "PROPER": + case 1: + message.proper = 1; break; - case "COP": - case 75: - message.label = 75; + case "NOT_PROPER": + case 2: + message.proper = 2; break; - case "DISLOCATED": - case 76: - message.label = 76; + } + switch (object.reciprocity) { + default: + if (typeof object.reciprocity === "number") { + message.reciprocity = object.reciprocity; + break; + } break; - case "ASP": - case 77: - message.label = 77; + case "RECIPROCITY_UNKNOWN": + case 0: + message.reciprocity = 0; break; - case "GMOD": - case 78: - message.label = 78; + case "RECIPROCAL": + case 1: + message.reciprocity = 1; break; - case "GOBJ": - case 79: - message.label = 79; + case "NON_RECIPROCAL": + case 2: + message.reciprocity = 2; + break; + } + switch (object.tense) { + default: + if (typeof object.tense === "number") { + message.tense = object.tense; + break; + } + break; + case "TENSE_UNKNOWN": + case 0: + message.tense = 0; + break; + case "CONDITIONAL_TENSE": + case 1: + message.tense = 1; + break; + case "FUTURE": + case 2: + message.tense = 2; + break; + case "PAST": + case 3: + message.tense = 3; + break; + case "PRESENT": + case 4: + message.tense = 4; + break; + case "IMPERFECT": + case 5: + message.tense = 5; + break; + case "PLUPERFECT": + case 6: + message.tense = 6; + break; + } + switch (object.voice) { + default: + if (typeof object.voice === "number") { + message.voice = object.voice; + break; + } + break; + case "VOICE_UNKNOWN": + case 0: + message.voice = 0; + break; + case "ACTIVE": + case 1: + message.voice = 1; + break; + case "CAUSATIVE": + case 2: + message.voice = 2; + break; + case "PASSIVE": + case 3: + message.voice = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.PartOfSpeech} message PartOfSpeech + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartOfSpeech.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = options.enums === String ? "UNKNOWN" : 0; + object.aspect = options.enums === String ? "ASPECT_UNKNOWN" : 0; + object["case"] = options.enums === String ? "CASE_UNKNOWN" : 0; + object.form = options.enums === String ? "FORM_UNKNOWN" : 0; + object.gender = options.enums === String ? "GENDER_UNKNOWN" : 0; + object.mood = options.enums === String ? "MOOD_UNKNOWN" : 0; + object.number = options.enums === String ? "NUMBER_UNKNOWN" : 0; + object.person = options.enums === String ? "PERSON_UNKNOWN" : 0; + object.proper = options.enums === String ? "PROPER_UNKNOWN" : 0; + object.reciprocity = options.enums === String ? "RECIPROCITY_UNKNOWN" : 0; + object.tense = options.enums === String ? "TENSE_UNKNOWN" : 0; + object.voice = options.enums === String ? "VOICE_UNKNOWN" : 0; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tag[message.tag] === undefined ? message.tag : $root.google.cloud.language.v1beta2.PartOfSpeech.Tag[message.tag] : message.tag; + if (message.aspect != null && message.hasOwnProperty("aspect")) + object.aspect = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Aspect[message.aspect] === undefined ? message.aspect : $root.google.cloud.language.v1beta2.PartOfSpeech.Aspect[message.aspect] : message.aspect; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Case[message["case"]] === undefined ? message["case"] : $root.google.cloud.language.v1beta2.PartOfSpeech.Case[message["case"]] : message["case"]; + if (message.form != null && message.hasOwnProperty("form")) + object.form = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Form[message.form] === undefined ? message.form : $root.google.cloud.language.v1beta2.PartOfSpeech.Form[message.form] : message.form; + if (message.gender != null && message.hasOwnProperty("gender")) + object.gender = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Gender[message.gender] === undefined ? message.gender : $root.google.cloud.language.v1beta2.PartOfSpeech.Gender[message.gender] : message.gender; + if (message.mood != null && message.hasOwnProperty("mood")) + object.mood = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Mood[message.mood] === undefined ? message.mood : $root.google.cloud.language.v1beta2.PartOfSpeech.Mood[message.mood] : message.mood; + if (message.number != null && message.hasOwnProperty("number")) + object.number = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Number[message.number] === undefined ? message.number : $root.google.cloud.language.v1beta2.PartOfSpeech.Number[message.number] : message.number; + if (message.person != null && message.hasOwnProperty("person")) + object.person = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Person[message.person] === undefined ? message.person : $root.google.cloud.language.v1beta2.PartOfSpeech.Person[message.person] : message.person; + if (message.proper != null && message.hasOwnProperty("proper")) + object.proper = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Proper[message.proper] === undefined ? message.proper : $root.google.cloud.language.v1beta2.PartOfSpeech.Proper[message.proper] : message.proper; + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + object.reciprocity = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity[message.reciprocity] === undefined ? message.reciprocity : $root.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity[message.reciprocity] : message.reciprocity; + if (message.tense != null && message.hasOwnProperty("tense")) + object.tense = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tense[message.tense] === undefined ? message.tense : $root.google.cloud.language.v1beta2.PartOfSpeech.Tense[message.tense] : message.tense; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Voice[message.voice] === undefined ? message.voice : $root.google.cloud.language.v1beta2.PartOfSpeech.Voice[message.voice] : message.voice; + return object; + }; + + /** + * Converts this PartOfSpeech to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + * @returns {Object.} JSON object + */ + PartOfSpeech.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartOfSpeech + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartOfSpeech.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.PartOfSpeech"; + }; + + /** + * Tag enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Tag + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ADJ=1 ADJ value + * @property {number} ADP=2 ADP value + * @property {number} ADV=3 ADV value + * @property {number} CONJ=4 CONJ value + * @property {number} DET=5 DET value + * @property {number} NOUN=6 NOUN value + * @property {number} NUM=7 NUM value + * @property {number} PRON=8 PRON value + * @property {number} PRT=9 PRT value + * @property {number} PUNCT=10 PUNCT value + * @property {number} VERB=11 VERB value + * @property {number} X=12 X value + * @property {number} AFFIX=13 AFFIX value + */ + PartOfSpeech.Tag = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ADJ"] = 1; + values[valuesById[2] = "ADP"] = 2; + values[valuesById[3] = "ADV"] = 3; + values[valuesById[4] = "CONJ"] = 4; + values[valuesById[5] = "DET"] = 5; + values[valuesById[6] = "NOUN"] = 6; + values[valuesById[7] = "NUM"] = 7; + values[valuesById[8] = "PRON"] = 8; + values[valuesById[9] = "PRT"] = 9; + values[valuesById[10] = "PUNCT"] = 10; + values[valuesById[11] = "VERB"] = 11; + values[valuesById[12] = "X"] = 12; + values[valuesById[13] = "AFFIX"] = 13; + return values; + })(); + + /** + * Aspect enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Aspect + * @enum {number} + * @property {number} ASPECT_UNKNOWN=0 ASPECT_UNKNOWN value + * @property {number} PERFECTIVE=1 PERFECTIVE value + * @property {number} IMPERFECTIVE=2 IMPERFECTIVE value + * @property {number} PROGRESSIVE=3 PROGRESSIVE value + */ + PartOfSpeech.Aspect = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ASPECT_UNKNOWN"] = 0; + values[valuesById[1] = "PERFECTIVE"] = 1; + values[valuesById[2] = "IMPERFECTIVE"] = 2; + values[valuesById[3] = "PROGRESSIVE"] = 3; + return values; + })(); + + /** + * Case enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Case + * @enum {number} + * @property {number} CASE_UNKNOWN=0 CASE_UNKNOWN value + * @property {number} ACCUSATIVE=1 ACCUSATIVE value + * @property {number} ADVERBIAL=2 ADVERBIAL value + * @property {number} COMPLEMENTIVE=3 COMPLEMENTIVE value + * @property {number} DATIVE=4 DATIVE value + * @property {number} GENITIVE=5 GENITIVE value + * @property {number} INSTRUMENTAL=6 INSTRUMENTAL value + * @property {number} LOCATIVE=7 LOCATIVE value + * @property {number} NOMINATIVE=8 NOMINATIVE value + * @property {number} OBLIQUE=9 OBLIQUE value + * @property {number} PARTITIVE=10 PARTITIVE value + * @property {number} PREPOSITIONAL=11 PREPOSITIONAL value + * @property {number} REFLEXIVE_CASE=12 REFLEXIVE_CASE value + * @property {number} RELATIVE_CASE=13 RELATIVE_CASE value + * @property {number} VOCATIVE=14 VOCATIVE value + */ + PartOfSpeech.Case = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CASE_UNKNOWN"] = 0; + values[valuesById[1] = "ACCUSATIVE"] = 1; + values[valuesById[2] = "ADVERBIAL"] = 2; + values[valuesById[3] = "COMPLEMENTIVE"] = 3; + values[valuesById[4] = "DATIVE"] = 4; + values[valuesById[5] = "GENITIVE"] = 5; + values[valuesById[6] = "INSTRUMENTAL"] = 6; + values[valuesById[7] = "LOCATIVE"] = 7; + values[valuesById[8] = "NOMINATIVE"] = 8; + values[valuesById[9] = "OBLIQUE"] = 9; + values[valuesById[10] = "PARTITIVE"] = 10; + values[valuesById[11] = "PREPOSITIONAL"] = 11; + values[valuesById[12] = "REFLEXIVE_CASE"] = 12; + values[valuesById[13] = "RELATIVE_CASE"] = 13; + values[valuesById[14] = "VOCATIVE"] = 14; + return values; + })(); + + /** + * Form enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Form + * @enum {number} + * @property {number} FORM_UNKNOWN=0 FORM_UNKNOWN value + * @property {number} ADNOMIAL=1 ADNOMIAL value + * @property {number} AUXILIARY=2 AUXILIARY value + * @property {number} COMPLEMENTIZER=3 COMPLEMENTIZER value + * @property {number} FINAL_ENDING=4 FINAL_ENDING value + * @property {number} GERUND=5 GERUND value + * @property {number} REALIS=6 REALIS value + * @property {number} IRREALIS=7 IRREALIS value + * @property {number} SHORT=8 SHORT value + * @property {number} LONG=9 LONG value + * @property {number} ORDER=10 ORDER value + * @property {number} SPECIFIC=11 SPECIFIC value + */ + PartOfSpeech.Form = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORM_UNKNOWN"] = 0; + values[valuesById[1] = "ADNOMIAL"] = 1; + values[valuesById[2] = "AUXILIARY"] = 2; + values[valuesById[3] = "COMPLEMENTIZER"] = 3; + values[valuesById[4] = "FINAL_ENDING"] = 4; + values[valuesById[5] = "GERUND"] = 5; + values[valuesById[6] = "REALIS"] = 6; + values[valuesById[7] = "IRREALIS"] = 7; + values[valuesById[8] = "SHORT"] = 8; + values[valuesById[9] = "LONG"] = 9; + values[valuesById[10] = "ORDER"] = 10; + values[valuesById[11] = "SPECIFIC"] = 11; + return values; + })(); + + /** + * Gender enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Gender + * @enum {number} + * @property {number} GENDER_UNKNOWN=0 GENDER_UNKNOWN value + * @property {number} FEMININE=1 FEMININE value + * @property {number} MASCULINE=2 MASCULINE value + * @property {number} NEUTER=3 NEUTER value + */ + PartOfSpeech.Gender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENDER_UNKNOWN"] = 0; + values[valuesById[1] = "FEMININE"] = 1; + values[valuesById[2] = "MASCULINE"] = 2; + values[valuesById[3] = "NEUTER"] = 3; + return values; + })(); + + /** + * Mood enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Mood + * @enum {number} + * @property {number} MOOD_UNKNOWN=0 MOOD_UNKNOWN value + * @property {number} CONDITIONAL_MOOD=1 CONDITIONAL_MOOD value + * @property {number} IMPERATIVE=2 IMPERATIVE value + * @property {number} INDICATIVE=3 INDICATIVE value + * @property {number} INTERROGATIVE=4 INTERROGATIVE value + * @property {number} JUSSIVE=5 JUSSIVE value + * @property {number} SUBJUNCTIVE=6 SUBJUNCTIVE value + */ + PartOfSpeech.Mood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MOOD_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_MOOD"] = 1; + values[valuesById[2] = "IMPERATIVE"] = 2; + values[valuesById[3] = "INDICATIVE"] = 3; + values[valuesById[4] = "INTERROGATIVE"] = 4; + values[valuesById[5] = "JUSSIVE"] = 5; + values[valuesById[6] = "SUBJUNCTIVE"] = 6; + return values; + })(); + + /** + * Number enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Number + * @enum {number} + * @property {number} NUMBER_UNKNOWN=0 NUMBER_UNKNOWN value + * @property {number} SINGULAR=1 SINGULAR value + * @property {number} PLURAL=2 PLURAL value + * @property {number} DUAL=3 DUAL value + */ + PartOfSpeech.Number = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NUMBER_UNKNOWN"] = 0; + values[valuesById[1] = "SINGULAR"] = 1; + values[valuesById[2] = "PLURAL"] = 2; + values[valuesById[3] = "DUAL"] = 3; + return values; + })(); + + /** + * Person enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Person + * @enum {number} + * @property {number} PERSON_UNKNOWN=0 PERSON_UNKNOWN value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} REFLEXIVE_PERSON=4 REFLEXIVE_PERSON value + */ + PartOfSpeech.Person = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERSON_UNKNOWN"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "REFLEXIVE_PERSON"] = 4; + return values; + })(); + + /** + * Proper enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Proper + * @enum {number} + * @property {number} PROPER_UNKNOWN=0 PROPER_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} NOT_PROPER=2 NOT_PROPER value + */ + PartOfSpeech.Proper = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPER_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "NOT_PROPER"] = 2; + return values; + })(); + + /** + * Reciprocity enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Reciprocity + * @enum {number} + * @property {number} RECIPROCITY_UNKNOWN=0 RECIPROCITY_UNKNOWN value + * @property {number} RECIPROCAL=1 RECIPROCAL value + * @property {number} NON_RECIPROCAL=2 NON_RECIPROCAL value + */ + PartOfSpeech.Reciprocity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECIPROCITY_UNKNOWN"] = 0; + values[valuesById[1] = "RECIPROCAL"] = 1; + values[valuesById[2] = "NON_RECIPROCAL"] = 2; + return values; + })(); + + /** + * Tense enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Tense + * @enum {number} + * @property {number} TENSE_UNKNOWN=0 TENSE_UNKNOWN value + * @property {number} CONDITIONAL_TENSE=1 CONDITIONAL_TENSE value + * @property {number} FUTURE=2 FUTURE value + * @property {number} PAST=3 PAST value + * @property {number} PRESENT=4 PRESENT value + * @property {number} IMPERFECT=5 IMPERFECT value + * @property {number} PLUPERFECT=6 PLUPERFECT value + */ + PartOfSpeech.Tense = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TENSE_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_TENSE"] = 1; + values[valuesById[2] = "FUTURE"] = 2; + values[valuesById[3] = "PAST"] = 3; + values[valuesById[4] = "PRESENT"] = 4; + values[valuesById[5] = "IMPERFECT"] = 5; + values[valuesById[6] = "PLUPERFECT"] = 6; + return values; + })(); + + /** + * Voice enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Voice + * @enum {number} + * @property {number} VOICE_UNKNOWN=0 VOICE_UNKNOWN value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CAUSATIVE=2 CAUSATIVE value + * @property {number} PASSIVE=3 PASSIVE value + */ + PartOfSpeech.Voice = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOICE_UNKNOWN"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CAUSATIVE"] = 2; + values[valuesById[3] = "PASSIVE"] = 3; + return values; + })(); + + return PartOfSpeech; + })(); + + v1beta2.DependencyEdge = (function() { + + /** + * Properties of a DependencyEdge. + * @memberof google.cloud.language.v1beta2 + * @interface IDependencyEdge + * @property {number|null} [headTokenIndex] DependencyEdge headTokenIndex + * @property {google.cloud.language.v1beta2.DependencyEdge.Label|null} [label] DependencyEdge label + */ + + /** + * Constructs a new DependencyEdge. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a DependencyEdge. + * @implements IDependencyEdge + * @constructor + * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set + */ + function DependencyEdge(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DependencyEdge headTokenIndex. + * @member {number} headTokenIndex + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + */ + DependencyEdge.prototype.headTokenIndex = 0; + + /** + * DependencyEdge label. + * @member {google.cloud.language.v1beta2.DependencyEdge.Label} label + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + */ + DependencyEdge.prototype.label = 0; + + /** + * Creates a new DependencyEdge instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge instance + */ + DependencyEdge.create = function create(properties) { + return new DependencyEdge(properties); + }; + + /** + * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headTokenIndex != null && Object.hasOwnProperty.call(message, "headTokenIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headTokenIndex); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.label); + return writer; + }; + + /** + * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.DependencyEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headTokenIndex = reader.int32(); + break; + } + case 2: { + message.label = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyEdge message. + * @function verify + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyEdge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + if (!$util.isInteger(message.headTokenIndex)) + return "headTokenIndex: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + break; + } + return null; + }; + + /** + * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + */ + DependencyEdge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.DependencyEdge) + return object; + var message = new $root.google.cloud.language.v1beta2.DependencyEdge(); + if (object.headTokenIndex != null) + message.headTokenIndex = object.headTokenIndex | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "UNKNOWN": + case 0: + message.label = 0; + break; + case "ABBREV": + case 1: + message.label = 1; + break; + case "ACOMP": + case 2: + message.label = 2; + break; + case "ADVCL": + case 3: + message.label = 3; + break; + case "ADVMOD": + case 4: + message.label = 4; + break; + case "AMOD": + case 5: + message.label = 5; + break; + case "APPOS": + case 6: + message.label = 6; + break; + case "ATTR": + case 7: + message.label = 7; + break; + case "AUX": + case 8: + message.label = 8; + break; + case "AUXPASS": + case 9: + message.label = 9; + break; + case "CC": + case 10: + message.label = 10; + break; + case "CCOMP": + case 11: + message.label = 11; + break; + case "CONJ": + case 12: + message.label = 12; + break; + case "CSUBJ": + case 13: + message.label = 13; + break; + case "CSUBJPASS": + case 14: + message.label = 14; + break; + case "DEP": + case 15: + message.label = 15; + break; + case "DET": + case 16: + message.label = 16; + break; + case "DISCOURSE": + case 17: + message.label = 17; + break; + case "DOBJ": + case 18: + message.label = 18; + break; + case "EXPL": + case 19: + message.label = 19; + break; + case "GOESWITH": + case 20: + message.label = 20; + break; + case "IOBJ": + case 21: + message.label = 21; + break; + case "MARK": + case 22: + message.label = 22; + break; + case "MWE": + case 23: + message.label = 23; + break; + case "MWV": + case 24: + message.label = 24; + break; + case "NEG": + case 25: + message.label = 25; + break; + case "NN": + case 26: + message.label = 26; + break; + case "NPADVMOD": + case 27: + message.label = 27; + break; + case "NSUBJ": + case 28: + message.label = 28; + break; + case "NSUBJPASS": + case 29: + message.label = 29; + break; + case "NUM": + case 30: + message.label = 30; + break; + case "NUMBER": + case 31: + message.label = 31; + break; + case "P": + case 32: + message.label = 32; + break; + case "PARATAXIS": + case 33: + message.label = 33; + break; + case "PARTMOD": + case 34: + message.label = 34; + break; + case "PCOMP": + case 35: + message.label = 35; + break; + case "POBJ": + case 36: + message.label = 36; + break; + case "POSS": + case 37: + message.label = 37; + break; + case "POSTNEG": + case 38: + message.label = 38; + break; + case "PRECOMP": + case 39: + message.label = 39; + break; + case "PRECONJ": + case 40: + message.label = 40; + break; + case "PREDET": + case 41: + message.label = 41; + break; + case "PREF": + case 42: + message.label = 42; + break; + case "PREP": + case 43: + message.label = 43; + break; + case "PRONL": + case 44: + message.label = 44; + break; + case "PRT": + case 45: + message.label = 45; + break; + case "PS": + case 46: + message.label = 46; + break; + case "QUANTMOD": + case 47: + message.label = 47; + break; + case "RCMOD": + case 48: + message.label = 48; + break; + case "RCMODREL": + case 49: + message.label = 49; + break; + case "RDROP": + case 50: + message.label = 50; + break; + case "REF": + case 51: + message.label = 51; + break; + case "REMNANT": + case 52: + message.label = 52; + break; + case "REPARANDUM": + case 53: + message.label = 53; + break; + case "ROOT": + case 54: + message.label = 54; + break; + case "SNUM": + case 55: + message.label = 55; + break; + case "SUFF": + case 56: + message.label = 56; + break; + case "TMOD": + case 57: + message.label = 57; + break; + case "TOPIC": + case 58: + message.label = 58; + break; + case "VMOD": + case 59: + message.label = 59; + break; + case "VOCATIVE": + case 60: + message.label = 60; + break; + case "XCOMP": + case 61: + message.label = 61; + break; + case "SUFFIX": + case 62: + message.label = 62; + break; + case "TITLE": + case 63: + message.label = 63; + break; + case "ADVPHMOD": + case 64: + message.label = 64; + break; + case "AUXCAUS": + case 65: + message.label = 65; + break; + case "AUXVV": + case 66: + message.label = 66; + break; + case "DTMOD": + case 67: + message.label = 67; + break; + case "FOREIGN": + case 68: + message.label = 68; + break; + case "KW": + case 69: + message.label = 69; + break; + case "LIST": + case 70: + message.label = 70; + break; + case "NOMC": + case 71: + message.label = 71; + break; + case "NOMCSUBJ": + case 72: + message.label = 72; + break; + case "NOMCSUBJPASS": + case 73: + message.label = 73; + break; + case "NUMC": + case 74: + message.label = 74; + break; + case "COP": + case 75: + message.label = 75; + break; + case "DISLOCATED": + case 76: + message.label = 76; + break; + case "ASP": + case 77: + message.label = 77; + break; + case "GMOD": + case 78: + message.label = 78; + break; + case "GOBJ": + case 79: + message.label = 79; + break; + case "INFMOD": + case 80: + message.label = 80; + break; + case "MES": + case 81: + message.label = 81; + break; + case "NCOMP": + case 82: + message.label = 82; + break; + } + return message; + }; + + /** + * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.DependencyEdge} message DependencyEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.headTokenIndex = 0; + object.label = options.enums === String ? "UNKNOWN" : 0; + } + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + object.headTokenIndex = message.headTokenIndex; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.cloud.language.v1beta2.DependencyEdge.Label[message.label] === undefined ? message.label : $root.google.cloud.language.v1beta2.DependencyEdge.Label[message.label] : message.label; + return object; + }; + + /** + * Converts this DependencyEdge to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + * @returns {Object.} JSON object + */ + DependencyEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyEdge + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.DependencyEdge"; + }; + + /** + * Label enum. + * @name google.cloud.language.v1beta2.DependencyEdge.Label + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ABBREV=1 ABBREV value + * @property {number} ACOMP=2 ACOMP value + * @property {number} ADVCL=3 ADVCL value + * @property {number} ADVMOD=4 ADVMOD value + * @property {number} AMOD=5 AMOD value + * @property {number} APPOS=6 APPOS value + * @property {number} ATTR=7 ATTR value + * @property {number} AUX=8 AUX value + * @property {number} AUXPASS=9 AUXPASS value + * @property {number} CC=10 CC value + * @property {number} CCOMP=11 CCOMP value + * @property {number} CONJ=12 CONJ value + * @property {number} CSUBJ=13 CSUBJ value + * @property {number} CSUBJPASS=14 CSUBJPASS value + * @property {number} DEP=15 DEP value + * @property {number} DET=16 DET value + * @property {number} DISCOURSE=17 DISCOURSE value + * @property {number} DOBJ=18 DOBJ value + * @property {number} EXPL=19 EXPL value + * @property {number} GOESWITH=20 GOESWITH value + * @property {number} IOBJ=21 IOBJ value + * @property {number} MARK=22 MARK value + * @property {number} MWE=23 MWE value + * @property {number} MWV=24 MWV value + * @property {number} NEG=25 NEG value + * @property {number} NN=26 NN value + * @property {number} NPADVMOD=27 NPADVMOD value + * @property {number} NSUBJ=28 NSUBJ value + * @property {number} NSUBJPASS=29 NSUBJPASS value + * @property {number} NUM=30 NUM value + * @property {number} NUMBER=31 NUMBER value + * @property {number} P=32 P value + * @property {number} PARATAXIS=33 PARATAXIS value + * @property {number} PARTMOD=34 PARTMOD value + * @property {number} PCOMP=35 PCOMP value + * @property {number} POBJ=36 POBJ value + * @property {number} POSS=37 POSS value + * @property {number} POSTNEG=38 POSTNEG value + * @property {number} PRECOMP=39 PRECOMP value + * @property {number} PRECONJ=40 PRECONJ value + * @property {number} PREDET=41 PREDET value + * @property {number} PREF=42 PREF value + * @property {number} PREP=43 PREP value + * @property {number} PRONL=44 PRONL value + * @property {number} PRT=45 PRT value + * @property {number} PS=46 PS value + * @property {number} QUANTMOD=47 QUANTMOD value + * @property {number} RCMOD=48 RCMOD value + * @property {number} RCMODREL=49 RCMODREL value + * @property {number} RDROP=50 RDROP value + * @property {number} REF=51 REF value + * @property {number} REMNANT=52 REMNANT value + * @property {number} REPARANDUM=53 REPARANDUM value + * @property {number} ROOT=54 ROOT value + * @property {number} SNUM=55 SNUM value + * @property {number} SUFF=56 SUFF value + * @property {number} TMOD=57 TMOD value + * @property {number} TOPIC=58 TOPIC value + * @property {number} VMOD=59 VMOD value + * @property {number} VOCATIVE=60 VOCATIVE value + * @property {number} XCOMP=61 XCOMP value + * @property {number} SUFFIX=62 SUFFIX value + * @property {number} TITLE=63 TITLE value + * @property {number} ADVPHMOD=64 ADVPHMOD value + * @property {number} AUXCAUS=65 AUXCAUS value + * @property {number} AUXVV=66 AUXVV value + * @property {number} DTMOD=67 DTMOD value + * @property {number} FOREIGN=68 FOREIGN value + * @property {number} KW=69 KW value + * @property {number} LIST=70 LIST value + * @property {number} NOMC=71 NOMC value + * @property {number} NOMCSUBJ=72 NOMCSUBJ value + * @property {number} NOMCSUBJPASS=73 NOMCSUBJPASS value + * @property {number} NUMC=74 NUMC value + * @property {number} COP=75 COP value + * @property {number} DISLOCATED=76 DISLOCATED value + * @property {number} ASP=77 ASP value + * @property {number} GMOD=78 GMOD value + * @property {number} GOBJ=79 GOBJ value + * @property {number} INFMOD=80 INFMOD value + * @property {number} MES=81 MES value + * @property {number} NCOMP=82 NCOMP value + */ + DependencyEdge.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ABBREV"] = 1; + values[valuesById[2] = "ACOMP"] = 2; + values[valuesById[3] = "ADVCL"] = 3; + values[valuesById[4] = "ADVMOD"] = 4; + values[valuesById[5] = "AMOD"] = 5; + values[valuesById[6] = "APPOS"] = 6; + values[valuesById[7] = "ATTR"] = 7; + values[valuesById[8] = "AUX"] = 8; + values[valuesById[9] = "AUXPASS"] = 9; + values[valuesById[10] = "CC"] = 10; + values[valuesById[11] = "CCOMP"] = 11; + values[valuesById[12] = "CONJ"] = 12; + values[valuesById[13] = "CSUBJ"] = 13; + values[valuesById[14] = "CSUBJPASS"] = 14; + values[valuesById[15] = "DEP"] = 15; + values[valuesById[16] = "DET"] = 16; + values[valuesById[17] = "DISCOURSE"] = 17; + values[valuesById[18] = "DOBJ"] = 18; + values[valuesById[19] = "EXPL"] = 19; + values[valuesById[20] = "GOESWITH"] = 20; + values[valuesById[21] = "IOBJ"] = 21; + values[valuesById[22] = "MARK"] = 22; + values[valuesById[23] = "MWE"] = 23; + values[valuesById[24] = "MWV"] = 24; + values[valuesById[25] = "NEG"] = 25; + values[valuesById[26] = "NN"] = 26; + values[valuesById[27] = "NPADVMOD"] = 27; + values[valuesById[28] = "NSUBJ"] = 28; + values[valuesById[29] = "NSUBJPASS"] = 29; + values[valuesById[30] = "NUM"] = 30; + values[valuesById[31] = "NUMBER"] = 31; + values[valuesById[32] = "P"] = 32; + values[valuesById[33] = "PARATAXIS"] = 33; + values[valuesById[34] = "PARTMOD"] = 34; + values[valuesById[35] = "PCOMP"] = 35; + values[valuesById[36] = "POBJ"] = 36; + values[valuesById[37] = "POSS"] = 37; + values[valuesById[38] = "POSTNEG"] = 38; + values[valuesById[39] = "PRECOMP"] = 39; + values[valuesById[40] = "PRECONJ"] = 40; + values[valuesById[41] = "PREDET"] = 41; + values[valuesById[42] = "PREF"] = 42; + values[valuesById[43] = "PREP"] = 43; + values[valuesById[44] = "PRONL"] = 44; + values[valuesById[45] = "PRT"] = 45; + values[valuesById[46] = "PS"] = 46; + values[valuesById[47] = "QUANTMOD"] = 47; + values[valuesById[48] = "RCMOD"] = 48; + values[valuesById[49] = "RCMODREL"] = 49; + values[valuesById[50] = "RDROP"] = 50; + values[valuesById[51] = "REF"] = 51; + values[valuesById[52] = "REMNANT"] = 52; + values[valuesById[53] = "REPARANDUM"] = 53; + values[valuesById[54] = "ROOT"] = 54; + values[valuesById[55] = "SNUM"] = 55; + values[valuesById[56] = "SUFF"] = 56; + values[valuesById[57] = "TMOD"] = 57; + values[valuesById[58] = "TOPIC"] = 58; + values[valuesById[59] = "VMOD"] = 59; + values[valuesById[60] = "VOCATIVE"] = 60; + values[valuesById[61] = "XCOMP"] = 61; + values[valuesById[62] = "SUFFIX"] = 62; + values[valuesById[63] = "TITLE"] = 63; + values[valuesById[64] = "ADVPHMOD"] = 64; + values[valuesById[65] = "AUXCAUS"] = 65; + values[valuesById[66] = "AUXVV"] = 66; + values[valuesById[67] = "DTMOD"] = 67; + values[valuesById[68] = "FOREIGN"] = 68; + values[valuesById[69] = "KW"] = 69; + values[valuesById[70] = "LIST"] = 70; + values[valuesById[71] = "NOMC"] = 71; + values[valuesById[72] = "NOMCSUBJ"] = 72; + values[valuesById[73] = "NOMCSUBJPASS"] = 73; + values[valuesById[74] = "NUMC"] = 74; + values[valuesById[75] = "COP"] = 75; + values[valuesById[76] = "DISLOCATED"] = 76; + values[valuesById[77] = "ASP"] = 77; + values[valuesById[78] = "GMOD"] = 78; + values[valuesById[79] = "GOBJ"] = 79; + values[valuesById[80] = "INFMOD"] = 80; + values[valuesById[81] = "MES"] = 81; + values[valuesById[82] = "NCOMP"] = 82; + return values; + })(); + + return DependencyEdge; + })(); + + v1beta2.EntityMention = (function() { + + /** + * Properties of an EntityMention. + * @memberof google.cloud.language.v1beta2 + * @interface IEntityMention + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] EntityMention text + * @property {google.cloud.language.v1beta2.EntityMention.Type|null} [type] EntityMention type + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] EntityMention sentiment + */ + + /** + * Constructs a new EntityMention. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an EntityMention. + * @implements IEntityMention + * @constructor + * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set + */ + function EntityMention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityMention text. + * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.text = null; + + /** + * EntityMention type. + * @member {google.cloud.language.v1beta2.EntityMention.Type} type + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.type = 0; + + /** + * EntityMention sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.sentiment = null; + + /** + * Creates a new EntityMention instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention instance + */ + EntityMention.create = function create(properties) { + return new EntityMention(properties); + }; + + /** + * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.EntityMention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityMention message. + * @function verify + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityMention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates an EntityMention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + */ + EntityMention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.EntityMention) + return object; + var message = new $root.google.cloud.language.v1beta2.EntityMention(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1beta2.EntityMention.text: object expected"); + message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } break; - case "INFMOD": - case 80: - message.label = 80; + case "TYPE_UNKNOWN": + case 0: + message.type = 0; break; - case "MES": - case 81: - message.label = 81; + case "PROPER": + case 1: + message.type = 1; break; - case "NCOMP": - case 82: - message.label = 82; + case "COMMON": + case 2: + message.type = 2; break; } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.EntityMention.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); + } return message; }; /** - * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * Creates a plain object from an EntityMention message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.DependencyEdge + * @memberof google.cloud.language.v1beta2.EntityMention * @static - * @param {google.cloud.language.v1beta2.DependencyEdge} message DependencyEdge + * @param {google.cloud.language.v1beta2.EntityMention} message EntityMention * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DependencyEdge.toObject = function toObject(message, options) { + EntityMention.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.headTokenIndex = 0; - object.label = options.enums === String ? "UNKNOWN" : 0; + object.text = null; + object.type = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.sentiment = null; } - if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) - object.headTokenIndex = message.headTokenIndex; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.cloud.language.v1beta2.DependencyEdge.Label[message.label] === undefined ? message.label : $root.google.cloud.language.v1beta2.DependencyEdge.Label[message.label] : message.label; + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1beta2.EntityMention.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.EntityMention.Type[message.type] : message.type; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); return object; }; /** - * Converts this DependencyEdge to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.DependencyEdge - * @instance - * @returns {Object.} JSON object + * Converts this EntityMention to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + * @returns {Object.} JSON object + */ + EntityMention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityMention + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.EntityMention"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1beta2.EntityMention.Type + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} COMMON=2 COMMON value + */ + EntityMention.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "COMMON"] = 2; + return values; + })(); + + return EntityMention; + })(); + + v1beta2.TextSpan = (function() { + + /** + * Properties of a TextSpan. + * @memberof google.cloud.language.v1beta2 + * @interface ITextSpan + * @property {string|null} [content] TextSpan content + * @property {number|null} [beginOffset] TextSpan beginOffset + */ + + /** + * Constructs a new TextSpan. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a TextSpan. + * @implements ITextSpan + * @constructor + * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set + */ + function TextSpan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSpan content. + * @member {string} content + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + */ + TextSpan.prototype.content = ""; + + /** + * TextSpan beginOffset. + * @member {number} beginOffset + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + */ + TextSpan.prototype.beginOffset = 0; + + /** + * Creates a new TextSpan instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan instance + */ + TextSpan.create = function create(properties) { + return new TextSpan(properties); + }; + + /** + * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.beginOffset != null && Object.hasOwnProperty.call(message, "beginOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.beginOffset); + return writer; + }; + + /** + * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DependencyEdge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + TextSpan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.TextSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.beginOffset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; }; /** - * Gets the default type url for DependencyEdge - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.DependencyEdge + * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.TextSpan * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DependencyEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.DependencyEdge"; + TextSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; /** - * Label enum. - * @name google.cloud.language.v1beta2.DependencyEdge.Label - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ABBREV=1 ABBREV value - * @property {number} ACOMP=2 ACOMP value - * @property {number} ADVCL=3 ADVCL value - * @property {number} ADVMOD=4 ADVMOD value - * @property {number} AMOD=5 AMOD value - * @property {number} APPOS=6 APPOS value - * @property {number} ATTR=7 ATTR value - * @property {number} AUX=8 AUX value - * @property {number} AUXPASS=9 AUXPASS value - * @property {number} CC=10 CC value - * @property {number} CCOMP=11 CCOMP value - * @property {number} CONJ=12 CONJ value - * @property {number} CSUBJ=13 CSUBJ value - * @property {number} CSUBJPASS=14 CSUBJPASS value - * @property {number} DEP=15 DEP value - * @property {number} DET=16 DET value - * @property {number} DISCOURSE=17 DISCOURSE value - * @property {number} DOBJ=18 DOBJ value - * @property {number} EXPL=19 EXPL value - * @property {number} GOESWITH=20 GOESWITH value - * @property {number} IOBJ=21 IOBJ value - * @property {number} MARK=22 MARK value - * @property {number} MWE=23 MWE value - * @property {number} MWV=24 MWV value - * @property {number} NEG=25 NEG value - * @property {number} NN=26 NN value - * @property {number} NPADVMOD=27 NPADVMOD value - * @property {number} NSUBJ=28 NSUBJ value - * @property {number} NSUBJPASS=29 NSUBJPASS value - * @property {number} NUM=30 NUM value - * @property {number} NUMBER=31 NUMBER value - * @property {number} P=32 P value - * @property {number} PARATAXIS=33 PARATAXIS value - * @property {number} PARTMOD=34 PARTMOD value - * @property {number} PCOMP=35 PCOMP value - * @property {number} POBJ=36 POBJ value - * @property {number} POSS=37 POSS value - * @property {number} POSTNEG=38 POSTNEG value - * @property {number} PRECOMP=39 PRECOMP value - * @property {number} PRECONJ=40 PRECONJ value - * @property {number} PREDET=41 PREDET value - * @property {number} PREF=42 PREF value - * @property {number} PREP=43 PREP value - * @property {number} PRONL=44 PRONL value - * @property {number} PRT=45 PRT value - * @property {number} PS=46 PS value - * @property {number} QUANTMOD=47 QUANTMOD value - * @property {number} RCMOD=48 RCMOD value - * @property {number} RCMODREL=49 RCMODREL value - * @property {number} RDROP=50 RDROP value - * @property {number} REF=51 REF value - * @property {number} REMNANT=52 REMNANT value - * @property {number} REPARANDUM=53 REPARANDUM value - * @property {number} ROOT=54 ROOT value - * @property {number} SNUM=55 SNUM value - * @property {number} SUFF=56 SUFF value - * @property {number} TMOD=57 TMOD value - * @property {number} TOPIC=58 TOPIC value - * @property {number} VMOD=59 VMOD value - * @property {number} VOCATIVE=60 VOCATIVE value - * @property {number} XCOMP=61 XCOMP value - * @property {number} SUFFIX=62 SUFFIX value - * @property {number} TITLE=63 TITLE value - * @property {number} ADVPHMOD=64 ADVPHMOD value - * @property {number} AUXCAUS=65 AUXCAUS value - * @property {number} AUXVV=66 AUXVV value - * @property {number} DTMOD=67 DTMOD value - * @property {number} FOREIGN=68 FOREIGN value - * @property {number} KW=69 KW value - * @property {number} LIST=70 LIST value - * @property {number} NOMC=71 NOMC value - * @property {number} NOMCSUBJ=72 NOMCSUBJ value - * @property {number} NOMCSUBJPASS=73 NOMCSUBJPASS value - * @property {number} NUMC=74 NUMC value - * @property {number} COP=75 COP value - * @property {number} DISLOCATED=76 DISLOCATED value - * @property {number} ASP=77 ASP value - * @property {number} GMOD=78 GMOD value - * @property {number} GOBJ=79 GOBJ value - * @property {number} INFMOD=80 INFMOD value - * @property {number} MES=81 MES value - * @property {number} NCOMP=82 NCOMP value + * Verifies a TextSpan message. + * @function verify + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DependencyEdge.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ABBREV"] = 1; - values[valuesById[2] = "ACOMP"] = 2; - values[valuesById[3] = "ADVCL"] = 3; - values[valuesById[4] = "ADVMOD"] = 4; - values[valuesById[5] = "AMOD"] = 5; - values[valuesById[6] = "APPOS"] = 6; - values[valuesById[7] = "ATTR"] = 7; - values[valuesById[8] = "AUX"] = 8; - values[valuesById[9] = "AUXPASS"] = 9; - values[valuesById[10] = "CC"] = 10; - values[valuesById[11] = "CCOMP"] = 11; - values[valuesById[12] = "CONJ"] = 12; - values[valuesById[13] = "CSUBJ"] = 13; - values[valuesById[14] = "CSUBJPASS"] = 14; - values[valuesById[15] = "DEP"] = 15; - values[valuesById[16] = "DET"] = 16; - values[valuesById[17] = "DISCOURSE"] = 17; - values[valuesById[18] = "DOBJ"] = 18; - values[valuesById[19] = "EXPL"] = 19; - values[valuesById[20] = "GOESWITH"] = 20; - values[valuesById[21] = "IOBJ"] = 21; - values[valuesById[22] = "MARK"] = 22; - values[valuesById[23] = "MWE"] = 23; - values[valuesById[24] = "MWV"] = 24; - values[valuesById[25] = "NEG"] = 25; - values[valuesById[26] = "NN"] = 26; - values[valuesById[27] = "NPADVMOD"] = 27; - values[valuesById[28] = "NSUBJ"] = 28; - values[valuesById[29] = "NSUBJPASS"] = 29; - values[valuesById[30] = "NUM"] = 30; - values[valuesById[31] = "NUMBER"] = 31; - values[valuesById[32] = "P"] = 32; - values[valuesById[33] = "PARATAXIS"] = 33; - values[valuesById[34] = "PARTMOD"] = 34; - values[valuesById[35] = "PCOMP"] = 35; - values[valuesById[36] = "POBJ"] = 36; - values[valuesById[37] = "POSS"] = 37; - values[valuesById[38] = "POSTNEG"] = 38; - values[valuesById[39] = "PRECOMP"] = 39; - values[valuesById[40] = "PRECONJ"] = 40; - values[valuesById[41] = "PREDET"] = 41; - values[valuesById[42] = "PREF"] = 42; - values[valuesById[43] = "PREP"] = 43; - values[valuesById[44] = "PRONL"] = 44; - values[valuesById[45] = "PRT"] = 45; - values[valuesById[46] = "PS"] = 46; - values[valuesById[47] = "QUANTMOD"] = 47; - values[valuesById[48] = "RCMOD"] = 48; - values[valuesById[49] = "RCMODREL"] = 49; - values[valuesById[50] = "RDROP"] = 50; - values[valuesById[51] = "REF"] = 51; - values[valuesById[52] = "REMNANT"] = 52; - values[valuesById[53] = "REPARANDUM"] = 53; - values[valuesById[54] = "ROOT"] = 54; - values[valuesById[55] = "SNUM"] = 55; - values[valuesById[56] = "SUFF"] = 56; - values[valuesById[57] = "TMOD"] = 57; - values[valuesById[58] = "TOPIC"] = 58; - values[valuesById[59] = "VMOD"] = 59; - values[valuesById[60] = "VOCATIVE"] = 60; - values[valuesById[61] = "XCOMP"] = 61; - values[valuesById[62] = "SUFFIX"] = 62; - values[valuesById[63] = "TITLE"] = 63; - values[valuesById[64] = "ADVPHMOD"] = 64; - values[valuesById[65] = "AUXCAUS"] = 65; - values[valuesById[66] = "AUXVV"] = 66; - values[valuesById[67] = "DTMOD"] = 67; - values[valuesById[68] = "FOREIGN"] = 68; - values[valuesById[69] = "KW"] = 69; - values[valuesById[70] = "LIST"] = 70; - values[valuesById[71] = "NOMC"] = 71; - values[valuesById[72] = "NOMCSUBJ"] = 72; - values[valuesById[73] = "NOMCSUBJPASS"] = 73; - values[valuesById[74] = "NUMC"] = 74; - values[valuesById[75] = "COP"] = 75; - values[valuesById[76] = "DISLOCATED"] = 76; - values[valuesById[77] = "ASP"] = 77; - values[valuesById[78] = "GMOD"] = 78; - values[valuesById[79] = "GOBJ"] = 79; - values[valuesById[80] = "INFMOD"] = 80; - values[valuesById[81] = "MES"] = 81; - values[valuesById[82] = "NCOMP"] = 82; - return values; - })(); + TextSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + if (!$util.isInteger(message.beginOffset)) + return "beginOffset: integer expected"; + return null; + }; - return DependencyEdge; + /** + * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + */ + TextSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.TextSpan) + return object; + var message = new $root.google.cloud.language.v1beta2.TextSpan(); + if (object.content != null) + message.content = String(object.content); + if (object.beginOffset != null) + message.beginOffset = object.beginOffset | 0; + return message; + }; + + /** + * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.TextSpan} message TextSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.beginOffset = 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + object.beginOffset = message.beginOffset; + return object; + }; + + /** + * Converts this TextSpan to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + * @returns {Object.} JSON object + */ + TextSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSpan + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.TextSpan"; + }; + + return TextSpan; })(); - v1beta2.EntityMention = (function() { + v1beta2.ClassificationCategory = (function() { /** - * Properties of an EntityMention. + * Properties of a ClassificationCategory. * @memberof google.cloud.language.v1beta2 - * @interface IEntityMention - * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] EntityMention text - * @property {google.cloud.language.v1beta2.EntityMention.Type|null} [type] EntityMention type - * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] EntityMention sentiment + * @interface IClassificationCategory + * @property {string|null} [name] ClassificationCategory name + * @property {number|null} [confidence] ClassificationCategory confidence */ /** - * Constructs a new EntityMention. + * Constructs a new ClassificationCategory. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an EntityMention. - * @implements IEntityMention + * @classdesc Represents a ClassificationCategory. + * @implements IClassificationCategory * @constructor - * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set */ - function EntityMention(properties) { + function ClassificationCategory(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13057,103 +14148,89 @@ } /** - * EntityMention text. - * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text - * @memberof google.cloud.language.v1beta2.EntityMention - * @instance - */ - EntityMention.prototype.text = null; - - /** - * EntityMention type. - * @member {google.cloud.language.v1beta2.EntityMention.Type} type - * @memberof google.cloud.language.v1beta2.EntityMention + * ClassificationCategory name. + * @member {string} name + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @instance */ - EntityMention.prototype.type = 0; + ClassificationCategory.prototype.name = ""; /** - * EntityMention sentiment. - * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment - * @memberof google.cloud.language.v1beta2.EntityMention + * ClassificationCategory confidence. + * @member {number} confidence + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @instance */ - EntityMention.prototype.sentiment = null; + ClassificationCategory.prototype.confidence = 0; /** - * Creates a new EntityMention instance using the specified properties. + * Creates a new ClassificationCategory instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static - * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention instance + * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory instance */ - EntityMention.create = function create(properties) { - return new EntityMention(properties); + ClassificationCategory.create = function create(properties) { + return new ClassificationCategory(properties); }; /** - * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static - * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityMention.encode = function encode(message, writer) { + ClassificationCategory.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) - $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); return writer; }; /** - * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static - * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityMention.encodeDelimited = function encodeDelimited(message, writer) { + ClassificationCategory.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityMention message from the specified reader or buffer. + * Decodes a ClassificationCategory message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityMention.decode = function decode(reader, length) { + ClassificationCategory.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.EntityMention(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.type = reader.int32(); - break; - } - case 3: { - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + message.confidence = reader.float(); break; } default: @@ -13165,190 +14242,132 @@ }; /** - * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityMention.decodeDelimited = function decodeDelimited(reader) { + ClassificationCategory.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityMention message. + * Verifies a ClassificationCategory message. * @function verify - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityMention.verify = function verify(message) { + ClassificationCategory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) { - var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); - if (error) - return "text." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.sentiment != null && message.hasOwnProperty("sentiment")) { - var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); - if (error) - return "sentiment." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; return null; }; /** - * Creates an EntityMention message from a plain object. Also converts values to their respective internal types. + * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory */ - EntityMention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.EntityMention) + ClassificationCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationCategory) return object; - var message = new $root.google.cloud.language.v1beta2.EntityMention(); - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.language.v1beta2.EntityMention.text: object expected"); - message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "PROPER": - case 1: - message.type = 1; - break; - case "COMMON": - case 2: - message.type = 2; - break; - } - if (object.sentiment != null) { - if (typeof object.sentiment !== "object") - throw TypeError(".google.cloud.language.v1beta2.EntityMention.sentiment: object expected"); - message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); - } + var message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); + if (object.name != null) + message.name = String(object.name); + if (object.confidence != null) + message.confidence = Number(object.confidence); return message; }; /** - * Creates a plain object from an EntityMention message. Also converts values to other types if specified. + * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static - * @param {google.cloud.language.v1beta2.EntityMention} message EntityMention + * @param {google.cloud.language.v1beta2.ClassificationCategory} message ClassificationCategory * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityMention.toObject = function toObject(message, options) { + ClassificationCategory.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.text = null; - object.type = options.enums === String ? "TYPE_UNKNOWN" : 0; - object.sentiment = null; + object.name = ""; + object.confidence = 0; } - if (message.text != null && message.hasOwnProperty("text")) - object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.language.v1beta2.EntityMention.Type[message.type] === undefined ? message.type : $root.google.cloud.language.v1beta2.EntityMention.Type[message.type] : message.type; - if (message.sentiment != null && message.hasOwnProperty("sentiment")) - object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; return object; }; /** - * Converts this EntityMention to JSON. + * Converts this ClassificationCategory to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @instance * @returns {Object.} JSON object */ - EntityMention.prototype.toJSON = function toJSON() { + ClassificationCategory.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EntityMention + * Gets the default type url for ClassificationCategory * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.EntityMention + * @memberof google.cloud.language.v1beta2.ClassificationCategory * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EntityMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ClassificationCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.EntityMention"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationCategory"; }; - /** - * Type enum. - * @name google.cloud.language.v1beta2.EntityMention.Type - * @enum {number} - * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value - * @property {number} PROPER=1 PROPER value - * @property {number} COMMON=2 COMMON value - */ - EntityMention.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "PROPER"] = 1; - values[valuesById[2] = "COMMON"] = 2; - return values; - })(); - - return EntityMention; + return ClassificationCategory; })(); - v1beta2.TextSpan = (function() { + v1beta2.ClassificationModelOptions = (function() { /** - * Properties of a TextSpan. + * Properties of a ClassificationModelOptions. * @memberof google.cloud.language.v1beta2 - * @interface ITextSpan - * @property {string|null} [content] TextSpan content - * @property {number|null} [beginOffset] TextSpan beginOffset + * @interface IClassificationModelOptions + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null} [v1Model] ClassificationModelOptions v1Model + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null} [v2Model] ClassificationModelOptions v2Model */ /** - * Constructs a new TextSpan. + * Constructs a new ClassificationModelOptions. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a TextSpan. - * @implements ITextSpan + * @classdesc Represents a ClassificationModelOptions. + * @implements IClassificationModelOptions * @constructor - * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set */ - function TextSpan(properties) { + function ClassificationModelOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13356,89 +14375,103 @@ } /** - * TextSpan content. - * @member {string} content - * @memberof google.cloud.language.v1beta2.TextSpan + * ClassificationModelOptions v1Model. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null|undefined} v1Model + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @instance */ - TextSpan.prototype.content = ""; + ClassificationModelOptions.prototype.v1Model = null; /** - * TextSpan beginOffset. - * @member {number} beginOffset - * @memberof google.cloud.language.v1beta2.TextSpan + * ClassificationModelOptions v2Model. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null|undefined} v2Model + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @instance */ - TextSpan.prototype.beginOffset = 0; + ClassificationModelOptions.prototype.v2Model = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new TextSpan instance using the specified properties. + * ClassificationModelOptions modelType. + * @member {"v1Model"|"v2Model"|undefined} modelType + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @instance + */ + Object.defineProperty(ClassificationModelOptions.prototype, "modelType", { + get: $util.oneOfGetter($oneOfFields = ["v1Model", "v2Model"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClassificationModelOptions instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static - * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan instance + * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions instance */ - TextSpan.create = function create(properties) { - return new TextSpan(properties); + ClassificationModelOptions.create = function create(properties) { + return new ClassificationModelOptions(properties); }; /** - * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static - * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextSpan.encode = function encode(message, writer) { + ClassificationModelOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.beginOffset != null && Object.hasOwnProperty.call(message, "beginOffset")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.beginOffset); + if (message.v1Model != null && Object.hasOwnProperty.call(message, "v1Model")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.encode(message.v1Model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v2Model != null && Object.hasOwnProperty.call(message, "v2Model")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.encode(message.v2Model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static - * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextSpan.encodeDelimited = function encodeDelimited(message, writer) { + ClassificationModelOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TextSpan message from the specified reader or buffer. + * Decodes a ClassificationModelOptions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextSpan.decode = function decode(reader, length) { + ClassificationModelOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.TextSpan(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.content = reader.string(); + message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.decode(reader, reader.uint32()); break; } case 2: { - message.beginOffset = reader.int32(); + message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.decode(reader, reader.uint32()); break; } default: @@ -13450,359 +14483,571 @@ }; /** - * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextSpan.decodeDelimited = function decodeDelimited(reader) { + ClassificationModelOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TextSpan message. + * Verifies a ClassificationModelOptions message. * @function verify - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TextSpan.verify = function verify(message) { + ClassificationModelOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) - if (!$util.isInteger(message.beginOffset)) - return "beginOffset: integer expected"; + var properties = {}; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify(message.v1Model); + if (error) + return "v1Model." + error; + } + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + if (properties.modelType === 1) + return "modelType: multiple values"; + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify(message.v2Model); + if (error) + return "v2Model." + error; + } + } return null; }; /** - * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions */ - TextSpan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.TextSpan) + ClassificationModelOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions) return object; - var message = new $root.google.cloud.language.v1beta2.TextSpan(); - if (object.content != null) - message.content = String(object.content); - if (object.beginOffset != null) - message.beginOffset = object.beginOffset | 0; + var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); + if (object.v1Model != null) { + if (typeof object.v1Model !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v1Model: object expected"); + message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.fromObject(object.v1Model); + } + if (object.v2Model != null) { + if (typeof object.v2Model !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v2Model: object expected"); + message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.fromObject(object.v2Model); + } return message; }; /** - * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static - * @param {google.cloud.language.v1beta2.TextSpan} message TextSpan + * @param {google.cloud.language.v1beta2.ClassificationModelOptions} message ClassificationModelOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextSpan.toObject = function toObject(message, options) { + ClassificationModelOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.content = ""; - object.beginOffset = 0; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + object.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.toObject(message.v1Model, options); + if (options.oneofs) + object.modelType = "v1Model"; + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + object.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.toObject(message.v2Model, options); + if (options.oneofs) + object.modelType = "v2Model"; } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) - object.beginOffset = message.beginOffset; return object; }; /** - * Converts this TextSpan to JSON. + * Converts this ClassificationModelOptions to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @instance * @returns {Object.} JSON object */ - TextSpan.prototype.toJSON = function toJSON() { + ClassificationModelOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TextSpan + * Gets the default type url for ClassificationModelOptions * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.TextSpan + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TextSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ClassificationModelOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.TextSpan"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions"; }; - return TextSpan; - })(); + ClassificationModelOptions.V1Model = (function() { - v1beta2.ClassificationCategory = (function() { + /** + * Properties of a V1Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @interface IV1Model + */ - /** - * Properties of a ClassificationCategory. - * @memberof google.cloud.language.v1beta2 - * @interface IClassificationCategory - * @property {string|null} [name] ClassificationCategory name - * @property {number|null} [confidence] ClassificationCategory confidence - */ + /** + * Constructs a new V1Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @classdesc Represents a V1Model. + * @implements IV1Model + * @constructor + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set + */ + function V1Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ClassificationCategory. - * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a ClassificationCategory. - * @implements IClassificationCategory - * @constructor - * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set - */ - function ClassificationCategory(properties) { - if (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 V1Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model instance + */ + V1Model.create = function create(properties) { + return new V1Model(properties); + }; - /** - * ClassificationCategory name. - * @member {string} name - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @instance - */ - ClassificationCategory.prototype.name = ""; + /** + * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * ClassificationCategory confidence. - * @member {number} confidence - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @instance - */ - ClassificationCategory.prototype.confidence = 0; + /** + * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ClassificationCategory instance using the specified properties. - * @function create - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory instance - */ - ClassificationCategory.create = function create(properties) { - return new ClassificationCategory(properties); - }; + /** + * Decodes a V1Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a V1Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V1Model message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V1Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a V1Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + */ + V1Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + return object; + return new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + }; + + /** + * Creates a plain object from a V1Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} message V1Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V1Model.toObject = function toObject() { + return {}; + }; + + /** + * Converts this V1Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @instance + * @returns {Object.} JSON object + */ + V1Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for V1Model + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V1Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V1Model"; + }; + + return V1Model; + })(); + + ClassificationModelOptions.V2Model = (function() { + + /** + * Properties of a V2Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @interface IV2Model + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null} [contentCategoriesVersion] V2Model contentCategoriesVersion + */ + + /** + * Constructs a new V2Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @classdesc Represents a V2Model. + * @implements IV2Model + * @constructor + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set + */ + function V2Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * V2Model contentCategoriesVersion. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion} contentCategoriesVersion + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @instance + */ + V2Model.prototype.contentCategoriesVersion = 0; + + /** + * Creates a new V2Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model instance + */ + V2Model.create = function create(properties) { + return new V2Model(properties); + }; - /** - * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClassificationCategory.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); - return writer; - }; + /** + * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentCategoriesVersion != null && Object.hasOwnProperty.call(message, "contentCategoriesVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.contentCategoriesVersion); + return writer; + }; - /** - * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClassificationCategory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ClassificationCategory message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClassificationCategory.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Decodes a V2Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentCategoriesVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 2: { - message.confidence = reader.float(); + } + return message; + }; + + /** + * Decodes a V2Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V2Model message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V2Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + switch (message.contentCategoriesVersion) { + default: + return "contentCategoriesVersion: enum value expected"; + case 0: + case 1: + case 2: break; } + return null; + }; + + /** + * Creates a V2Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + */ + V2Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + switch (object.contentCategoriesVersion) { default: - reader.skipType(tag & 7); + if (typeof object.contentCategoriesVersion === "number") { + message.contentCategoriesVersion = object.contentCategoriesVersion; + break; + } + break; + case "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": + case 0: + message.contentCategoriesVersion = 0; + break; + case "V1": + case 1: + message.contentCategoriesVersion = 1; + break; + case "V2": + case 2: + message.contentCategoriesVersion = 2; break; } - } - return message; - }; - - /** - * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClassificationCategory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClassificationCategory message. - * @function verify - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClassificationCategory.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.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - return null; - }; + return message; + }; - /** - * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory - */ - ClassificationCategory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassificationCategory) - return object; - var message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); - if (object.name != null) - message.name = String(object.name); - if (object.confidence != null) - message.confidence = Number(object.confidence); - return message; - }; + /** + * Creates a plain object from a V2Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} message V2Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V2Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contentCategoriesVersion = options.enums === String ? "CONTENT_CATEGORIES_VERSION_UNSPECIFIED" : 0; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + object.contentCategoriesVersion = options.enums === String ? $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] === undefined ? message.contentCategoriesVersion : $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] : message.contentCategoriesVersion; + return object; + }; - /** - * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {google.cloud.language.v1beta2.ClassificationCategory} message ClassificationCategory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClassificationCategory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.confidence = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - return object; - }; + /** + * Converts this V2Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @instance + * @returns {Object.} JSON object + */ + V2Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ClassificationCategory to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @instance - * @returns {Object.} JSON object - */ - ClassificationCategory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for V2Model + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V2Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V2Model"; + }; - /** - * Gets the default type url for ClassificationCategory - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassificationCategory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClassificationCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationCategory"; - }; + /** + * ContentCategoriesVersion enum. + * @name google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + * @enum {number} + * @property {number} CONTENT_CATEGORIES_VERSION_UNSPECIFIED=0 CONTENT_CATEGORIES_VERSION_UNSPECIFIED value + * @property {number} V1=1 V1 value + * @property {number} V2=2 V2 value + */ + V2Model.ContentCategoriesVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "V1"] = 1; + values[valuesById[2] = "V2"] = 2; + return values; + })(); - return ClassificationCategory; + return V2Model; + })(); + + return ClassificationModelOptions; })(); - v1beta2.ClassificationModelOptions = (function() { + v1beta2.AnalyzeSentimentRequest = (function() { /** - * Properties of a ClassificationModelOptions. + * Properties of an AnalyzeSentimentRequest. * @memberof google.cloud.language.v1beta2 - * @interface IClassificationModelOptions - * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null} [v1Model] ClassificationModelOptions v1Model - * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null} [v2Model] ClassificationModelOptions v2Model + * @interface IAnalyzeSentimentRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSentimentRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSentimentRequest encodingType */ /** - * Constructs a new ClassificationModelOptions. + * Constructs a new AnalyzeSentimentRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a ClassificationModelOptions. - * @implements IClassificationModelOptions + * @classdesc Represents an AnalyzeSentimentRequest. + * @implements IAnalyzeSentimentRequest * @constructor - * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set */ - function ClassificationModelOptions(properties) { + function AnalyzeSentimentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13810,103 +15055,89 @@ } /** - * ClassificationModelOptions v1Model. - * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null|undefined} v1Model - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @instance - */ - ClassificationModelOptions.prototype.v1Model = null; - - /** - * ClassificationModelOptions v2Model. - * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null|undefined} v2Model - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * AnalyzeSentimentRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @instance */ - ClassificationModelOptions.prototype.v2Model = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + AnalyzeSentimentRequest.prototype.document = null; /** - * ClassificationModelOptions modelType. - * @member {"v1Model"|"v2Model"|undefined} modelType - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * AnalyzeSentimentRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @instance */ - Object.defineProperty(ClassificationModelOptions.prototype, "modelType", { - get: $util.oneOfGetter($oneOfFields = ["v1Model", "v2Model"]), - set: $util.oneOfSetter($oneOfFields) - }); + AnalyzeSentimentRequest.prototype.encodingType = 0; /** - * Creates a new ClassificationModelOptions instance using the specified properties. + * Creates a new AnalyzeSentimentRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static - * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions instance + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest instance */ - ClassificationModelOptions.create = function create(properties) { - return new ClassificationModelOptions(properties); + AnalyzeSentimentRequest.create = function create(properties) { + return new AnalyzeSentimentRequest(properties); }; /** - * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static - * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassificationModelOptions.encode = function encode(message, writer) { + AnalyzeSentimentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.v1Model != null && Object.hasOwnProperty.call(message, "v1Model")) - $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.encode(message.v1Model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.v2Model != null && Object.hasOwnProperty.call(message, "v2Model")) - $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.encode(message.v2Model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); return writer; }; /** - * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static - * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassificationModelOptions.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeSentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClassificationModelOptions message from the specified reader or buffer. + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassificationModelOptions.decode = function decode(reader, length) { + AnalyzeSentimentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.decode(reader, reader.uint32()); + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); break; } case 2: { - message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.decode(reader, reader.uint32()); + message.encodingType = reader.int32(); break; } default: @@ -13918,571 +15149,443 @@ }; /** - * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassificationModelOptions.decodeDelimited = function decodeDelimited(reader) { + AnalyzeSentimentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClassificationModelOptions message. + * Verifies an AnalyzeSentimentRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClassificationModelOptions.verify = function verify(message) { + AnalyzeSentimentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.v1Model != null && message.hasOwnProperty("v1Model")) { - properties.modelType = 1; - { - var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify(message.v1Model); - if (error) - return "v1Model." + error; - } + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; } - if (message.v2Model != null && message.hasOwnProperty("v2Model")) { - if (properties.modelType === 1) - return "modelType: multiple values"; - properties.modelType = 1; - { - var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify(message.v2Model); - if (error) - return "v2Model." + error; + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } return null; }; /** - * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest */ - ClassificationModelOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions) - return object; - var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); - if (object.v1Model != null) { - if (typeof object.v1Model !== "object") - throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v1Model: object expected"); - message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.fromObject(object.v1Model); + AnalyzeSentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } - if (object.v2Model != null) { - if (typeof object.v2Model !== "object") - throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v2Model: object expected"); - message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.fromObject(object.v2Model); + switch (object.encodingType) { + default: + if (typeof object.encodingType === "number") { + message.encodingType = object.encodingType; + break; + } + break; + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; } return message; }; /** - * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions} message ClassificationModelOptions + * @param {google.cloud.language.v1beta2.AnalyzeSentimentRequest} message AnalyzeSentimentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClassificationModelOptions.toObject = function toObject(message, options) { + AnalyzeSentimentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.v1Model != null && message.hasOwnProperty("v1Model")) { - object.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.toObject(message.v1Model, options); - if (options.oneofs) - object.modelType = "v1Model"; - } - if (message.v2Model != null && message.hasOwnProperty("v2Model")) { - object.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.toObject(message.v2Model, options); - if (options.oneofs) - object.modelType = "v2Model"; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] === undefined ? message.encodingType : $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; return object; }; - /** - * Converts this ClassificationModelOptions to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @instance - * @returns {Object.} JSON object - */ - ClassificationModelOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClassificationModelOptions - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClassificationModelOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions"; - }; - - ClassificationModelOptions.V1Model = (function() { - - /** - * Properties of a V1Model. - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @interface IV1Model - */ - - /** - * Constructs a new V1Model. - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @classdesc Represents a V1Model. - * @implements IV1Model - * @constructor - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set - */ - function V1Model(properties) { - if (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 V1Model instance using the specified properties. - * @function create - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model instance - */ - V1Model.create = function create(properties) { - return new V1Model(properties); - }; - - /** - * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - V1Model.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - V1Model.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a V1Model message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - V1Model.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a V1Model message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - V1Model.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a V1Model message. - * @function verify - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - V1Model.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a V1Model message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model - */ - V1Model.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) - return object; - return new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); - }; - - /** - * Creates a plain object from a V1Model message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} message V1Model - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - V1Model.toObject = function toObject() { - return {}; - }; - - /** - * Converts this V1Model to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @instance - * @returns {Object.} JSON object - */ - V1Model.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for V1Model - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - V1Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V1Model"; - }; - - return V1Model; - })(); + /** + * Converts this AnalyzeSentimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - ClassificationModelOptions.V2Model = (function() { + /** + * Gets the default type url for AnalyzeSentimentRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentRequest"; + }; - /** - * Properties of a V2Model. - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @interface IV2Model - * @property {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null} [contentCategoriesVersion] V2Model contentCategoriesVersion - */ + return AnalyzeSentimentRequest; + })(); - /** - * Constructs a new V2Model. - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions - * @classdesc Represents a V2Model. - * @implements IV2Model - * @constructor - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set - */ - function V2Model(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1beta2.AnalyzeSentimentResponse = (function() { - /** - * V2Model contentCategoriesVersion. - * @member {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion} contentCategoriesVersion - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @instance - */ - V2Model.prototype.contentCategoriesVersion = 0; + /** + * Properties of an AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeSentimentResponse + * @property {google.cloud.language.v1beta2.ISentiment|null} [documentSentiment] AnalyzeSentimentResponse documentSentiment + * @property {string|null} [language] AnalyzeSentimentResponse language + * @property {Array.|null} [sentences] AnalyzeSentimentResponse sentences + */ - /** - * Creates a new V2Model instance using the specified properties. - * @function create - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model instance - */ - V2Model.create = function create(properties) { - return new V2Model(properties); - }; + /** + * Constructs a new AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeSentimentResponse. + * @implements IAnalyzeSentimentResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set + */ + function AnalyzeSentimentResponse(properties) { + this.sentences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. - * @function encode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - V2Model.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contentCategoriesVersion != null && Object.hasOwnProperty.call(message, "contentCategoriesVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.contentCategoriesVersion); - return writer; - }; + /** + * AnalyzeSentimentResponse documentSentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.documentSentiment = null; - /** - * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - V2Model.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * AnalyzeSentimentResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.language = ""; - /** - * Decodes a V2Model message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - V2Model.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.contentCategoriesVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * AnalyzeSentimentResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.sentences = $util.emptyArray; - /** - * Decodes a V2Model message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - V2Model.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse instance + */ + AnalyzeSentimentResponse.create = function create(properties) { + return new AnalyzeSentimentResponse(properties); + }; - /** - * Verifies a V2Model message. - * @function verify - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - V2Model.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) - switch (message.contentCategoriesVersion) { - default: - return "contentCategoriesVersion: enum value expected"; - case 0: - case 1: - case 2: + /** + * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); break; } - return null; - }; - - /** - * Creates a V2Model message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model - */ - V2Model.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) - return object; - var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); - switch (object.contentCategoriesVersion) { - default: - if (typeof object.contentCategoriesVersion === "number") { - message.contentCategoriesVersion = object.contentCategoriesVersion; + case 2: { + message.language = reader.string(); break; } - break; - case "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": - case 0: - message.contentCategoriesVersion = 0; - break; - case "V1": - case 1: - message.contentCategoriesVersion = 1; - break; - case "V2": - case 2: - message.contentCategoriesVersion = 2; + case 3: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a V2Model message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} message V2Model - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - V2Model.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.contentCategoriesVersion = options.enums === String ? "CONTENT_CATEGORIES_VERSION_UNSPECIFIED" : 0; - if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) - object.contentCategoriesVersion = options.enums === String ? $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] === undefined ? message.contentCategoriesVersion : $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] : message.contentCategoriesVersion; - return object; - }; + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this V2Model to JSON. - * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @instance - * @returns {Object.} JSON object - */ - V2Model.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies an AnalyzeSentimentResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSentimentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + return null; + }; - /** - * Gets the default type url for V2Model - * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - V2Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Creates an AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + */ + AnalyzeSentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.documentSentiment); + } + if (object.language != null) + message.language = String(object.language); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V2Model"; - }; + } + return message; + }; - /** - * ContentCategoriesVersion enum. - * @name google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion - * @enum {number} - * @property {number} CONTENT_CATEGORIES_VERSION_UNSPECIFIED=0 CONTENT_CATEGORIES_VERSION_UNSPECIFIED value - * @property {number} V1=1 V1 value - * @property {number} V2=2 V2 value - */ - V2Model.ContentCategoriesVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "V1"] = 1; - values[valuesById[2] = "V2"] = 2; - return values; - })(); + /** + * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} message AnalyzeSentimentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSentimentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sentences = []; + if (options.defaults) { + object.documentSentiment = null; + object.language = ""; + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.documentSentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); + } + return object; + }; - return V2Model; - })(); + /** + * Converts this AnalyzeSentimentResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ClassificationModelOptions; + /** + * Gets the default type url for AnalyzeSentimentResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentResponse"; + }; + + return AnalyzeSentimentResponse; })(); - v1beta2.AnalyzeSentimentRequest = (function() { + v1beta2.AnalyzeEntitySentimentRequest = (function() { /** - * Properties of an AnalyzeSentimentRequest. - * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeSentimentRequest - * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSentimentRequest document - * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSentimentRequest encodingType + * Properties of an AnalyzeEntitySentimentRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeEntitySentimentRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitySentimentRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitySentimentRequest encodingType */ /** - * Constructs a new AnalyzeSentimentRequest. + * Constructs a new AnalyzeEntitySentimentRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeSentimentRequest. - * @implements IAnalyzeSentimentRequest + * @classdesc Represents an AnalyzeEntitySentimentRequest. + * @implements IAnalyzeEntitySentimentRequest * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set */ - function AnalyzeSentimentRequest(properties) { + function AnalyzeEntitySentimentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14490,43 +15593,43 @@ } /** - * AnalyzeSentimentRequest document. + * AnalyzeEntitySentimentRequest document. * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @instance */ - AnalyzeSentimentRequest.prototype.document = null; + AnalyzeEntitySentimentRequest.prototype.document = null; /** - * AnalyzeSentimentRequest encodingType. + * AnalyzeEntitySentimentRequest encodingType. * @member {google.cloud.language.v1beta2.EncodingType} encodingType - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @instance */ - AnalyzeSentimentRequest.prototype.encodingType = 0; + AnalyzeEntitySentimentRequest.prototype.encodingType = 0; /** - * Creates a new AnalyzeSentimentRequest instance using the specified properties. + * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest instance */ - AnalyzeSentimentRequest.create = function create(properties) { - return new AnalyzeSentimentRequest(properties); + AnalyzeEntitySentimentRequest.create = function create(properties) { + return new AnalyzeEntitySentimentRequest(properties); }; /** - * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSentimentRequest.encode = function encode(message, writer) { + AnalyzeEntitySentimentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) @@ -14537,33 +15640,33 @@ }; /** - * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeEntitySentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSentimentRequest.decode = function decode(reader, length) { + AnalyzeEntitySentimentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14584,30 +15687,30 @@ }; /** - * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSentimentRequest.decodeDelimited = function decodeDelimited(reader) { + AnalyzeEntitySentimentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeSentimentRequest message. + * Verifies an AnalyzeEntitySentimentRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeSentimentRequest.verify = function verify(message) { + AnalyzeEntitySentimentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { @@ -14629,20 +15732,20 @@ }; /** - * Creates an AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest */ - AnalyzeSentimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest) + AnalyzeEntitySentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.document: object expected"); message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } switch (object.encodingType) { @@ -14673,15 +15776,15 @@ }; /** - * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static - * @param {google.cloud.language.v1beta2.AnalyzeSentimentRequest} message AnalyzeSentimentRequest + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeSentimentRequest.toObject = function toObject(message, options) { + AnalyzeEntitySentimentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -14697,55 +15800,54 @@ }; /** - * Converts this AnalyzeSentimentRequest to JSON. + * Converts this AnalyzeEntitySentimentRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @instance * @returns {Object.} JSON object */ - AnalyzeSentimentRequest.prototype.toJSON = function toJSON() { + AnalyzeEntitySentimentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeSentimentRequest + * Gets the default type url for AnalyzeEntitySentimentRequest * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeSentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeEntitySentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentRequest"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest"; }; - return AnalyzeSentimentRequest; + return AnalyzeEntitySentimentRequest; })(); - v1beta2.AnalyzeSentimentResponse = (function() { + v1beta2.AnalyzeEntitySentimentResponse = (function() { /** - * Properties of an AnalyzeSentimentResponse. + * Properties of an AnalyzeEntitySentimentResponse. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeSentimentResponse - * @property {google.cloud.language.v1beta2.ISentiment|null} [documentSentiment] AnalyzeSentimentResponse documentSentiment - * @property {string|null} [language] AnalyzeSentimentResponse language - * @property {Array.|null} [sentences] AnalyzeSentimentResponse sentences + * @interface IAnalyzeEntitySentimentResponse + * @property {Array.|null} [entities] AnalyzeEntitySentimentResponse entities + * @property {string|null} [language] AnalyzeEntitySentimentResponse language */ /** - * Constructs a new AnalyzeSentimentResponse. + * Constructs a new AnalyzeEntitySentimentResponse. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeSentimentResponse. - * @implements IAnalyzeSentimentResponse + * @classdesc Represents an AnalyzeEntitySentimentResponse. + * @implements IAnalyzeEntitySentimentResponse * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set */ - function AnalyzeSentimentResponse(properties) { - this.sentences = []; + function AnalyzeEntitySentimentResponse(properties) { + this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14753,108 +15855,94 @@ } /** - * AnalyzeSentimentResponse documentSentiment. - * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} documentSentiment - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * AnalyzeEntitySentimentResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @instance */ - AnalyzeSentimentResponse.prototype.documentSentiment = null; + AnalyzeEntitySentimentResponse.prototype.entities = $util.emptyArray; /** - * AnalyzeSentimentResponse language. + * AnalyzeEntitySentimentResponse language. * @member {string} language - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse - * @instance - */ - AnalyzeSentimentResponse.prototype.language = ""; - - /** - * AnalyzeSentimentResponse sentences. - * @member {Array.} sentences - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @instance */ - AnalyzeSentimentResponse.prototype.sentences = $util.emptyArray; + AnalyzeEntitySentimentResponse.prototype.language = ""; /** - * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse instance */ - AnalyzeSentimentResponse.create = function create(properties) { - return new AnalyzeSentimentResponse(properties); + AnalyzeEntitySentimentResponse.create = function create(properties) { + return new AnalyzeEntitySentimentResponse(properties); }; /** - * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSentimentResponse.encode = function encode(message, writer) { + AnalyzeEntitySentimentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) - $root.google.cloud.language.v1beta2.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1beta2.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.language != null && Object.hasOwnProperty.call(message, "language")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); - if (message.sentences != null && message.sentences.length) - for (var i = 0; i < message.sentences.length; ++i) - $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeEntitySentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSentimentResponse.decode = function decode(reader, length) { + AnalyzeEntitySentimentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1beta2.Entity.decode(reader, reader.uint32())); break; } case 2: { message.language = reader.string(); break; } - case 3: { - if (!(message.sentences && message.sentences.length)) - message.sentences = []; - message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); - break; - } default: reader.skipType(tag & 7); break; @@ -14864,163 +15952,149 @@ }; /** - * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSentimentResponse.decodeDelimited = function decodeDelimited(reader) { + AnalyzeEntitySentimentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeSentimentResponse message. + * Verifies an AnalyzeEntitySentimentResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeSentimentResponse.verify = function verify(message) { + AnalyzeEntitySentimentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { - var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.documentSentiment); - if (error) - return "documentSentiment." + error; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } } if (message.language != null && message.hasOwnProperty("language")) if (!$util.isString(message.language)) return "language: string expected"; - if (message.sentences != null && message.hasOwnProperty("sentences")) { - if (!Array.isArray(message.sentences)) - return "sentences: array expected"; - for (var i = 0; i < message.sentences.length; ++i) { - var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); - if (error) - return "sentences." + error; - } - } return null; }; /** - * Creates an AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse */ - AnalyzeSentimentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse) + AnalyzeEntitySentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); - if (object.documentSentiment != null) { - if (typeof object.documentSentiment !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.documentSentiment: object expected"); - message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.documentSentiment); + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); + } } if (object.language != null) message.language = String(object.language); - if (object.sentences) { - if (!Array.isArray(object.sentences)) - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: array expected"); - message.sentences = []; - for (var i = 0; i < object.sentences.length; ++i) { - if (typeof object.sentences[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: object expected"); - message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); - } - } return message; }; /** - * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static - * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} message AnalyzeSentimentResponse + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeSentimentResponse.toObject = function toObject(message, options) { + AnalyzeEntitySentimentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.sentences = []; - if (options.defaults) { - object.documentSentiment = null; + object.entities = []; + if (options.defaults) object.language = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1beta2.Entity.toObject(message.entities[j], options); } - if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) - object.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.documentSentiment, options); if (message.language != null && message.hasOwnProperty("language")) object.language = message.language; - if (message.sentences && message.sentences.length) { - object.sentences = []; - for (var j = 0; j < message.sentences.length; ++j) - object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); - } return object; }; /** - * Converts this AnalyzeSentimentResponse to JSON. + * Converts this AnalyzeEntitySentimentResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @instance * @returns {Object.} JSON object */ - AnalyzeSentimentResponse.prototype.toJSON = function toJSON() { + AnalyzeEntitySentimentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeSentimentResponse + * Gets the default type url for AnalyzeEntitySentimentResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeSentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeEntitySentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentResponse"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse"; }; - return AnalyzeSentimentResponse; + return AnalyzeEntitySentimentResponse; })(); - v1beta2.AnalyzeEntitySentimentRequest = (function() { + v1beta2.AnalyzeEntitiesRequest = (function() { /** - * Properties of an AnalyzeEntitySentimentRequest. + * Properties of an AnalyzeEntitiesRequest. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeEntitySentimentRequest - * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitySentimentRequest document - * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitySentimentRequest encodingType + * @interface IAnalyzeEntitiesRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitiesRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitiesRequest encodingType */ /** - * Constructs a new AnalyzeEntitySentimentRequest. + * Constructs a new AnalyzeEntitiesRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeEntitySentimentRequest. - * @implements IAnalyzeEntitySentimentRequest + * @classdesc Represents an AnalyzeEntitiesRequest. + * @implements IAnalyzeEntitiesRequest * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set */ - function AnalyzeEntitySentimentRequest(properties) { + function AnalyzeEntitiesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15028,43 +16102,43 @@ } /** - * AnalyzeEntitySentimentRequest document. + * AnalyzeEntitiesRequest document. * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @instance */ - AnalyzeEntitySentimentRequest.prototype.document = null; + AnalyzeEntitiesRequest.prototype.document = null; /** - * AnalyzeEntitySentimentRequest encodingType. + * AnalyzeEntitiesRequest encodingType. * @member {google.cloud.language.v1beta2.EncodingType} encodingType - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @instance */ - AnalyzeEntitySentimentRequest.prototype.encodingType = 0; + AnalyzeEntitiesRequest.prototype.encodingType = 0; /** - * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. + * Creates a new AnalyzeEntitiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest instance */ - AnalyzeEntitySentimentRequest.create = function create(properties) { - return new AnalyzeEntitySentimentRequest(properties); + AnalyzeEntitiesRequest.create = function create(properties) { + return new AnalyzeEntitiesRequest(properties); }; /** - * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitySentimentRequest.encode = function encode(message, writer) { + AnalyzeEntitiesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) @@ -15075,33 +16149,33 @@ }; /** - * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitySentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitySentimentRequest.decode = function decode(reader, length) { + AnalyzeEntitiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15122,30 +16196,30 @@ }; /** - * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitySentimentRequest.decodeDelimited = function decodeDelimited(reader) { + AnalyzeEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeEntitySentimentRequest message. + * Verifies an AnalyzeEntitiesRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeEntitySentimentRequest.verify = function verify(message) { + AnalyzeEntitiesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { @@ -15167,20 +16241,20 @@ }; /** - * Creates an AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest */ - AnalyzeEntitySentimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) + AnalyzeEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesRequest.document: object expected"); message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } switch (object.encodingType) { @@ -15211,15 +16285,15 @@ }; /** - * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static - * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} message AnalyzeEntitiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeEntitySentimentRequest.toObject = function toObject(message, options) { + AnalyzeEntitiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15235,53 +16309,53 @@ }; /** - * Converts this AnalyzeEntitySentimentRequest to JSON. + * Converts this AnalyzeEntitiesRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @instance * @returns {Object.} JSON object */ - AnalyzeEntitySentimentRequest.prototype.toJSON = function toJSON() { + AnalyzeEntitiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeEntitySentimentRequest + * Gets the default type url for AnalyzeEntitiesRequest * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeEntitySentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesRequest"; }; - return AnalyzeEntitySentimentRequest; + return AnalyzeEntitiesRequest; })(); - v1beta2.AnalyzeEntitySentimentResponse = (function() { + v1beta2.AnalyzeEntitiesResponse = (function() { /** - * Properties of an AnalyzeEntitySentimentResponse. + * Properties of an AnalyzeEntitiesResponse. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeEntitySentimentResponse - * @property {Array.|null} [entities] AnalyzeEntitySentimentResponse entities - * @property {string|null} [language] AnalyzeEntitySentimentResponse language + * @interface IAnalyzeEntitiesResponse + * @property {Array.|null} [entities] AnalyzeEntitiesResponse entities + * @property {string|null} [language] AnalyzeEntitiesResponse language */ /** - * Constructs a new AnalyzeEntitySentimentResponse. + * Constructs a new AnalyzeEntitiesResponse. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeEntitySentimentResponse. - * @implements IAnalyzeEntitySentimentResponse + * @classdesc Represents an AnalyzeEntitiesResponse. + * @implements IAnalyzeEntitiesResponse * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set */ - function AnalyzeEntitySentimentResponse(properties) { + function AnalyzeEntitiesResponse(properties) { this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -15290,43 +16364,43 @@ } /** - * AnalyzeEntitySentimentResponse entities. + * AnalyzeEntitiesResponse entities. * @member {Array.} entities - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @instance */ - AnalyzeEntitySentimentResponse.prototype.entities = $util.emptyArray; + AnalyzeEntitiesResponse.prototype.entities = $util.emptyArray; /** - * AnalyzeEntitySentimentResponse language. + * AnalyzeEntitiesResponse language. * @member {string} language - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @instance */ - AnalyzeEntitySentimentResponse.prototype.language = ""; + AnalyzeEntitiesResponse.prototype.language = ""; /** - * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. + * Creates a new AnalyzeEntitiesResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse instance */ - AnalyzeEntitySentimentResponse.create = function create(properties) { - return new AnalyzeEntitySentimentResponse(properties); + AnalyzeEntitiesResponse.create = function create(properties) { + return new AnalyzeEntitiesResponse(properties); }; /** - * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitySentimentResponse.encode = function encode(message, writer) { + AnalyzeEntitiesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.entities != null && message.entities.length) @@ -15338,33 +16412,33 @@ }; /** - * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitySentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitySentimentResponse.decode = function decode(reader, length) { + AnalyzeEntitiesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15387,30 +16461,30 @@ }; /** - * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitySentimentResponse.decodeDelimited = function decodeDelimited(reader) { + AnalyzeEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeEntitySentimentResponse message. + * Verifies an AnalyzeEntitiesResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeEntitySentimentResponse.verify = function verify(message) { + AnalyzeEntitiesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.entities != null && message.hasOwnProperty("entities")) { @@ -15429,24 +16503,24 @@ }; /** - * Creates an AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse */ - AnalyzeEntitySentimentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse) + AnalyzeEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); if (object.entities) { if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: array expected"); + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: array expected"); message.entities = []; for (var i = 0; i < object.entities.length; ++i) { if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: object expected"); + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: object expected"); message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); } } @@ -15456,15 +16530,15 @@ }; /** - * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static - * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} message AnalyzeEntitiesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeEntitySentimentResponse.toObject = function toObject(message, options) { + AnalyzeEntitiesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15483,53 +16557,53 @@ }; /** - * Converts this AnalyzeEntitySentimentResponse to JSON. + * Converts this AnalyzeEntitiesResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @instance * @returns {Object.} JSON object */ - AnalyzeEntitySentimentResponse.prototype.toJSON = function toJSON() { + AnalyzeEntitiesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeEntitySentimentResponse + * Gets the default type url for AnalyzeEntitiesResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeEntitySentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesResponse"; }; - return AnalyzeEntitySentimentResponse; + return AnalyzeEntitiesResponse; })(); - v1beta2.AnalyzeEntitiesRequest = (function() { + v1beta2.AnalyzeSyntaxRequest = (function() { /** - * Properties of an AnalyzeEntitiesRequest. + * Properties of an AnalyzeSyntaxRequest. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeEntitiesRequest - * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitiesRequest document - * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitiesRequest encodingType + * @interface IAnalyzeSyntaxRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSyntaxRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSyntaxRequest encodingType */ /** - * Constructs a new AnalyzeEntitiesRequest. + * Constructs a new AnalyzeSyntaxRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeEntitiesRequest. - * @implements IAnalyzeEntitiesRequest + * @classdesc Represents an AnalyzeSyntaxRequest. + * @implements IAnalyzeSyntaxRequest * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set */ - function AnalyzeEntitiesRequest(properties) { + function AnalyzeSyntaxRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15537,43 +16611,43 @@ } /** - * AnalyzeEntitiesRequest document. + * AnalyzeSyntaxRequest document. * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @instance */ - AnalyzeEntitiesRequest.prototype.document = null; + AnalyzeSyntaxRequest.prototype.document = null; /** - * AnalyzeEntitiesRequest encodingType. + * AnalyzeSyntaxRequest encodingType. * @member {google.cloud.language.v1beta2.EncodingType} encodingType - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @instance */ - AnalyzeEntitiesRequest.prototype.encodingType = 0; + AnalyzeSyntaxRequest.prototype.encodingType = 0; /** - * Creates a new AnalyzeEntitiesRequest instance using the specified properties. + * Creates a new AnalyzeSyntaxRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest instance */ - AnalyzeEntitiesRequest.create = function create(properties) { - return new AnalyzeEntitiesRequest(properties); + AnalyzeSyntaxRequest.create = function create(properties) { + return new AnalyzeSyntaxRequest(properties); }; /** - * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitiesRequest.encode = function encode(message, writer) { + AnalyzeSyntaxRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) @@ -15584,33 +16658,33 @@ }; /** - * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeSyntaxRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitiesRequest.decode = function decode(reader, length) { + AnalyzeSyntaxRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15631,30 +16705,30 @@ }; /** - * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + AnalyzeSyntaxRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeEntitiesRequest message. + * Verifies an AnalyzeSyntaxRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeEntitiesRequest.verify = function verify(message) { + AnalyzeSyntaxRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { @@ -15676,20 +16750,20 @@ }; /** - * Creates an AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest */ - AnalyzeEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) + AnalyzeSyntaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); + var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxRequest.document: object expected"); message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } switch (object.encodingType) { @@ -15720,15 +16794,15 @@ }; /** - * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static - * @param {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} message AnalyzeEntitiesRequest + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} message AnalyzeSyntaxRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeEntitiesRequest.toObject = function toObject(message, options) { + AnalyzeSyntaxRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15744,54 +16818,56 @@ }; /** - * Converts this AnalyzeEntitiesRequest to JSON. + * Converts this AnalyzeSyntaxRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @instance * @returns {Object.} JSON object */ - AnalyzeEntitiesRequest.prototype.toJSON = function toJSON() { + AnalyzeSyntaxRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeEntitiesRequest + * Gets the default type url for AnalyzeSyntaxRequest * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeSyntaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesRequest"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxRequest"; }; - return AnalyzeEntitiesRequest; + return AnalyzeSyntaxRequest; })(); - v1beta2.AnalyzeEntitiesResponse = (function() { + v1beta2.AnalyzeSyntaxResponse = (function() { /** - * Properties of an AnalyzeEntitiesResponse. + * Properties of an AnalyzeSyntaxResponse. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeEntitiesResponse - * @property {Array.|null} [entities] AnalyzeEntitiesResponse entities - * @property {string|null} [language] AnalyzeEntitiesResponse language + * @interface IAnalyzeSyntaxResponse + * @property {Array.|null} [sentences] AnalyzeSyntaxResponse sentences + * @property {Array.|null} [tokens] AnalyzeSyntaxResponse tokens + * @property {string|null} [language] AnalyzeSyntaxResponse language */ /** - * Constructs a new AnalyzeEntitiesResponse. + * Constructs a new AnalyzeSyntaxResponse. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeEntitiesResponse. - * @implements IAnalyzeEntitiesResponse + * @classdesc Represents an AnalyzeSyntaxResponse. + * @implements IAnalyzeSyntaxResponse * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set */ - function AnalyzeEntitiesResponse(properties) { - this.entities = []; + function AnalyzeSyntaxResponse(properties) { + this.sentences = []; + this.tokens = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15799,91 +16875,108 @@ } /** - * AnalyzeEntitiesResponse entities. - * @member {Array.} entities - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * AnalyzeSyntaxResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @instance */ - AnalyzeEntitiesResponse.prototype.entities = $util.emptyArray; + AnalyzeSyntaxResponse.prototype.sentences = $util.emptyArray; /** - * AnalyzeEntitiesResponse language. + * AnalyzeSyntaxResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.tokens = $util.emptyArray; + + /** + * AnalyzeSyntaxResponse language. * @member {string} language - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @instance */ - AnalyzeEntitiesResponse.prototype.language = ""; + AnalyzeSyntaxResponse.prototype.language = ""; /** - * Creates a new AnalyzeEntitiesResponse instance using the specified properties. + * Creates a new AnalyzeSyntaxResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse instance */ - AnalyzeEntitiesResponse.create = function create(properties) { - return new AnalyzeEntitiesResponse(properties); + AnalyzeSyntaxResponse.create = function create(properties) { + return new AnalyzeSyntaxResponse(properties); }; /** - * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitiesResponse.encode = function encode(message, writer) { + AnalyzeSyntaxResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.language.v1beta2.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1beta2.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.language != null && Object.hasOwnProperty.call(message, "language")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.language); return writer; }; /** - * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeSyntaxResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitiesResponse.decode = function decode(reader, length) { + AnalyzeSyntaxResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.language.v1beta2.Entity.decode(reader, reader.uint32())); + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); break; } case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1beta2.Token.decode(reader, reader.uint32())); + break; + } + case 3: { message.language = reader.string(); break; } @@ -15896,39 +16989,48 @@ }; /** - * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + AnalyzeSyntaxResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeEntitiesResponse message. + * Verifies an AnalyzeSyntaxResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeEntitiesResponse.verify = function verify(message) { + AnalyzeSyntaxResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.language.v1beta2.Entity.verify(message.entities[i]); + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); if (error) - return "entities." + error; + return "sentences." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; } } if (message.language != null && message.hasOwnProperty("language")) @@ -15938,25 +17040,35 @@ }; /** - * Creates an AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse */ - AnalyzeEntitiesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse) + AnalyzeSyntaxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: object expected"); - message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); + var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1beta2.Token.fromObject(object.tokens[i]); } } if (object.language != null) @@ -15965,26 +17077,33 @@ }; /** - * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static - * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} message AnalyzeEntitiesResponse + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} message AnalyzeSyntaxResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeEntitiesResponse.toObject = function toObject(message, options) { + AnalyzeSyntaxResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + } if (options.defaults) object.language = ""; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.language.v1beta2.Entity.toObject(message.entities[j], options); + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1beta2.Token.toObject(message.tokens[j], options); } if (message.language != null && message.hasOwnProperty("language")) object.language = message.language; @@ -15992,53 +17111,53 @@ }; /** - * Converts this AnalyzeEntitiesResponse to JSON. + * Converts this AnalyzeSyntaxResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @instance * @returns {Object.} JSON object */ - AnalyzeEntitiesResponse.prototype.toJSON = function toJSON() { + AnalyzeSyntaxResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeEntitiesResponse + * Gets the default type url for AnalyzeSyntaxResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AnalyzeSyntaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesResponse"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxResponse"; }; - return AnalyzeEntitiesResponse; + return AnalyzeSyntaxResponse; })(); - v1beta2.AnalyzeSyntaxRequest = (function() { + v1beta2.ClassifyTextRequest = (function() { /** - * Properties of an AnalyzeSyntaxRequest. + * Properties of a ClassifyTextRequest. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeSyntaxRequest - * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSyntaxRequest document - * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSyntaxRequest encodingType + * @interface IClassifyTextRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] ClassifyTextRequest document + * @property {google.cloud.language.v1beta2.IClassificationModelOptions|null} [classificationModelOptions] ClassifyTextRequest classificationModelOptions */ /** - * Constructs a new AnalyzeSyntaxRequest. + * Constructs a new ClassifyTextRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeSyntaxRequest. - * @implements IAnalyzeSyntaxRequest + * @classdesc Represents a ClassifyTextRequest. + * @implements IClassifyTextRequest * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set */ - function AnalyzeSyntaxRequest(properties) { + function ClassifyTextRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16046,80 +17165,80 @@ } /** - * AnalyzeSyntaxRequest document. + * ClassifyTextRequest document. * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @instance */ - AnalyzeSyntaxRequest.prototype.document = null; + ClassifyTextRequest.prototype.document = null; /** - * AnalyzeSyntaxRequest encodingType. - * @member {google.cloud.language.v1beta2.EncodingType} encodingType - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * ClassifyTextRequest classificationModelOptions. + * @member {google.cloud.language.v1beta2.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @instance */ - AnalyzeSyntaxRequest.prototype.encodingType = 0; + ClassifyTextRequest.prototype.classificationModelOptions = null; /** - * Creates a new AnalyzeSyntaxRequest instance using the specified properties. + * Creates a new ClassifyTextRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest instance + * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest instance */ - AnalyzeSyntaxRequest.create = function create(properties) { - return new AnalyzeSyntaxRequest(properties); + ClassifyTextRequest.create = function create(properties) { + return new ClassifyTextRequest(properties); }; /** - * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSyntaxRequest.encode = function encode(message, writer) { + ClassifyTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSyntaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + ClassifyTextRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. + * Decodes a ClassifyTextRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSyntaxRequest.decode = function decode(reader, length) { + ClassifyTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16127,8 +17246,8 @@ message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); break; } - case 2: { - message.encodingType = reader.int32(); + case 3: { + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.decode(reader, reader.uint32()); break; } default: @@ -16140,169 +17259,142 @@ }; /** - * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. + * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSyntaxRequest.decodeDelimited = function decodeDelimited(reader) { + ClassifyTextRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeSyntaxRequest message. + * Verifies a ClassifyTextRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeSyntaxRequest.verify = function verify(message) { + ClassifyTextRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); if (error) return "document." + error; - } - if (message.encodingType != null && message.hasOwnProperty("encodingType")) - switch (message.encodingType) { - default: - return "encodingType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + } + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } return null; }; /** - * Creates an AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest */ - AnalyzeSyntaxRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest) + ClassifyTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextRequest) return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); + var message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.document: object expected"); message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } - switch (object.encodingType) { - default: - if (typeof object.encodingType === "number") { - message.encodingType = object.encodingType; - break; - } - break; - case "NONE": - case 0: - message.encodingType = 0; - break; - case "UTF8": - case 1: - message.encodingType = 1; - break; - case "UTF16": - case 2: - message.encodingType = 2; - break; - case "UTF32": - case 3: - message.encodingType = 3; - break; + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.fromObject(object.classificationModelOptions); } return message; }; /** - * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. + * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static - * @param {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} message AnalyzeSyntaxRequest + * @param {google.cloud.language.v1beta2.ClassifyTextRequest} message ClassifyTextRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeSyntaxRequest.toObject = function toObject(message, options) { + ClassifyTextRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.document = null; - object.encodingType = options.enums === String ? "NONE" : 0; + object.classificationModelOptions = null; } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); - if (message.encodingType != null && message.hasOwnProperty("encodingType")) - object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] === undefined ? message.encodingType : $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.toObject(message.classificationModelOptions, options); return object; }; /** - * Converts this AnalyzeSyntaxRequest to JSON. + * Converts this ClassifyTextRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @instance * @returns {Object.} JSON object */ - AnalyzeSyntaxRequest.prototype.toJSON = function toJSON() { + ClassifyTextRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeSyntaxRequest + * Gets the default type url for ClassifyTextRequest * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeSyntaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ClassifyTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxRequest"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextRequest"; }; - return AnalyzeSyntaxRequest; + return ClassifyTextRequest; })(); - v1beta2.AnalyzeSyntaxResponse = (function() { + v1beta2.ClassifyTextResponse = (function() { /** - * Properties of an AnalyzeSyntaxResponse. + * Properties of a ClassifyTextResponse. * @memberof google.cloud.language.v1beta2 - * @interface IAnalyzeSyntaxResponse - * @property {Array.|null} [sentences] AnalyzeSyntaxResponse sentences - * @property {Array.|null} [tokens] AnalyzeSyntaxResponse tokens - * @property {string|null} [language] AnalyzeSyntaxResponse language + * @interface IClassifyTextResponse + * @property {Array.|null} [categories] ClassifyTextResponse categories */ /** - * Constructs a new AnalyzeSyntaxResponse. + * Constructs a new ClassifyTextResponse. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents an AnalyzeSyntaxResponse. - * @implements IAnalyzeSyntaxResponse + * @classdesc Represents a ClassifyTextResponse. + * @implements IClassifyTextResponse * @constructor - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set */ - function AnalyzeSyntaxResponse(properties) { - this.sentences = []; - this.tokens = []; + function ClassifyTextResponse(properties) { + this.categories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16310,109 +17402,78 @@ } /** - * AnalyzeSyntaxResponse sentences. - * @member {Array.} sentences - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse - * @instance - */ - AnalyzeSyntaxResponse.prototype.sentences = $util.emptyArray; - - /** - * AnalyzeSyntaxResponse tokens. - * @member {Array.} tokens - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse - * @instance - */ - AnalyzeSyntaxResponse.prototype.tokens = $util.emptyArray; - - /** - * AnalyzeSyntaxResponse language. - * @member {string} language - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * ClassifyTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @instance */ - AnalyzeSyntaxResponse.prototype.language = ""; + ClassifyTextResponse.prototype.categories = $util.emptyArray; /** - * Creates a new AnalyzeSyntaxResponse instance using the specified properties. + * Creates a new ClassifyTextResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse instance + * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse instance */ - AnalyzeSyntaxResponse.create = function create(properties) { - return new AnalyzeSyntaxResponse(properties); + ClassifyTextResponse.create = function create(properties) { + return new ClassifyTextResponse(properties); }; /** - * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSyntaxResponse.encode = function encode(message, writer) { + ClassifyTextResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sentences != null && message.sentences.length) - for (var i = 0; i < message.sentences.length; ++i) - $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tokens != null && message.tokens.length) - for (var i = 0; i < message.tokens.length; ++i) - $root.google.cloud.language.v1beta2.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.language != null && Object.hasOwnProperty.call(message, "language")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.language); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static - * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeSyntaxResponse.encodeDelimited = function encodeDelimited(message, writer) { + ClassifyTextResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. + * Decodes a ClassifyTextResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSyntaxResponse.decode = function decode(reader, length) { + ClassifyTextResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.sentences && message.sentences.length)) - message.sentences = []; - message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.tokens && message.tokens.length)) - message.tokens = []; - message.tokens.push($root.google.cloud.language.v1beta2.Token.decode(reader, reader.uint32())); - break; - } - case 3: { - message.language = reader.string(); + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); break; } default: @@ -16424,175 +17485,139 @@ }; /** - * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. + * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeSyntaxResponse.decodeDelimited = function decodeDelimited(reader) { + ClassifyTextResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeSyntaxResponse message. + * Verifies a ClassifyTextResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeSyntaxResponse.verify = function verify(message) { + ClassifyTextResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sentences != null && message.hasOwnProperty("sentences")) { - if (!Array.isArray(message.sentences)) - return "sentences: array expected"; - for (var i = 0; i < message.sentences.length; ++i) { - var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); - if (error) - return "sentences." + error; - } - } - if (message.tokens != null && message.hasOwnProperty("tokens")) { - if (!Array.isArray(message.tokens)) - return "tokens: array expected"; - for (var i = 0; i < message.tokens.length; ++i) { - var error = $root.google.cloud.language.v1beta2.Token.verify(message.tokens[i]); + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.categories[i]); if (error) - return "tokens." + error; + return "categories." + error; } } - if (message.language != null && message.hasOwnProperty("language")) - if (!$util.isString(message.language)) - return "language: string expected"; return null; }; /** - * Creates an AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static - * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse - */ - AnalyzeSyntaxResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse) - return object; - var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); - if (object.sentences) { - if (!Array.isArray(object.sentences)) - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: array expected"); - message.sentences = []; - for (var i = 0; i < object.sentences.length; ++i) { - if (typeof object.sentences[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: object expected"); - message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); - } - } - if (object.tokens) { - if (!Array.isArray(object.tokens)) - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: array expected"); - message.tokens = []; - for (var i = 0; i < object.tokens.length; ++i) { - if (typeof object.tokens[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: object expected"); - message.tokens[i] = $root.google.cloud.language.v1beta2.Token.fromObject(object.tokens[i]); + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + */ + ClassifyTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.categories[i]); } } - if (object.language != null) - message.language = String(object.language); return message; }; /** - * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. + * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static - * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} message AnalyzeSyntaxResponse + * @param {google.cloud.language.v1beta2.ClassifyTextResponse} message ClassifyTextResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeSyntaxResponse.toObject = function toObject(message, options) { + ClassifyTextResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sentences = []; - object.tokens = []; - } - if (options.defaults) - object.language = ""; - if (message.sentences && message.sentences.length) { - object.sentences = []; - for (var j = 0; j < message.sentences.length; ++j) - object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); - } - if (message.tokens && message.tokens.length) { - object.tokens = []; - for (var j = 0; j < message.tokens.length; ++j) - object.tokens[j] = $root.google.cloud.language.v1beta2.Token.toObject(message.tokens[j], options); + if (options.arrays || options.defaults) + object.categories = []; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.categories[j], options); } - if (message.language != null && message.hasOwnProperty("language")) - object.language = message.language; return object; }; /** - * Converts this AnalyzeSyntaxResponse to JSON. + * Converts this ClassifyTextResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @instance * @returns {Object.} JSON object */ - AnalyzeSyntaxResponse.prototype.toJSON = function toJSON() { + ClassifyTextResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AnalyzeSyntaxResponse + * Gets the default type url for ClassifyTextResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AnalyzeSyntaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ClassifyTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxResponse"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextResponse"; }; - return AnalyzeSyntaxResponse; + return ClassifyTextResponse; })(); - v1beta2.ClassifyTextRequest = (function() { + v1beta2.ModerateTextRequest = (function() { /** - * Properties of a ClassifyTextRequest. + * Properties of a ModerateTextRequest. * @memberof google.cloud.language.v1beta2 - * @interface IClassifyTextRequest - * @property {google.cloud.language.v1beta2.IDocument|null} [document] ClassifyTextRequest document - * @property {google.cloud.language.v1beta2.IClassificationModelOptions|null} [classificationModelOptions] ClassifyTextRequest classificationModelOptions + * @interface IModerateTextRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] ModerateTextRequest document */ /** - * Constructs a new ClassifyTextRequest. + * Constructs a new ModerateTextRequest. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a ClassifyTextRequest. - * @implements IClassifyTextRequest + * @classdesc Represents a ModerateTextRequest. + * @implements IModerateTextRequest * @constructor - * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IModerateTextRequest=} [properties] Properties to set */ - function ClassifyTextRequest(properties) { + function ModerateTextRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16600,80 +17625,70 @@ } /** - * ClassifyTextRequest document. + * ModerateTextRequest document. * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest - * @instance - */ - ClassifyTextRequest.prototype.document = null; - - /** - * ClassifyTextRequest classificationModelOptions. - * @member {google.cloud.language.v1beta2.IClassificationModelOptions|null|undefined} classificationModelOptions - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @instance */ - ClassifyTextRequest.prototype.classificationModelOptions = null; + ModerateTextRequest.prototype.document = null; /** - * Creates a new ClassifyTextRequest instance using the specified properties. + * Creates a new ModerateTextRequest instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static - * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest instance + * @param {google.cloud.language.v1beta2.IModerateTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ModerateTextRequest} ModerateTextRequest instance */ - ClassifyTextRequest.create = function create(properties) { - return new ClassifyTextRequest(properties); + ModerateTextRequest.create = function create(properties) { + return new ModerateTextRequest(properties); }; /** - * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * Encodes the specified ModerateTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static - * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IModerateTextRequest} message ModerateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassifyTextRequest.encode = function encode(message, writer) { + ModerateTextRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.document != null && Object.hasOwnProperty.call(message, "document")) $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) - $root.google.cloud.language.v1beta2.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * Encodes the specified ModerateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static - * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {google.cloud.language.v1beta2.IModerateTextRequest} message ModerateTextRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassifyTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + ModerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClassifyTextRequest message from the specified reader or buffer. + * Decodes a ModerateTextRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + * @returns {google.cloud.language.v1beta2.ModerateTextRequest} ModerateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassifyTextRequest.decode = function decode(reader, length) { + ModerateTextRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ModerateTextRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16681,10 +17696,6 @@ message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); break; } - case 3: { - message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -16694,30 +17705,30 @@ }; /** - * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. + * Decodes a ModerateTextRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + * @returns {google.cloud.language.v1beta2.ModerateTextRequest} ModerateTextRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassifyTextRequest.decodeDelimited = function decodeDelimited(reader) { + ModerateTextRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClassifyTextRequest message. + * Verifies a ModerateTextRequest message. * @function verify - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClassifyTextRequest.verify = function verify(message) { + ModerateTextRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.document != null && message.hasOwnProperty("document")) { @@ -16725,111 +17736,97 @@ if (error) return "document." + error; } - if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { - var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.verify(message.classificationModelOptions); - if (error) - return "classificationModelOptions." + error; - } return null; }; /** - * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ModerateTextRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + * @returns {google.cloud.language.v1beta2.ModerateTextRequest} ModerateTextRequest */ - ClassifyTextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextRequest) + ModerateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ModerateTextRequest) return object; - var message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); + var message = new $root.google.cloud.language.v1beta2.ModerateTextRequest(); if (object.document != null) { if (typeof object.document !== "object") - throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.document: object expected"); + throw TypeError(".google.cloud.language.v1beta2.ModerateTextRequest.document: object expected"); message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); } - if (object.classificationModelOptions != null) { - if (typeof object.classificationModelOptions !== "object") - throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.classificationModelOptions: object expected"); - message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.fromObject(object.classificationModelOptions); - } return message; }; /** - * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. + * Creates a plain object from a ModerateTextRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static - * @param {google.cloud.language.v1beta2.ClassifyTextRequest} message ClassifyTextRequest + * @param {google.cloud.language.v1beta2.ModerateTextRequest} message ModerateTextRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClassifyTextRequest.toObject = function toObject(message, options) { + ModerateTextRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.document = null; - object.classificationModelOptions = null; - } if (message.document != null && message.hasOwnProperty("document")) object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); - if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) - object.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.toObject(message.classificationModelOptions, options); return object; }; /** - * Converts this ClassifyTextRequest to JSON. + * Converts this ModerateTextRequest to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @instance * @returns {Object.} JSON object */ - ClassifyTextRequest.prototype.toJSON = function toJSON() { + ModerateTextRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ClassifyTextRequest + * Gets the default type url for ModerateTextRequest * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @memberof google.cloud.language.v1beta2.ModerateTextRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ClassifyTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ModerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextRequest"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ModerateTextRequest"; }; - return ClassifyTextRequest; + return ModerateTextRequest; })(); - v1beta2.ClassifyTextResponse = (function() { + v1beta2.ModerateTextResponse = (function() { /** - * Properties of a ClassifyTextResponse. + * Properties of a ModerateTextResponse. * @memberof google.cloud.language.v1beta2 - * @interface IClassifyTextResponse - * @property {Array.|null} [categories] ClassifyTextResponse categories + * @interface IModerateTextResponse + * @property {Array.|null} [moderationCategories] ModerateTextResponse moderationCategories */ /** - * Constructs a new ClassifyTextResponse. + * Constructs a new ModerateTextResponse. * @memberof google.cloud.language.v1beta2 - * @classdesc Represents a ClassifyTextResponse. - * @implements IClassifyTextResponse + * @classdesc Represents a ModerateTextResponse. + * @implements IModerateTextResponse * @constructor - * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set + * @param {google.cloud.language.v1beta2.IModerateTextResponse=} [properties] Properties to set */ - function ClassifyTextResponse(properties) { - this.categories = []; + function ModerateTextResponse(properties) { + this.moderationCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16837,78 +17834,78 @@ } /** - * ClassifyTextResponse categories. - * @member {Array.} categories - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * ModerateTextResponse moderationCategories. + * @member {Array.} moderationCategories + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @instance */ - ClassifyTextResponse.prototype.categories = $util.emptyArray; + ModerateTextResponse.prototype.moderationCategories = $util.emptyArray; /** - * Creates a new ClassifyTextResponse instance using the specified properties. + * Creates a new ModerateTextResponse instance using the specified properties. * @function create - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static - * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set - * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse instance + * @param {google.cloud.language.v1beta2.IModerateTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ModerateTextResponse} ModerateTextResponse instance */ - ClassifyTextResponse.create = function create(properties) { - return new ClassifyTextResponse(properties); + ModerateTextResponse.create = function create(properties) { + return new ModerateTextResponse(properties); }; /** - * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * Encodes the specified ModerateTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static - * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IModerateTextResponse} message ModerateTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassifyTextResponse.encode = function encode(message, writer) { + ModerateTextResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.moderationCategories != null && message.moderationCategories.length) + for (var i = 0; i < message.moderationCategories.length; ++i) + $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.moderationCategories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * Encodes the specified ModerateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ModerateTextResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static - * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {google.cloud.language.v1beta2.IModerateTextResponse} message ModerateTextResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClassifyTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + ModerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClassifyTextResponse message from the specified reader or buffer. + * Decodes a ModerateTextResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + * @returns {google.cloud.language.v1beta2.ModerateTextResponse} ModerateTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassifyTextResponse.decode = function decode(reader, length) { + ModerateTextResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ModerateTextResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); + if (!(message.moderationCategories && message.moderationCategories.length)) + message.moderationCategories = []; + message.moderationCategories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); break; } default: @@ -16920,119 +17917,119 @@ }; /** - * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. + * Decodes a ModerateTextResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + * @returns {google.cloud.language.v1beta2.ModerateTextResponse} ModerateTextResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClassifyTextResponse.decodeDelimited = function decodeDelimited(reader) { + ModerateTextResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClassifyTextResponse message. + * Verifies a ModerateTextResponse message. * @function verify - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClassifyTextResponse.verify = function verify(message) { + ModerateTextResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) { - var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.categories[i]); + if (message.moderationCategories != null && message.hasOwnProperty("moderationCategories")) { + if (!Array.isArray(message.moderationCategories)) + return "moderationCategories: array expected"; + for (var i = 0; i < message.moderationCategories.length; ++i) { + var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.moderationCategories[i]); if (error) - return "categories." + error; + return "moderationCategories." + error; } } return null; }; /** - * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ModerateTextResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + * @returns {google.cloud.language.v1beta2.ModerateTextResponse} ModerateTextResponse */ - ClassifyTextResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextResponse) + ModerateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ModerateTextResponse) return object; - var message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) { - if (typeof object.categories[i] !== "object") - throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: object expected"); - message.categories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.categories[i]); + var message = new $root.google.cloud.language.v1beta2.ModerateTextResponse(); + if (object.moderationCategories) { + if (!Array.isArray(object.moderationCategories)) + throw TypeError(".google.cloud.language.v1beta2.ModerateTextResponse.moderationCategories: array expected"); + message.moderationCategories = []; + for (var i = 0; i < object.moderationCategories.length; ++i) { + if (typeof object.moderationCategories[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.ModerateTextResponse.moderationCategories: object expected"); + message.moderationCategories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.moderationCategories[i]); } } return message; }; /** - * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. + * Creates a plain object from a ModerateTextResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static - * @param {google.cloud.language.v1beta2.ClassifyTextResponse} message ClassifyTextResponse + * @param {google.cloud.language.v1beta2.ModerateTextResponse} message ModerateTextResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClassifyTextResponse.toObject = function toObject(message, options) { + ModerateTextResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.categories = []; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.categories[j], options); + object.moderationCategories = []; + if (message.moderationCategories && message.moderationCategories.length) { + object.moderationCategories = []; + for (var j = 0; j < message.moderationCategories.length; ++j) + object.moderationCategories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.moderationCategories[j], options); } return object; }; /** - * Converts this ClassifyTextResponse to JSON. + * Converts this ModerateTextResponse to JSON. * @function toJSON - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @instance * @returns {Object.} JSON object */ - ClassifyTextResponse.prototype.toJSON = function toJSON() { + ModerateTextResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ClassifyTextResponse + * Gets the default type url for ModerateTextResponse * @function getTypeUrl - * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @memberof google.cloud.language.v1beta2.ModerateTextResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ClassifyTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ModerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextResponse"; + return typeUrlPrefix + "/google.cloud.language.v1beta2.ModerateTextResponse"; }; - return ClassifyTextResponse; + return ModerateTextResponse; })(); v1beta2.AnnotateTextRequest = (function() { @@ -17332,6 +18329,7 @@ * @property {boolean|null} [extractDocumentSentiment] Features extractDocumentSentiment * @property {boolean|null} [extractEntitySentiment] Features extractEntitySentiment * @property {boolean|null} [classifyText] Features classifyText + * @property {boolean|null} [moderateText] Features moderateText * @property {google.cloud.language.v1beta2.IClassificationModelOptions|null} [classificationModelOptions] Features classificationModelOptions */ @@ -17390,6 +18388,14 @@ */ Features.prototype.classifyText = false; + /** + * Features moderateText. + * @member {boolean} moderateText + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.moderateText = false; + /** * Features classificationModelOptions. * @member {google.cloud.language.v1beta2.IClassificationModelOptions|null|undefined} classificationModelOptions @@ -17434,6 +18440,8 @@ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.classifyText); if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) $root.google.cloud.language.v1beta2.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.moderateText != null && Object.hasOwnProperty.call(message, "moderateText")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.moderateText); return writer; }; @@ -17488,6 +18496,10 @@ message.classifyText = reader.bool(); break; } + case 11: { + message.moderateText = reader.bool(); + break; + } case 10: { message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.decode(reader, reader.uint32()); break; @@ -17542,6 +18554,9 @@ if (message.classifyText != null && message.hasOwnProperty("classifyText")) if (typeof message.classifyText !== "boolean") return "classifyText: boolean expected"; + if (message.moderateText != null && message.hasOwnProperty("moderateText")) + if (typeof message.moderateText !== "boolean") + return "moderateText: boolean expected"; if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.verify(message.classificationModelOptions); if (error) @@ -17572,6 +18587,8 @@ message.extractEntitySentiment = Boolean(object.extractEntitySentiment); if (object.classifyText != null) message.classifyText = Boolean(object.classifyText); + if (object.moderateText != null) + message.moderateText = Boolean(object.moderateText); if (object.classificationModelOptions != null) { if (typeof object.classificationModelOptions !== "object") throw TypeError(".google.cloud.language.v1beta2.AnnotateTextRequest.Features.classificationModelOptions: object expected"); @@ -17600,6 +18617,7 @@ object.extractEntitySentiment = false; object.classifyText = false; object.classificationModelOptions = null; + object.moderateText = false; } if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) object.extractSyntax = message.extractSyntax; @@ -17613,6 +18631,8 @@ object.classifyText = message.classifyText; if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) object.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + if (message.moderateText != null && message.hasOwnProperty("moderateText")) + object.moderateText = message.moderateText; return object; }; @@ -17660,6 +18680,7 @@ * @property {google.cloud.language.v1beta2.ISentiment|null} [documentSentiment] AnnotateTextResponse documentSentiment * @property {string|null} [language] AnnotateTextResponse language * @property {Array.|null} [categories] AnnotateTextResponse categories + * @property {Array.|null} [moderationCategories] AnnotateTextResponse moderationCategories */ /** @@ -17675,6 +18696,7 @@ this.tokens = []; this.entities = []; this.categories = []; + this.moderationCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17729,6 +18751,14 @@ */ AnnotateTextResponse.prototype.categories = $util.emptyArray; + /** + * AnnotateTextResponse moderationCategories. + * @member {Array.} moderationCategories + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.moderationCategories = $util.emptyArray; + /** * Creates a new AnnotateTextResponse instance using the specified properties. * @function create @@ -17769,6 +18799,9 @@ if (message.categories != null && message.categories.length) for (var i = 0; i < message.categories.length; ++i) $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.moderationCategories != null && message.moderationCategories.length) + for (var i = 0; i < message.moderationCategories.length; ++i) + $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.moderationCategories[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -17835,6 +18868,12 @@ message.categories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); break; } + case 8: { + if (!(message.moderationCategories && message.moderationCategories.length)) + message.moderationCategories = []; + message.moderationCategories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -17914,6 +18953,15 @@ return "categories." + error; } } + if (message.moderationCategories != null && message.hasOwnProperty("moderationCategories")) { + if (!Array.isArray(message.moderationCategories)) + return "moderationCategories: array expected"; + for (var i = 0; i < message.moderationCategories.length; ++i) { + var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.moderationCategories[i]); + if (error) + return "moderationCategories." + error; + } + } return null; }; @@ -17976,6 +19024,16 @@ message.categories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.categories[i]); } } + if (object.moderationCategories) { + if (!Array.isArray(object.moderationCategories)) + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.moderationCategories: array expected"); + message.moderationCategories = []; + for (var i = 0; i < object.moderationCategories.length; ++i) { + if (typeof object.moderationCategories[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.moderationCategories: object expected"); + message.moderationCategories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.moderationCategories[i]); + } + } return message; }; @@ -17997,6 +19055,7 @@ object.tokens = []; object.entities = []; object.categories = []; + object.moderationCategories = []; } if (options.defaults) { object.documentSentiment = null; @@ -18026,6 +19085,11 @@ for (var j = 0; j < message.categories.length; ++j) object.categories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.categories[j], options); } + if (message.moderationCategories && message.moderationCategories.length) { + object.moderationCategories = []; + for (var j = 0; j < message.moderationCategories.length; ++j) + object.moderationCategories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.moderationCategories[j], options); + } return object; }; diff --git a/packages/google-cloud-language/protos/protos.json b/packages/google-cloud-language/protos/protos.json index 4d5a00f8cf9d..cf62bbc531d1 100644 --- a/packages/google-cloud-language/protos/protos.json +++ b/packages/google-cloud-language/protos/protos.json @@ -132,6 +132,26 @@ } ] }, + "ModerateText": { + "requestType": "ModerateTextRequest", + "responseType": "ModerateTextResponse", + "options": { + "(google.api.http).post": "/v1/documents:moderateText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:moderateText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document" + } + ] + }, "AnnotateText": { "requestType": "AnnotateTextRequest", "responseType": "AnnotateTextResponse", @@ -816,6 +836,26 @@ } } }, + "ModerateTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ModerateTextResponse": { + "fields": { + "moderationCategories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 1 + } + } + }, "AnnotateTextRequest": { "fields": { "document": { @@ -860,6 +900,10 @@ "type": "bool", "id": 6 }, + "moderateText": { + "type": "bool", + "id": 11 + }, "classificationModelOptions": { "type": "ClassificationModelOptions", "id": 10 @@ -897,6 +941,11 @@ "rule": "repeated", "type": "ClassificationCategory", "id": 6 + }, + "moderationCategories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 7 } } } @@ -1028,6 +1077,26 @@ } ] }, + "ModerateText": { + "requestType": "ModerateTextRequest", + "responseType": "ModerateTextResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:moderateText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:moderateText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document" + } + ] + }, "AnnotateText": { "requestType": "AnnotateTextRequest", "responseType": "AnnotateTextResponse", @@ -1727,6 +1796,26 @@ } } }, + "ModerateTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ModerateTextResponse": { + "fields": { + "moderationCategories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 1 + } + } + }, "AnnotateTextRequest": { "fields": { "document": { @@ -1771,6 +1860,10 @@ "type": "bool", "id": 6 }, + "moderateText": { + "type": "bool", + "id": 11 + }, "classificationModelOptions": { "type": "ClassificationModelOptions", "id": 10 @@ -1808,6 +1901,11 @@ "rule": "repeated", "type": "ClassificationCategory", "id": 6 + }, + "moderationCategories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 8 } } } diff --git a/packages/google-cloud-language/samples/README.md b/packages/google-cloud-language/samples/README.md index fb68ff250327..1e6f67b45484 100644 --- a/packages/google-cloud-language/samples/README.md +++ b/packages/google-cloud-language/samples/README.md @@ -18,14 +18,15 @@ * [Language_service.analyze_syntax](#language_service.analyze_syntax) * [Language_service.annotate_text](#language_service.annotate_text) * [Language_service.classify_text](#language_service.classify_text) + * [Language_service.moderate_text](#language_service.moderate_text) * [Language_service.analyze_entities](#language_service.analyze_entities) * [Language_service.analyze_entity_sentiment](#language_service.analyze_entity_sentiment) * [Language_service.analyze_sentiment](#language_service.analyze_sentiment) * [Language_service.analyze_syntax](#language_service.analyze_syntax) * [Language_service.annotate_text](#language_service.annotate_text) * [Language_service.classify_text](#language_service.classify_text) + * [Language_service.moderate_text](#language_service.moderate_text) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -144,6 +145,23 @@ __Usage:__ +### Language_service.moderate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js). + +[![Open in Cloud 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-language/samples/generated/v1/language_service.moderate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js` + + +----- + + + + ### Language_service.analyze_entities View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js). @@ -246,16 +264,16 @@ __Usage:__ -### Quickstart +### Language_service.moderate_text -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js). -[![Open in Cloud 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-language/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js,samples/README.md) __Usage:__ -`node packages/google-cloud-language/samples/quickstart.js` +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js` ----- @@ -263,16 +281,16 @@ __Usage:__ -### Quickstart.test +### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/test/quickstart.test.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/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-language/samples/test/quickstart.test.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/quickstart.js,samples/README.md) __Usage:__ -`node packages/google-cloud-language/samples/test/quickstart.test.js` +`node packages/google-cloud-language/samples/quickstart.js` diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js b/packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js new file mode 100644 index 000000000000..271b9fe1e1fe --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.moderate_text.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(document) { + // [START language_v1_generated_LanguageService_ModerateText_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. Input document. + */ + // const document = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callModerateText() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.moderateText(request); + console.log(response); + } + + callModerateText(); + // [END language_v1_generated_LanguageService_ModerateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json index ec92dcf12e54..b25a21ac6564 100644 --- a/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json +++ b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json @@ -231,6 +231,46 @@ } } }, + { + "regionTag": "language_v1_generated_LanguageService_ModerateText_async", + "title": "LanguageService moderateText Sample", + "origin": "API_DEFINITION", + "description": " Moderates a document for harmful and sensitive categories.", + "canonical": true, + "file": "language_service.moderate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + } + ], + "resultType": ".google.cloud.language.v1.ModerateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, { "regionTag": "language_v1_generated_LanguageService_AnnotateText_async", "title": "LanguageService annotateText Sample", diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js new file mode 100644 index 000000000000..2992deaa659f --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.moderate_text.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_ModerateText_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. Input document. + */ + // const document = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callModerateText() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.moderateText(request); + console.log(response); + } + + callModerateText(); + // [END language_v1beta2_generated_LanguageService_ModerateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json index 3aac28464a33..1a60d8a79ff5 100644 --- a/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json +++ b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json @@ -231,6 +231,46 @@ } } }, + { + "regionTag": "language_v1beta2_generated_LanguageService_ModerateText_async", + "title": "LanguageService moderateText Sample", + "origin": "API_DEFINITION", + "description": " Moderates a document for harmful and sensitive categories.", + "canonical": true, + "file": "language_service.moderate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1beta2.LanguageService.ModerateText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + } + ], + "resultType": ".google.cloud.language.v1beta2.ModerateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "ModerateText", + "fullName": "google.cloud.language.v1beta2.LanguageService.ModerateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, { "regionTag": "language_v1beta2_generated_LanguageService_AnnotateText_async", "title": "LanguageService annotateText Sample", diff --git a/packages/google-cloud-language/src/v1/gapic_metadata.json b/packages/google-cloud-language/src/v1/gapic_metadata.json index fc97e120f5a1..14d2569e0685 100644 --- a/packages/google-cloud-language/src/v1/gapic_metadata.json +++ b/packages/google-cloud-language/src/v1/gapic_metadata.json @@ -35,6 +35,11 @@ "classifyText" ] }, + "ModerateText": { + "methods": [ + "moderateText" + ] + }, "AnnotateText": { "methods": [ "annotateText" @@ -70,6 +75,11 @@ "classifyText" ] }, + "ModerateText": { + "methods": [ + "moderateText" + ] + }, "AnnotateText": { "methods": [ "annotateText" diff --git a/packages/google-cloud-language/src/v1/language_service_client.ts b/packages/google-cloud-language/src/v1/language_service_client.ts index 0eecb84ca505..fb33892c9afe 100644 --- a/packages/google-cloud-language/src/v1/language_service_client.ts +++ b/packages/google-cloud-language/src/v1/language_service_client.ts @@ -227,6 +227,7 @@ export class LanguageServiceClient { 'analyzeEntitySentiment', 'analyzeSyntax', 'classifyText', + 'moderateText', 'annotateText', ]; for (const methodName of languageServiceStubMethods) { @@ -765,6 +766,87 @@ export class LanguageServiceClient { this.initialize(); return this.innerApiCalls.classifyText(request, options, callback); } + /** + * Moderates a document for harmful and sensitive categories. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.language.v1.ModerateTextResponse | ModerateTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.moderate_text.js + * region_tag:language_v1_generated_LanguageService_ModerateText_async + */ + moderateText( + request?: protos.google.cloud.language.v1.IModerateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IModerateTextResponse, + protos.google.cloud.language.v1.IModerateTextRequest | undefined, + {} | undefined + ] + >; + moderateText( + request: protos.google.cloud.language.v1.IModerateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IModerateTextResponse, + protos.google.cloud.language.v1.IModerateTextRequest | null | undefined, + {} | null | undefined + > + ): void; + moderateText( + request: protos.google.cloud.language.v1.IModerateTextRequest, + callback: Callback< + protos.google.cloud.language.v1.IModerateTextResponse, + protos.google.cloud.language.v1.IModerateTextRequest | null | undefined, + {} | null | undefined + > + ): void; + moderateText( + request?: protos.google.cloud.language.v1.IModerateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IModerateTextResponse, + | protos.google.cloud.language.v1.IModerateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IModerateTextResponse, + protos.google.cloud.language.v1.IModerateTextRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IModerateTextResponse, + protos.google.cloud.language.v1.IModerateTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.moderateText(request, options, callback); + } /** * A convenience method that provides all the features that analyzeSentiment, * analyzeEntities, and analyzeSyntax provide in one call. diff --git a/packages/google-cloud-language/src/v1/language_service_client_config.json b/packages/google-cloud-language/src/v1/language_service_client_config.json index 4ee37da95959..ba23b0097e0b 100644 --- a/packages/google-cloud-language/src/v1/language_service_client_config.json +++ b/packages/google-cloud-language/src/v1/language_service_client_config.json @@ -45,6 +45,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ModerateText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "AnnotateText": { "timeout_millis": 600000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-language/src/v1beta2/gapic_metadata.json b/packages/google-cloud-language/src/v1beta2/gapic_metadata.json index cc37c24c2d19..0a44c5560859 100644 --- a/packages/google-cloud-language/src/v1beta2/gapic_metadata.json +++ b/packages/google-cloud-language/src/v1beta2/gapic_metadata.json @@ -35,6 +35,11 @@ "classifyText" ] }, + "ModerateText": { + "methods": [ + "moderateText" + ] + }, "AnnotateText": { "methods": [ "annotateText" @@ -70,6 +75,11 @@ "classifyText" ] }, + "ModerateText": { + "methods": [ + "moderateText" + ] + }, "AnnotateText": { "methods": [ "annotateText" diff --git a/packages/google-cloud-language/src/v1beta2/language_service_client.ts b/packages/google-cloud-language/src/v1beta2/language_service_client.ts index ffccfe5954ee..b134da898202 100644 --- a/packages/google-cloud-language/src/v1beta2/language_service_client.ts +++ b/packages/google-cloud-language/src/v1beta2/language_service_client.ts @@ -227,6 +227,7 @@ export class LanguageServiceClient { 'analyzeEntitySentiment', 'analyzeSyntax', 'classifyText', + 'moderateText', 'annotateText', ]; for (const methodName of languageServiceStubMethods) { @@ -496,8 +497,10 @@ export class LanguageServiceClient { return this.innerApiCalls.analyzeEntities(request, options, callback); } /** - * Finds entities, similar to {@link google.cloud.language.v1beta2.LanguageService.AnalyzeEntities|AnalyzeEntities} in the text and analyzes - * sentiment associated with each entity and its mentions. + * Finds entities, similar to + * {@link google.cloud.language.v1beta2.LanguageService.AnalyzeEntities|AnalyzeEntities} + * in the text and analyzes sentiment associated with each entity and its + * mentions. * * @param {Object} request * The request object that will be sent. @@ -776,6 +779,93 @@ export class LanguageServiceClient { this.initialize(); return this.innerApiCalls.classifyText(request, options, callback); } + /** + * Moderates a document for harmful and sensitive categories. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.language.v1beta2.ModerateTextResponse | ModerateTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.moderate_text.js + * region_tag:language_v1beta2_generated_LanguageService_ModerateText_async + */ + moderateText( + request?: protos.google.cloud.language.v1beta2.IModerateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IModerateTextResponse, + protos.google.cloud.language.v1beta2.IModerateTextRequest | undefined, + {} | undefined + ] + >; + moderateText( + request: protos.google.cloud.language.v1beta2.IModerateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IModerateTextResponse, + | protos.google.cloud.language.v1beta2.IModerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moderateText( + request: protos.google.cloud.language.v1beta2.IModerateTextRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IModerateTextResponse, + | protos.google.cloud.language.v1beta2.IModerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moderateText( + request?: protos.google.cloud.language.v1beta2.IModerateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IModerateTextResponse, + | protos.google.cloud.language.v1beta2.IModerateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IModerateTextResponse, + | protos.google.cloud.language.v1beta2.IModerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IModerateTextResponse, + protos.google.cloud.language.v1beta2.IModerateTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.moderateText(request, options, callback); + } /** * A convenience method that provides all syntax, sentiment, entity, and * classification features in one call. diff --git a/packages/google-cloud-language/src/v1beta2/language_service_client_config.json b/packages/google-cloud-language/src/v1beta2/language_service_client_config.json index a2671a61cf0b..59cb784dc033 100644 --- a/packages/google-cloud-language/src/v1beta2/language_service_client_config.json +++ b/packages/google-cloud-language/src/v1beta2/language_service_client_config.json @@ -45,6 +45,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "ModerateText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "AnnotateText": { "timeout_millis": 600000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-language/test/gapic_language_service_v1.ts b/packages/google-cloud-language/test/gapic_language_service_v1.ts index dbbda6a0d2bf..45b0a8f5a1f3 100644 --- a/packages/google-cloud-language/test/gapic_language_service_v1.ts +++ b/packages/google-cloud-language/test/gapic_language_service_v1.ts @@ -586,6 +586,89 @@ describe('v1.LanguageServiceClient', () => { }); }); + describe('moderateText', () => { + it('invokes moderateText without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextResponse() + ); + client.innerApiCalls.moderateText = stubSimpleCall(expectedResponse); + const [response] = await client.moderateText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes moderateText without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextResponse() + ); + client.innerApiCalls.moderateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moderateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IModerateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes moderateText with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.moderateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.moderateText(request), expectedError); + }); + + it('invokes moderateText with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ModerateTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moderateText(request), expectedError); + }); + }); + describe('annotateText', () => { it('invokes annotateText without error', async () => { const client = new languageserviceModule.v1.LanguageServiceClient({ diff --git a/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts b/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts index 7028feffc88b..48d5808592b7 100644 --- a/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts +++ b/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts @@ -586,6 +586,89 @@ describe('v1beta2.LanguageServiceClient', () => { }); }); + describe('moderateText', () => { + it('invokes moderateText without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextResponse() + ); + client.innerApiCalls.moderateText = stubSimpleCall(expectedResponse); + const [response] = await client.moderateText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes moderateText without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextResponse() + ); + client.innerApiCalls.moderateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moderateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IModerateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes moderateText with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.moderateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.moderateText(request), expectedError); + }); + + it('invokes moderateText with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ModerateTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moderateText(request), expectedError); + }); + }); + describe('annotateText', () => { it('invokes annotateText without error', async () => { const client = new languageserviceModule.v1beta2.LanguageServiceClient({ From bb739f4a87c77e8971b2a2b2b6c1a34ca724e93f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 May 2023 12:54:12 +0200 Subject: [PATCH 10/46] chore(deps): update dependency @types/is to v0.0.22 (#4300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/is](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`0.0.21` -> `0.0.22`](https://renovatebot.com/diffs/npm/@types%2fis/0.0.21/0.0.22) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fis/0.0.22/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fis/0.0.22/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fis/0.0.22/compatibility-slim/0.0.21)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fis/0.0.22/confidence-slim/0.0.21)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-cloud-node). --- packages/google-cloud-vision/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-vision/package.json b/packages/google-cloud-vision/package.json index 667d86623a54..b6b8e76fd3f8 100644 --- a/packages/google-cloud-vision/package.json +++ b/packages/google-cloud-vision/package.json @@ -55,7 +55,7 @@ }, "devDependencies": { "@google-cloud/storage": "^6.0.0", - "@types/is": "0.0.21", + "@types/is": "0.0.22", "@types/mocha": "^10.0.0", "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", From 8ba5c60d92ee4cd8444fa35fba8dbbf034532564 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 09:48:45 -0400 Subject: [PATCH 11/46] chore: release main (#4296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release main * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .release-please-manifest.json | 4 +- changelog.json | 37 ++++++++++++++++++- packages/google-cloud-language/CHANGELOG.md | 7 ++++ packages/google-cloud-language/package.json | 2 +- ...pet_metadata.google.cloud.language.v1.json | 2 +- ...etadata.google.cloud.language.v1beta2.json | 2 +- .../samples/package.json | 2 +- packages/typeless-sample-bot/CHANGELOG.md | 7 ++++ packages/typeless-sample-bot/package.json | 2 +- 9 files changed, 57 insertions(+), 8 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 645184a11a75..af4776d3e726 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -66,7 +66,7 @@ "packages/google-cloud-ids": "2.2.2", "packages/google-cloud-iot": "3.2.2", "packages/google-cloud-kms": "3.6.0", - "packages/google-cloud-language": "5.2.2", + "packages/google-cloud-language": "5.3.0", "packages/google-cloud-lifesciences": "2.3.2", "packages/google-cloud-managedidentities": "2.2.2", "packages/google-cloud-mediatranslation": "3.1.2", @@ -131,7 +131,7 @@ "packages/google-privacy-dlp": "4.4.2", "packages/google-storagetransfer": "2.3.2", "packages/grafeas": "4.5.0", - "packages/typeless-sample-bot": "1.3.2", + "packages/typeless-sample-bot": "1.3.3", "packages/google-cloud-advisorynotifications": "0.2.1", "packages/google-cloud-kms-inventory": "0.1.1", "packages/google-cloud-alloydb": "0.1.1", diff --git a/changelog.json b/changelog.json index 0ddd8c4e0422..c8ad940301b8 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,41 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "fix", + "sha": "b6ae70ddcc50fc3bfd1abbb347b25e0bfcafccf0", + "message": "Update dependency recast to ^0.23.0", + "issues": [ + "4277" + ], + "scope": "deps" + } + ], + "version": "1.3.3", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/typeless-sample-bot", + "id": "9a124b25-cfda-4cd2-b2e9-c65b94338f39", + "createTime": "2023-05-26T10:59:12.347Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2c5e862c151f5e0294b3933808388a5f7e83cf62", + "message": "[language] Added client library support for ModerateText in the Natural Language API (V1)", + "issues": [ + "4298" + ] + } + ], + "version": "5.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/language", + "id": "acae1fb9-158c-4246-bcfc-78aa50bc9bd4", + "createTime": "2023-05-26T10:59:12.343Z" + }, { "changes": [ { @@ -9702,5 +9737,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2023-05-22T17:28:11.924Z" + "updateTime": "2023-05-26T10:59:12.347Z" } \ No newline at end of file diff --git a/packages/google-cloud-language/CHANGELOG.md b/packages/google-cloud-language/CHANGELOG.md index 5aadbe4c70be..2765aa020aca 100644 --- a/packages/google-cloud-language/CHANGELOG.md +++ b/packages/google-cloud-language/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/language?activeTab=versions +## [5.3.0](https://github.com/googleapis/google-cloud-node/compare/language-v5.2.2...language-v5.3.0) (2023-05-26) + + +### Features + +* [language] Added client library support for ModerateText in the Natural Language API (V1) ([#4298](https://github.com/googleapis/google-cloud-node/issues/4298)) ([2c5e862](https://github.com/googleapis/google-cloud-node/commit/2c5e862c151f5e0294b3933808388a5f7e83cf62)) + ## [5.2.2](https://github.com/googleapis/google-cloud-node/compare/language-v5.2.1...language-v5.2.2) (2023-04-13) diff --git a/packages/google-cloud-language/package.json b/packages/google-cloud-language/package.json index bc5376529d25..579a14d7c189 100644 --- a/packages/google-cloud-language/package.json +++ b/packages/google-cloud-language/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/language", "description": "Google Cloud Natural Language API client for Node.js", - "version": "5.2.2", + "version": "5.3.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json index b25a21ac6564..81b72fc9c1d3 100644 --- a/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json +++ b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-language", - "version": "5.2.2", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json index 1a60d8a79ff5..802ffe0d6fc9 100644 --- a/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json +++ b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-language", - "version": "5.2.2", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-language/samples/package.json b/packages/google-cloud-language/samples/package.json index 046253c223b1..c386dbe12be9 100644 --- a/packages/google-cloud-language/samples/package.json +++ b/packages/google-cloud-language/samples/package.json @@ -17,7 +17,7 @@ "dependencies": { "@google-cloud/automl": "^3.0.0", "mathjs": "^11.0.0", - "@google-cloud/language": "^5.2.2", + "@google-cloud/language": "^5.3.0", "@google-cloud/storage": "^6.0.0", "yargs": "^17.0.0" }, diff --git a/packages/typeless-sample-bot/CHANGELOG.md b/packages/typeless-sample-bot/CHANGELOG.md index c6097d91f7be..e61ef31741c1 100644 --- a/packages/typeless-sample-bot/CHANGELOG.md +++ b/packages/typeless-sample-bot/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.3](https://github.com/googleapis/google-cloud-node/compare/typeless-sample-bot-v1.3.2...typeless-sample-bot-v1.3.3) (2023-05-26) + + +### Bug Fixes + +* **deps:** Update dependency recast to ^0.23.0 ([#4277](https://github.com/googleapis/google-cloud-node/issues/4277)) ([b6ae70d](https://github.com/googleapis/google-cloud-node/commit/b6ae70ddcc50fc3bfd1abbb347b25e0bfcafccf0)) + ## [1.3.2](https://github.com/googleapis/google-cloud-node/compare/typeless-sample-bot-v1.3.1...typeless-sample-bot-v1.3.2) (2023-05-11) diff --git a/packages/typeless-sample-bot/package.json b/packages/typeless-sample-bot/package.json index 64d9442dc0e7..d1bbe085932d 100644 --- a/packages/typeless-sample-bot/package.json +++ b/packages/typeless-sample-bot/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/typeless-sample-bot", "description": "Google Cloud GitHub bot that converts TypeScript snippets into JavaScript", - "version": "1.3.2", + "version": "1.3.3", "license": "Apache-2.0", "author": "Google LLC", "engines": { From 9dbe449dd8be2d1b91b900bdc771204de347de49 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 31 May 2023 22:19:39 +0200 Subject: [PATCH 12/46] chore(deps): update dependency semistandard to v17 (#4304) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df9b8f67c6d2..ac65157b1a4f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "parse-link-header": "^2.0.0" }, "devDependencies": { - "semistandard": "^16.0.0" + "semistandard": "^17.0.0" }, "engines": { "node": ">=14" From 05cc8c60a380263cb25d9be787a5ae01c864e820 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 2 Jun 2023 20:48:16 +0200 Subject: [PATCH 13/46] chore(deps): pin dependency `linkinator` to v4.1.2 (#4303) * chore(deps): update dependency linkinator to v5 * chore: Pin `linkinator` to v4.1.2 to avoid Node 16+ req --------- Co-authored-by: Daniel Bankhead --- .../templates/bootstrap-templates/package.json | 2 +- packages/google-ai-generativelanguage/package.json | 2 +- packages/google-analytics-admin/package.json | 4 ++-- packages/google-analytics-data/package.json | 4 ++-- packages/google-api-apikeys/package.json | 4 ++-- packages/google-api-servicecontrol/package.json | 4 ++-- packages/google-api-servicemanagement/package.json | 4 ++-- packages/google-api-serviceusage/package.json | 4 ++-- packages/google-appengine/package.json | 4 ++-- packages/google-area120-tables/package.json | 4 ++-- packages/google-cloud-accessapproval/package.json | 4 ++-- packages/google-cloud-advisorynotifications/package.json | 4 ++-- packages/google-cloud-aiplatform/package.json | 4 ++-- packages/google-cloud-alloydb/package.json | 4 ++-- packages/google-cloud-apigateway/package.json | 4 ++-- packages/google-cloud-apigeeconnect/package.json | 4 ++-- packages/google-cloud-asset/package.json | 4 ++-- packages/google-cloud-assuredworkloads/package.json | 4 ++-- packages/google-cloud-baremetalsolution/package.json | 4 ++-- packages/google-cloud-batch/package.json | 4 ++-- packages/google-cloud-beyondcorp-appconnections/package.json | 4 ++-- packages/google-cloud-beyondcorp-appconnectors/package.json | 4 ++-- packages/google-cloud-beyondcorp-appgateways/package.json | 4 ++-- .../package.json | 4 ++-- packages/google-cloud-beyondcorp-clientgateways/package.json | 4 ++-- packages/google-cloud-bigquery-analyticshub/package.json | 4 ++-- packages/google-cloud-bigquery-connection/package.json | 4 ++-- packages/google-cloud-bigquery-dataexchange/package.json | 4 ++-- packages/google-cloud-bigquery-datapolicies/package.json | 4 ++-- packages/google-cloud-bigquery-datatransfer/package.json | 4 ++-- packages/google-cloud-bigquery-reservation/package.json | 4 ++-- packages/google-cloud-billing-budgets/package.json | 4 ++-- packages/google-cloud-billing/package.json | 4 ++-- packages/google-cloud-binaryauthorization/package.json | 4 ++-- packages/google-cloud-certificatemanager/package.json | 4 ++-- packages/google-cloud-channel/package.json | 4 ++-- packages/google-cloud-clouddms/package.json | 4 ++-- packages/google-cloud-compute/package.json | 4 ++-- packages/google-cloud-confidentialcomputing/package.json | 4 ++-- packages/google-cloud-contactcenterinsights/package.json | 4 ++-- packages/google-cloud-contentwarehouse/package.json | 4 ++-- packages/google-cloud-datacatalog-lineage/package.json | 4 ++-- packages/google-cloud-datacatalog/package.json | 4 ++-- packages/google-cloud-dataform/package.json | 4 ++-- packages/google-cloud-datafusion/package.json | 4 ++-- packages/google-cloud-datalabeling/package.json | 4 ++-- packages/google-cloud-dataplex/package.json | 4 ++-- packages/google-cloud-dataproc/package.json | 4 ++-- packages/google-cloud-dataqna/package.json | 4 ++-- packages/google-cloud-datastream/package.json | 4 ++-- packages/google-cloud-deploy/package.json | 4 ++-- packages/google-cloud-dialogflow-cx/package.json | 4 ++-- packages/google-cloud-dialogflow/package.json | 4 ++-- packages/google-cloud-discoveryengine/package.json | 4 ++-- packages/google-cloud-documentai/package.json | 4 ++-- packages/google-cloud-domains/package.json | 4 ++-- packages/google-cloud-essentialcontacts/package.json | 4 ++-- packages/google-cloud-eventarc-publishing/package.json | 4 ++-- packages/google-cloud-eventarc/package.json | 4 ++-- packages/google-cloud-filestore/package.json | 4 ++-- packages/google-cloud-functions/package.json | 4 ++-- packages/google-cloud-gaming/package.json | 4 ++-- packages/google-cloud-gkebackup/package.json | 4 ++-- packages/google-cloud-gkeconnect-gateway/package.json | 4 ++-- packages/google-cloud-gkehub/package.json | 4 ++-- packages/google-cloud-gkemulticloud/package.json | 4 ++-- packages/google-cloud-gsuiteaddons/package.json | 4 ++-- packages/google-cloud-iap/package.json | 4 ++-- packages/google-cloud-ids/package.json | 4 ++-- packages/google-cloud-iot/package.json | 4 ++-- packages/google-cloud-kms-inventory/package.json | 4 ++-- packages/google-cloud-kms/package.json | 4 ++-- packages/google-cloud-language/package.json | 4 ++-- packages/google-cloud-lifesciences/package.json | 4 ++-- packages/google-cloud-managedidentities/package.json | 4 ++-- packages/google-cloud-mediatranslation/package.json | 4 ++-- packages/google-cloud-memcache/package.json | 4 ++-- packages/google-cloud-metastore/package.json | 4 ++-- packages/google-cloud-monitoring/package.json | 4 ++-- packages/google-cloud-networkconnectivity/package.json | 4 ++-- packages/google-cloud-networkmanagement/package.json | 4 ++-- packages/google-cloud-networksecurity/package.json | 4 ++-- packages/google-cloud-notebooks/package.json | 4 ++-- packages/google-cloud-optimization/package.json | 4 ++-- .../google-cloud-orchestration-airflow-service/package.json | 4 ++-- packages/google-cloud-orgpolicy/package.json | 4 ++-- packages/google-cloud-osconfig/package.json | 4 ++-- packages/google-cloud-oslogin/package.json | 4 ++-- packages/google-cloud-phishingprotection/package.json | 4 ++-- packages/google-cloud-policytroubleshooter/package.json | 4 ++-- packages/google-cloud-privatecatalog/package.json | 4 ++-- packages/google-cloud-recaptchaenterprise/package.json | 4 ++-- packages/google-cloud-recommender/package.json | 4 ++-- packages/google-cloud-redis/package.json | 4 ++-- packages/google-cloud-resourcemanager/package.json | 4 ++-- packages/google-cloud-resourcesettings/package.json | 4 ++-- packages/google-cloud-retail/package.json | 4 ++-- packages/google-cloud-run/package.json | 4 ++-- packages/google-cloud-scheduler/package.json | 4 ++-- packages/google-cloud-secretmanager/package.json | 4 ++-- packages/google-cloud-security-privateca/package.json | 4 ++-- packages/google-cloud-security-publicca/package.json | 4 ++-- packages/google-cloud-securitycenter/package.json | 4 ++-- packages/google-cloud-servicedirectory/package.json | 4 ++-- packages/google-cloud-shell/package.json | 4 ++-- packages/google-cloud-speech/package.json | 4 ++-- packages/google-cloud-storageinsights/package.json | 2 +- packages/google-cloud-support/package.json | 2 +- packages/google-cloud-talent/package.json | 4 ++-- packages/google-cloud-tasks/package.json | 4 ++-- packages/google-cloud-texttospeech/package.json | 4 ++-- packages/google-cloud-tpu/package.json | 4 ++-- packages/google-cloud-translate/package.json | 4 ++-- packages/google-cloud-video-livestream/package.json | 4 ++-- packages/google-cloud-video-stitcher/package.json | 4 ++-- packages/google-cloud-video-transcoder/package.json | 4 ++-- packages/google-cloud-videointelligence/package.json | 4 ++-- packages/google-cloud-vision/package.json | 4 ++-- packages/google-cloud-vmmigration/package.json | 4 ++-- packages/google-cloud-vmwareengine/package.json | 4 ++-- packages/google-cloud-vpcaccess/package.json | 4 ++-- packages/google-cloud-webrisk/package.json | 4 ++-- packages/google-cloud-websecurityscanner/package.json | 4 ++-- packages/google-cloud-workflows-executions/package.json | 4 ++-- packages/google-cloud-workstations/package.json | 4 ++-- packages/google-container/package.json | 4 ++-- packages/google-dataflow/package.json | 4 ++-- packages/google-devtools-artifactregistry/package.json | 4 ++-- packages/google-devtools-cloudbuild/package.json | 4 ++-- packages/google-devtools-containeranalysis/package.json | 4 ++-- packages/google-iam-credentials/package.json | 4 ++-- packages/google-iam/package.json | 4 ++-- packages/google-identity-accesscontextmanager/package.json | 4 ++-- packages/google-maps-addressvalidation/package.json | 4 ++-- packages/google-maps-mapsplatformdatasets/package.json | 4 ++-- packages/google-maps-places/package.json | 2 +- packages/google-maps-routing/package.json | 4 ++-- packages/google-monitoring-dashboard/package.json | 4 ++-- packages/google-privacy-dlp/package.json | 4 ++-- packages/google-storagetransfer/package.json | 4 ++-- packages/grafeas/package.json | 4 ++-- 141 files changed, 277 insertions(+), 277 deletions(-) diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/package.json b/packages/gapic-node-templating/templates/bootstrap-templates/package.json index 8f6e2a6d97df..5a86b8509d1f 100644 --- a/packages/gapic-node-templating/templates/bootstrap-templates/package.json +++ b/packages/gapic-node-templating/templates/bootstrap-templates/package.json @@ -57,7 +57,7 @@ "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "long": "^5.2.3", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", diff --git a/packages/google-ai-generativelanguage/package.json b/packages/google-ai-generativelanguage/package.json index 6a50ab8bbe3e..14f8c87c6952 100644 --- a/packages/google-ai-generativelanguage/package.json +++ b/packages/google-ai-generativelanguage/package.json @@ -56,7 +56,7 @@ "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "long": "^5.2.3", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", diff --git a/packages/google-analytics-admin/package.json b/packages/google-analytics-admin/package.json index 18d5f03253c5..d277d994447d 100644 --- a/packages/google-analytics-admin/package.json +++ b/packages/google-analytics-admin/package.json @@ -58,7 +58,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-admin" -} \ No newline at end of file +} diff --git a/packages/google-analytics-data/package.json b/packages/google-analytics-data/package.json index bd276226b97a..0a0657b4cdd8 100644 --- a/packages/google-analytics-data/package.json +++ b/packages/google-analytics-data/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-data" -} \ No newline at end of file +} diff --git a/packages/google-api-apikeys/package.json b/packages/google-api-apikeys/package.json index f40a4a3d3221..ed2d08cb506b 100644 --- a/packages/google-api-apikeys/package.json +++ b/packages/google-api-apikeys/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-api-servicecontrol/package.json b/packages/google-api-servicecontrol/package.json index 5f8ab0f30fdf..8aa6fe9093c1 100644 --- a/packages/google-api-servicecontrol/package.json +++ b/packages/google-api-servicecontrol/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -72,4 +72,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-servicecontrol" -} \ No newline at end of file +} diff --git a/packages/google-api-servicemanagement/package.json b/packages/google-api-servicemanagement/package.json index bd7cdda80fda..a8e047db6064 100644 --- a/packages/google-api-servicemanagement/package.json +++ b/packages/google-api-servicemanagement/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-servicemanagement" -} \ No newline at end of file +} diff --git a/packages/google-api-serviceusage/package.json b/packages/google-api-serviceusage/package.json index 53e5c6a97955..052d670243b9 100644 --- a/packages/google-api-serviceusage/package.json +++ b/packages/google-api-serviceusage/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-serviceusage" -} \ No newline at end of file +} diff --git a/packages/google-appengine/package.json b/packages/google-appengine/package.json index d36ffe24b80d..e0c996050fc2 100644 --- a/packages/google-appengine/package.json +++ b/packages/google-appengine/package.json @@ -63,7 +63,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -78,4 +78,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-appengine" -} \ No newline at end of file +} diff --git a/packages/google-area120-tables/package.json b/packages/google-area120-tables/package.json index db35a836f0f9..120bd7da0640 100644 --- a/packages/google-area120-tables/package.json +++ b/packages/google-area120-tables/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-area120-tables" -} \ No newline at end of file +} diff --git a/packages/google-cloud-accessapproval/package.json b/packages/google-cloud-accessapproval/package.json index 5d33d8c10a63..843383b6d7fa 100644 --- a/packages/google-cloud-accessapproval/package.json +++ b/packages/google-cloud-accessapproval/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-accessapproval" -} \ No newline at end of file +} diff --git a/packages/google-cloud-advisorynotifications/package.json b/packages/google-cloud-advisorynotifications/package.json index d91c1c51780e..c96d2b9751a1 100644 --- a/packages/google-cloud-advisorynotifications/package.json +++ b/packages/google-cloud-advisorynotifications/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-aiplatform/package.json b/packages/google-cloud-aiplatform/package.json index 82832a6e7615..43a4c6483f7a 100644 --- a/packages/google-cloud-aiplatform/package.json +++ b/packages/google-cloud-aiplatform/package.json @@ -65,7 +65,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -80,4 +80,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-aiplatform" -} \ No newline at end of file +} diff --git a/packages/google-cloud-alloydb/package.json b/packages/google-cloud-alloydb/package.json index 75db988a5c80..996af42c5c32 100644 --- a/packages/google-cloud-alloydb/package.json +++ b/packages/google-cloud-alloydb/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-apigateway/package.json b/packages/google-cloud-apigateway/package.json index d3444d187333..65fc30a19715 100644 --- a/packages/google-cloud-apigateway/package.json +++ b/packages/google-cloud-apigateway/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigateway" -} \ No newline at end of file +} diff --git a/packages/google-cloud-apigeeconnect/package.json b/packages/google-cloud-apigeeconnect/package.json index 97589048a620..404e465a82bc 100644 --- a/packages/google-cloud-apigeeconnect/package.json +++ b/packages/google-cloud-apigeeconnect/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeconnect" -} \ No newline at end of file +} diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 404ee75f5fce..a7b974ff47f7 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset" -} \ No newline at end of file +} diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 872774d42e2f..d12700002190 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads" -} \ No newline at end of file +} diff --git a/packages/google-cloud-baremetalsolution/package.json b/packages/google-cloud-baremetalsolution/package.json index 900aad505ade..3643f43d65bd 100644 --- a/packages/google-cloud-baremetalsolution/package.json +++ b/packages/google-cloud-baremetalsolution/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^8.4.0", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=v12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-baremetalsolution" -} \ No newline at end of file +} diff --git a/packages/google-cloud-batch/package.json b/packages/google-cloud-batch/package.json index 8b1ecd16a00b..c65b199b5f89 100644 --- a/packages/google-cloud-batch/package.json +++ b/packages/google-cloud-batch/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appconnections/package.json b/packages/google-cloud-beyondcorp-appconnections/package.json index c68204d7eed0..4a23e7a27959 100644 --- a/packages/google-cloud-beyondcorp-appconnections/package.json +++ b/packages/google-cloud-beyondcorp-appconnections/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appconnectors/package.json b/packages/google-cloud-beyondcorp-appconnectors/package.json index d60c6fdd6b07..1b7e6f60f1fd 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/package.json +++ b/packages/google-cloud-beyondcorp-appconnectors/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appgateways/package.json b/packages/google-cloud-beyondcorp-appgateways/package.json index 99b52b35931e..64116be4f6d9 100644 --- a/packages/google-cloud-beyondcorp-appgateways/package.json +++ b/packages/google-cloud-beyondcorp-appgateways/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/package.json b/packages/google-cloud-beyondcorp-clientconnectorservices/package.json index 23556681753e..b9164ba52072 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/package.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-clientgateways/package.json b/packages/google-cloud-beyondcorp-clientgateways/package.json index 23556681753e..b9164ba52072 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/package.json +++ b/packages/google-cloud-beyondcorp-clientgateways/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-analyticshub/package.json b/packages/google-cloud-bigquery-analyticshub/package.json index 1dae78566b94..7ca20005e71d 100644 --- a/packages/google-cloud-bigquery-analyticshub/package.json +++ b/packages/google-cloud-bigquery-analyticshub/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-connection/package.json b/packages/google-cloud-bigquery-connection/package.json index 1ede36b03580..3fd4856a120a 100644 --- a/packages/google-cloud-bigquery-connection/package.json +++ b/packages/google-cloud-bigquery-connection/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-connection" -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-dataexchange/package.json b/packages/google-cloud-bigquery-dataexchange/package.json index 2a57abdb87bc..2a54f1188162 100644 --- a/packages/google-cloud-bigquery-dataexchange/package.json +++ b/packages/google-cloud-bigquery-dataexchange/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.0.0", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=v12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-datapolicies/package.json b/packages/google-cloud-bigquery-datapolicies/package.json index c0614f8f266e..2643ac6b08d1 100644 --- a/packages/google-cloud-bigquery-datapolicies/package.json +++ b/packages/google-cloud-bigquery-datapolicies/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-datatransfer/package.json b/packages/google-cloud-bigquery-datatransfer/package.json index 8681b0fba3b9..d39923f4573c 100644 --- a/packages/google-cloud-bigquery-datatransfer/package.json +++ b/packages/google-cloud-bigquery-datatransfer/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack": "^5.0.0", "webpack-cli": "^5.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index e68f4a5e22e7..ea09dca5342f 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-billing-budgets/package.json b/packages/google-cloud-billing-budgets/package.json index 27a566760e8f..6031adbe7f05 100644 --- a/packages/google-cloud-billing-budgets/package.json +++ b/packages/google-cloud-billing-budgets/package.json @@ -23,7 +23,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", @@ -54,4 +54,4 @@ "google-gax": "^3.5.8" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets" -} \ No newline at end of file +} diff --git a/packages/google-cloud-billing/package.json b/packages/google-cloud-billing/package.json index e63e1cb20b78..7bbc9ae55571 100644 --- a/packages/google-cloud-billing/package.json +++ b/packages/google-cloud-billing/package.json @@ -43,7 +43,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing" -} \ No newline at end of file +} diff --git a/packages/google-cloud-binaryauthorization/package.json b/packages/google-cloud-binaryauthorization/package.json index 7401e0dfdb05..205a965ca16a 100644 --- a/packages/google-cloud-binaryauthorization/package.json +++ b/packages/google-cloud-binaryauthorization/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-binaryauthorization" -} \ No newline at end of file +} diff --git a/packages/google-cloud-certificatemanager/package.json b/packages/google-cloud-certificatemanager/package.json index 2b7db4bb14d5..0b8ece52bef5 100644 --- a/packages/google-cloud-certificatemanager/package.json +++ b/packages/google-cloud-certificatemanager/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-channel/package.json b/packages/google-cloud-channel/package.json index a6fa2d306066..e01c005770c0 100644 --- a/packages/google-cloud-channel/package.json +++ b/packages/google-cloud-channel/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel" -} \ No newline at end of file +} diff --git a/packages/google-cloud-clouddms/package.json b/packages/google-cloud-clouddms/package.json index 4ae4d73fec2a..4d78fe24da5f 100644 --- a/packages/google-cloud-clouddms/package.json +++ b/packages/google-cloud-clouddms/package.json @@ -58,7 +58,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -70,4 +70,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms" -} \ No newline at end of file +} diff --git a/packages/google-cloud-compute/package.json b/packages/google-cloud-compute/package.json index 7fe885abd7c3..b97f492f0f2a 100644 --- a/packages/google-cloud-compute/package.json +++ b/packages/google-cloud-compute/package.json @@ -137,7 +137,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -150,4 +150,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-compute" -} \ No newline at end of file +} diff --git a/packages/google-cloud-confidentialcomputing/package.json b/packages/google-cloud-confidentialcomputing/package.json index 0e6e83354a84..9bcab55ab38c 100644 --- a/packages/google-cloud-confidentialcomputing/package.json +++ b/packages/google-cloud-confidentialcomputing/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -70,4 +70,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-contactcenterinsights/package.json b/packages/google-cloud-contactcenterinsights/package.json index 94eb732b9c0f..39a2efdf09bf 100644 --- a/packages/google-cloud-contactcenterinsights/package.json +++ b/packages/google-cloud-contactcenterinsights/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-contactcenterinsights" -} \ No newline at end of file +} diff --git a/packages/google-cloud-contentwarehouse/package.json b/packages/google-cloud-contentwarehouse/package.json index c1194d0e968a..00ddc1717b20 100644 --- a/packages/google-cloud-contentwarehouse/package.json +++ b/packages/google-cloud-contentwarehouse/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-datacatalog-lineage/package.json b/packages/google-cloud-datacatalog-lineage/package.json index 4a326b5b6d2b..f71ae8052497 100644 --- a/packages/google-cloud-datacatalog-lineage/package.json +++ b/packages/google-cloud-datacatalog-lineage/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-datacatalog/package.json b/packages/google-cloud-datacatalog/package.json index c4422461ad35..8135b841c109 100644 --- a/packages/google-cloud-datacatalog/package.json +++ b/packages/google-cloud-datacatalog/package.json @@ -42,7 +42,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", @@ -70,4 +70,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datacatalog" -} \ No newline at end of file +} diff --git a/packages/google-cloud-dataform/package.json b/packages/google-cloud-dataform/package.json index a87d3e1f335d..f16d44e95793 100644 --- a/packages/google-cloud-dataform/package.json +++ b/packages/google-cloud-dataform/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.0.0", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=v12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataform" -} \ No newline at end of file +} diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 81eb76acfbbc..d96ae0a9189f 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datafusion" -} \ No newline at end of file +} diff --git a/packages/google-cloud-datalabeling/package.json b/packages/google-cloud-datalabeling/package.json index c0dea7cf4735..96918696ca68 100644 --- a/packages/google-cloud-datalabeling/package.json +++ b/packages/google-cloud-datalabeling/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datalabeling" -} \ No newline at end of file +} diff --git a/packages/google-cloud-dataplex/package.json b/packages/google-cloud-dataplex/package.json index b2c694eb022e..85c28061ae30 100644 --- a/packages/google-cloud-dataplex/package.json +++ b/packages/google-cloud-dataplex/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -73,4 +73,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-dataproc/package.json b/packages/google-cloud-dataproc/package.json index febfd37cc97c..ca4c34ceebc9 100644 --- a/packages/google-cloud-dataproc/package.json +++ b/packages/google-cloud-dataproc/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataproc" -} \ No newline at end of file +} diff --git a/packages/google-cloud-dataqna/package.json b/packages/google-cloud-dataqna/package.json index 7f42df021e73..185b2c502923 100644 --- a/packages/google-cloud-dataqna/package.json +++ b/packages/google-cloud-dataqna/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -72,4 +72,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataqna" -} \ No newline at end of file +} diff --git a/packages/google-cloud-datastream/package.json b/packages/google-cloud-datastream/package.json index c9cd19c4a991..25dd42f67060 100644 --- a/packages/google-cloud-datastream/package.json +++ b/packages/google-cloud-datastream/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datastream" -} \ No newline at end of file +} diff --git a/packages/google-cloud-deploy/package.json b/packages/google-cloud-deploy/package.json index 93cf7c44628c..bbf203e4861d 100644 --- a/packages/google-cloud-deploy/package.json +++ b/packages/google-cloud-deploy/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-dialogflow-cx/package.json b/packages/google-cloud-dialogflow-cx/package.json index 2697af5c003f..638cc5a637db 100644 --- a/packages/google-cloud-dialogflow-cx/package.json +++ b/packages/google-cloud-dialogflow-cx/package.json @@ -67,7 +67,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -82,4 +82,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dialogflow-cx" -} \ No newline at end of file +} diff --git a/packages/google-cloud-dialogflow/package.json b/packages/google-cloud-dialogflow/package.json index a7f2ed9792e8..5f5aedc5fd77 100644 --- a/packages/google-cloud-dialogflow/package.json +++ b/packages/google-cloud-dialogflow/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dialogflow" -} \ No newline at end of file +} diff --git a/packages/google-cloud-discoveryengine/package.json b/packages/google-cloud-discoveryengine/package.json index 76e6ea983dea..3146d42d15f7 100644 --- a/packages/google-cloud-discoveryengine/package.json +++ b/packages/google-cloud-discoveryengine/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-documentai/package.json b/packages/google-cloud-documentai/package.json index d02fa9d4534f..89778b8a56ff 100644 --- a/packages/google-cloud-documentai/package.json +++ b/packages/google-cloud-documentai/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -59,4 +59,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-documentai" -} \ No newline at end of file +} diff --git a/packages/google-cloud-domains/package.json b/packages/google-cloud-domains/package.json index 6027d0aa558b..3a94491b64b2 100644 --- a/packages/google-cloud-domains/package.json +++ b/packages/google-cloud-domains/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-domains" -} \ No newline at end of file +} diff --git a/packages/google-cloud-essentialcontacts/package.json b/packages/google-cloud-essentialcontacts/package.json index 4d32cace755d..c5b1c434819a 100644 --- a/packages/google-cloud-essentialcontacts/package.json +++ b/packages/google-cloud-essentialcontacts/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-essentialcontacts" -} \ No newline at end of file +} diff --git a/packages/google-cloud-eventarc-publishing/package.json b/packages/google-cloud-eventarc-publishing/package.json index 4226a31b10c8..de3af82fb391 100644 --- a/packages/google-cloud-eventarc-publishing/package.json +++ b/packages/google-cloud-eventarc-publishing/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-eventarc-publishing" -} \ No newline at end of file +} diff --git a/packages/google-cloud-eventarc/package.json b/packages/google-cloud-eventarc/package.json index 5046454a185a..813933f74c2e 100644 --- a/packages/google-cloud-eventarc/package.json +++ b/packages/google-cloud-eventarc/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-eventarc" -} \ No newline at end of file +} diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 61daafbc4038..c24ee56747e7 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore" -} \ No newline at end of file +} diff --git a/packages/google-cloud-functions/package.json b/packages/google-cloud-functions/package.json index 3b1b7cb96656..7590744b5156 100644 --- a/packages/google-cloud-functions/package.json +++ b/packages/google-cloud-functions/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions" -} \ No newline at end of file +} diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 8ab2015ccaf5..7f4c3b43ab2b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -43,7 +43,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gaming" -} \ No newline at end of file +} diff --git a/packages/google-cloud-gkebackup/package.json b/packages/google-cloud-gkebackup/package.json index 4a70363e3913..2732c701f568 100644 --- a/packages/google-cloud-gkebackup/package.json +++ b/packages/google-cloud-gkebackup/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.0.0", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=v12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkebackup" -} \ No newline at end of file +} diff --git a/packages/google-cloud-gkeconnect-gateway/package.json b/packages/google-cloud-gkeconnect-gateway/package.json index 3b2fad9e5b5d..832848e5eb81 100644 --- a/packages/google-cloud-gkeconnect-gateway/package.json +++ b/packages/google-cloud-gkeconnect-gateway/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-gkehub/package.json b/packages/google-cloud-gkehub/package.json index 8efcc7cc5ff0..cb590ced1a15 100644 --- a/packages/google-cloud-gkehub/package.json +++ b/packages/google-cloud-gkehub/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkehub" -} \ No newline at end of file +} diff --git a/packages/google-cloud-gkemulticloud/package.json b/packages/google-cloud-gkemulticloud/package.json index e8cbba027354..b9fa62dd3c90 100644 --- a/packages/google-cloud-gkemulticloud/package.json +++ b/packages/google-cloud-gkemulticloud/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-gsuiteaddons/package.json b/packages/google-cloud-gsuiteaddons/package.json index 71ff51acb38d..33e145779de4 100644 --- a/packages/google-cloud-gsuiteaddons/package.json +++ b/packages/google-cloud-gsuiteaddons/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-iap/package.json b/packages/google-cloud-iap/package.json index 6b0f27459267..046c8d73e94b 100644 --- a/packages/google-cloud-iap/package.json +++ b/packages/google-cloud-iap/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-iap" -} \ No newline at end of file +} diff --git a/packages/google-cloud-ids/package.json b/packages/google-cloud-ids/package.json index 80176d06bc59..1a0e0f6dd956 100644 --- a/packages/google-cloud-ids/package.json +++ b/packages/google-cloud-ids/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-ids" -} \ No newline at end of file +} diff --git a/packages/google-cloud-iot/package.json b/packages/google-cloud-iot/package.json index 0905755ab880..c17286c747b5 100644 --- a/packages/google-cloud-iot/package.json +++ b/packages/google-cloud-iot/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-iot" -} \ No newline at end of file +} diff --git a/packages/google-cloud-kms-inventory/package.json b/packages/google-cloud-kms-inventory/package.json index 4578332c589c..a5a02ebf455f 100644 --- a/packages/google-cloud-kms-inventory/package.json +++ b/packages/google-cloud-kms-inventory/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.2", "jsdoc-fresh": "^2.0.1", "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.2.0", "null-loader": "^4.0.1", @@ -72,4 +72,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-kms-inventory" -} \ No newline at end of file +} diff --git a/packages/google-cloud-kms/package.json b/packages/google-cloud-kms/package.json index ac0a3fc5ea4c..4b1ddb8942ba 100644 --- a/packages/google-cloud-kms/package.json +++ b/packages/google-cloud-kms/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-kms" -} \ No newline at end of file +} diff --git a/packages/google-cloud-language/package.json b/packages/google-cloud-language/package.json index 579a14d7c189..f4a173e3adfe 100644 --- a/packages/google-cloud-language/package.json +++ b/packages/google-cloud-language/package.json @@ -64,7 +64,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -75,4 +75,4 @@ "webpack": "^5.0.0", "webpack-cli": "^5.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-lifesciences/package.json b/packages/google-cloud-lifesciences/package.json index 4121bcabd58b..c7212b0ef678 100644 --- a/packages/google-cloud-lifesciences/package.json +++ b/packages/google-cloud-lifesciences/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lifesciences" -} \ No newline at end of file +} diff --git a/packages/google-cloud-managedidentities/package.json b/packages/google-cloud-managedidentities/package.json index 8b02d977357f..dc6ad4eda24a 100644 --- a/packages/google-cloud-managedidentities/package.json +++ b/packages/google-cloud-managedidentities/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedidentities" -} \ No newline at end of file +} diff --git a/packages/google-cloud-mediatranslation/package.json b/packages/google-cloud-mediatranslation/package.json index 67c220a14bf0..7a69c31f384a 100644 --- a/packages/google-cloud-mediatranslation/package.json +++ b/packages/google-cloud-mediatranslation/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 2e7fbe48383b..c88dcf6939e1 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-metastore/package.json b/packages/google-cloud-metastore/package.json index a07d65867fdc..45b509eedf95 100644 --- a/packages/google-cloud-metastore/package.json +++ b/packages/google-cloud-metastore/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-metastore" -} \ No newline at end of file +} diff --git a/packages/google-cloud-monitoring/package.json b/packages/google-cloud-monitoring/package.json index c3fc258943fb..ce0b3f028e07 100644 --- a/packages/google-cloud-monitoring/package.json +++ b/packages/google-cloud-monitoring/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-monitoring" -} \ No newline at end of file +} diff --git a/packages/google-cloud-networkconnectivity/package.json b/packages/google-cloud-networkconnectivity/package.json index f21443afdf28..2956f1dc0fae 100644 --- a/packages/google-cloud-networkconnectivity/package.json +++ b/packages/google-cloud-networkconnectivity/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkconnectivity" -} \ No newline at end of file +} diff --git a/packages/google-cloud-networkmanagement/package.json b/packages/google-cloud-networkmanagement/package.json index 57718e6fe471..4380d0fd2475 100644 --- a/packages/google-cloud-networkmanagement/package.json +++ b/packages/google-cloud-networkmanagement/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkmanagement" -} \ No newline at end of file +} diff --git a/packages/google-cloud-networksecurity/package.json b/packages/google-cloud-networksecurity/package.json index 70951492308c..c77ee8e1a9c2 100644 --- a/packages/google-cloud-networksecurity/package.json +++ b/packages/google-cloud-networksecurity/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networksecurity" -} \ No newline at end of file +} diff --git a/packages/google-cloud-notebooks/package.json b/packages/google-cloud-notebooks/package.json index 3f6ebac58128..f3e3ffcf7473 100644 --- a/packages/google-cloud-notebooks/package.json +++ b/packages/google-cloud-notebooks/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-notebooks" -} \ No newline at end of file +} diff --git a/packages/google-cloud-optimization/package.json b/packages/google-cloud-optimization/package.json index f05dee98235f..27f2136978aa 100644 --- a/packages/google-cloud-optimization/package.json +++ b/packages/google-cloud-optimization/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-optimization" -} \ No newline at end of file +} diff --git a/packages/google-cloud-orchestration-airflow-service/package.json b/packages/google-cloud-orchestration-airflow-service/package.json index f053ebf991c4..71f7181f3234 100644 --- a/packages/google-cloud-orchestration-airflow-service/package.json +++ b/packages/google-cloud-orchestration-airflow-service/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-orchestration-airflow-service" -} \ No newline at end of file +} diff --git a/packages/google-cloud-orgpolicy/package.json b/packages/google-cloud-orgpolicy/package.json index 5558560bac5d..6c22e5514ec7 100644 --- a/packages/google-cloud-orgpolicy/package.json +++ b/packages/google-cloud-orgpolicy/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-orgpolicy" -} \ No newline at end of file +} diff --git a/packages/google-cloud-osconfig/package.json b/packages/google-cloud-osconfig/package.json index 0315391e1925..78e9b53c156c 100644 --- a/packages/google-cloud-osconfig/package.json +++ b/packages/google-cloud-osconfig/package.json @@ -43,7 +43,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -56,4 +56,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-osconfig" -} \ No newline at end of file +} diff --git a/packages/google-cloud-oslogin/package.json b/packages/google-cloud-oslogin/package.json index 7c62cff5d395..2e125718cc87 100644 --- a/packages/google-cloud-oslogin/package.json +++ b/packages/google-cloud-oslogin/package.json @@ -62,7 +62,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -73,4 +73,4 @@ "webpack": "^5.0.0", "webpack-cli": "^5.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-phishingprotection/package.json b/packages/google-cloud-phishingprotection/package.json index 830d71a10cc3..d067b0bc6620 100644 --- a/packages/google-cloud-phishingprotection/package.json +++ b/packages/google-cloud-phishingprotection/package.json @@ -41,7 +41,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-policytroubleshooter/package.json b/packages/google-cloud-policytroubleshooter/package.json index c53ffb97b4d8..cbefdd9f76a0 100644 --- a/packages/google-cloud-policytroubleshooter/package.json +++ b/packages/google-cloud-policytroubleshooter/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-privatecatalog/package.json b/packages/google-cloud-privatecatalog/package.json index 8573dc76ef76..dfcc429111b9 100644 --- a/packages/google-cloud-privatecatalog/package.json +++ b/packages/google-cloud-privatecatalog/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privatecatalog" -} \ No newline at end of file +} diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 64c33a7958b7..92d90137fa1e 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -41,7 +41,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -73,4 +73,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-recaptchaenterprise" -} \ No newline at end of file +} diff --git a/packages/google-cloud-recommender/package.json b/packages/google-cloud-recommender/package.json index 91c3e39410d5..1fc23e7eae59 100644 --- a/packages/google-cloud-recommender/package.json +++ b/packages/google-cloud-recommender/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-redis/package.json b/packages/google-cloud-redis/package.json index 46058977e5a5..0656fd1658b5 100644 --- a/packages/google-cloud-redis/package.json +++ b/packages/google-cloud-redis/package.json @@ -61,7 +61,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack": "^5.0.0", "webpack-cli": "^5.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-resourcemanager/package.json b/packages/google-cloud-resourcemanager/package.json index 3439886a1883..ea4409381641 100644 --- a/packages/google-cloud-resourcemanager/package.json +++ b/packages/google-cloud-resourcemanager/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack": "^5.0.0", "webpack-cli": "^5.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-resourcesettings/package.json b/packages/google-cloud-resourcesettings/package.json index b6c5663955ff..f4731e1ea7f1 100644 --- a/packages/google-cloud-resourcesettings/package.json +++ b/packages/google-cloud-resourcesettings/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-resourcesettings" -} \ No newline at end of file +} diff --git a/packages/google-cloud-retail/package.json b/packages/google-cloud-retail/package.json index d5fe081699f9..784c8bcaa01c 100644 --- a/packages/google-cloud-retail/package.json +++ b/packages/google-cloud-retail/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -74,4 +74,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-retail" -} \ No newline at end of file +} diff --git a/packages/google-cloud-run/package.json b/packages/google-cloud-run/package.json index 105820d63c01..ee82093fc7ef 100644 --- a/packages/google-cloud-run/package.json +++ b/packages/google-cloud-run/package.json @@ -52,7 +52,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.0.0", "null-loader": "^4.0.0", @@ -67,4 +67,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-run" -} \ No newline at end of file +} diff --git a/packages/google-cloud-scheduler/package.json b/packages/google-cloud-scheduler/package.json index 73a9e3bd8f0e..6347baa52a33 100644 --- a/packages/google-cloud-scheduler/package.json +++ b/packages/google-cloud-scheduler/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -66,4 +66,4 @@ "typescript": "^4.6.4" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-scheduler" -} \ No newline at end of file +} diff --git a/packages/google-cloud-secretmanager/package.json b/packages/google-cloud-secretmanager/package.json index 83d653e371ac..79520e01a588 100644 --- a/packages/google-cloud-secretmanager/package.json +++ b/packages/google-cloud-secretmanager/package.json @@ -52,7 +52,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -67,4 +67,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-secretmanager" -} \ No newline at end of file +} diff --git a/packages/google-cloud-security-privateca/package.json b/packages/google-cloud-security-privateca/package.json index 89a502b81f64..cfc19e8e1caa 100644 --- a/packages/google-cloud-security-privateca/package.json +++ b/packages/google-cloud-security-privateca/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-security-privateca" -} \ No newline at end of file +} diff --git a/packages/google-cloud-security-publicca/package.json b/packages/google-cloud-security-publicca/package.json index ccedcc277e00..124be3ee77bd 100644 --- a/packages/google-cloud-security-publicca/package.json +++ b/packages/google-cloud-security-publicca/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index c838ffd0035f..b1c6bf6cdf85 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -69,4 +69,4 @@ "typescript": "^4.6.4" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-securitycenter" -} \ No newline at end of file +} diff --git a/packages/google-cloud-servicedirectory/package.json b/packages/google-cloud-servicedirectory/package.json index 757f0499b19d..8b9e2e8e393f 100644 --- a/packages/google-cloud-servicedirectory/package.json +++ b/packages/google-cloud-servicedirectory/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -57,4 +57,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-servicedirectory" -} \ No newline at end of file +} diff --git a/packages/google-cloud-shell/package.json b/packages/google-cloud-shell/package.json index 3411da3320c5..570671196d1d 100644 --- a/packages/google-cloud-shell/package.json +++ b/packages/google-cloud-shell/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-speech/package.json b/packages/google-cloud-speech/package.json index a3fa21c0933b..963a1dbad93e 100644 --- a/packages/google-cloud-speech/package.json +++ b/packages/google-cloud-speech/package.json @@ -67,7 +67,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -79,4 +79,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-speech" -} \ No newline at end of file +} diff --git a/packages/google-cloud-storageinsights/package.json b/packages/google-cloud-storageinsights/package.json index 2c62dd2ab185..e23ec5778d50 100644 --- a/packages/google-cloud-storageinsights/package.json +++ b/packages/google-cloud-storageinsights/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", diff --git a/packages/google-cloud-support/package.json b/packages/google-cloud-support/package.json index d0ce95363664..d7d4249e4978 100644 --- a/packages/google-cloud-support/package.json +++ b/packages/google-cloud-support/package.json @@ -57,7 +57,7 @@ "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "long": "^5.2.3", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", diff --git a/packages/google-cloud-talent/package.json b/packages/google-cloud-talent/package.json index 58b4d268eab8..dcafd898d8e3 100644 --- a/packages/google-cloud-talent/package.json +++ b/packages/google-cloud-talent/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-talent" -} \ No newline at end of file +} diff --git a/packages/google-cloud-tasks/package.json b/packages/google-cloud-tasks/package.json index ab0629f4c432..2faacf7e2925 100644 --- a/packages/google-cloud-tasks/package.json +++ b/packages/google-cloud-tasks/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-tasks" -} \ No newline at end of file +} diff --git a/packages/google-cloud-texttospeech/package.json b/packages/google-cloud-texttospeech/package.json index aa50938a828e..f07e89436029 100644 --- a/packages/google-cloud-texttospeech/package.json +++ b/packages/google-cloud-texttospeech/package.json @@ -60,7 +60,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-texttospeech" -} \ No newline at end of file +} diff --git a/packages/google-cloud-tpu/package.json b/packages/google-cloud-tpu/package.json index cba5e3ba430d..c1103550dc6a 100644 --- a/packages/google-cloud-tpu/package.json +++ b/packages/google-cloud-tpu/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-tpu" -} \ No newline at end of file +} diff --git a/packages/google-cloud-translate/package.json b/packages/google-cloud-translate/package.json index 50e02a019092..646f352c7bb1 100644 --- a/packages/google-cloud-translate/package.json +++ b/packages/google-cloud-translate/package.json @@ -71,7 +71,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", @@ -80,4 +80,4 @@ "typescript": "^4.6.4" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-translate" -} \ No newline at end of file +} diff --git a/packages/google-cloud-video-livestream/package.json b/packages/google-cloud-video-livestream/package.json index c94c68e46b08..67fe5c258279 100644 --- a/packages/google-cloud-video-livestream/package.json +++ b/packages/google-cloud-video-livestream/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-livestream" -} \ No newline at end of file +} diff --git a/packages/google-cloud-video-stitcher/package.json b/packages/google-cloud-video-stitcher/package.json index 9545f168e9d6..b09fc54bf61b 100644 --- a/packages/google-cloud-video-stitcher/package.json +++ b/packages/google-cloud-video-stitcher/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^8.4.0", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=v12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-stitcher" -} \ No newline at end of file +} diff --git a/packages/google-cloud-video-transcoder/package.json b/packages/google-cloud-video-transcoder/package.json index be6379515d50..b2a6965b93c4 100644 --- a/packages/google-cloud-video-transcoder/package.json +++ b/packages/google-cloud-video-transcoder/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -70,4 +70,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-transcoder" -} \ No newline at end of file +} diff --git a/packages/google-cloud-videointelligence/package.json b/packages/google-cloud-videointelligence/package.json index 347939681538..f0136a2b49ad 100644 --- a/packages/google-cloud-videointelligence/package.json +++ b/packages/google-cloud-videointelligence/package.json @@ -61,7 +61,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -72,4 +72,4 @@ "typescript": "^4.6.4" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence" -} \ No newline at end of file +} diff --git a/packages/google-cloud-vision/package.json b/packages/google-cloud-vision/package.json index b6b8e76fd3f8..5e8f1815483e 100644 --- a/packages/google-cloud-vision/package.json +++ b/packages/google-cloud-vision/package.json @@ -66,7 +66,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.0.0", "null-loader": "^4.0.0", @@ -79,4 +79,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vision" -} \ No newline at end of file +} diff --git a/packages/google-cloud-vmmigration/package.json b/packages/google-cloud-vmmigration/package.json index 3f629d25fc20..b5b11cca072f 100644 --- a/packages/google-cloud-vmmigration/package.json +++ b/packages/google-cloud-vmmigration/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmmigration" -} \ No newline at end of file +} diff --git a/packages/google-cloud-vmwareengine/package.json b/packages/google-cloud-vmwareengine/package.json index cbeb89fc8b0c..738df109bec8 100644 --- a/packages/google-cloud-vmwareengine/package.json +++ b/packages/google-cloud-vmwareengine/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-vpcaccess/package.json b/packages/google-cloud-vpcaccess/package.json index 89aef9f312b9..972ff92dbf52 100644 --- a/packages/google-cloud-vpcaccess/package.json +++ b/packages/google-cloud-vpcaccess/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vpcaccess" -} \ No newline at end of file +} diff --git a/packages/google-cloud-webrisk/package.json b/packages/google-cloud-webrisk/package.json index aeaa5025ba6a..e6a13ce39d1b 100644 --- a/packages/google-cloud-webrisk/package.json +++ b/packages/google-cloud-webrisk/package.json @@ -42,7 +42,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -74,4 +74,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-webrisk" -} \ No newline at end of file +} diff --git a/packages/google-cloud-websecurityscanner/package.json b/packages/google-cloud-websecurityscanner/package.json index cd0f2716b33d..d17db6919cd9 100644 --- a/packages/google-cloud-websecurityscanner/package.json +++ b/packages/google-cloud-websecurityscanner/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-websecurityscanner" -} \ No newline at end of file +} diff --git a/packages/google-cloud-workflows-executions/package.json b/packages/google-cloud-workflows-executions/package.json index 1bd51918bed1..6050861b8d02 100644 --- a/packages/google-cloud-workflows-executions/package.json +++ b/packages/google-cloud-workflows-executions/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions" -} \ No newline at end of file +} diff --git a/packages/google-cloud-workstations/package.json b/packages/google-cloud-workstations/package.json index a24c121ab5ec..4fc704a8a9ec 100644 --- a/packages/google-cloud-workstations/package.json +++ b/packages/google-cloud-workstations/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-container/package.json b/packages/google-container/package.json index 12fa2670a532..63d032d9652f 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-container" -} \ No newline at end of file +} diff --git a/packages/google-dataflow/package.json b/packages/google-dataflow/package.json index 88d8c8249c7d..a9e513051cd1 100644 --- a/packages/google-dataflow/package.json +++ b/packages/google-dataflow/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-dataflow" -} \ No newline at end of file +} diff --git a/packages/google-devtools-artifactregistry/package.json b/packages/google-devtools-artifactregistry/package.json index 6b79d861f389..770c36831151 100644 --- a/packages/google-devtools-artifactregistry/package.json +++ b/packages/google-devtools-artifactregistry/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-devtools-cloudbuild/package.json b/packages/google-devtools-cloudbuild/package.json index 07833004391d..f14d74e2cb89 100644 --- a/packages/google-devtools-cloudbuild/package.json +++ b/packages/google-devtools-cloudbuild/package.json @@ -37,7 +37,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "pack-n-play": "^1.0.0-2", @@ -68,4 +68,4 @@ "google-gax": "^3.5.8" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudbuild" -} \ No newline at end of file +} diff --git a/packages/google-devtools-containeranalysis/package.json b/packages/google-devtools-containeranalysis/package.json index b173f998c551..510ba4c5212d 100644 --- a/packages/google-devtools-containeranalysis/package.json +++ b/packages/google-devtools-containeranalysis/package.json @@ -54,7 +54,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.1", "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^10.2.0", "null-loader": "^4.0.1", @@ -68,4 +68,4 @@ "engines": { "node": ">=v12" } -} \ No newline at end of file +} diff --git a/packages/google-iam-credentials/package.json b/packages/google-iam-credentials/package.json index e17c1c54f636..05f894baab11 100644 --- a/packages/google-iam-credentials/package.json +++ b/packages/google-iam-credentials/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-iam-credentials" -} \ No newline at end of file +} diff --git a/packages/google-iam/package.json b/packages/google-iam/package.json index fa47d14ff948..2d6a916c1adb 100644 --- a/packages/google-iam/package.json +++ b/packages/google-iam/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-identity-accesscontextmanager/package.json b/packages/google-identity-accesscontextmanager/package.json index be81d6435f87..e0195bf7b6d3 100644 --- a/packages/google-identity-accesscontextmanager/package.json +++ b/packages/google-identity-accesscontextmanager/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-identity-accesscontextmanager" -} \ No newline at end of file +} diff --git a/packages/google-maps-addressvalidation/package.json b/packages/google-maps-addressvalidation/package.json index 5918d6b1b132..2581ae848b1b 100644 --- a/packages/google-maps-addressvalidation/package.json +++ b/packages/google-maps-addressvalidation/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-maps-mapsplatformdatasets/package.json b/packages/google-maps-mapsplatformdatasets/package.json index 0913cebe6a0b..721de918f982 100644 --- a/packages/google-maps-mapsplatformdatasets/package.json +++ b/packages/google-maps-mapsplatformdatasets/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-maps-places/package.json b/packages/google-maps-places/package.json index b02c40294592..a408261efd02 100644 --- a/packages/google-maps-places/package.json +++ b/packages/google-maps-places/package.json @@ -57,7 +57,7 @@ "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "long": "^5.2.3", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", diff --git a/packages/google-maps-routing/package.json b/packages/google-maps-routing/package.json index 8adf963a7ca4..d99b25998674 100644 --- a/packages/google-maps-routing/package.json +++ b/packages/google-maps-routing/package.json @@ -57,7 +57,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-monitoring-dashboard/package.json b/packages/google-monitoring-dashboard/package.json index 433269f8cd25..95d4094125bd 100644 --- a/packages/google-monitoring-dashboard/package.json +++ b/packages/google-monitoring-dashboard/package.json @@ -44,7 +44,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -58,4 +58,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/packages/google-privacy-dlp/package.json b/packages/google-privacy-dlp/package.json index f5262238ab68..04127ae63ce6 100644 --- a/packages/google-privacy-dlp/package.json +++ b/packages/google-privacy-dlp/package.json @@ -59,7 +59,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "webpack-cli": "^5.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-privacy-dlp" -} \ No newline at end of file +} diff --git a/packages/google-storagetransfer/package.json b/packages/google-storagetransfer/package.json index db0113212952..7d5ba117c411 100644 --- a/packages/google-storagetransfer/package.json +++ b/packages/google-storagetransfer/package.json @@ -56,7 +56,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.1", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storagetransfer" -} \ No newline at end of file +} diff --git a/packages/grafeas/package.json b/packages/grafeas/package.json index ac0ca1fc6f41..06faac372014 100644 --- a/packages/grafeas/package.json +++ b/packages/grafeas/package.json @@ -39,7 +39,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", + "linkinator": "4.1.2", "long": "^5.2.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", @@ -71,4 +71,4 @@ "node": ">=12.0.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/grafeas" -} \ No newline at end of file +} From 02f2346643a61ebed9c25a60e6229a1996be727c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 19:26:12 +0000 Subject: [PATCH 14/46] feat: [contactcenterinsights] Add the resource definition of a STT recognizer (#4310) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 537079193 Source-Link: https://togithub.com/googleapis/googleapis/commit/b93344664d31b20e068c641422406d50bd03d6ec Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/086270d1be505d20aba7bb283a04bf10089dbd38 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3RjZW50ZXJpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiMDg2MjcwZDFiZTUwNWQyMGFiYTdiYjI4M2EwNGJmMTAwODlkYmQzOCJ9 --- .../README.md | 83 +++++++++---------- .../contactcenterinsights/v1/resources.proto | 4 + .../protos/protos.json | 4 +- .../samples/README.md | 18 ---- 4 files changed, 47 insertions(+), 62 deletions(-) diff --git a/packages/google-cloud-contactcenterinsights/README.md b/packages/google-cloud-contactcenterinsights/README.md index 96e160757daf..1e41dbb5c75c 100644 --- a/packages/google-cloud-contactcenterinsights/README.md +++ b/packages/google-cloud-contactcenterinsights/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Contact Center AI Insights API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Contact Center AI Insights API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-contactcenterinsights) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/contact-center-insights.svg)](https://www.npmjs.org/package/@google-cloud/contact-center-insights) @@ -83,50 +83,49 @@ listConversations(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-contactcenterinsights/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Contact_center_insights.bulk_analyze_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js,samples/README.md) | -| Contact_center_insights.calculate_issue_model_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js,samples/README.md) | -| Contact_center_insights.calculate_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js,samples/README.md) | -| Contact_center_insights.create_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js,samples/README.md) | -| Contact_center_insights.create_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_conversation.js,samples/README.md) | -| Contact_center_insights.create_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_issue_model.js,samples/README.md) | -| Contact_center_insights.create_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_phrase_matcher.js,samples/README.md) | -| Contact_center_insights.create_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js,samples/README.md) | -| Contact_center_insights.delete_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js,samples/README.md) | -| Contact_center_insights.delete_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js,samples/README.md) | -| Contact_center_insights.delete_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js,samples/README.md) | -| Contact_center_insights.delete_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js,samples/README.md) | -| Contact_center_insights.delete_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js,samples/README.md) | -| Contact_center_insights.delete_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js,samples/README.md) | -| Contact_center_insights.deploy_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.deploy_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.deploy_issue_model.js,samples/README.md) | -| Contact_center_insights.export_insights_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.export_insights_data.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.export_insights_data.js,samples/README.md) | -| Contact_center_insights.get_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_analysis.js,samples/README.md) | -| Contact_center_insights.get_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_conversation.js,samples/README.md) | -| Contact_center_insights.get_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue.js,samples/README.md) | -| Contact_center_insights.get_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue_model.js,samples/README.md) | -| Contact_center_insights.get_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js,samples/README.md) | -| Contact_center_insights.get_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js,samples/README.md) | -| Contact_center_insights.get_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js,samples/README.md) | -| Contact_center_insights.ingest_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js,samples/README.md) | -| Contact_center_insights.list_analyses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js,samples/README.md) | -| Contact_center_insights.list_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js,samples/README.md) | -| Contact_center_insights.list_issue_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js,samples/README.md) | -| Contact_center_insights.list_issues | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issues.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issues.js,samples/README.md) | -| Contact_center_insights.list_phrase_matchers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_phrase_matchers.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_phrase_matchers.js,samples/README.md) | -| Contact_center_insights.list_views | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_views.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_views.js,samples/README.md) | -| Contact_center_insights.undeploy_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.undeploy_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.undeploy_issue_model.js,samples/README.md) | -| Contact_center_insights.update_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_conversation.js,samples/README.md) | -| Contact_center_insights.update_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue.js,samples/README.md) | -| Contact_center_insights.update_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue_model.js,samples/README.md) | -| Contact_center_insights.update_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_phrase_matcher.js,samples/README.md) | -| Contact_center_insights.update_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_settings.js,samples/README.md) | -| Contact_center_insights.update_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_view.js,samples/README.md) | -| Contact_center_insights.upload_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/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-contactcenterinsights/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/test/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-contactcenterinsights/samples/test/quickstart.js,samples/README.md) | +| Contact_center_insights.bulk_analyze_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.calculate_issue_model_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.calculate_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.create_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.create_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_conversation.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.create_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.create_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_phrase_matcher.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.create_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.delete_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.deploy_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.deploy_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.deploy_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.export_insights_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.export_insights_data.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.export_insights_data.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_analysis.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_analysis.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_conversation.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.get_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.ingest_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_analyses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_issue_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_issues | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issues.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issues.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_phrase_matchers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_phrase_matchers.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_phrase_matchers.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.list_views | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_views.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.list_views.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.undeploy_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.undeploy_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.undeploy_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_conversation.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue_model.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_issue_model.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_phrase_matcher.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_phrase_matcher.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_settings.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.update_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.update_view.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.update_view.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Contact_center_insights.upload_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js) | [![Open in Cloud 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-contactcenterinsights/samples/generated/v1/contact_center_insights.upload_conversation.js,packages/google-cloud-contactcenterinsights/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/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-contactcenterinsights/samples/quickstart.js,packages/google-cloud-contactcenterinsights/samples/README.md) | diff --git a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto index 736333aceeef..a6e881b845ce 100644 --- a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto +++ b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto @@ -37,6 +37,10 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/conversations/{conversation}/participants/{participant}" pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" }; +option (google.api.resource_definition) = { + type: "speech.googleapis.com/Recognizer" + pattern: "projects/{project}/locations/{location}/recognizers/{recognizer}" +}; // The conversation resource. message Conversation { diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.json b/packages/google-cloud-contactcenterinsights/protos/protos.json index 321f05891d6b..5c8fafa30107 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.json +++ b/packages/google-cloud-contactcenterinsights/protos/protos.json @@ -15,8 +15,8 @@ "java_package": "com.google.cloud.contactcenterinsights.v1", "php_namespace": "Google\\Cloud\\ContactCenterInsights\\V1", "ruby_package": "Google::Cloud::ContactCenterInsights::V1", - "(google.api.resource_definition).type": "dialogflow.googleapis.com/Participant", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" + "(google.api.resource_definition).type": "speech.googleapis.com/Recognizer", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/recognizers/{recognizer}" }, "nested": { "ContactCenterInsights": { diff --git a/packages/google-cloud-contactcenterinsights/samples/README.md b/packages/google-cloud-contactcenterinsights/samples/README.md index 3f1d0f4911f6..7fc2048a60cd 100644 --- a/packages/google-cloud-contactcenterinsights/samples/README.md +++ b/packages/google-cloud-contactcenterinsights/samples/README.md @@ -51,7 +51,6 @@ * [Contact_center_insights.update_view](#contact_center_insights.update_view) * [Contact_center_insights.upload_conversation](#contact_center_insights.upload_conversation) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -726,23 +725,6 @@ __Usage:__ `node packages/google-cloud-contactcenterinsights/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/test/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-contactcenterinsights/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-contactcenterinsights/samples/test/quickstart.js` - - From 89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 19:40:13 +0000 Subject: [PATCH 15/46] feat: [datacatalog] add support for entries associated with Spanner and ClougBigTable (#4302) - [ ] Regenerate this pull request now. feat: expand SearchCatalogResponse with totalSize feat: modify documentation for FQN support feat: extend ImportApiRequest with jobId parameter PiperOrigin-RevId: 536127089 Source-Link: https://togithub.com/googleapis/googleapis/commit/208fb58cd6f412fd9b9438ce8dcc13ea5b307a45 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/df299c5888ab0f55f1dad63918ac88b2b15ba4e2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFjYXRhbG9nLy5Pd2xCb3QueWFtbCIsImgiOiJkZjI5OWM1ODg4YWIwZjU1ZjFkYWQ2MzkxOGFjODhiMmIxNWJhNGUyIn0= --- packages/google-cloud-datacatalog/README.md | 191 +- .../cloud/datacatalog/v1/bigquery.proto | 2 +- .../google/cloud/datacatalog/v1/common.proto | 8 +- .../cloud/datacatalog/v1/data_source.proto | 2 +- .../cloud/datacatalog/v1/datacatalog.proto | 96 +- .../cloud/datacatalog/v1/dataplex_spec.proto | 2 +- .../cloud/datacatalog/v1/dump_content.proto | 12 +- .../datacatalog/v1/gcs_fileset_spec.proto | 2 +- .../datacatalog/v1/physical_schema.proto | 2 +- .../datacatalog/v1/policytagmanager.proto | 4 +- .../v1/policytagmanagerserialization.proto | 2 +- .../google/cloud/datacatalog/v1/schema.proto | 2 +- .../google/cloud/datacatalog/v1/search.proto | 2 +- .../cloud/datacatalog/v1/table_spec.proto | 2 +- .../google/cloud/datacatalog/v1/tags.proto | 2 +- .../cloud/datacatalog/v1/timestamps.proto | 2 +- .../google/cloud/datacatalog/v1/usage.proto | 2 +- .../protos/protos.d.ts | 454 ++++- .../google-cloud-datacatalog/protos/protos.js | 1547 ++++++++++++++--- .../protos/protos.json | 99 +- .../samples/README.md | 18 - .../v1/data_catalog.import_entries.js | 5 + .../generated/v1/data_catalog.lookup_entry.js | 16 +- ..._metadata.google.cloud.datacatalog.v1.json | 18 +- ...data.google.cloud.datacatalog.v1beta1.json | 2 +- .../src/v1/data_catalog_client.ts | 15 +- .../src/v1/data_catalog_client_config.json | 72 +- 27 files changed, 2170 insertions(+), 411 deletions(-) diff --git a/packages/google-cloud-datacatalog/README.md b/packages/google-cloud-datacatalog/README.md index 4028e746e590..f761dcd14f9c 100644 --- a/packages/google-cloud-datacatalog/README.md +++ b/packages/google-cloud-datacatalog/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Data Catalog: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Data Catalog: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datacatalog) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/datacatalog.svg)](https://www.npmjs.org/package/@google-cloud/datacatalog) @@ -213,104 +213,103 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datacatalog/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Data_catalog.create_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_entry.js,samples/README.md) | -| Data_catalog.create_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_entry_group.js,samples/README.md) | -| Data_catalog.create_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag.js,samples/README.md) | -| Data_catalog.create_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag_template.js,samples/README.md) | -| Data_catalog.create_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag_template_field.js,samples/README.md) | -| Data_catalog.delete_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_entry.js,samples/README.md) | -| Data_catalog.delete_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_entry_group.js,samples/README.md) | -| Data_catalog.delete_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag.js,samples/README.md) | -| Data_catalog.delete_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag_template.js,samples/README.md) | -| Data_catalog.delete_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag_template_field.js,samples/README.md) | -| Data_catalog.get_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_entry.js,samples/README.md) | -| Data_catalog.get_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_entry_group.js,samples/README.md) | -| Data_catalog.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_iam_policy.js,samples/README.md) | -| Data_catalog.get_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_tag_template.js,samples/README.md) | -| Data_catalog.import_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.import_entries.js,samples/README.md) | -| Data_catalog.list_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_entries.js,samples/README.md) | -| Data_catalog.list_entry_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_entry_groups.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_entry_groups.js,samples/README.md) | -| Data_catalog.list_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_tags.js,samples/README.md) | -| Data_catalog.lookup_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js,samples/README.md) | -| Data_catalog.modify_entry_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_contacts.js,samples/README.md) | -| Data_catalog.modify_entry_overview | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_overview.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.modify_entry_overview.js,samples/README.md) | -| Data_catalog.reconcile_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.reconcile_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.reconcile_tags.js,samples/README.md) | -| Data_catalog.rename_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field.js,samples/README.md) | -| Data_catalog.rename_tag_template_field_enum_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field_enum_value.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field_enum_value.js,samples/README.md) | -| Data_catalog.search_catalog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.search_catalog.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.search_catalog.js,samples/README.md) | -| Data_catalog.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.set_iam_policy.js,samples/README.md) | -| Data_catalog.star_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.star_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.star_entry.js,samples/README.md) | -| Data_catalog.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.test_iam_permissions.js,samples/README.md) | -| Data_catalog.unstar_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.unstar_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.unstar_entry.js,samples/README.md) | -| Data_catalog.update_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_entry.js,samples/README.md) | -| Data_catalog.update_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_entry_group.js,samples/README.md) | -| Data_catalog.update_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag.js,samples/README.md) | -| Data_catalog.update_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag_template.js,samples/README.md) | -| Data_catalog.update_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag_template_field.js,samples/README.md) | -| Policy_tag_manager.create_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.create_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.create_policy_tag.js,samples/README.md) | -| Policy_tag_manager.create_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.create_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.create_taxonomy.js,samples/README.md) | -| Policy_tag_manager.delete_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.delete_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.delete_policy_tag.js,samples/README.md) | -| Policy_tag_manager.delete_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.delete_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.delete_taxonomy.js,samples/README.md) | -| Policy_tag_manager.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_iam_policy.js,samples/README.md) | -| Policy_tag_manager.get_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_policy_tag.js,samples/README.md) | -| Policy_tag_manager.get_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_taxonomy.js,samples/README.md) | -| Policy_tag_manager.list_policy_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.list_policy_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.list_policy_tags.js,samples/README.md) | -| Policy_tag_manager.list_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.list_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.list_taxonomies.js,samples/README.md) | -| Policy_tag_manager.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.set_iam_policy.js,samples/README.md) | -| Policy_tag_manager.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.test_iam_permissions.js,samples/README.md) | -| Policy_tag_manager.update_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.update_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.update_policy_tag.js,samples/README.md) | -| Policy_tag_manager.update_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.update_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.update_taxonomy.js,samples/README.md) | -| Policy_tag_manager_serialization.export_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.export_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.export_taxonomies.js,samples/README.md) | -| Policy_tag_manager_serialization.import_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.import_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.import_taxonomies.js,samples/README.md) | -| Policy_tag_manager_serialization.replace_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.replace_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.replace_taxonomy.js,samples/README.md) | -| Data_catalog.create_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_entry.js,samples/README.md) | -| Data_catalog.create_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_entry_group.js,samples/README.md) | -| Data_catalog.create_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag.js,samples/README.md) | -| Data_catalog.create_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template.js,samples/README.md) | -| Data_catalog.create_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template_field.js,samples/README.md) | -| Data_catalog.delete_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry.js,samples/README.md) | -| Data_catalog.delete_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry_group.js,samples/README.md) | -| Data_catalog.delete_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag.js,samples/README.md) | -| Data_catalog.delete_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template.js,samples/README.md) | -| Data_catalog.delete_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template_field.js,samples/README.md) | -| Data_catalog.get_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_entry.js,samples/README.md) | -| Data_catalog.get_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_entry_group.js,samples/README.md) | -| Data_catalog.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_iam_policy.js,samples/README.md) | -| Data_catalog.get_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_tag_template.js,samples/README.md) | -| Data_catalog.list_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_entries.js,samples/README.md) | -| Data_catalog.list_entry_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_entry_groups.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_entry_groups.js,samples/README.md) | -| Data_catalog.list_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_tags.js,samples/README.md) | -| Data_catalog.lookup_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.lookup_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.lookup_entry.js,samples/README.md) | -| Data_catalog.rename_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.rename_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.rename_tag_template_field.js,samples/README.md) | -| Data_catalog.search_catalog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.search_catalog.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.search_catalog.js,samples/README.md) | -| Data_catalog.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.set_iam_policy.js,samples/README.md) | -| Data_catalog.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.test_iam_permissions.js,samples/README.md) | -| Data_catalog.update_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_entry.js,samples/README.md) | -| Data_catalog.update_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_entry_group.js,samples/README.md) | -| Data_catalog.update_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag.js,samples/README.md) | -| Data_catalog.update_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template.js,samples/README.md) | -| Data_catalog.update_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template_field.js,samples/README.md) | -| Policy_tag_manager.create_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_policy_tag.js,samples/README.md) | -| Policy_tag_manager.create_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_taxonomy.js,samples/README.md) | -| Policy_tag_manager.delete_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_policy_tag.js,samples/README.md) | -| Policy_tag_manager.delete_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_taxonomy.js,samples/README.md) | -| Policy_tag_manager.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_iam_policy.js,samples/README.md) | -| Policy_tag_manager.get_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_policy_tag.js,samples/README.md) | -| Policy_tag_manager.get_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_taxonomy.js,samples/README.md) | -| Policy_tag_manager.list_policy_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_policy_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_policy_tags.js,samples/README.md) | -| Policy_tag_manager.list_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_taxonomies.js,samples/README.md) | -| Policy_tag_manager.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.set_iam_policy.js,samples/README.md) | -| Policy_tag_manager.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.test_iam_permissions.js,samples/README.md) | -| Policy_tag_manager.update_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_policy_tag.js,samples/README.md) | -| Policy_tag_manager.update_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_taxonomy.js,samples/README.md) | -| Policy_tag_manager_serialization.export_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.export_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.export_taxonomies.js,samples/README.md) | -| Policy_tag_manager_serialization.import_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.import_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.import_taxonomies.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/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-datacatalog/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-datacatalog/samples/test/quickstart.test.js,samples/README.md) | +| Data_catalog.create_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.create_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.create_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.delete_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.delete_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.get_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.get_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.import_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.import_entries.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_entries.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_entry_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_entry_groups.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_entry_groups.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.list_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.list_tags.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.lookup_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.modify_entry_contacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_contacts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_contacts.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.modify_entry_overview | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.modify_entry_overview.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.modify_entry_overview.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.reconcile_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.reconcile_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.reconcile_tags.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.rename_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.rename_tag_template_field_enum_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field_enum_value.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.rename_tag_template_field_enum_value.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.search_catalog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.search_catalog.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.search_catalog.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.set_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.star_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.star_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.star_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.test_iam_permissions.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.unstar_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.unstar_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.unstar_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.update_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/data_catalog.update_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.create_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.create_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.create_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.create_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.create_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.create_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.delete_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.delete_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.delete_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.delete_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.delete_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.delete_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.get_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.get_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.list_policy_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.list_policy_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.list_policy_tags.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.list_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.list_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.list_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.set_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.test_iam_permissions.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.update_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.update_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.update_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.update_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager.update_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager.update_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager_serialization.export_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.export_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.export_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager_serialization.import_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.import_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.import_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager_serialization.replace_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1/policy_tag_manager_serialization.replace_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1/policy_tag_manager_serialization.replace_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.create_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.create_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.delete_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.delete_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.get_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.get_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.get_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_entries.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_entries.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_entry_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_entry_groups.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_entry_groups.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.list_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.list_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.list_tags.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.lookup_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.lookup_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.lookup_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.rename_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.rename_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.rename_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.search_catalog | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.search_catalog.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.search_catalog.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.set_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.test_iam_permissions.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_entry.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_entry.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_entry_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_entry_group.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_entry_group.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template.js,packages/google-cloud-datacatalog/samples/README.md) | +| Data_catalog.update_tag_template_field | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template_field.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/data_catalog.update_tag_template_field.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.create_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.create_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.create_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.delete_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.delete_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.delete_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.get_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.get_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.list_policy_tags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_policy_tags.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_policy_tags.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.list_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.list_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.set_iam_policy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.set_iam_policy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.test_iam_permissions.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.test_iam_permissions.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.update_policy_tag | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_policy_tag.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_policy_tag.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager.update_taxonomy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_taxonomy.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager.update_taxonomy.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager_serialization.export_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.export_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.export_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Policy_tag_manager_serialization.import_taxonomies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.import_taxonomies.js) | [![Open in Cloud 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-datacatalog/samples/generated/v1beta1/policy_tag_manager_serialization.import_taxonomies.js,packages/google-cloud-datacatalog/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/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-datacatalog/samples/quickstart.js,packages/google-cloud-datacatalog/samples/README.md) | diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/bigquery.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/bigquery.proto index 33994ac3fae1..72088e8f41e2 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/bigquery.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/bigquery.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto index 9b7c1fd6ab9e..efe049e9d579 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -52,6 +52,12 @@ enum IntegratedSystem { // Dataplex. DATAPLEX = 4; + // Cloud Spanner + CLOUD_SPANNER = 6; + + // Cloud Bigtable + CLOUD_BIGTABLE = 7; + // Cloud Sql CLOUD_SQL = 8; diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto index faf2666625eb..d026379adf6b 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto index e91da18d21bc..34957c4cd0e1 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -735,6 +735,9 @@ message SearchCatalogResponse { // Search results. repeated SearchCatalogResult results = 1; + // The approximate total number of entries matched by the query. + int32 total_size = 2; + // Pagination token that can be used in subsequent calls to retrieve the next // page of results. string next_page_token = 3; @@ -971,7 +974,9 @@ message LookupEntryRequest { // (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical). string sql_resource = 3; - // Fully qualified name (FQN) of the resource. + // [Fully Qualified Name + // (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + // of the resource. // // FQNs take two forms: // @@ -988,6 +993,16 @@ message LookupEntryRequest { // `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` string fully_qualified_name = 5; } + + // Project where the lookup should be performed. Required to lookup + // entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + // using its `fully_qualified_name`. Ignored in other cases. + string project = 6; + + // Location where the lookup should be performed. Required to lookup + // entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + // using its `fully_qualified_name`. Ignored in other cases. + string location = 7; } // Entry metadata. @@ -1037,25 +1052,12 @@ message Entry { // The maximum size is 200 bytes when encoded in UTF-8. string linked_resource = 9; - // Fully qualified name (FQN) of the resource. Set automatically for entries - // representing resources from synced systems. Settable only during creation - // and read-only afterwards. Can be used for search and lookup of the entries. - // - // - // - // FQNs take two forms: - // - // * For non-regionalized resources: - // - // `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + // [Fully Qualified Name + // (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + // of the resource. Set automatically for entries representing resources from + // synced systems. Settable only during creation, and read-only later. Can + // be used for search and lookup of the entries. // - // * For regionalized resources: - // - // `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` - // - // Example for a DPMS table: - // - // `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` string fully_qualified_name = 29; // Required. Entry type. @@ -1113,6 +1115,10 @@ message Entry { // Specification that applies to Looker sysstem. Only settable when // `user_specified_system` is equal to `LOOKER` LookerSystemSpec looker_system_spec = 40; + + // Specification that applies to Cloud Bigtable system. Only settable when + // `integrated_system` is equal to `CLOUD_BIGTABLE` + CloudBigtableSystemSpec cloud_bigtable_system_spec = 41; } // Type specification. @@ -1157,6 +1163,9 @@ message Entry { // Specification that applies to a fileset resource. Valid only // for entries with the `FILESET` type. FilesetSpec fileset_spec = 33; + + // Specification that applies to a Service resource. + ServiceSpec service_spec = 42; } // Display name of an entry. @@ -1404,6 +1413,49 @@ message LookerSystemSpec { string parent_view_display_name = 6; } +// Specification that applies to +// all entries that are part of `CLOUD_BIGTABLE` system +// (user_specified_type) +message CloudBigtableSystemSpec { + // Display name of the Instance. This is user specified and different from + // the resource name. + string instance_display_name = 1; +} + +// Specification that applies to Instance +// entries that are part of `CLOUD_BIGTABLE` system. +// (user_specified_type) +message CloudBigtableInstanceSpec { + // Spec that applies to clusters of an Instance of Cloud Bigtable. + message CloudBigtableClusterSpec { + // Name of the cluster. + string display_name = 1; + + // Location of the cluster, typically a Cloud zone. + string location = 2; + + // Type of the resource. For a cluster this would be "CLUSTER". + string type = 3; + + // A link back to the parent resource, in this case Instance. + string linked_resource = 4; + } + + // The list of clusters for the Instance. + repeated CloudBigtableClusterSpec cloud_bigtable_cluster_specs = 1; +} + +// Specification that applies to a Service resource. Valid only +// for entries with the `SERVICE` type. +message ServiceSpec { + // System spec + oneof system_spec { + // Specification that applies to Instance entries of `CLOUD_BIGTABLE` + // system. + CloudBigtableInstanceSpec cloud_bigtable_instance_spec = 1; + } +} + // Business Context of the entry. message BusinessContext { // Entry overview fields for rich text descriptions of entries. @@ -1898,6 +1950,10 @@ message ImportEntriesRequest { // Path to a Cloud Storage bucket that contains a dump ready for ingestion. string gcs_bucket_path = 2; } + + // Optional. (Optional) Dataplex task job id, if specified will be used as + // part of ImportEntries LRO ID + string job_id = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response message for [long-running operation][google.longrunning.Operation] diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dataplex_spec.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dataplex_spec.proto index bf47a373bb09..961f452af790 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dataplex_spec.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dataplex_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dump_content.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dump_content.proto index 846877c5ca7f..0d01faec26d8 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dump_content.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/dump_content.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.datacatalog.v1; +import "google/api/field_behavior.proto"; import "google/cloud/datacatalog/v1/datacatalog.proto"; import "google/cloud/datacatalog/v1/tags.proto"; @@ -31,18 +32,19 @@ option ruby_package = "Google::Cloud::DataCatalog::V1"; // Wrapper containing Entry and information about Tags // that should and should not be attached to it. message TaggedEntry { + // Required. Entry to be ingested. oneof entry { // Non-encrypted Data Catalog v1 Entry. Entry v1_entry = 1; } - // Tags that should be ingested into the Data Catalog. + // Optional. Tags that should be ingested into the Data Catalog. // Caller should populate template name, column and fields. - repeated Tag present_tags = 2; + repeated Tag present_tags = 2 [(google.api.field_behavior) = OPTIONAL]; - // Tags that should be deleted from the Data Catalog. + // Optional. Tags that should be deleted from the Data Catalog. // Caller should populate template name and column only. - repeated Tag absent_tags = 3; + repeated Tag absent_tags = 3 [(google.api.field_behavior) = OPTIONAL]; } // Wrapper for any item that can be contained in the dump. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto index 5f6d8f62deab..7dba877c1286 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/physical_schema.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/physical_schema.proto index 162d71586804..d1bfe6a3bf46 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/physical_schema.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/physical_schema.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto index 3c13a62885fa..709641aafcda 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -229,7 +229,7 @@ message Taxonomy { // The Google Cloud service name. ManagingSystem name = 1; - // P4SA Identity of the service. + // The service agent for the service. string identity = 2; } diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto index a0da69380c7c..865cf19dcc40 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto index 9d799d052fae..559f389210de 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto index 4cf3bf826844..13c719364620 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto index a09579bfb8b7..d570beecc886 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto index 8716c5c262a4..2022df7adac4 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto index 9c5e2aa01128..e9efe67974b6 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/usage.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/usage.proto index aa7921abf5b0..5b5f2d08f370 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/usage.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/usage.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-datacatalog/protos/protos.d.ts b/packages/google-cloud-datacatalog/protos/protos.d.ts index 17d7a5104189..83c91746f1d3 100644 --- a/packages/google-cloud-datacatalog/protos/protos.d.ts +++ b/packages/google-cloud-datacatalog/protos/protos.d.ts @@ -473,6 +473,8 @@ export namespace google { CLOUD_PUBSUB = 2, DATAPROC_METASTORE = 3, DATAPLEX = 4, + CLOUD_SPANNER = 6, + CLOUD_BIGTABLE = 7, CLOUD_SQL = 8, LOOKER = 9 } @@ -1710,6 +1712,9 @@ export namespace google { /** SearchCatalogResponse results */ results?: (google.cloud.datacatalog.v1.ISearchCatalogResult[]|null); + /** SearchCatalogResponse totalSize */ + totalSize?: (number|null); + /** SearchCatalogResponse nextPageToken */ nextPageToken?: (string|null); @@ -1729,6 +1734,9 @@ export namespace google { /** SearchCatalogResponse results. */ public results: google.cloud.datacatalog.v1.ISearchCatalogResult[]; + /** SearchCatalogResponse totalSize. */ + public totalSize: number; + /** SearchCatalogResponse nextPageToken. */ public nextPageToken: string; @@ -2860,6 +2868,12 @@ export namespace google { /** LookupEntryRequest fullyQualifiedName */ fullyQualifiedName?: (string|null); + + /** LookupEntryRequest project */ + project?: (string|null); + + /** LookupEntryRequest location */ + location?: (string|null); } /** Represents a LookupEntryRequest. */ @@ -2880,6 +2894,12 @@ export namespace google { /** LookupEntryRequest fullyQualifiedName. */ public fullyQualifiedName?: (string|null); + /** LookupEntryRequest project. */ + public project: string; + + /** LookupEntryRequest location. */ + public location: string; + /** LookupEntryRequest targetName. */ public targetName?: ("linkedResource"|"sqlResource"|"fullyQualifiedName"); @@ -2991,6 +3011,9 @@ export namespace google { /** Entry lookerSystemSpec */ lookerSystemSpec?: (google.cloud.datacatalog.v1.ILookerSystemSpec|null); + /** Entry cloudBigtableSystemSpec */ + cloudBigtableSystemSpec?: (google.cloud.datacatalog.v1.ICloudBigtableSystemSpec|null); + /** Entry gcsFilesetSpec */ gcsFilesetSpec?: (google.cloud.datacatalog.v1.IGcsFilesetSpec|null); @@ -3012,6 +3035,9 @@ export namespace google { /** Entry filesetSpec */ filesetSpec?: (google.cloud.datacatalog.v1.IFilesetSpec|null); + /** Entry serviceSpec */ + serviceSpec?: (google.cloud.datacatalog.v1.IServiceSpec|null); + /** Entry displayName */ displayName?: (string|null); @@ -3076,6 +3102,9 @@ export namespace google { /** Entry lookerSystemSpec. */ public lookerSystemSpec?: (google.cloud.datacatalog.v1.ILookerSystemSpec|null); + /** Entry cloudBigtableSystemSpec. */ + public cloudBigtableSystemSpec?: (google.cloud.datacatalog.v1.ICloudBigtableSystemSpec|null); + /** Entry gcsFilesetSpec. */ public gcsFilesetSpec?: (google.cloud.datacatalog.v1.IGcsFilesetSpec|null); @@ -3097,6 +3126,9 @@ export namespace google { /** Entry filesetSpec. */ public filesetSpec?: (google.cloud.datacatalog.v1.IFilesetSpec|null); + /** Entry serviceSpec. */ + public serviceSpec?: (google.cloud.datacatalog.v1.IServiceSpec|null); + /** Entry displayName. */ public displayName: string; @@ -3131,13 +3163,13 @@ export namespace google { public system?: ("integratedSystem"|"userSpecifiedSystem"); /** Entry systemSpec. */ - public systemSpec?: ("sqlDatabaseSystemSpec"|"lookerSystemSpec"); + public systemSpec?: ("sqlDatabaseSystemSpec"|"lookerSystemSpec"|"cloudBigtableSystemSpec"); /** Entry typeSpec. */ public typeSpec?: ("gcsFilesetSpec"|"bigqueryTableSpec"|"bigqueryDateShardedSpec"); /** Entry spec. */ - public spec?: ("databaseTableSpec"|"dataSourceConnectionSpec"|"routineSpec"|"filesetSpec"); + public spec?: ("databaseTableSpec"|"dataSourceConnectionSpec"|"routineSpec"|"filesetSpec"|"serviceSpec"); /** * Creates a new Entry instance using the specified properties. @@ -4148,6 +4180,418 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CloudBigtableSystemSpec. */ + interface ICloudBigtableSystemSpec { + + /** CloudBigtableSystemSpec instanceDisplayName */ + instanceDisplayName?: (string|null); + } + + /** Represents a CloudBigtableSystemSpec. */ + class CloudBigtableSystemSpec implements ICloudBigtableSystemSpec { + + /** + * Constructs a new CloudBigtableSystemSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ICloudBigtableSystemSpec); + + /** CloudBigtableSystemSpec instanceDisplayName. */ + public instanceDisplayName: string; + + /** + * Creates a new CloudBigtableSystemSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudBigtableSystemSpec instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ICloudBigtableSystemSpec): google.cloud.datacatalog.v1.CloudBigtableSystemSpec; + + /** + * Encodes the specified CloudBigtableSystemSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableSystemSpec.verify|verify} messages. + * @param message CloudBigtableSystemSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ICloudBigtableSystemSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudBigtableSystemSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableSystemSpec.verify|verify} messages. + * @param message CloudBigtableSystemSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ICloudBigtableSystemSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudBigtableSystemSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudBigtableSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CloudBigtableSystemSpec; + + /** + * Decodes a CloudBigtableSystemSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudBigtableSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CloudBigtableSystemSpec; + + /** + * Verifies a CloudBigtableSystemSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudBigtableSystemSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudBigtableSystemSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CloudBigtableSystemSpec; + + /** + * Creates a plain object from a CloudBigtableSystemSpec message. Also converts values to other types if specified. + * @param message CloudBigtableSystemSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CloudBigtableSystemSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudBigtableSystemSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudBigtableSystemSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudBigtableInstanceSpec. */ + interface ICloudBigtableInstanceSpec { + + /** CloudBigtableInstanceSpec cloudBigtableClusterSpecs */ + cloudBigtableClusterSpecs?: (google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec[]|null); + } + + /** Represents a CloudBigtableInstanceSpec. */ + class CloudBigtableInstanceSpec implements ICloudBigtableInstanceSpec { + + /** + * Constructs a new CloudBigtableInstanceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec); + + /** CloudBigtableInstanceSpec cloudBigtableClusterSpecs. */ + public cloudBigtableClusterSpecs: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec[]; + + /** + * Creates a new CloudBigtableInstanceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudBigtableInstanceSpec instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec; + + /** + * Encodes the specified CloudBigtableInstanceSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.verify|verify} messages. + * @param message CloudBigtableInstanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudBigtableInstanceSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.verify|verify} messages. + * @param message CloudBigtableInstanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudBigtableInstanceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudBigtableInstanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec; + + /** + * Decodes a CloudBigtableInstanceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudBigtableInstanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec; + + /** + * Verifies a CloudBigtableInstanceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudBigtableInstanceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudBigtableInstanceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec; + + /** + * Creates a plain object from a CloudBigtableInstanceSpec message. Also converts values to other types if specified. + * @param message CloudBigtableInstanceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudBigtableInstanceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudBigtableInstanceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudBigtableInstanceSpec { + + /** Properties of a CloudBigtableClusterSpec. */ + interface ICloudBigtableClusterSpec { + + /** CloudBigtableClusterSpec displayName */ + displayName?: (string|null); + + /** CloudBigtableClusterSpec location */ + location?: (string|null); + + /** CloudBigtableClusterSpec type */ + type?: (string|null); + + /** CloudBigtableClusterSpec linkedResource */ + linkedResource?: (string|null); + } + + /** Represents a CloudBigtableClusterSpec. */ + class CloudBigtableClusterSpec implements ICloudBigtableClusterSpec { + + /** + * Constructs a new CloudBigtableClusterSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec); + + /** CloudBigtableClusterSpec displayName. */ + public displayName: string; + + /** CloudBigtableClusterSpec location. */ + public location: string; + + /** CloudBigtableClusterSpec type. */ + public type: string; + + /** CloudBigtableClusterSpec linkedResource. */ + public linkedResource: string; + + /** + * Creates a new CloudBigtableClusterSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudBigtableClusterSpec instance + */ + public static create(properties?: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec; + + /** + * Encodes the specified CloudBigtableClusterSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.verify|verify} messages. + * @param message CloudBigtableClusterSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudBigtableClusterSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.verify|verify} messages. + * @param message CloudBigtableClusterSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudBigtableClusterSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudBigtableClusterSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec; + + /** + * Decodes a CloudBigtableClusterSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudBigtableClusterSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec; + + /** + * Verifies a CloudBigtableClusterSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudBigtableClusterSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudBigtableClusterSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec; + + /** + * Creates a plain object from a CloudBigtableClusterSpec message. Also converts values to other types if specified. + * @param message CloudBigtableClusterSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudBigtableClusterSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudBigtableClusterSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServiceSpec. */ + interface IServiceSpec { + + /** ServiceSpec cloudBigtableInstanceSpec */ + cloudBigtableInstanceSpec?: (google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec|null); + } + + /** Represents a ServiceSpec. */ + class ServiceSpec implements IServiceSpec { + + /** + * Constructs a new ServiceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IServiceSpec); + + /** ServiceSpec cloudBigtableInstanceSpec. */ + public cloudBigtableInstanceSpec?: (google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec|null); + + /** ServiceSpec systemSpec. */ + public systemSpec?: "cloudBigtableInstanceSpec"; + + /** + * Creates a new ServiceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceSpec instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IServiceSpec): google.cloud.datacatalog.v1.ServiceSpec; + + /** + * Encodes the specified ServiceSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.ServiceSpec.verify|verify} messages. + * @param message ServiceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IServiceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ServiceSpec.verify|verify} messages. + * @param message ServiceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IServiceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ServiceSpec; + + /** + * Decodes a ServiceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ServiceSpec; + + /** + * Verifies a ServiceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ServiceSpec; + + /** + * Creates a plain object from a ServiceSpec message. Also converts values to other types if specified. + * @param message ServiceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ServiceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a BusinessContext. */ interface IBusinessContext { @@ -7060,6 +7504,9 @@ export namespace google { /** ImportEntriesRequest gcsBucketPath */ gcsBucketPath?: (string|null); + + /** ImportEntriesRequest jobId */ + jobId?: (string|null); } /** Represents an ImportEntriesRequest. */ @@ -7077,6 +7524,9 @@ export namespace google { /** ImportEntriesRequest gcsBucketPath. */ public gcsBucketPath?: (string|null); + /** ImportEntriesRequest jobId. */ + public jobId: string; + /** ImportEntriesRequest source. */ public source?: "gcsBucketPath"; diff --git a/packages/google-cloud-datacatalog/protos/protos.js b/packages/google-cloud-datacatalog/protos/protos.js index 5b8153718d76..832f42365c47 100644 --- a/packages/google-cloud-datacatalog/protos/protos.js +++ b/packages/google-cloud-datacatalog/protos/protos.js @@ -1124,6 +1124,8 @@ * @property {number} CLOUD_PUBSUB=2 CLOUD_PUBSUB value * @property {number} DATAPROC_METASTORE=3 DATAPROC_METASTORE value * @property {number} DATAPLEX=4 DATAPLEX value + * @property {number} CLOUD_SPANNER=6 CLOUD_SPANNER value + * @property {number} CLOUD_BIGTABLE=7 CLOUD_BIGTABLE value * @property {number} CLOUD_SQL=8 CLOUD_SQL value * @property {number} LOOKER=9 LOOKER value */ @@ -1134,6 +1136,8 @@ values[valuesById[2] = "CLOUD_PUBSUB"] = 2; values[valuesById[3] = "DATAPROC_METASTORE"] = 3; values[valuesById[4] = "DATAPLEX"] = 4; + values[valuesById[6] = "CLOUD_SPANNER"] = 6; + values[valuesById[7] = "CLOUD_BIGTABLE"] = 7; values[valuesById[8] = "CLOUD_SQL"] = 8; values[valuesById[9] = "LOOKER"] = 9; return values; @@ -3570,6 +3574,7 @@ * @memberof google.cloud.datacatalog.v1 * @interface ISearchCatalogResponse * @property {Array.|null} [results] SearchCatalogResponse results + * @property {number|null} [totalSize] SearchCatalogResponse totalSize * @property {string|null} [nextPageToken] SearchCatalogResponse nextPageToken * @property {Array.|null} [unreachable] SearchCatalogResponse unreachable */ @@ -3599,6 +3604,14 @@ */ SearchCatalogResponse.prototype.results = $util.emptyArray; + /** + * SearchCatalogResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.datacatalog.v1.SearchCatalogResponse + * @instance + */ + SearchCatalogResponse.prototype.totalSize = 0; + /** * SearchCatalogResponse nextPageToken. * @member {string} nextPageToken @@ -3642,6 +3655,8 @@ if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) $root.google.cloud.datacatalog.v1.SearchCatalogResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalSize); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); if (message.unreachable != null && message.unreachable.length) @@ -3687,6 +3702,10 @@ message.results.push($root.google.cloud.datacatalog.v1.SearchCatalogResult.decode(reader, reader.uint32())); break; } + case 2: { + message.totalSize = reader.int32(); + break; + } case 3: { message.nextPageToken = reader.string(); break; @@ -3741,6 +3760,9 @@ return "results." + error; } } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; @@ -3776,6 +3798,8 @@ message.results[i] = $root.google.cloud.datacatalog.v1.SearchCatalogResult.fromObject(object.results[i]); } } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.unreachable) { @@ -3805,13 +3829,17 @@ object.results = []; object.unreachable = []; } - if (options.defaults) + if (options.defaults) { + object.totalSize = 0; object.nextPageToken = ""; + } if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) object.results[j] = $root.google.cloud.datacatalog.v1.SearchCatalogResult.toObject(message.results[j], options); } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.unreachable && message.unreachable.length) { @@ -6207,6 +6235,8 @@ * @property {string|null} [linkedResource] LookupEntryRequest linkedResource * @property {string|null} [sqlResource] LookupEntryRequest sqlResource * @property {string|null} [fullyQualifiedName] LookupEntryRequest fullyQualifiedName + * @property {string|null} [project] LookupEntryRequest project + * @property {string|null} [location] LookupEntryRequest location */ /** @@ -6248,6 +6278,22 @@ */ LookupEntryRequest.prototype.fullyQualifiedName = null; + /** + * LookupEntryRequest project. + * @member {string} project + * @memberof google.cloud.datacatalog.v1.LookupEntryRequest + * @instance + */ + LookupEntryRequest.prototype.project = ""; + + /** + * LookupEntryRequest location. + * @member {string} location + * @memberof google.cloud.datacatalog.v1.LookupEntryRequest + * @instance + */ + LookupEntryRequest.prototype.location = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6292,6 +6338,10 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.sqlResource); if (message.fullyQualifiedName != null && Object.hasOwnProperty.call(message, "fullyQualifiedName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.fullyQualifiedName); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.project); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.location); return writer; }; @@ -6338,6 +6388,14 @@ message.fullyQualifiedName = reader.string(); break; } + case 6: { + message.project = reader.string(); + break; + } + case 7: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6393,6 +6451,12 @@ if (!$util.isString(message.fullyQualifiedName)) return "fullyQualifiedName: string expected"; } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; @@ -6414,6 +6478,10 @@ message.sqlResource = String(object.sqlResource); if (object.fullyQualifiedName != null) message.fullyQualifiedName = String(object.fullyQualifiedName); + if (object.project != null) + message.project = String(object.project); + if (object.location != null) + message.location = String(object.location); return message; }; @@ -6430,6 +6498,10 @@ if (!options) options = {}; var object = {}; + if (options.defaults) { + object.project = ""; + object.location = ""; + } if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) { object.linkedResource = message.linkedResource; if (options.oneofs) @@ -6445,6 +6517,10 @@ if (options.oneofs) object.targetName = "fullyQualifiedName"; } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; return object; }; @@ -6492,6 +6568,7 @@ * @property {string|null} [userSpecifiedSystem] Entry userSpecifiedSystem * @property {google.cloud.datacatalog.v1.ISqlDatabaseSystemSpec|null} [sqlDatabaseSystemSpec] Entry sqlDatabaseSystemSpec * @property {google.cloud.datacatalog.v1.ILookerSystemSpec|null} [lookerSystemSpec] Entry lookerSystemSpec + * @property {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec|null} [cloudBigtableSystemSpec] Entry cloudBigtableSystemSpec * @property {google.cloud.datacatalog.v1.IGcsFilesetSpec|null} [gcsFilesetSpec] Entry gcsFilesetSpec * @property {google.cloud.datacatalog.v1.IBigQueryTableSpec|null} [bigqueryTableSpec] Entry bigqueryTableSpec * @property {google.cloud.datacatalog.v1.IBigQueryDateShardedSpec|null} [bigqueryDateShardedSpec] Entry bigqueryDateShardedSpec @@ -6499,6 +6576,7 @@ * @property {google.cloud.datacatalog.v1.IDataSourceConnectionSpec|null} [dataSourceConnectionSpec] Entry dataSourceConnectionSpec * @property {google.cloud.datacatalog.v1.IRoutineSpec|null} [routineSpec] Entry routineSpec * @property {google.cloud.datacatalog.v1.IFilesetSpec|null} [filesetSpec] Entry filesetSpec + * @property {google.cloud.datacatalog.v1.IServiceSpec|null} [serviceSpec] Entry serviceSpec * @property {string|null} [displayName] Entry displayName * @property {string|null} [description] Entry description * @property {google.cloud.datacatalog.v1.IBusinessContext|null} [businessContext] Entry businessContext @@ -6598,6 +6676,14 @@ */ Entry.prototype.lookerSystemSpec = null; + /** + * Entry cloudBigtableSystemSpec. + * @member {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec|null|undefined} cloudBigtableSystemSpec + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Entry.prototype.cloudBigtableSystemSpec = null; + /** * Entry gcsFilesetSpec. * @member {google.cloud.datacatalog.v1.IGcsFilesetSpec|null|undefined} gcsFilesetSpec @@ -6654,6 +6740,14 @@ */ Entry.prototype.filesetSpec = null; + /** + * Entry serviceSpec. + * @member {google.cloud.datacatalog.v1.IServiceSpec|null|undefined} serviceSpec + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Entry.prototype.serviceSpec = null; + /** * Entry displayName. * @member {string} displayName @@ -6753,12 +6847,12 @@ /** * Entry systemSpec. - * @member {"sqlDatabaseSystemSpec"|"lookerSystemSpec"|undefined} systemSpec + * @member {"sqlDatabaseSystemSpec"|"lookerSystemSpec"|"cloudBigtableSystemSpec"|undefined} systemSpec * @memberof google.cloud.datacatalog.v1.Entry * @instance */ Object.defineProperty(Entry.prototype, "systemSpec", { - get: $util.oneOfGetter($oneOfFields = ["sqlDatabaseSystemSpec", "lookerSystemSpec"]), + get: $util.oneOfGetter($oneOfFields = ["sqlDatabaseSystemSpec", "lookerSystemSpec", "cloudBigtableSystemSpec"]), set: $util.oneOfSetter($oneOfFields) }); @@ -6775,12 +6869,12 @@ /** * Entry spec. - * @member {"databaseTableSpec"|"dataSourceConnectionSpec"|"routineSpec"|"filesetSpec"|undefined} spec + * @member {"databaseTableSpec"|"dataSourceConnectionSpec"|"routineSpec"|"filesetSpec"|"serviceSpec"|undefined} spec * @memberof google.cloud.datacatalog.v1.Entry * @instance */ Object.defineProperty(Entry.prototype, "spec", { - get: $util.oneOfGetter($oneOfFields = ["databaseTableSpec", "dataSourceConnectionSpec", "routineSpec", "filesetSpec"]), + get: $util.oneOfGetter($oneOfFields = ["databaseTableSpec", "dataSourceConnectionSpec", "routineSpec", "filesetSpec", "serviceSpec"]), set: $util.oneOfSetter($oneOfFields) }); @@ -6859,6 +6953,10 @@ $root.google.cloud.datacatalog.v1.SqlDatabaseSystemSpec.encode(message.sqlDatabaseSystemSpec, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); if (message.lookerSystemSpec != null && Object.hasOwnProperty.call(message, "lookerSystemSpec")) $root.google.cloud.datacatalog.v1.LookerSystemSpec.encode(message.lookerSystemSpec, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.cloudBigtableSystemSpec != null && Object.hasOwnProperty.call(message, "cloudBigtableSystemSpec")) + $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec.encode(message.cloudBigtableSystemSpec, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.serviceSpec != null && Object.hasOwnProperty.call(message, "serviceSpec")) + $root.google.cloud.datacatalog.v1.ServiceSpec.encode(message.serviceSpec, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); return writer; }; @@ -6929,6 +7027,10 @@ message.lookerSystemSpec = $root.google.cloud.datacatalog.v1.LookerSystemSpec.decode(reader, reader.uint32()); break; } + case 41: { + message.cloudBigtableSystemSpec = $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec.decode(reader, reader.uint32()); + break; + } case 6: { message.gcsFilesetSpec = $root.google.cloud.datacatalog.v1.GcsFilesetSpec.decode(reader, reader.uint32()); break; @@ -6957,6 +7059,10 @@ message.filesetSpec = $root.google.cloud.datacatalog.v1.FilesetSpec.decode(reader, reader.uint32()); break; } + case 42: { + message.serviceSpec = $root.google.cloud.datacatalog.v1.ServiceSpec.decode(reader, reader.uint32()); + break; + } case 3: { message.displayName = reader.string(); break; @@ -7098,6 +7204,8 @@ case 2: case 3: case 4: + case 6: + case 7: case 8: case 9: break; @@ -7128,6 +7236,16 @@ return "lookerSystemSpec." + error; } } + if (message.cloudBigtableSystemSpec != null && message.hasOwnProperty("cloudBigtableSystemSpec")) { + if (properties.systemSpec === 1) + return "systemSpec: multiple values"; + properties.systemSpec = 1; + { + var error = $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec.verify(message.cloudBigtableSystemSpec); + if (error) + return "cloudBigtableSystemSpec." + error; + } + } if (message.gcsFilesetSpec != null && message.hasOwnProperty("gcsFilesetSpec")) { properties.typeSpec = 1; { @@ -7194,6 +7312,16 @@ return "filesetSpec." + error; } } + if (message.serviceSpec != null && message.hasOwnProperty("serviceSpec")) { + if (properties.spec === 1) + return "spec: multiple values"; + properties.spec = 1; + { + var error = $root.google.cloud.datacatalog.v1.ServiceSpec.verify(message.serviceSpec); + if (error) + return "serviceSpec." + error; + } + } if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -7360,6 +7488,14 @@ case 4: message.integratedSystem = 4; break; + case "CLOUD_SPANNER": + case 6: + message.integratedSystem = 6; + break; + case "CLOUD_BIGTABLE": + case 7: + message.integratedSystem = 7; + break; case "CLOUD_SQL": case 8: message.integratedSystem = 8; @@ -7381,6 +7517,11 @@ throw TypeError(".google.cloud.datacatalog.v1.Entry.lookerSystemSpec: object expected"); message.lookerSystemSpec = $root.google.cloud.datacatalog.v1.LookerSystemSpec.fromObject(object.lookerSystemSpec); } + if (object.cloudBigtableSystemSpec != null) { + if (typeof object.cloudBigtableSystemSpec !== "object") + throw TypeError(".google.cloud.datacatalog.v1.Entry.cloudBigtableSystemSpec: object expected"); + message.cloudBigtableSystemSpec = $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec.fromObject(object.cloudBigtableSystemSpec); + } if (object.gcsFilesetSpec != null) { if (typeof object.gcsFilesetSpec !== "object") throw TypeError(".google.cloud.datacatalog.v1.Entry.gcsFilesetSpec: object expected"); @@ -7416,6 +7557,11 @@ throw TypeError(".google.cloud.datacatalog.v1.Entry.filesetSpec: object expected"); message.filesetSpec = $root.google.cloud.datacatalog.v1.FilesetSpec.fromObject(object.filesetSpec); } + if (object.serviceSpec != null) { + if (typeof object.serviceSpec !== "object") + throw TypeError(".google.cloud.datacatalog.v1.Entry.serviceSpec: object expected"); + message.serviceSpec = $root.google.cloud.datacatalog.v1.ServiceSpec.fromObject(object.serviceSpec); + } if (object.displayName != null) message.displayName = String(object.displayName); if (object.description != null) @@ -7581,6 +7727,16 @@ if (options.oneofs) object.systemSpec = "lookerSystemSpec"; } + if (message.cloudBigtableSystemSpec != null && message.hasOwnProperty("cloudBigtableSystemSpec")) { + object.cloudBigtableSystemSpec = $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec.toObject(message.cloudBigtableSystemSpec, options); + if (options.oneofs) + object.systemSpec = "cloudBigtableSystemSpec"; + } + if (message.serviceSpec != null && message.hasOwnProperty("serviceSpec")) { + object.serviceSpec = $root.google.cloud.datacatalog.v1.ServiceSpec.toObject(message.serviceSpec, options); + if (options.oneofs) + object.spec = "serviceSpec"; + } return object; }; @@ -9567,58 +9723,1072 @@ return object; }; - /** - * Converts this SqlDatabaseSystemSpec to JSON. - * @function toJSON - * @memberof google.cloud.datacatalog.v1.SqlDatabaseSystemSpec - * @instance - * @returns {Object.} JSON object - */ - SqlDatabaseSystemSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this SqlDatabaseSystemSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.SqlDatabaseSystemSpec + * @instance + * @returns {Object.} JSON object + */ + SqlDatabaseSystemSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlDatabaseSystemSpec + * @function getTypeUrl + * @memberof google.cloud.datacatalog.v1.SqlDatabaseSystemSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlDatabaseSystemSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datacatalog.v1.SqlDatabaseSystemSpec"; + }; + + return SqlDatabaseSystemSpec; + })(); + + v1.LookerSystemSpec = (function() { + + /** + * Properties of a LookerSystemSpec. + * @memberof google.cloud.datacatalog.v1 + * @interface ILookerSystemSpec + * @property {string|null} [parentInstanceId] LookerSystemSpec parentInstanceId + * @property {string|null} [parentInstanceDisplayName] LookerSystemSpec parentInstanceDisplayName + * @property {string|null} [parentModelId] LookerSystemSpec parentModelId + * @property {string|null} [parentModelDisplayName] LookerSystemSpec parentModelDisplayName + * @property {string|null} [parentViewId] LookerSystemSpec parentViewId + * @property {string|null} [parentViewDisplayName] LookerSystemSpec parentViewDisplayName + */ + + /** + * Constructs a new LookerSystemSpec. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a LookerSystemSpec. + * @implements ILookerSystemSpec + * @constructor + * @param {google.cloud.datacatalog.v1.ILookerSystemSpec=} [properties] Properties to set + */ + function LookerSystemSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookerSystemSpec parentInstanceId. + * @member {string} parentInstanceId + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentInstanceId = ""; + + /** + * LookerSystemSpec parentInstanceDisplayName. + * @member {string} parentInstanceDisplayName + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentInstanceDisplayName = ""; + + /** + * LookerSystemSpec parentModelId. + * @member {string} parentModelId + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentModelId = ""; + + /** + * LookerSystemSpec parentModelDisplayName. + * @member {string} parentModelDisplayName + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentModelDisplayName = ""; + + /** + * LookerSystemSpec parentViewId. + * @member {string} parentViewId + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentViewId = ""; + + /** + * LookerSystemSpec parentViewDisplayName. + * @member {string} parentViewDisplayName + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + */ + LookerSystemSpec.prototype.parentViewDisplayName = ""; + + /** + * Creates a new LookerSystemSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ILookerSystemSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec instance + */ + LookerSystemSpec.create = function create(properties) { + return new LookerSystemSpec(properties); + }; + + /** + * Encodes the specified LookerSystemSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.LookerSystemSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ILookerSystemSpec} message LookerSystemSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookerSystemSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parentInstanceId != null && Object.hasOwnProperty.call(message, "parentInstanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parentInstanceId); + if (message.parentInstanceDisplayName != null && Object.hasOwnProperty.call(message, "parentInstanceDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentInstanceDisplayName); + if (message.parentModelId != null && Object.hasOwnProperty.call(message, "parentModelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parentModelId); + if (message.parentModelDisplayName != null && Object.hasOwnProperty.call(message, "parentModelDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentModelDisplayName); + if (message.parentViewId != null && Object.hasOwnProperty.call(message, "parentViewId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentViewId); + if (message.parentViewDisplayName != null && Object.hasOwnProperty.call(message, "parentViewDisplayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.parentViewDisplayName); + return writer; + }; + + /** + * Encodes the specified LookerSystemSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.LookerSystemSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ILookerSystemSpec} message LookerSystemSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookerSystemSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookerSystemSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookerSystemSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.LookerSystemSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parentInstanceId = reader.string(); + break; + } + case 2: { + message.parentInstanceDisplayName = reader.string(); + break; + } + case 3: { + message.parentModelId = reader.string(); + break; + } + case 4: { + message.parentModelDisplayName = reader.string(); + break; + } + case 5: { + message.parentViewId = reader.string(); + break; + } + case 6: { + message.parentViewDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookerSystemSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookerSystemSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookerSystemSpec message. + * @function verify + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookerSystemSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parentInstanceId != null && message.hasOwnProperty("parentInstanceId")) + if (!$util.isString(message.parentInstanceId)) + return "parentInstanceId: string expected"; + if (message.parentInstanceDisplayName != null && message.hasOwnProperty("parentInstanceDisplayName")) + if (!$util.isString(message.parentInstanceDisplayName)) + return "parentInstanceDisplayName: string expected"; + if (message.parentModelId != null && message.hasOwnProperty("parentModelId")) + if (!$util.isString(message.parentModelId)) + return "parentModelId: string expected"; + if (message.parentModelDisplayName != null && message.hasOwnProperty("parentModelDisplayName")) + if (!$util.isString(message.parentModelDisplayName)) + return "parentModelDisplayName: string expected"; + if (message.parentViewId != null && message.hasOwnProperty("parentViewId")) + if (!$util.isString(message.parentViewId)) + return "parentViewId: string expected"; + if (message.parentViewDisplayName != null && message.hasOwnProperty("parentViewDisplayName")) + if (!$util.isString(message.parentViewDisplayName)) + return "parentViewDisplayName: string expected"; + return null; + }; + + /** + * Creates a LookerSystemSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + */ + LookerSystemSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.LookerSystemSpec) + return object; + var message = new $root.google.cloud.datacatalog.v1.LookerSystemSpec(); + if (object.parentInstanceId != null) + message.parentInstanceId = String(object.parentInstanceId); + if (object.parentInstanceDisplayName != null) + message.parentInstanceDisplayName = String(object.parentInstanceDisplayName); + if (object.parentModelId != null) + message.parentModelId = String(object.parentModelId); + if (object.parentModelDisplayName != null) + message.parentModelDisplayName = String(object.parentModelDisplayName); + if (object.parentViewId != null) + message.parentViewId = String(object.parentViewId); + if (object.parentViewDisplayName != null) + message.parentViewDisplayName = String(object.parentViewDisplayName); + return message; + }; + + /** + * Creates a plain object from a LookerSystemSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.LookerSystemSpec} message LookerSystemSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookerSystemSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parentInstanceId = ""; + object.parentInstanceDisplayName = ""; + object.parentModelId = ""; + object.parentModelDisplayName = ""; + object.parentViewId = ""; + object.parentViewDisplayName = ""; + } + if (message.parentInstanceId != null && message.hasOwnProperty("parentInstanceId")) + object.parentInstanceId = message.parentInstanceId; + if (message.parentInstanceDisplayName != null && message.hasOwnProperty("parentInstanceDisplayName")) + object.parentInstanceDisplayName = message.parentInstanceDisplayName; + if (message.parentModelId != null && message.hasOwnProperty("parentModelId")) + object.parentModelId = message.parentModelId; + if (message.parentModelDisplayName != null && message.hasOwnProperty("parentModelDisplayName")) + object.parentModelDisplayName = message.parentModelDisplayName; + if (message.parentViewId != null && message.hasOwnProperty("parentViewId")) + object.parentViewId = message.parentViewId; + if (message.parentViewDisplayName != null && message.hasOwnProperty("parentViewDisplayName")) + object.parentViewDisplayName = message.parentViewDisplayName; + return object; + }; + + /** + * Converts this LookerSystemSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @instance + * @returns {Object.} JSON object + */ + LookerSystemSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookerSystemSpec + * @function getTypeUrl + * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookerSystemSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datacatalog.v1.LookerSystemSpec"; + }; + + return LookerSystemSpec; + })(); + + v1.CloudBigtableSystemSpec = (function() { + + /** + * Properties of a CloudBigtableSystemSpec. + * @memberof google.cloud.datacatalog.v1 + * @interface ICloudBigtableSystemSpec + * @property {string|null} [instanceDisplayName] CloudBigtableSystemSpec instanceDisplayName + */ + + /** + * Constructs a new CloudBigtableSystemSpec. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a CloudBigtableSystemSpec. + * @implements ICloudBigtableSystemSpec + * @constructor + * @param {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec=} [properties] Properties to set + */ + function CloudBigtableSystemSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudBigtableSystemSpec instanceDisplayName. + * @member {string} instanceDisplayName + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @instance + */ + CloudBigtableSystemSpec.prototype.instanceDisplayName = ""; + + /** + * Creates a new CloudBigtableSystemSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CloudBigtableSystemSpec} CloudBigtableSystemSpec instance + */ + CloudBigtableSystemSpec.create = function create(properties) { + return new CloudBigtableSystemSpec(properties); + }; + + /** + * Encodes the specified CloudBigtableSystemSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableSystemSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec} message CloudBigtableSystemSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableSystemSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceDisplayName != null && Object.hasOwnProperty.call(message, "instanceDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceDisplayName); + return writer; + }; + + /** + * Encodes the specified CloudBigtableSystemSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableSystemSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableSystemSpec} message CloudBigtableSystemSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableSystemSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudBigtableSystemSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CloudBigtableSystemSpec} CloudBigtableSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableSystemSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instanceDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudBigtableSystemSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CloudBigtableSystemSpec} CloudBigtableSystemSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableSystemSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudBigtableSystemSpec message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudBigtableSystemSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceDisplayName != null && message.hasOwnProperty("instanceDisplayName")) + if (!$util.isString(message.instanceDisplayName)) + return "instanceDisplayName: string expected"; + return null; + }; + + /** + * Creates a CloudBigtableSystemSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CloudBigtableSystemSpec} CloudBigtableSystemSpec + */ + CloudBigtableSystemSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec) + return object; + var message = new $root.google.cloud.datacatalog.v1.CloudBigtableSystemSpec(); + if (object.instanceDisplayName != null) + message.instanceDisplayName = String(object.instanceDisplayName); + return message; + }; + + /** + * Creates a plain object from a CloudBigtableSystemSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableSystemSpec} message CloudBigtableSystemSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudBigtableSystemSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instanceDisplayName = ""; + if (message.instanceDisplayName != null && message.hasOwnProperty("instanceDisplayName")) + object.instanceDisplayName = message.instanceDisplayName; + return object; + }; + + /** + * Converts this CloudBigtableSystemSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @instance + * @returns {Object.} JSON object + */ + CloudBigtableSystemSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudBigtableSystemSpec + * @function getTypeUrl + * @memberof google.cloud.datacatalog.v1.CloudBigtableSystemSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudBigtableSystemSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datacatalog.v1.CloudBigtableSystemSpec"; + }; + + return CloudBigtableSystemSpec; + })(); + + v1.CloudBigtableInstanceSpec = (function() { + + /** + * Properties of a CloudBigtableInstanceSpec. + * @memberof google.cloud.datacatalog.v1 + * @interface ICloudBigtableInstanceSpec + * @property {Array.|null} [cloudBigtableClusterSpecs] CloudBigtableInstanceSpec cloudBigtableClusterSpecs + */ + + /** + * Constructs a new CloudBigtableInstanceSpec. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a CloudBigtableInstanceSpec. + * @implements ICloudBigtableInstanceSpec + * @constructor + * @param {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec=} [properties] Properties to set + */ + function CloudBigtableInstanceSpec(properties) { + this.cloudBigtableClusterSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudBigtableInstanceSpec cloudBigtableClusterSpecs. + * @member {Array.} cloudBigtableClusterSpecs + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @instance + */ + CloudBigtableInstanceSpec.prototype.cloudBigtableClusterSpecs = $util.emptyArray; + + /** + * Creates a new CloudBigtableInstanceSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec} CloudBigtableInstanceSpec instance + */ + CloudBigtableInstanceSpec.create = function create(properties) { + return new CloudBigtableInstanceSpec(properties); + }; + + /** + * Encodes the specified CloudBigtableInstanceSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec} message CloudBigtableInstanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableInstanceSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudBigtableClusterSpecs != null && message.cloudBigtableClusterSpecs.length) + for (var i = 0; i < message.cloudBigtableClusterSpecs.length; ++i) + $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.encode(message.cloudBigtableClusterSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudBigtableInstanceSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec} message CloudBigtableInstanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableInstanceSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudBigtableInstanceSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec} CloudBigtableInstanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableInstanceSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cloudBigtableClusterSpecs && message.cloudBigtableClusterSpecs.length)) + message.cloudBigtableClusterSpecs = []; + message.cloudBigtableClusterSpecs.push($root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudBigtableInstanceSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec} CloudBigtableInstanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableInstanceSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudBigtableInstanceSpec message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudBigtableInstanceSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudBigtableClusterSpecs != null && message.hasOwnProperty("cloudBigtableClusterSpecs")) { + if (!Array.isArray(message.cloudBigtableClusterSpecs)) + return "cloudBigtableClusterSpecs: array expected"; + for (var i = 0; i < message.cloudBigtableClusterSpecs.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.verify(message.cloudBigtableClusterSpecs[i]); + if (error) + return "cloudBigtableClusterSpecs." + error; + } + } + return null; + }; + + /** + * Creates a CloudBigtableInstanceSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec} CloudBigtableInstanceSpec + */ + CloudBigtableInstanceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec) + return object; + var message = new $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec(); + if (object.cloudBigtableClusterSpecs) { + if (!Array.isArray(object.cloudBigtableClusterSpecs)) + throw TypeError(".google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.cloudBigtableClusterSpecs: array expected"); + message.cloudBigtableClusterSpecs = []; + for (var i = 0; i < object.cloudBigtableClusterSpecs.length; ++i) { + if (typeof object.cloudBigtableClusterSpecs[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.cloudBigtableClusterSpecs: object expected"); + message.cloudBigtableClusterSpecs[i] = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.fromObject(object.cloudBigtableClusterSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CloudBigtableInstanceSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec} message CloudBigtableInstanceSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudBigtableInstanceSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cloudBigtableClusterSpecs = []; + if (message.cloudBigtableClusterSpecs && message.cloudBigtableClusterSpecs.length) { + object.cloudBigtableClusterSpecs = []; + for (var j = 0; j < message.cloudBigtableClusterSpecs.length; ++j) + object.cloudBigtableClusterSpecs[j] = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.toObject(message.cloudBigtableClusterSpecs[j], options); + } + return object; + }; + + /** + * Converts this CloudBigtableInstanceSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @instance + * @returns {Object.} JSON object + */ + CloudBigtableInstanceSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudBigtableInstanceSpec + * @function getTypeUrl + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudBigtableInstanceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datacatalog.v1.CloudBigtableInstanceSpec"; + }; + + CloudBigtableInstanceSpec.CloudBigtableClusterSpec = (function() { + + /** + * Properties of a CloudBigtableClusterSpec. + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @interface ICloudBigtableClusterSpec + * @property {string|null} [displayName] CloudBigtableClusterSpec displayName + * @property {string|null} [location] CloudBigtableClusterSpec location + * @property {string|null} [type] CloudBigtableClusterSpec type + * @property {string|null} [linkedResource] CloudBigtableClusterSpec linkedResource + */ + + /** + * Constructs a new CloudBigtableClusterSpec. + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec + * @classdesc Represents a CloudBigtableClusterSpec. + * @implements ICloudBigtableClusterSpec + * @constructor + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec=} [properties] Properties to set + */ + function CloudBigtableClusterSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudBigtableClusterSpec displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @instance + */ + CloudBigtableClusterSpec.prototype.displayName = ""; + + /** + * CloudBigtableClusterSpec location. + * @member {string} location + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @instance + */ + CloudBigtableClusterSpec.prototype.location = ""; + + /** + * CloudBigtableClusterSpec type. + * @member {string} type + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @instance + */ + CloudBigtableClusterSpec.prototype.type = ""; + + /** + * CloudBigtableClusterSpec linkedResource. + * @member {string} linkedResource + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @instance + */ + CloudBigtableClusterSpec.prototype.linkedResource = ""; + + /** + * Creates a new CloudBigtableClusterSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec} CloudBigtableClusterSpec instance + */ + CloudBigtableClusterSpec.create = function create(properties) { + return new CloudBigtableClusterSpec(properties); + }; + + /** + * Encodes the specified CloudBigtableClusterSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec} message CloudBigtableClusterSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableClusterSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.linkedResource != null && Object.hasOwnProperty.call(message, "linkedResource")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.linkedResource); + return writer; + }; + + /** + * Encodes the specified CloudBigtableClusterSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.ICloudBigtableClusterSpec} message CloudBigtableClusterSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudBigtableClusterSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudBigtableClusterSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec} CloudBigtableClusterSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableClusterSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.linkedResource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudBigtableClusterSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec} CloudBigtableClusterSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudBigtableClusterSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudBigtableClusterSpec message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudBigtableClusterSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) + if (!$util.isString(message.linkedResource)) + return "linkedResource: string expected"; + return null; + }; + + /** + * Creates a CloudBigtableClusterSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec} CloudBigtableClusterSpec + */ + CloudBigtableClusterSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec) + return object; + var message = new $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + if (object.linkedResource != null) + message.linkedResource = String(object.linkedResource); + return message; + }; + + /** + * Creates a plain object from a CloudBigtableClusterSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec} message CloudBigtableClusterSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudBigtableClusterSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.location = ""; + object.type = ""; + object.linkedResource = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) + object.linkedResource = message.linkedResource; + return object; + }; + + /** + * Converts this CloudBigtableClusterSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @instance + * @returns {Object.} JSON object + */ + CloudBigtableClusterSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudBigtableClusterSpec + * @function getTypeUrl + * @memberof google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudBigtableClusterSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec"; + }; - /** - * Gets the default type url for SqlDatabaseSystemSpec - * @function getTypeUrl - * @memberof google.cloud.datacatalog.v1.SqlDatabaseSystemSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlDatabaseSystemSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.datacatalog.v1.SqlDatabaseSystemSpec"; - }; + return CloudBigtableClusterSpec; + })(); - return SqlDatabaseSystemSpec; + return CloudBigtableInstanceSpec; })(); - v1.LookerSystemSpec = (function() { + v1.ServiceSpec = (function() { /** - * Properties of a LookerSystemSpec. + * Properties of a ServiceSpec. * @memberof google.cloud.datacatalog.v1 - * @interface ILookerSystemSpec - * @property {string|null} [parentInstanceId] LookerSystemSpec parentInstanceId - * @property {string|null} [parentInstanceDisplayName] LookerSystemSpec parentInstanceDisplayName - * @property {string|null} [parentModelId] LookerSystemSpec parentModelId - * @property {string|null} [parentModelDisplayName] LookerSystemSpec parentModelDisplayName - * @property {string|null} [parentViewId] LookerSystemSpec parentViewId - * @property {string|null} [parentViewDisplayName] LookerSystemSpec parentViewDisplayName + * @interface IServiceSpec + * @property {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec|null} [cloudBigtableInstanceSpec] ServiceSpec cloudBigtableInstanceSpec */ /** - * Constructs a new LookerSystemSpec. + * Constructs a new ServiceSpec. * @memberof google.cloud.datacatalog.v1 - * @classdesc Represents a LookerSystemSpec. - * @implements ILookerSystemSpec + * @classdesc Represents a ServiceSpec. + * @implements IServiceSpec * @constructor - * @param {google.cloud.datacatalog.v1.ILookerSystemSpec=} [properties] Properties to set + * @param {google.cloud.datacatalog.v1.IServiceSpec=} [properties] Properties to set */ - function LookerSystemSpec(properties) { + function ServiceSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9626,145 +10796,89 @@ } /** - * LookerSystemSpec parentInstanceId. - * @member {string} parentInstanceId - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec - * @instance - */ - LookerSystemSpec.prototype.parentInstanceId = ""; - - /** - * LookerSystemSpec parentInstanceDisplayName. - * @member {string} parentInstanceDisplayName - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec - * @instance - */ - LookerSystemSpec.prototype.parentInstanceDisplayName = ""; - - /** - * LookerSystemSpec parentModelId. - * @member {string} parentModelId - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec - * @instance - */ - LookerSystemSpec.prototype.parentModelId = ""; - - /** - * LookerSystemSpec parentModelDisplayName. - * @member {string} parentModelDisplayName - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * ServiceSpec cloudBigtableInstanceSpec. + * @member {google.cloud.datacatalog.v1.ICloudBigtableInstanceSpec|null|undefined} cloudBigtableInstanceSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @instance */ - LookerSystemSpec.prototype.parentModelDisplayName = ""; + ServiceSpec.prototype.cloudBigtableInstanceSpec = null; - /** - * LookerSystemSpec parentViewId. - * @member {string} parentViewId - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec - * @instance - */ - LookerSystemSpec.prototype.parentViewId = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * LookerSystemSpec parentViewDisplayName. - * @member {string} parentViewDisplayName - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * ServiceSpec systemSpec. + * @member {"cloudBigtableInstanceSpec"|undefined} systemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @instance */ - LookerSystemSpec.prototype.parentViewDisplayName = ""; + Object.defineProperty(ServiceSpec.prototype, "systemSpec", { + get: $util.oneOfGetter($oneOfFields = ["cloudBigtableInstanceSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new LookerSystemSpec instance using the specified properties. + * Creates a new ServiceSpec instance using the specified properties. * @function create - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static - * @param {google.cloud.datacatalog.v1.ILookerSystemSpec=} [properties] Properties to set - * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec instance + * @param {google.cloud.datacatalog.v1.IServiceSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ServiceSpec} ServiceSpec instance */ - LookerSystemSpec.create = function create(properties) { - return new LookerSystemSpec(properties); + ServiceSpec.create = function create(properties) { + return new ServiceSpec(properties); }; /** - * Encodes the specified LookerSystemSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.LookerSystemSpec.verify|verify} messages. + * Encodes the specified ServiceSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.ServiceSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static - * @param {google.cloud.datacatalog.v1.ILookerSystemSpec} message LookerSystemSpec message or plain object to encode + * @param {google.cloud.datacatalog.v1.IServiceSpec} message ServiceSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookerSystemSpec.encode = function encode(message, writer) { + ServiceSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parentInstanceId != null && Object.hasOwnProperty.call(message, "parentInstanceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parentInstanceId); - if (message.parentInstanceDisplayName != null && Object.hasOwnProperty.call(message, "parentInstanceDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentInstanceDisplayName); - if (message.parentModelId != null && Object.hasOwnProperty.call(message, "parentModelId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parentModelId); - if (message.parentModelDisplayName != null && Object.hasOwnProperty.call(message, "parentModelDisplayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentModelDisplayName); - if (message.parentViewId != null && Object.hasOwnProperty.call(message, "parentViewId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parentViewId); - if (message.parentViewDisplayName != null && Object.hasOwnProperty.call(message, "parentViewDisplayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.parentViewDisplayName); + if (message.cloudBigtableInstanceSpec != null && Object.hasOwnProperty.call(message, "cloudBigtableInstanceSpec")) + $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.encode(message.cloudBigtableInstanceSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified LookerSystemSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.LookerSystemSpec.verify|verify} messages. + * Encodes the specified ServiceSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ServiceSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static - * @param {google.cloud.datacatalog.v1.ILookerSystemSpec} message LookerSystemSpec message or plain object to encode + * @param {google.cloud.datacatalog.v1.IServiceSpec} message ServiceSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookerSystemSpec.encodeDelimited = function encodeDelimited(message, writer) { + ServiceSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LookerSystemSpec message from the specified reader or buffer. + * Decodes a ServiceSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + * @returns {google.cloud.datacatalog.v1.ServiceSpec} ServiceSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookerSystemSpec.decode = function decode(reader, length) { + ServiceSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.LookerSystemSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ServiceSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parentInstanceId = reader.string(); - break; - } - case 2: { - message.parentInstanceDisplayName = reader.string(); - break; - } - case 3: { - message.parentModelId = reader.string(); - break; - } - case 4: { - message.parentModelDisplayName = reader.string(); - break; - } - case 5: { - message.parentViewId = reader.string(); - break; - } - case 6: { - message.parentViewDisplayName = reader.string(); + message.cloudBigtableInstanceSpec = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.decode(reader, reader.uint32()); break; } default: @@ -9776,143 +10890,112 @@ }; /** - * Decodes a LookerSystemSpec message from the specified reader or buffer, length delimited. + * Decodes a ServiceSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + * @returns {google.cloud.datacatalog.v1.ServiceSpec} ServiceSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookerSystemSpec.decodeDelimited = function decodeDelimited(reader) { + ServiceSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LookerSystemSpec message. + * Verifies a ServiceSpec message. * @function verify - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LookerSystemSpec.verify = function verify(message) { + ServiceSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parentInstanceId != null && message.hasOwnProperty("parentInstanceId")) - if (!$util.isString(message.parentInstanceId)) - return "parentInstanceId: string expected"; - if (message.parentInstanceDisplayName != null && message.hasOwnProperty("parentInstanceDisplayName")) - if (!$util.isString(message.parentInstanceDisplayName)) - return "parentInstanceDisplayName: string expected"; - if (message.parentModelId != null && message.hasOwnProperty("parentModelId")) - if (!$util.isString(message.parentModelId)) - return "parentModelId: string expected"; - if (message.parentModelDisplayName != null && message.hasOwnProperty("parentModelDisplayName")) - if (!$util.isString(message.parentModelDisplayName)) - return "parentModelDisplayName: string expected"; - if (message.parentViewId != null && message.hasOwnProperty("parentViewId")) - if (!$util.isString(message.parentViewId)) - return "parentViewId: string expected"; - if (message.parentViewDisplayName != null && message.hasOwnProperty("parentViewDisplayName")) - if (!$util.isString(message.parentViewDisplayName)) - return "parentViewDisplayName: string expected"; + var properties = {}; + if (message.cloudBigtableInstanceSpec != null && message.hasOwnProperty("cloudBigtableInstanceSpec")) { + properties.systemSpec = 1; + { + var error = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.verify(message.cloudBigtableInstanceSpec); + if (error) + return "cloudBigtableInstanceSpec." + error; + } + } return null; }; /** - * Creates a LookerSystemSpec message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.datacatalog.v1.LookerSystemSpec} LookerSystemSpec + * @returns {google.cloud.datacatalog.v1.ServiceSpec} ServiceSpec */ - LookerSystemSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.datacatalog.v1.LookerSystemSpec) + ServiceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ServiceSpec) return object; - var message = new $root.google.cloud.datacatalog.v1.LookerSystemSpec(); - if (object.parentInstanceId != null) - message.parentInstanceId = String(object.parentInstanceId); - if (object.parentInstanceDisplayName != null) - message.parentInstanceDisplayName = String(object.parentInstanceDisplayName); - if (object.parentModelId != null) - message.parentModelId = String(object.parentModelId); - if (object.parentModelDisplayName != null) - message.parentModelDisplayName = String(object.parentModelDisplayName); - if (object.parentViewId != null) - message.parentViewId = String(object.parentViewId); - if (object.parentViewDisplayName != null) - message.parentViewDisplayName = String(object.parentViewDisplayName); + var message = new $root.google.cloud.datacatalog.v1.ServiceSpec(); + if (object.cloudBigtableInstanceSpec != null) { + if (typeof object.cloudBigtableInstanceSpec !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ServiceSpec.cloudBigtableInstanceSpec: object expected"); + message.cloudBigtableInstanceSpec = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.fromObject(object.cloudBigtableInstanceSpec); + } return message; }; /** - * Creates a plain object from a LookerSystemSpec message. Also converts values to other types if specified. + * Creates a plain object from a ServiceSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static - * @param {google.cloud.datacatalog.v1.LookerSystemSpec} message LookerSystemSpec + * @param {google.cloud.datacatalog.v1.ServiceSpec} message ServiceSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LookerSystemSpec.toObject = function toObject(message, options) { + ServiceSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parentInstanceId = ""; - object.parentInstanceDisplayName = ""; - object.parentModelId = ""; - object.parentModelDisplayName = ""; - object.parentViewId = ""; - object.parentViewDisplayName = ""; + if (message.cloudBigtableInstanceSpec != null && message.hasOwnProperty("cloudBigtableInstanceSpec")) { + object.cloudBigtableInstanceSpec = $root.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.toObject(message.cloudBigtableInstanceSpec, options); + if (options.oneofs) + object.systemSpec = "cloudBigtableInstanceSpec"; } - if (message.parentInstanceId != null && message.hasOwnProperty("parentInstanceId")) - object.parentInstanceId = message.parentInstanceId; - if (message.parentInstanceDisplayName != null && message.hasOwnProperty("parentInstanceDisplayName")) - object.parentInstanceDisplayName = message.parentInstanceDisplayName; - if (message.parentModelId != null && message.hasOwnProperty("parentModelId")) - object.parentModelId = message.parentModelId; - if (message.parentModelDisplayName != null && message.hasOwnProperty("parentModelDisplayName")) - object.parentModelDisplayName = message.parentModelDisplayName; - if (message.parentViewId != null && message.hasOwnProperty("parentViewId")) - object.parentViewId = message.parentViewId; - if (message.parentViewDisplayName != null && message.hasOwnProperty("parentViewDisplayName")) - object.parentViewDisplayName = message.parentViewDisplayName; return object; }; /** - * Converts this LookerSystemSpec to JSON. + * Converts this ServiceSpec to JSON. * @function toJSON - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @instance * @returns {Object.} JSON object */ - LookerSystemSpec.prototype.toJSON = function toJSON() { + ServiceSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LookerSystemSpec + * Gets the default type url for ServiceSpec * @function getTypeUrl - * @memberof google.cloud.datacatalog.v1.LookerSystemSpec + * @memberof google.cloud.datacatalog.v1.ServiceSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LookerSystemSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.datacatalog.v1.LookerSystemSpec"; + return typeUrlPrefix + "/google.cloud.datacatalog.v1.ServiceSpec"; }; - return LookerSystemSpec; + return ServiceSpec; })(); v1.BusinessContext = (function() { @@ -16565,6 +17648,7 @@ * @interface IImportEntriesRequest * @property {string|null} [parent] ImportEntriesRequest parent * @property {string|null} [gcsBucketPath] ImportEntriesRequest gcsBucketPath + * @property {string|null} [jobId] ImportEntriesRequest jobId */ /** @@ -16598,6 +17682,14 @@ */ ImportEntriesRequest.prototype.gcsBucketPath = null; + /** + * ImportEntriesRequest jobId. + * @member {string} jobId + * @memberof google.cloud.datacatalog.v1.ImportEntriesRequest + * @instance + */ + ImportEntriesRequest.prototype.jobId = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -16640,6 +17732,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.gcsBucketPath != null && Object.hasOwnProperty.call(message, "gcsBucketPath")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsBucketPath); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); return writer; }; @@ -16682,6 +17776,10 @@ message.gcsBucketPath = reader.string(); break; } + case 3: { + message.jobId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -16726,6 +17824,9 @@ if (!$util.isString(message.gcsBucketPath)) return "gcsBucketPath: string expected"; } + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; return null; }; @@ -16745,6 +17846,8 @@ message.parent = String(object.parent); if (object.gcsBucketPath != null) message.gcsBucketPath = String(object.gcsBucketPath); + if (object.jobId != null) + message.jobId = String(object.jobId); return message; }; @@ -16761,8 +17864,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.jobId = ""; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.gcsBucketPath != null && message.hasOwnProperty("gcsBucketPath")) { @@ -16770,6 +17875,8 @@ if (options.oneofs) object.source = "gcsBucketPath"; } + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; return object; }; @@ -18837,6 +19944,8 @@ case 2: case 3: case 4: + case 6: + case 7: case 8: case 9: break; @@ -18892,6 +20001,14 @@ case 4: message.system = 4; break; + case "CLOUD_SPANNER": + case 6: + message.system = 6; + break; + case "CLOUD_BIGTABLE": + case 7: + message.system = 7; + break; case "CLOUD_SQL": case 8: message.system = 8; @@ -22618,6 +23735,8 @@ case 2: case 3: case 4: + case 6: + case 7: case 8: case 9: break; @@ -22716,6 +23835,14 @@ case 4: message.integratedSystem = 4; break; + case "CLOUD_SPANNER": + case 6: + message.integratedSystem = 6; + break; + case "CLOUD_BIGTABLE": + case 7: + message.integratedSystem = 7; + break; case "CLOUD_SQL": case 8: message.integratedSystem = 8; diff --git a/packages/google-cloud-datacatalog/protos/protos.json b/packages/google-cloud-datacatalog/protos/protos.json index b52b51d0eb1c..cf8eaebd03ef 100644 --- a/packages/google-cloud-datacatalog/protos/protos.json +++ b/packages/google-cloud-datacatalog/protos/protos.json @@ -104,6 +104,8 @@ "CLOUD_PUBSUB": 2, "DATAPROC_METASTORE": 3, "DATAPLEX": 4, + "CLOUD_SPANNER": 6, + "CLOUD_BIGTABLE": 7, "CLOUD_SQL": 8, "LOOKER": 9 } @@ -974,6 +976,10 @@ "type": "SearchCatalogResult", "id": 1 }, + "totalSize": { + "type": "int32", + "id": 2 + }, "nextPageToken": { "type": "string", "id": 3 @@ -1184,6 +1190,14 @@ "fullyQualifiedName": { "type": "string", "id": 5 + }, + "project": { + "type": "string", + "id": 6 + }, + "location": { + "type": "string", + "id": 7 } } }, @@ -1208,7 +1222,8 @@ "systemSpec": { "oneof": [ "sqlDatabaseSystemSpec", - "lookerSystemSpec" + "lookerSystemSpec", + "cloudBigtableSystemSpec" ] }, "typeSpec": { @@ -1223,7 +1238,8 @@ "databaseTableSpec", "dataSourceConnectionSpec", "routineSpec", - "filesetSpec" + "filesetSpec", + "serviceSpec" ] } }, @@ -1271,6 +1287,10 @@ "type": "LookerSystemSpec", "id": 40 }, + "cloudBigtableSystemSpec": { + "type": "CloudBigtableSystemSpec", + "id": 41 + }, "gcsFilesetSpec": { "type": "GcsFilesetSpec", "id": 6 @@ -1305,6 +1325,10 @@ "type": "FilesetSpec", "id": 33 }, + "serviceSpec": { + "type": "ServiceSpec", + "id": 42 + }, "displayName": { "type": "string", "id": 3 @@ -1542,6 +1566,60 @@ } } }, + "CloudBigtableSystemSpec": { + "fields": { + "instanceDisplayName": { + "type": "string", + "id": 1 + } + } + }, + "CloudBigtableInstanceSpec": { + "fields": { + "cloudBigtableClusterSpecs": { + "rule": "repeated", + "type": "CloudBigtableClusterSpec", + "id": 1 + } + }, + "nested": { + "CloudBigtableClusterSpec": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "linkedResource": { + "type": "string", + "id": 4 + } + } + } + } + }, + "ServiceSpec": { + "oneofs": { + "systemSpec": { + "oneof": [ + "cloudBigtableInstanceSpec" + ] + } + }, + "fields": { + "cloudBigtableInstanceSpec": { + "type": "CloudBigtableInstanceSpec", + "id": 1 + } + } + }, "BusinessContext": { "fields": { "entryOverview": { @@ -2027,6 +2105,13 @@ "gcsBucketPath": { "type": "string", "id": 2 + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -2937,12 +3022,18 @@ "presentTags": { "rule": "repeated", "type": "Tag", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "absentTags": { "rule": "repeated", "type": "Tag", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-datacatalog/samples/README.md b/packages/google-cloud-datacatalog/samples/README.md index c55a995ec6cc..3902400918cc 100644 --- a/packages/google-cloud-datacatalog/samples/README.md +++ b/packages/google-cloud-datacatalog/samples/README.md @@ -105,7 +105,6 @@ * [Policy_tag_manager_serialization.export_taxonomies](#policy_tag_manager_serialization.export_taxonomies) * [Policy_tag_manager_serialization.import_taxonomies](#policy_tag_manager_serialization.import_taxonomies) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -1698,23 +1697,6 @@ __Usage:__ `node packages/google-cloud-datacatalog/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-datacatalog/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-datacatalog/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-datacatalog/samples/test/quickstart.test.js` - - diff --git a/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js b/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js index 2610373f9afb..c1920b7ef5c4 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js +++ b/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.import_entries.js @@ -36,6 +36,11 @@ function main(parent) { * Path to a Cloud Storage bucket that contains a dump ready for ingestion. */ // const gcsBucketPath = 'abc123' + /** + * Optional. (Optional) Dataplex task job id, if specified will be used as + * part of ImportEntries LRO ID + */ + // const jobId = 'abc123' // Imports the Datacatalog library const {DataCatalogClient} = require('@google-cloud/datacatalog').v1; diff --git a/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js b/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js index d6f5f99936f8..6027492f018e 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js +++ b/packages/google-cloud-datacatalog/samples/generated/v1/data_catalog.lookup_entry.js @@ -51,7 +51,9 @@ function main() { */ // const sqlResource = 'abc123' /** - * Fully qualified name (FQN) of the resource. + * Fully Qualified Name + * (FQN) (https://cloud.google.com//data-catalog/docs/fully-qualified-names) + * of the resource. * FQNs take two forms: * * For non-regionalized resources: * `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` @@ -61,6 +63,18 @@ function main() { * `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` */ // const fullyQualifiedName = 'abc123' + /** + * Project where the lookup should be performed. Required to lookup + * entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + * using its `fully_qualified_name`. Ignored in other cases. + */ + // const project = 'my-project' + /** + * Location where the lookup should be performed. Required to lookup + * entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + * using its `fully_qualified_name`. Ignored in other cases. + */ + // const location = 'abc123' // Imports the Datacatalog library const {DataCatalogClient} = require('@google-cloud/datacatalog').v1; diff --git a/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json b/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json index 5b9fb42ab984..8e3bfe02c314 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json +++ b/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datacatalog", - "version": "3.3.0", + "version": "3.3.1", "language": "TYPESCRIPT", "apis": [ { @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 95, "type": "FULL" } ], @@ -498,6 +498,14 @@ { "name": "fully_qualified_name", "type": "TYPE_STRING" + }, + { + "name": "project", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.datacatalog.v1.Entry", @@ -1514,7 +1522,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 63, "type": "FULL" } ], @@ -1530,6 +1538,10 @@ { "name": "gcs_bucket_path", "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json b/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json index 40dfb7e76f23..8e1e1050ab4c 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json +++ b/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datacatalog", - "version": "3.3.0", + "version": "3.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts b/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts index 41cfa8f02611..a14028343914 100644 --- a/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts +++ b/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts @@ -1323,7 +1323,9 @@ export class DataCatalogClient { * [Lexical structure in Standard SQL] * (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical). * @param {string} request.fullyQualifiedName - * Fully qualified name (FQN) of the resource. + * [Fully Qualified Name + * (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + * of the resource. * * FQNs take two forms: * @@ -1338,6 +1340,14 @@ export class DataCatalogClient { * Example for a DPMS table: * * `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` + * @param {string} request.project + * Project where the lookup should be performed. Required to lookup + * entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + * using its `fully_qualified_name`. Ignored in other cases. + * @param {string} request.location + * Location where the lookup should be performed. Required to lookup + * entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + * using its `fully_qualified_name`. Ignored in other cases. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3551,6 +3561,9 @@ export class DataCatalogClient { * Required. Target entry group for ingested entries. * @param {string} request.gcsBucketPath * Path to a Cloud Storage bucket that contains a dump ready for ingestion. + * @param {string} [request.jobId] + * Optional. (Optional) Dataplex task job id, if specified will be used as + * part of ImportEntries LRO ID * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json b/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json index 89de713f1a94..59273240c2aa 100644 --- a/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json +++ b/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json @@ -7,7 +7,9 @@ "DEADLINE_EXCEEDED", "UNAVAILABLE" ], - "unavailable": [ + "resource_exhausted_internal_unavailable": [ + "RESOURCE_EXHAUSTED", + "INTERNAL", "UNAVAILABLE" ] }, @@ -25,172 +27,172 @@ "methods": { "SearchCatalog": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "CreateEntryGroup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "GetEntryGroup": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UpdateEntryGroup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "DeleteEntryGroup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ListEntryGroups": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "CreateEntry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UpdateEntry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "DeleteEntry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "GetEntry": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "LookupEntry": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ListEntries": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ModifyEntryOverview": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ModifyEntryContacts": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "CreateTagTemplate": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "GetTagTemplate": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UpdateTagTemplate": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "DeleteTagTemplate": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "CreateTagTemplateField": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UpdateTagTemplateField": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "RenameTagTemplateField": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "RenameTagTemplateFieldEnumValue": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "DeleteTagTemplateField": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "CreateTag": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UpdateTag": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "DeleteTag": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ListTags": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ReconcileTags": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "StarEntry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "UnstarEntry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "GetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" }, "ImportEntries": { "timeout_millis": 60000, - "retry_codes_name": "unavailable", + "retry_codes_name": "resource_exhausted_internal_unavailable", "retry_params_name": "default" } } From 47ab1c3ee106fce357950245318129d2be723dd2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 19:54:14 +0000 Subject: [PATCH 16/46] feat: [tpu] Add MultisliceNode (#4308) - [ ] Regenerate this pull request now. --- feat: Enable Force on DeleteQueuedResource PiperOrigin-RevId: 536935689 Source-Link: https://togithub.com/googleapis/googleapis/commit/5649269b4e6d024f45287e1610fb479cf4e726a8 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/9562345a095887618b945a5a7b671a2ad8a8536a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRwdS8uT3dsQm90LnlhbWwiLCJoIjoiOTU2MjM0NWEwOTU4ODc2MThiOTQ1YTVhN2I2NzFhMmFkOGE4NTM2YSJ9 --- .../google/cloud/tpu/v2alpha1/cloud_tpu.proto | 10 ++++ packages/google-cloud-tpu/protos/protos.d.ts | 12 +++++ packages/google-cloud-tpu/protos/protos.js | 46 +++++++++++++++++++ packages/google-cloud-tpu/protos/protos.json | 11 +++++ ...et_metadata.google.cloud.tpu.v2alpha1.json | 6 ++- .../v2alpha1/tpu.delete_queued_resource.js | 8 ++++ .../src/v2alpha1/tpu_client.ts | 6 +++ 7 files changed, 98 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto b/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto index 54af59170637..71b88386b5b6 100644 --- a/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto +++ b/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto @@ -525,6 +525,9 @@ message Node { // Shielded Instance options. ShieldedInstanceConfig shielded_instance_config = 45; + + // Output only. Whether the Node belongs to a Multislice group. + bool multislice_node = 47 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A QueuedResource represents a request for resources that will be placed @@ -912,6 +915,13 @@ message DeleteQueuedResourceRequest { // Idempotent request UUID. string request_id = 2; + + // If set to true, all running nodes belonging to this queued resource will + // be deleted first and then the queued resource will be deleted. + // Otherwise (i.e. force=false), the queued resource will only be deleted if + // its nodes have already been deleted or the queued resource is in the + // ACCEPTED, FAILED, or SUSPENDED state. + bool force = 3; } // The per-product per-project service identity for Cloud TPU service. diff --git a/packages/google-cloud-tpu/protos/protos.d.ts b/packages/google-cloud-tpu/protos/protos.d.ts index 7cb9444bdcdd..37a03a187964 100644 --- a/packages/google-cloud-tpu/protos/protos.d.ts +++ b/packages/google-cloud-tpu/protos/protos.d.ts @@ -8265,6 +8265,9 @@ export namespace google { /** Node shieldedInstanceConfig */ shieldedInstanceConfig?: (google.cloud.tpu.v2alpha1.IShieldedInstanceConfig|null); + + /** Node multisliceNode */ + multisliceNode?: (boolean|null); } /** Represents a Node. */ @@ -8345,6 +8348,9 @@ export namespace google { /** Node shieldedInstanceConfig. */ public shieldedInstanceConfig?: (google.cloud.tpu.v2alpha1.IShieldedInstanceConfig|null); + /** Node multisliceNode. */ + public multisliceNode: boolean; + /** * Creates a new Node instance using the specified properties. * @param [properties] Properties to set @@ -11297,6 +11303,9 @@ export namespace google { /** DeleteQueuedResourceRequest requestId */ requestId?: (string|null); + + /** DeleteQueuedResourceRequest force */ + force?: (boolean|null); } /** Represents a DeleteQueuedResourceRequest. */ @@ -11314,6 +11323,9 @@ export namespace google { /** DeleteQueuedResourceRequest requestId. */ public requestId: string; + /** DeleteQueuedResourceRequest force. */ + public force: boolean; + /** * Creates a new DeleteQueuedResourceRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-tpu/protos/protos.js b/packages/google-cloud-tpu/protos/protos.js index d495f92f7352..4b29cfcdcef8 100644 --- a/packages/google-cloud-tpu/protos/protos.js +++ b/packages/google-cloud-tpu/protos/protos.js @@ -19220,6 +19220,7 @@ * @property {string|null} [queuedResource] Node queuedResource * @property {google.cloud.tpu.v2alpha1.IAcceleratorConfig|null} [acceleratorConfig] Node acceleratorConfig * @property {google.cloud.tpu.v2alpha1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] Node shieldedInstanceConfig + * @property {boolean|null} [multisliceNode] Node multisliceNode */ /** @@ -19427,6 +19428,14 @@ */ Node.prototype.shieldedInstanceConfig = null; + /** + * Node multisliceNode. + * @member {boolean} multisliceNode + * @memberof google.cloud.tpu.v2alpha1.Node + * @instance + */ + Node.prototype.multisliceNode = false; + /** * Creates a new Node instance using the specified properties. * @function create @@ -19503,6 +19512,8 @@ $root.google.cloud.tpu.v2alpha1.AcceleratorConfig.encode(message.acceleratorConfig, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) $root.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.multisliceNode != null && Object.hasOwnProperty.call(message, "multisliceNode")) + writer.uint32(/* id 47, wireType 0 =*/376).bool(message.multisliceNode); return writer; }; @@ -19675,6 +19686,10 @@ message.shieldedInstanceConfig = $root.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.decode(reader, reader.uint32()); break; } + case 47: { + message.multisliceNode = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -19856,6 +19871,9 @@ if (error) return "shieldedInstanceConfig." + error; } + if (message.multisliceNode != null && message.hasOwnProperty("multisliceNode")) + if (typeof message.multisliceNode !== "boolean") + return "multisliceNode: boolean expected"; return null; }; @@ -20095,6 +20113,8 @@ throw TypeError(".google.cloud.tpu.v2alpha1.Node.shieldedInstanceConfig: object expected"); message.shieldedInstanceConfig = $root.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); } + if (object.multisliceNode != null) + message.multisliceNode = Boolean(object.multisliceNode); return message; }; @@ -20143,6 +20163,7 @@ object.queuedResource = ""; object.acceleratorConfig = null; object.shieldedInstanceConfig = null; + object.multisliceNode = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -20212,6 +20233,8 @@ object.acceleratorConfig = $root.google.cloud.tpu.v2alpha1.AcceleratorConfig.toObject(message.acceleratorConfig, options); if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) object.shieldedInstanceConfig = $root.google.cloud.tpu.v2alpha1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); + if (message.multisliceNode != null && message.hasOwnProperty("multisliceNode")) + object.multisliceNode = message.multisliceNode; return object; }; @@ -26912,6 +26935,7 @@ * @interface IDeleteQueuedResourceRequest * @property {string|null} [name] DeleteQueuedResourceRequest name * @property {string|null} [requestId] DeleteQueuedResourceRequest requestId + * @property {boolean|null} [force] DeleteQueuedResourceRequest force */ /** @@ -26945,6 +26969,14 @@ */ DeleteQueuedResourceRequest.prototype.requestId = ""; + /** + * DeleteQueuedResourceRequest force. + * @member {boolean} force + * @memberof google.cloud.tpu.v2alpha1.DeleteQueuedResourceRequest + * @instance + */ + DeleteQueuedResourceRequest.prototype.force = false; + /** * Creates a new DeleteQueuedResourceRequest instance using the specified properties. * @function create @@ -26973,6 +27005,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; @@ -27015,6 +27049,10 @@ message.requestId = reader.string(); break; } + case 3: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -27056,6 +27094,9 @@ if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; @@ -27075,6 +27116,8 @@ message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); return message; }; @@ -27094,11 +27137,14 @@ if (options.defaults) { object.name = ""; object.requestId = ""; + object.force = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; diff --git a/packages/google-cloud-tpu/protos/protos.json b/packages/google-cloud-tpu/protos/protos.json index 316ccc66a747..efd655bf6568 100644 --- a/packages/google-cloud-tpu/protos/protos.json +++ b/packages/google-cloud-tpu/protos/protos.json @@ -2461,6 +2461,13 @@ "shieldedInstanceConfig": { "type": "ShieldedInstanceConfig", "id": 45 + }, + "multisliceNode": { + "type": "bool", + "id": 47, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -2972,6 +2979,10 @@ "requestId": { "type": "string", "id": 2 + }, + "force": { + "type": "bool", + "id": 3 } } }, diff --git a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json index df3b9520522d..d658562d92f1 100644 --- a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json +++ b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 66, "type": "FULL" } ], @@ -486,6 +486,10 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-tpu/samples/generated/v2alpha1/tpu.delete_queued_resource.js b/packages/google-cloud-tpu/samples/generated/v2alpha1/tpu.delete_queued_resource.js index 1a4a93e40355..2ef4c48124e9 100644 --- a/packages/google-cloud-tpu/samples/generated/v2alpha1/tpu.delete_queued_resource.js +++ b/packages/google-cloud-tpu/samples/generated/v2alpha1/tpu.delete_queued_resource.js @@ -36,6 +36,14 @@ function main(name) { * Idempotent request UUID. */ // const requestId = 'abc123' + /** + * If set to true, all running nodes belonging to this queued resource will + * be deleted first and then the queued resource will be deleted. + * Otherwise (i.e. force=false), the queued resource will only be deleted if + * its nodes have already been deleted or the queued resource is in the + * ACCEPTED, FAILED, or SUSPENDED state. + */ + // const force = true // Imports the Tpu library const {TpuClient} = require('@google-cloud/tpu').v2alpha1; diff --git a/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts b/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts index 6bcf1a621dea..e513e2f94aa3 100644 --- a/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts +++ b/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts @@ -1936,6 +1936,12 @@ export class TpuClient { * Required. The resource name. * @param {string} request.requestId * Idempotent request UUID. + * @param {boolean} request.force + * If set to true, all running nodes belonging to this queued resource will + * be deleted first and then the queued resource will be deleted. + * Otherwise (i.e. force=false), the queued resource will only be deleted if + * its nodes have already been deleted or the queued resource is in the + * ACCEPTED, FAILED, or SUSPENDED state. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. From 737325faf2535b6de9a8b9fe39a59e44bab16527 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 20:10:12 +0000 Subject: [PATCH 17/46] docs: [talent] Add three per company option to diversification levels (#4305) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 536429537 Source-Link: https://togithub.com/googleapis/googleapis/commit/7cb9709446ff8de8c1587448889b1dd26a3b1b2d Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/bc0f6d65d7da9fb78c6e3773d8c0cc8b1af86b41 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhbGVudC8uT3dsQm90LnlhbWwiLCJoIjoiYmMwZjZkNjVkN2RhOWZiNzhjNmUzNzczZDhjMGNjOGIxYWY4NmI0MSJ9 --- packages/google-cloud-talent/README.md | 95 +++++++++---------- .../google/cloud/talent/v4/job_service.proto | 5 + .../google-cloud-talent/protos/protos.d.ts | 1 + packages/google-cloud-talent/protos/protos.js | 7 ++ .../google-cloud-talent/protos/protos.json | 1 + .../google-cloud-talent/samples/README.md | 18 ---- 6 files changed, 61 insertions(+), 66 deletions(-) diff --git a/packages/google-cloud-talent/README.md b/packages/google-cloud-talent/README.md index d24be7213ddd..90f8184c6c73 100644 --- a/packages/google-cloud-talent/README.md +++ b/packages/google-cloud-talent/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Talent Solution: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Google Cloud Talent Solution: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-talent) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/talent.svg)](https://www.npmjs.org/package/@google-cloud/talent) @@ -58,56 +58,55 @@ npm install @google-cloud/talent ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-talent/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Company_service.create_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.create_company.js,samples/README.md) | -| Company_service.delete_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.delete_company.js,samples/README.md) | -| Company_service.get_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.get_company.js,samples/README.md) | -| Company_service.list_companies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.list_companies.js,samples/README.md) | -| Company_service.update_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.update_company.js,samples/README.md) | -| Completion.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js) | [![Open in Cloud 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-talent/samples/generated/v4/completion.complete_query.js,samples/README.md) | -| Event_service.create_client_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js) | [![Open in Cloud 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-talent/samples/generated/v4/event_service.create_client_event.js,samples/README.md) | -| Job_service.batch_create_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_create_jobs.js,samples/README.md) | -| Job_service.batch_delete_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_delete_jobs.js,samples/README.md) | -| Job_service.batch_update_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_update_jobs.js,samples/README.md) | -| Job_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.create_job.js,samples/README.md) | -| Job_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.delete_job.js,samples/README.md) | -| Job_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.get_job.js,samples/README.md) | -| Job_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.list_jobs.js,samples/README.md) | -| Job_service.search_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.search_jobs.js,samples/README.md) | -| Job_service.search_jobs_for_alert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.search_jobs_for_alert.js,samples/README.md) | -| Job_service.update_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.update_job.js,samples/README.md) | -| Tenant_service.create_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.create_tenant.js,samples/README.md) | -| Tenant_service.delete_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.delete_tenant.js,samples/README.md) | -| Tenant_service.get_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.get_tenant.js,samples/README.md) | -| Tenant_service.list_tenants | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.list_tenants.js,samples/README.md) | -| Tenant_service.update_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.update_tenant.js,samples/README.md) | -| Company_service.create_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.create_company.js,samples/README.md) | -| Company_service.delete_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.delete_company.js,samples/README.md) | -| Company_service.get_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.get_company.js,samples/README.md) | -| Company_service.list_companies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.list_companies.js,samples/README.md) | -| Company_service.update_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.update_company.js,samples/README.md) | -| Completion.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/completion.complete_query.js,samples/README.md) | -| Event_service.create_client_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/event_service.create_client_event.js,samples/README.md) | -| Job_service.batch_create_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js,samples/README.md) | -| Job_service.batch_delete_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js,samples/README.md) | -| Job_service.batch_update_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js,samples/README.md) | -| Job_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.create_job.js,samples/README.md) | -| Job_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.delete_job.js,samples/README.md) | -| Job_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.get_job.js,samples/README.md) | -| Job_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.list_jobs.js,samples/README.md) | -| Job_service.search_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.search_jobs.js,samples/README.md) | -| Job_service.search_jobs_for_alert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js,samples/README.md) | -| Job_service.update_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.update_job.js,samples/README.md) | -| Tenant_service.create_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.create_tenant.js,samples/README.md) | -| Tenant_service.delete_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js,samples/README.md) | -| Tenant_service.get_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.get_tenant.js,samples/README.md) | -| Tenant_service.list_tenants | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.list_tenants.js,samples/README.md) | -| Tenant_service.update_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.update_tenant.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/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-talent/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-talent/samples/test/quickstart.test.js,samples/README.md) | +| Company_service.create_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.create_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.delete_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.delete_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.get_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.get_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.list_companies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.list_companies.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.update_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js) | [![Open in Cloud 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-talent/samples/generated/v4/company_service.update_company.js,packages/google-cloud-talent/samples/README.md) | +| Completion.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js) | [![Open in Cloud 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-talent/samples/generated/v4/completion.complete_query.js,packages/google-cloud-talent/samples/README.md) | +| Event_service.create_client_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js) | [![Open in Cloud 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-talent/samples/generated/v4/event_service.create_client_event.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_create_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_create_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_delete_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_delete_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_update_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.batch_update_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.create_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.delete_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.get_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.list_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.search_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.search_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.search_jobs_for_alert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.search_jobs_for_alert.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.update_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js) | [![Open in Cloud 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-talent/samples/generated/v4/job_service.update_job.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.create_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.create_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.delete_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.delete_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.get_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.get_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.list_tenants | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.list_tenants.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.update_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4/tenant_service.update_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.create_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.create_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.delete_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.delete_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.get_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.get_company.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.list_companies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.list_companies.js,packages/google-cloud-talent/samples/README.md) | +| Company_service.update_company | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/company_service.update_company.js,packages/google-cloud-talent/samples/README.md) | +| Completion.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/completion.complete_query.js,packages/google-cloud-talent/samples/README.md) | +| Event_service.create_client_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/event_service.create_client_event.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_create_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_delete_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.batch_update_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.create_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.delete_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.get_job.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.list_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.search_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.search_jobs.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.search_jobs_for_alert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js,packages/google-cloud-talent/samples/README.md) | +| Job_service.update_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/job_service.update_job.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.create_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.create_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.delete_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.get_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.get_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.list_tenants | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.list_tenants.js,packages/google-cloud-talent/samples/README.md) | +| Tenant_service.update_tenant | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js) | [![Open in Cloud 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-talent/samples/generated/v4beta1/tenant_service.update_tenant.js,packages/google-cloud-talent/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/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-talent/samples/quickstart.js,packages/google-cloud-talent/samples/README.md) | diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto index 1673b82fad0b..71d8117a34e6 100644 --- a/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto @@ -395,6 +395,11 @@ message SearchJobsRequest { // pushed to the end of the last page of search result. TWO_PER_COMPANY = 4; + // Similar to ONE_PER_COMPANY, but it allows at most three jobs in the + // same company to be shown at once, the other jobs under same company are + // dropped. + MAX_THREE_PER_COMPANY = 6; + // The result list is ordered such that somewhat similar results are pushed // to the end of the last page of the search results. This option is // recommended if SIMPLE diversification does not diversify enough. diff --git a/packages/google-cloud-talent/protos/protos.d.ts b/packages/google-cloud-talent/protos/protos.d.ts index dc8a864703fc..a33f168374fd 100644 --- a/packages/google-cloud-talent/protos/protos.d.ts +++ b/packages/google-cloud-talent/protos/protos.d.ts @@ -5742,6 +5742,7 @@ export namespace google { SIMPLE = 2, ONE_PER_COMPANY = 3, TWO_PER_COMPANY = 4, + MAX_THREE_PER_COMPANY = 6, DIVERSIFY_BY_LOOSER_SIMILARITY = 5 } diff --git a/packages/google-cloud-talent/protos/protos.js b/packages/google-cloud-talent/protos/protos.js index 9067ebb680bf..39baf9f7452a 100644 --- a/packages/google-cloud-talent/protos/protos.js +++ b/packages/google-cloud-talent/protos/protos.js @@ -15394,6 +15394,7 @@ case 2: case 3: case 4: + case 6: case 5: break; } @@ -15537,6 +15538,10 @@ case 4: message.diversificationLevel = 4; break; + case "MAX_THREE_PER_COMPANY": + case 6: + message.diversificationLevel = 6; + break; case "DIVERSIFY_BY_LOOSER_SIMILARITY": case 5: message.diversificationLevel = 5; @@ -15694,6 +15699,7 @@ * @property {number} SIMPLE=2 SIMPLE value * @property {number} ONE_PER_COMPANY=3 ONE_PER_COMPANY value * @property {number} TWO_PER_COMPANY=4 TWO_PER_COMPANY value + * @property {number} MAX_THREE_PER_COMPANY=6 MAX_THREE_PER_COMPANY value * @property {number} DIVERSIFY_BY_LOOSER_SIMILARITY=5 DIVERSIFY_BY_LOOSER_SIMILARITY value */ SearchJobsRequest.DiversificationLevel = (function() { @@ -15703,6 +15709,7 @@ values[valuesById[2] = "SIMPLE"] = 2; values[valuesById[3] = "ONE_PER_COMPANY"] = 3; values[valuesById[4] = "TWO_PER_COMPANY"] = 4; + values[valuesById[6] = "MAX_THREE_PER_COMPANY"] = 6; values[valuesById[5] = "DIVERSIFY_BY_LOOSER_SIMILARITY"] = 5; return values; })(); diff --git a/packages/google-cloud-talent/protos/protos.json b/packages/google-cloud-talent/protos/protos.json index 916bd0e0e6be..7f3d49e754e2 100644 --- a/packages/google-cloud-talent/protos/protos.json +++ b/packages/google-cloud-talent/protos/protos.json @@ -1819,6 +1819,7 @@ "SIMPLE": 2, "ONE_PER_COMPANY": 3, "TWO_PER_COMPANY": 4, + "MAX_THREE_PER_COMPANY": 6, "DIVERSIFY_BY_LOOSER_SIMILARITY": 5 } }, diff --git a/packages/google-cloud-talent/samples/README.md b/packages/google-cloud-talent/samples/README.md index 0f2e04b65223..b5947e1ffcb4 100644 --- a/packages/google-cloud-talent/samples/README.md +++ b/packages/google-cloud-talent/samples/README.md @@ -57,7 +57,6 @@ * [Tenant_service.list_tenants](#tenant_service.list_tenants) * [Tenant_service.update_tenant](#tenant_service.update_tenant) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -834,23 +833,6 @@ __Usage:__ `node packages/google-cloud-talent/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-talent/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-talent/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-talent/samples/test/quickstart.test.js` - - From 12cc0d9c6d17614b5e1a9b5eb189258279f4cee2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 20:26:13 +0000 Subject: [PATCH 18/46] feat: [container] add SoleTenantConfig API (#4306) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 536569254 Source-Link: https://togithub.com/googleapis/googleapis/commit/3cc45f010cebf0e5b11afb88d2d3e1827244e2e3 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/ed8d7546cd177053d5312d0e40f7f506352ba805 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiZWQ4ZDc1NDZjZDE3NzA1M2Q1MzEyZDBlNDBmN2Y1MDYzNTJiYTgwNSJ9 BEGIN_NESTED_COMMIT feat: [container] add SoleTenantConfig API PiperOrigin-RevId: 536516473 Source-Link: https://togithub.com/googleapis/googleapis/commit/0fb1181647f076e33f936babee46cdf362798dd5 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/3d69310994242d5bdb9d345f4d894d45b7262f9d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiM2Q2OTMxMDk5NDI0MmQ1YmRiOWQzNDVmNGQ4OTRkNDViNzI2MmY5ZCJ9 END_NESTED_COMMIT --- .../google/container/v1/cluster_service.proto | 37 + .../container/v1beta1/cluster_service.proto | 37 + packages/google-container/protos/protos.d.ts | 450 +++++++ packages/google-container/protos/protos.js | 1118 +++++++++++++++++ packages/google-container/protos/protos.json | 82 ++ 5 files changed, 1724 insertions(+) diff --git a/packages/google-container/protos/google/container/v1/cluster_service.proto b/packages/google-container/protos/google/container/v1/cluster_service.proto index 4ca597b1a198..5e9f89693aa0 100644 --- a/packages/google-container/protos/google/container/v1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1/cluster_service.proto @@ -816,6 +816,9 @@ message NodeConfig { // Parameters for the node ephemeral storage using Local SSDs. // If unspecified, ephemeral storage is backed by the boot disk. EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; } // Specifies options for controlling advanced machine features. @@ -980,6 +983,40 @@ message ReservationAffinity { repeated string values = 3; } +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + // Kubernetes taint is composed of three fields: key, value, and effect. Effect // can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. // diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index 8c7776a58008..266f507d787f 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -813,6 +813,9 @@ message NodeConfig { // If unspecified, ephemeral storage is backed by the boot disk. // This field is functionally equivalent to the ephemeral_storage_config EphemeralStorageLocalSsdConfig ephemeral_storage_local_ssd_config = 41; + + // Parameters for node pools to be backed by shared sole tenant node groups. + SoleTenantConfig sole_tenant_config = 42; } // Specifies options for controlling advanced machine features. @@ -1018,6 +1021,40 @@ message ReservationAffinity { repeated string values = 3; } +// SoleTenantConfig contains the NodeAffinities to specify what shared sole +// tenant node groups should back the node pool. +message SoleTenantConfig { + // Specifies the NodeAffinity key, values, and affinity operator according to + // [shared sole tenant node group + // affinities](https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity). + message NodeAffinity { + // Operator allows user to specify affinity or anti-affinity for the + // given key values. + enum Operator { + // Invalid or unspecified affinity operator. + OPERATOR_UNSPECIFIED = 0; + + // Affinity operator. + IN = 1; + + // Anti-affinity operator. + NOT_IN = 2; + } + + // Key for NodeAffinity. + string key = 1; + + // Operator for NodeAffinity. + Operator operator = 2; + + // Values for NodeAffinity. + repeated string values = 3; + } + + // NodeAffinities used to match to a shared sole tenant node group. + repeated NodeAffinity node_affinities = 1; +} + // Kubernetes taint is composed of three fields: key, value, and effect. Effect // can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. // diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index a99d5aa707d2..67f659e12ad9 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -1176,6 +1176,9 @@ export namespace google { /** NodeConfig ephemeralStorageLocalSsdConfig */ ephemeralStorageLocalSsdConfig?: (google.container.v1.IEphemeralStorageLocalSsdConfig|null); + + /** NodeConfig soleTenantConfig */ + soleTenantConfig?: (google.container.v1.ISoleTenantConfig|null); } /** Represents a NodeConfig. */ @@ -1286,6 +1289,9 @@ export namespace google { /** NodeConfig ephemeralStorageLocalSsdConfig. */ public ephemeralStorageLocalSsdConfig?: (google.container.v1.IEphemeralStorageLocalSsdConfig|null); + /** NodeConfig soleTenantConfig. */ + public soleTenantConfig?: (google.container.v1.ISoleTenantConfig|null); + /** NodeConfig _fastSocket. */ public _fastSocket?: "fastSocket"; @@ -2138,6 +2144,225 @@ export namespace google { } } + /** Properties of a SoleTenantConfig. */ + interface ISoleTenantConfig { + + /** SoleTenantConfig nodeAffinities */ + nodeAffinities?: (google.container.v1.SoleTenantConfig.INodeAffinity[]|null); + } + + /** Represents a SoleTenantConfig. */ + class SoleTenantConfig implements ISoleTenantConfig { + + /** + * Constructs a new SoleTenantConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.ISoleTenantConfig); + + /** SoleTenantConfig nodeAffinities. */ + public nodeAffinities: google.container.v1.SoleTenantConfig.INodeAffinity[]; + + /** + * Creates a new SoleTenantConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SoleTenantConfig instance + */ + public static create(properties?: google.container.v1.ISoleTenantConfig): google.container.v1.SoleTenantConfig; + + /** + * Encodes the specified SoleTenantConfig message. Does not implicitly {@link google.container.v1.SoleTenantConfig.verify|verify} messages. + * @param message SoleTenantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.ISoleTenantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoleTenantConfig message, length delimited. Does not implicitly {@link google.container.v1.SoleTenantConfig.verify|verify} messages. + * @param message SoleTenantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.ISoleTenantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.SoleTenantConfig; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.SoleTenantConfig; + + /** + * Verifies a SoleTenantConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoleTenantConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoleTenantConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.SoleTenantConfig; + + /** + * Creates a plain object from a SoleTenantConfig message. Also converts values to other types if specified. + * @param message SoleTenantConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.SoleTenantConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoleTenantConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoleTenantConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SoleTenantConfig { + + /** Properties of a NodeAffinity. */ + interface INodeAffinity { + + /** NodeAffinity key */ + key?: (string|null); + + /** NodeAffinity operator */ + operator?: (google.container.v1.SoleTenantConfig.NodeAffinity.Operator|keyof typeof google.container.v1.SoleTenantConfig.NodeAffinity.Operator|null); + + /** NodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a NodeAffinity. */ + class NodeAffinity implements INodeAffinity { + + /** + * Constructs a new NodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.SoleTenantConfig.INodeAffinity); + + /** NodeAffinity key. */ + public key: string; + + /** NodeAffinity operator. */ + public operator: (google.container.v1.SoleTenantConfig.NodeAffinity.Operator|keyof typeof google.container.v1.SoleTenantConfig.NodeAffinity.Operator); + + /** NodeAffinity values. */ + public values: string[]; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAffinity instance + */ + public static create(properties?: google.container.v1.SoleTenantConfig.INodeAffinity): google.container.v1.SoleTenantConfig.NodeAffinity; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.container.v1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.SoleTenantConfig.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.container.v1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.SoleTenantConfig.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.SoleTenantConfig.NodeAffinity; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.SoleTenantConfig.NodeAffinity; + + /** + * Verifies a NodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.SoleTenantConfig.NodeAffinity; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @param message NodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.SoleTenantConfig.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + } + /** Properties of a NodeTaint. */ interface INodeTaint { @@ -20337,6 +20562,9 @@ export namespace google { /** NodeConfig ephemeralStorageLocalSsdConfig */ ephemeralStorageLocalSsdConfig?: (google.container.v1beta1.IEphemeralStorageLocalSsdConfig|null); + + /** NodeConfig soleTenantConfig */ + soleTenantConfig?: (google.container.v1beta1.ISoleTenantConfig|null); } /** Represents a NodeConfig. */ @@ -20450,6 +20678,9 @@ export namespace google { /** NodeConfig ephemeralStorageLocalSsdConfig. */ public ephemeralStorageLocalSsdConfig?: (google.container.v1beta1.IEphemeralStorageLocalSsdConfig|null); + /** NodeConfig soleTenantConfig. */ + public soleTenantConfig?: (google.container.v1beta1.ISoleTenantConfig|null); + /** NodeConfig _fastSocket. */ public _fastSocket?: "fastSocket"; @@ -21608,6 +21839,225 @@ export namespace google { } } + /** Properties of a SoleTenantConfig. */ + interface ISoleTenantConfig { + + /** SoleTenantConfig nodeAffinities */ + nodeAffinities?: (google.container.v1beta1.SoleTenantConfig.INodeAffinity[]|null); + } + + /** Represents a SoleTenantConfig. */ + class SoleTenantConfig implements ISoleTenantConfig { + + /** + * Constructs a new SoleTenantConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.ISoleTenantConfig); + + /** SoleTenantConfig nodeAffinities. */ + public nodeAffinities: google.container.v1beta1.SoleTenantConfig.INodeAffinity[]; + + /** + * Creates a new SoleTenantConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SoleTenantConfig instance + */ + public static create(properties?: google.container.v1beta1.ISoleTenantConfig): google.container.v1beta1.SoleTenantConfig; + + /** + * Encodes the specified SoleTenantConfig message. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.verify|verify} messages. + * @param message SoleTenantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.ISoleTenantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoleTenantConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.verify|verify} messages. + * @param message SoleTenantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.ISoleTenantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.SoleTenantConfig; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.SoleTenantConfig; + + /** + * Verifies a SoleTenantConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoleTenantConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoleTenantConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.SoleTenantConfig; + + /** + * Creates a plain object from a SoleTenantConfig message. Also converts values to other types if specified. + * @param message SoleTenantConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.SoleTenantConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoleTenantConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoleTenantConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SoleTenantConfig { + + /** Properties of a NodeAffinity. */ + interface INodeAffinity { + + /** NodeAffinity key */ + key?: (string|null); + + /** NodeAffinity operator */ + operator?: (google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator|keyof typeof google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator|null); + + /** NodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a NodeAffinity. */ + class NodeAffinity implements INodeAffinity { + + /** + * Constructs a new NodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.SoleTenantConfig.INodeAffinity); + + /** NodeAffinity key. */ + public key: string; + + /** NodeAffinity operator. */ + public operator: (google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator|keyof typeof google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator); + + /** NodeAffinity values. */ + public values: string[]; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAffinity instance + */ + public static create(properties?: google.container.v1beta1.SoleTenantConfig.INodeAffinity): google.container.v1beta1.SoleTenantConfig.NodeAffinity; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.SoleTenantConfig.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.SoleTenantConfig.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.SoleTenantConfig.NodeAffinity; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.SoleTenantConfig.NodeAffinity; + + /** + * Verifies a NodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.SoleTenantConfig.NodeAffinity; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @param message NodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.SoleTenantConfig.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + } + /** Properties of a NodeTaint. */ interface INodeTaint { diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index 7046fb7c7978..0be180172ed7 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -2057,6 +2057,7 @@ * @property {google.container.v1.IWindowsNodeConfig|null} [windowsNodeConfig] NodeConfig windowsNodeConfig * @property {google.container.v1.ILocalNvmeSsdBlockConfig|null} [localNvmeSsdBlockConfig] NodeConfig localNvmeSsdBlockConfig * @property {google.container.v1.IEphemeralStorageLocalSsdConfig|null} [ephemeralStorageLocalSsdConfig] NodeConfig ephemeralStorageLocalSsdConfig + * @property {google.container.v1.ISoleTenantConfig|null} [soleTenantConfig] NodeConfig soleTenantConfig */ /** @@ -2345,6 +2346,14 @@ */ NodeConfig.prototype.ephemeralStorageLocalSsdConfig = null; + /** + * NodeConfig soleTenantConfig. + * @member {google.container.v1.ISoleTenantConfig|null|undefined} soleTenantConfig + * @memberof google.container.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.soleTenantConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2456,6 +2465,8 @@ $root.google.container.v1.LocalNvmeSsdBlockConfig.encode(message.localNvmeSsdBlockConfig, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); if (message.ephemeralStorageLocalSsdConfig != null && Object.hasOwnProperty.call(message, "ephemeralStorageLocalSsdConfig")) $root.google.container.v1.EphemeralStorageLocalSsdConfig.encode(message.ephemeralStorageLocalSsdConfig, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.soleTenantConfig != null && Object.hasOwnProperty.call(message, "soleTenantConfig")) + $root.google.container.v1.SoleTenantConfig.encode(message.soleTenantConfig, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); return writer; }; @@ -2687,6 +2698,10 @@ message.ephemeralStorageLocalSsdConfig = $root.google.container.v1.EphemeralStorageLocalSsdConfig.decode(reader, reader.uint32()); break; } + case 42: { + message.soleTenantConfig = $root.google.container.v1.SoleTenantConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2890,6 +2905,11 @@ if (error) return "ephemeralStorageLocalSsdConfig." + error; } + if (message.soleTenantConfig != null && message.hasOwnProperty("soleTenantConfig")) { + var error = $root.google.container.v1.SoleTenantConfig.verify(message.soleTenantConfig); + if (error) + return "soleTenantConfig." + error; + } return null; }; @@ -3057,6 +3077,11 @@ throw TypeError(".google.container.v1.NodeConfig.ephemeralStorageLocalSsdConfig: object expected"); message.ephemeralStorageLocalSsdConfig = $root.google.container.v1.EphemeralStorageLocalSsdConfig.fromObject(object.ephemeralStorageLocalSsdConfig); } + if (object.soleTenantConfig != null) { + if (typeof object.soleTenantConfig !== "object") + throw TypeError(".google.container.v1.NodeConfig.soleTenantConfig: object expected"); + message.soleTenantConfig = $root.google.container.v1.SoleTenantConfig.fromObject(object.soleTenantConfig); + } return message; }; @@ -3110,6 +3135,7 @@ object.windowsNodeConfig = null; object.localNvmeSsdBlockConfig = null; object.ephemeralStorageLocalSsdConfig = null; + object.soleTenantConfig = null; } if (message.machineType != null && message.hasOwnProperty("machineType")) object.machineType = message.machineType; @@ -3202,6 +3228,8 @@ object.localNvmeSsdBlockConfig = $root.google.container.v1.LocalNvmeSsdBlockConfig.toObject(message.localNvmeSsdBlockConfig, options); if (message.ephemeralStorageLocalSsdConfig != null && message.hasOwnProperty("ephemeralStorageLocalSsdConfig")) object.ephemeralStorageLocalSsdConfig = $root.google.container.v1.EphemeralStorageLocalSsdConfig.toObject(message.ephemeralStorageLocalSsdConfig, options); + if (message.soleTenantConfig != null && message.hasOwnProperty("soleTenantConfig")) + object.soleTenantConfig = $root.google.container.v1.SoleTenantConfig.toObject(message.soleTenantConfig, options); return object; }; @@ -5063,6 +5091,537 @@ return ReservationAffinity; })(); + v1.SoleTenantConfig = (function() { + + /** + * Properties of a SoleTenantConfig. + * @memberof google.container.v1 + * @interface ISoleTenantConfig + * @property {Array.|null} [nodeAffinities] SoleTenantConfig nodeAffinities + */ + + /** + * Constructs a new SoleTenantConfig. + * @memberof google.container.v1 + * @classdesc Represents a SoleTenantConfig. + * @implements ISoleTenantConfig + * @constructor + * @param {google.container.v1.ISoleTenantConfig=} [properties] Properties to set + */ + function SoleTenantConfig(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoleTenantConfig nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.container.v1.SoleTenantConfig + * @instance + */ + SoleTenantConfig.prototype.nodeAffinities = $util.emptyArray; + + /** + * Creates a new SoleTenantConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {google.container.v1.ISoleTenantConfig=} [properties] Properties to set + * @returns {google.container.v1.SoleTenantConfig} SoleTenantConfig instance + */ + SoleTenantConfig.create = function create(properties) { + return new SoleTenantConfig(properties); + }; + + /** + * Encodes the specified SoleTenantConfig message. Does not implicitly {@link google.container.v1.SoleTenantConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {google.container.v1.ISoleTenantConfig} message SoleTenantConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.container.v1.SoleTenantConfig.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoleTenantConfig message, length delimited. Does not implicitly {@link google.container.v1.SoleTenantConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {google.container.v1.ISoleTenantConfig} message SoleTenantConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.SoleTenantConfig} SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.SoleTenantConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.container.v1.SoleTenantConfig.NodeAffinity.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.SoleTenantConfig} SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoleTenantConfig message. + * @function verify + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoleTenantConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.container.v1.SoleTenantConfig.NodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + return null; + }; + + /** + * Creates a SoleTenantConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.SoleTenantConfig} SoleTenantConfig + */ + SoleTenantConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.SoleTenantConfig) + return object; + var message = new $root.google.container.v1.SoleTenantConfig(); + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.container.v1.SoleTenantConfig.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.container.v1.SoleTenantConfig.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.container.v1.SoleTenantConfig.NodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SoleTenantConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {google.container.v1.SoleTenantConfig} message SoleTenantConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoleTenantConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.container.v1.SoleTenantConfig.NodeAffinity.toObject(message.nodeAffinities[j], options); + } + return object; + }; + + /** + * Converts this SoleTenantConfig to JSON. + * @function toJSON + * @memberof google.container.v1.SoleTenantConfig + * @instance + * @returns {Object.} JSON object + */ + SoleTenantConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoleTenantConfig + * @function getTypeUrl + * @memberof google.container.v1.SoleTenantConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoleTenantConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.SoleTenantConfig"; + }; + + SoleTenantConfig.NodeAffinity = (function() { + + /** + * Properties of a NodeAffinity. + * @memberof google.container.v1.SoleTenantConfig + * @interface INodeAffinity + * @property {string|null} [key] NodeAffinity key + * @property {google.container.v1.SoleTenantConfig.NodeAffinity.Operator|null} [operator] NodeAffinity operator + * @property {Array.|null} [values] NodeAffinity values + */ + + /** + * Constructs a new NodeAffinity. + * @memberof google.container.v1.SoleTenantConfig + * @classdesc Represents a NodeAffinity. + * @implements INodeAffinity + * @constructor + * @param {google.container.v1.SoleTenantConfig.INodeAffinity=} [properties] Properties to set + */ + function NodeAffinity(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeAffinity key. + * @member {string} key + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.key = ""; + + /** + * NodeAffinity operator. + * @member {google.container.v1.SoleTenantConfig.NodeAffinity.Operator} operator + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.operator = 0; + + /** + * NodeAffinity values. + * @member {Array.} values + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.values = $util.emptyArray; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @function create + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1.SoleTenantConfig.INodeAffinity=} [properties] Properties to set + * @returns {google.container.v1.SoleTenantConfig.NodeAffinity} NodeAffinity instance + */ + NodeAffinity.create = function create(properties) { + return new NodeAffinity(properties); + }; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.container.v1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1.SoleTenantConfig.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.container.v1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1.SoleTenantConfig.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.SoleTenantConfig.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.SoleTenantConfig.NodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.SoleTenantConfig.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAffinity message. + * @function verify + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.SoleTenantConfig.NodeAffinity} NodeAffinity + */ + NodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.SoleTenantConfig.NodeAffinity) + return object; + var message = new $root.google.container.v1.SoleTenantConfig.NodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.container.v1.SoleTenantConfig.NodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1.SoleTenantConfig.NodeAffinity} message NodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.operator = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.google.container.v1.SoleTenantConfig.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.container.v1.SoleTenantConfig.NodeAffinity.Operator[message.operator] : message.operator; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this NodeAffinity to JSON. + * @function toJSON + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAffinity + * @function getTypeUrl + * @memberof google.container.v1.SoleTenantConfig.NodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.SoleTenantConfig.NodeAffinity"; + }; + + /** + * Operator enum. + * @name google.container.v1.SoleTenantConfig.NodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + NodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return NodeAffinity; + })(); + + return SoleTenantConfig; + })(); + v1.NodeTaint = (function() { /** @@ -50597,6 +51156,7 @@ * @property {google.container.v1beta1.IWindowsNodeConfig|null} [windowsNodeConfig] NodeConfig windowsNodeConfig * @property {google.container.v1beta1.ILocalNvmeSsdBlockConfig|null} [localNvmeSsdBlockConfig] NodeConfig localNvmeSsdBlockConfig * @property {google.container.v1beta1.IEphemeralStorageLocalSsdConfig|null} [ephemeralStorageLocalSsdConfig] NodeConfig ephemeralStorageLocalSsdConfig + * @property {google.container.v1beta1.ISoleTenantConfig|null} [soleTenantConfig] NodeConfig soleTenantConfig */ /** @@ -50893,6 +51453,14 @@ */ NodeConfig.prototype.ephemeralStorageLocalSsdConfig = null; + /** + * NodeConfig soleTenantConfig. + * @member {google.container.v1beta1.ISoleTenantConfig|null|undefined} soleTenantConfig + * @memberof google.container.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.soleTenantConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -51006,6 +51574,8 @@ $root.google.container.v1beta1.LocalNvmeSsdBlockConfig.encode(message.localNvmeSsdBlockConfig, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); if (message.ephemeralStorageLocalSsdConfig != null && Object.hasOwnProperty.call(message, "ephemeralStorageLocalSsdConfig")) $root.google.container.v1beta1.EphemeralStorageLocalSsdConfig.encode(message.ephemeralStorageLocalSsdConfig, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.soleTenantConfig != null && Object.hasOwnProperty.call(message, "soleTenantConfig")) + $root.google.container.v1beta1.SoleTenantConfig.encode(message.soleTenantConfig, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); return writer; }; @@ -51241,6 +51811,10 @@ message.ephemeralStorageLocalSsdConfig = $root.google.container.v1beta1.EphemeralStorageLocalSsdConfig.decode(reader, reader.uint32()); break; } + case 42: { + message.soleTenantConfig = $root.google.container.v1beta1.SoleTenantConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -51449,6 +52023,11 @@ if (error) return "ephemeralStorageLocalSsdConfig." + error; } + if (message.soleTenantConfig != null && message.hasOwnProperty("soleTenantConfig")) { + var error = $root.google.container.v1beta1.SoleTenantConfig.verify(message.soleTenantConfig); + if (error) + return "soleTenantConfig." + error; + } return null; }; @@ -51621,6 +52200,11 @@ throw TypeError(".google.container.v1beta1.NodeConfig.ephemeralStorageLocalSsdConfig: object expected"); message.ephemeralStorageLocalSsdConfig = $root.google.container.v1beta1.EphemeralStorageLocalSsdConfig.fromObject(object.ephemeralStorageLocalSsdConfig); } + if (object.soleTenantConfig != null) { + if (typeof object.soleTenantConfig !== "object") + throw TypeError(".google.container.v1beta1.NodeConfig.soleTenantConfig: object expected"); + message.soleTenantConfig = $root.google.container.v1beta1.SoleTenantConfig.fromObject(object.soleTenantConfig); + } return message; }; @@ -51675,6 +52259,7 @@ object.windowsNodeConfig = null; object.localNvmeSsdBlockConfig = null; object.ephemeralStorageLocalSsdConfig = null; + object.soleTenantConfig = null; } if (message.machineType != null && message.hasOwnProperty("machineType")) object.machineType = message.machineType; @@ -51769,6 +52354,8 @@ object.localNvmeSsdBlockConfig = $root.google.container.v1beta1.LocalNvmeSsdBlockConfig.toObject(message.localNvmeSsdBlockConfig, options); if (message.ephemeralStorageLocalSsdConfig != null && message.hasOwnProperty("ephemeralStorageLocalSsdConfig")) object.ephemeralStorageLocalSsdConfig = $root.google.container.v1beta1.EphemeralStorageLocalSsdConfig.toObject(message.ephemeralStorageLocalSsdConfig, options); + if (message.soleTenantConfig != null && message.hasOwnProperty("soleTenantConfig")) + object.soleTenantConfig = $root.google.container.v1beta1.SoleTenantConfig.toObject(message.soleTenantConfig, options); return object; }; @@ -54320,6 +54907,537 @@ return ReservationAffinity; })(); + v1beta1.SoleTenantConfig = (function() { + + /** + * Properties of a SoleTenantConfig. + * @memberof google.container.v1beta1 + * @interface ISoleTenantConfig + * @property {Array.|null} [nodeAffinities] SoleTenantConfig nodeAffinities + */ + + /** + * Constructs a new SoleTenantConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents a SoleTenantConfig. + * @implements ISoleTenantConfig + * @constructor + * @param {google.container.v1beta1.ISoleTenantConfig=} [properties] Properties to set + */ + function SoleTenantConfig(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoleTenantConfig nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.container.v1beta1.SoleTenantConfig + * @instance + */ + SoleTenantConfig.prototype.nodeAffinities = $util.emptyArray; + + /** + * Creates a new SoleTenantConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {google.container.v1beta1.ISoleTenantConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.SoleTenantConfig} SoleTenantConfig instance + */ + SoleTenantConfig.create = function create(properties) { + return new SoleTenantConfig(properties); + }; + + /** + * Encodes the specified SoleTenantConfig message. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {google.container.v1beta1.ISoleTenantConfig} message SoleTenantConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoleTenantConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {google.container.v1beta1.ISoleTenantConfig} message SoleTenantConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.SoleTenantConfig} SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.SoleTenantConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoleTenantConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.SoleTenantConfig} SoleTenantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoleTenantConfig message. + * @function verify + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoleTenantConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + return null; + }; + + /** + * Creates a SoleTenantConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.SoleTenantConfig} SoleTenantConfig + */ + SoleTenantConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.SoleTenantConfig) + return object; + var message = new $root.google.container.v1beta1.SoleTenantConfig(); + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.container.v1beta1.SoleTenantConfig.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.container.v1beta1.SoleTenantConfig.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SoleTenantConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {google.container.v1beta1.SoleTenantConfig} message SoleTenantConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoleTenantConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.toObject(message.nodeAffinities[j], options); + } + return object; + }; + + /** + * Converts this SoleTenantConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.SoleTenantConfig + * @instance + * @returns {Object.} JSON object + */ + SoleTenantConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoleTenantConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.SoleTenantConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoleTenantConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.SoleTenantConfig"; + }; + + SoleTenantConfig.NodeAffinity = (function() { + + /** + * Properties of a NodeAffinity. + * @memberof google.container.v1beta1.SoleTenantConfig + * @interface INodeAffinity + * @property {string|null} [key] NodeAffinity key + * @property {google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator|null} [operator] NodeAffinity operator + * @property {Array.|null} [values] NodeAffinity values + */ + + /** + * Constructs a new NodeAffinity. + * @memberof google.container.v1beta1.SoleTenantConfig + * @classdesc Represents a NodeAffinity. + * @implements INodeAffinity + * @constructor + * @param {google.container.v1beta1.SoleTenantConfig.INodeAffinity=} [properties] Properties to set + */ + function NodeAffinity(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeAffinity key. + * @member {string} key + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.key = ""; + + /** + * NodeAffinity operator. + * @member {google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator} operator + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.operator = 0; + + /** + * NodeAffinity values. + * @member {Array.} values + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @instance + */ + NodeAffinity.prototype.values = $util.emptyArray; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1beta1.SoleTenantConfig.INodeAffinity=} [properties] Properties to set + * @returns {google.container.v1beta1.SoleTenantConfig.NodeAffinity} NodeAffinity instance + */ + NodeAffinity.create = function create(properties) { + return new NodeAffinity(properties); + }; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1beta1.SoleTenantConfig.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.container.v1beta1.SoleTenantConfig.NodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1beta1.SoleTenantConfig.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.SoleTenantConfig.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.SoleTenantConfig.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAffinity message. + * @function verify + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.SoleTenantConfig.NodeAffinity} NodeAffinity + */ + NodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity) + return object; + var message = new $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.container.v1beta1.SoleTenantConfig.NodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {google.container.v1beta1.SoleTenantConfig.NodeAffinity} message NodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.operator = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator[message.operator] : message.operator; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this NodeAffinity to JSON. + * @function toJSON + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAffinity + * @function getTypeUrl + * @memberof google.container.v1beta1.SoleTenantConfig.NodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.SoleTenantConfig.NodeAffinity"; + }; + + /** + * Operator enum. + * @name google.container.v1beta1.SoleTenantConfig.NodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + NodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return NodeAffinity; + })(); + + return SoleTenantConfig; + })(); + v1beta1.NodeTaint = (function() { /** diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index 7b38cdbe6d8f..b7620cb3c122 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -1071,6 +1071,10 @@ "ephemeralStorageLocalSsdConfig": { "type": "EphemeralStorageLocalSsdConfig", "id": 41 + }, + "soleTenantConfig": { + "type": "SoleTenantConfig", + "id": 42 } } }, @@ -1232,6 +1236,43 @@ } } }, + "SoleTenantConfig": { + "fields": { + "nodeAffinities": { + "rule": "repeated", + "type": "NodeAffinity", + "id": 1 + } + }, + "nested": { + "NodeAffinity": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "operator": { + "type": "Operator", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } + } + } + } + }, "NodeTaint": { "fields": { "key": { @@ -6134,6 +6175,10 @@ "ephemeralStorageLocalSsdConfig": { "type": "EphemeralStorageLocalSsdConfig", "id": 41 + }, + "soleTenantConfig": { + "type": "SoleTenantConfig", + "id": 42 } } }, @@ -6338,6 +6383,43 @@ } } }, + "SoleTenantConfig": { + "fields": { + "nodeAffinities": { + "rule": "repeated", + "type": "NodeAffinity", + "id": 1 + } + }, + "nested": { + "NodeAffinity": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "operator": { + "type": "Operator", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } + } + } + } + }, "NodeTaint": { "fields": { "key": { From b73a87f4f1c8d84da66ea81b88a3f2cc6704aa6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 12:27:04 -0700 Subject: [PATCH 19/46] feat: [video-stitcher] introduce GAM settings for GAM related configs and support ListOperations (#4130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: LRO changes for CdnKey and Slate methods, VodSession changes for ad tracking, and LiveSession changes for live config PiperOrigin-RevId: 519189362 Source-Link: https://github.com/googleapis/googleapis/commit/a917ece8d22d3477fa70c2bbb537763fb31767c5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae5539df1d81504f80de98f80ca9da9fb9c31039 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiJhZTU1MzlkZjFkODE1MDRmODBkZTk4ZjgwY2E5ZGE5ZmI5YzMxMDM5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat!: Update LRO metadata type to google.cloud.common.OperationMetadata BREAKING CHANGE PiperOrigin-RevId: 520405218 Source-Link: https://github.com/googleapis/googleapis/commit/4931d1b387a3f09fe63f5779fe0b4f8b20d45ce2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dd1f11489e32e15ba5a5b1a76e2b8f4748c6c1d9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiJkZDFmMTE0ODllMzJlMTViYTVhNWIxYTc2ZTJiOGY0NzQ4YzZjMWQ5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat!: Remove default_ad_break_duration from LiveConfig BREAKING CHANGE PiperOrigin-RevId: 520434307 Source-Link: https://github.com/googleapis/googleapis/commit/273994f50104cf46d1608b626ddf409bd906348a Source-Link: https://github.com/googleapis/googleapis-gen/commit/49986a12fef4f0ed9b200228347e3f5d280cc72f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiI0OTk4NmExMmZlZjRmMGVkOWIyMDAyMjgzNDdlM2Y1ZDI4MGNjNzJmIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix!: Roll back the changes that update of LRO metadata type to google.cloud.common.OperationMetadata PiperOrigin-RevId: 520464508 Source-Link: https://github.com/googleapis/googleapis/commit/cf015527b23b2d0f36357f88af5b27d689d8684b Source-Link: https://github.com/googleapis/googleapis-gen/commit/5a981d622d237b05476086408ec523ff4b7c0600 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiI1YTk4MWQ2MjJkMjM3YjA1NDc2MDg2NDA4ZWM1MjNmZjRiN2MwNjAwIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat!: introduce GAM settings for GAM related configs and support ListOperations PiperOrigin-RevId: 524328971 Source-Link: https://github.com/googleapis/googleapis/commit/a5f8761d4cd993d238536688c834d70aa143b855 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6414e5e4aa4eb9de399b3b5f36c9d1640ebcd07a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiI2NDE0ZTVlNGFhNGViOWRlMzk5YjNiNWYzNmM5ZDE2NDBlYmNkMDdhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../google-cloud-video-stitcher/README.md | 51 +- .../cloud/common/operation_metadata.proto | 53 + .../video/stitcher/v1/ad_tag_details.proto | 2 +- .../cloud/video/stitcher/v1/cdn_keys.proto | 2 +- .../cloud/video/stitcher/v1/companions.proto | 2 +- .../cloud/video/stitcher/v1/events.proto | 2 +- .../video/stitcher/v1/live_configs.proto | 140 + .../cloud/video/stitcher/v1/sessions.proto | 102 +- .../cloud/video/stitcher/v1/slates.proto | 15 +- .../video/stitcher/v1/stitch_details.proto | 8 +- .../stitcher/v1/video_stitcher_service.proto | 272 +- .../protos/protos.d.ts | 7849 ++-- .../protos/protos.js | 32553 +++++++++------- .../protos/protos.json | 801 +- .../samples/README.md | 90 +- ...tadata.google.cloud.video.stitcher.v1.json | 224 +- .../video_stitcher_service.create_cdn_key.js | 11 +- ...deo_stitcher_service.create_live_config.js | 87 + ...eo_stitcher_service.create_live_session.js | 4 +- .../v1/video_stitcher_service.create_slate.js | 19 +- ...deo_stitcher_service.create_vod_session.js | 4 +- .../video_stitcher_service.delete_cdn_key.js | 3 +- ...deo_stitcher_service.delete_live_config.js | 63 + .../v1/video_stitcher_service.delete_slate.js | 3 +- .../video_stitcher_service.get_live_config.js | 63 + .../v1/video_stitcher_service.get_slate.js | 4 +- ..._stitcher_service.get_vod_ad_tag_detail.js | 3 +- ..._stitcher_service.get_vod_stitch_detail.js | 3 +- ...ideo_stitcher_service.list_live_configs.js | 83 + .../v1/video_stitcher_service.list_slates.js | 3 +- ...titcher_service.list_vod_ad_tag_details.js | 4 +- ...titcher_service.list_vod_stitch_details.js | 4 +- .../video_stitcher_service.update_cdn_key.js | 3 +- .../v1/video_stitcher_service.update_slate.js | 3 +- .../src/v1/gapic_metadata.json | 136 +- .../src/v1/video_stitcher_service_client.ts | 2261 +- .../video_stitcher_service_client_config.json | 32 + .../v1/video_stitcher_service_proto_list.json | 1 + .../test/gapic_video_stitcher_service_v1.ts | 4010 +- 39 files changed, 31120 insertions(+), 17853 deletions(-) create mode 100644 packages/google-cloud-video-stitcher/protos/google/cloud/common/operation_metadata.proto create mode 100644 packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/live_configs.proto create mode 100644 packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js create mode 100644 packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js create mode 100644 packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js create mode 100644 packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js diff --git a/packages/google-cloud-video-stitcher/README.md b/packages/google-cloud-video-stitcher/README.md index 9dab194ba279..e1b703b8b2a9 100644 --- a/packages/google-cloud-video-stitcher/README.md +++ b/packages/google-cloud-video-stitcher/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Video Stitcher API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Video Stitcher API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-stitcher) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/video-stitcher.svg)](https://www.npmjs.org/package/@google-cloud/video-stitcher) @@ -58,32 +58,35 @@ npm install @google-cloud/video-stitcher ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-stitcher/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Video_stitcher_service.create_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js,samples/README.md) | -| Video_stitcher_service.create_live_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js,samples/README.md) | -| Video_stitcher_service.create_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js,samples/README.md) | -| Video_stitcher_service.create_vod_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js,samples/README.md) | -| Video_stitcher_service.delete_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js,samples/README.md) | -| Video_stitcher_service.delete_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js,samples/README.md) | -| Video_stitcher_service.get_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_cdn_key.js,samples/README.md) | -| Video_stitcher_service.get_live_ad_tag_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js,samples/README.md) | -| Video_stitcher_service.get_live_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_session.js,samples/README.md) | -| Video_stitcher_service.get_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js,samples/README.md) | -| Video_stitcher_service.get_vod_ad_tag_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js,samples/README.md) | -| Video_stitcher_service.get_vod_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_session.js,samples/README.md) | -| Video_stitcher_service.get_vod_stitch_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js,samples/README.md) | -| Video_stitcher_service.list_cdn_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_cdn_keys.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_cdn_keys.js,samples/README.md) | -| Video_stitcher_service.list_live_ad_tag_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_ad_tag_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_ad_tag_details.js,samples/README.md) | -| Video_stitcher_service.list_slates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js,samples/README.md) | -| Video_stitcher_service.list_vod_ad_tag_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js,samples/README.md) | -| Video_stitcher_service.list_vod_stitch_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js,samples/README.md) | -| Video_stitcher_service.update_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js,samples/README.md) | -| Video_stitcher_service.update_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/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-video-stitcher/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/test/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-video-stitcher/samples/test/quickstart.js,samples/README.md) | +| Video_stitcher_service.create_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.create_live_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.create_live_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.create_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.create_vod_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.delete_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.delete_live_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.delete_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_cdn_key.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_live_ad_tag_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_live_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_live_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_session.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_vod_ad_tag_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_vod_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_session.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_session.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.get_vod_stitch_detail | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_cdn_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_cdn_keys.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_cdn_keys.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_live_ad_tag_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_ad_tag_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_ad_tag_details.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_live_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_slates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_vod_ad_tag_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.list_vod_stitch_details | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.update_cdn_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Video_stitcher_service.update_slate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js) | [![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js,packages/google-cloud-video-stitcher/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/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-video-stitcher/samples/quickstart.js,packages/google-cloud-video-stitcher/samples/README.md) | diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/common/operation_metadata.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/common/operation_metadata.proto new file mode 100644 index 000000000000..24300e36f8ad --- /dev/null +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/common/operation_metadata.proto @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.common; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/common;common"; +option java_multiple_files = true; +option java_package = "com.google.cloud.common"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/ad_tag_details.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/ad_tag_details.proto index 1961fa9b810b..9efe99e2de14 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/ad_tag_details.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/ad_tag_details.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/cdn_keys.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/cdn_keys.proto index fd7a40200daa..1513c3da003c 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/cdn_keys.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/cdn_keys.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/companions.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/companions.proto index ef87e1994de8..a089ed150ee2 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/companions.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/companions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/events.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/events.proto index 24e4c459c803..6a538ebc6cc0 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/events.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/events.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/live_configs.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/live_configs.proto new file mode 100644 index 000000000000..1b0192ab33cb --- /dev/null +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/live_configs.proto @@ -0,0 +1,140 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.video.stitcher.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb"; +option java_multiple_files = true; +option java_outer_classname = "LiveConfigsProto"; +option java_package = "com.google.cloud.video.stitcher.v1"; + +// Determines the ad tracking policy. +enum AdTracking { + // The ad tracking policy is not specified. + AD_TRACKING_UNSPECIFIED = 0; + + // Client-side ad tracking is specified. The client player is expected to + // trigger playback and activity events itself. + CLIENT = 1; + + // The Video Stitcher API will trigger playback events on behalf of + // the client player. + SERVER = 2; +} + +// Metadata for used to register live configs. +message LiveConfig { + option (google.api.resource) = { + type: "videostitcher.googleapis.com/LiveConfig" + pattern: "projects/{project}/locations/{location}/liveConfigs/{live_config}" + }; + + // State of the live config. + enum State { + // State is not specified. + STATE_UNSPECIFIED = 0; + + // Live config is being created. + CREATING = 1; + + // Live config is ready for use. + READY = 2; + + // Live config is queued up for deletion. + DELETING = 3; + } + + // Defines the ad stitching behavior in case the ad duration does not align + // exactly with the ad break boundaries. If not specified, the default is + // `CUT_CURRENT`. + enum StitchingPolicy { + // Stitching policy is not specified. + STITCHING_POLICY_UNSPECIFIED = 0; + + // Cuts an ad short and returns to content in the middle of the ad. + CUT_CURRENT = 1; + + // Finishes stitching the current ad before returning to content. + COMPLETE_AD = 2; + } + + // Output only. The resource name of the live config, in the form of + // `projects/{project}/locations/{location}/liveConfigs/{id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Source URI for the live stream manifest. + string source_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // The default ad tag associated with this live stream config. + string ad_tag_uri = 3; + + // Additional metadata used to register a live stream with Google Ad Manager + // (GAM) + GamLiveConfig gam_live_config = 4; + + // Output only. State of the live config. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Determines how the ads are tracked. If + // [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] + // is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + AdTracking ad_tracking = 6 [(google.api.field_behavior) = REQUIRED]; + + // This must refer to a slate in the same + // project. If Google Ad Manager (GAM) is used for ads, this string sets the + // value of `slateCreativeId` in + // https://developers.google.com/ad-manager/api/reference/v202211/LiveStreamEventService.LiveStreamEvent#slateCreativeId + string default_slate = 7 [(google.api.resource_reference) = { + type: "videostitcher.googleapis.com/Slate" + }]; + + // Defines the stitcher behavior in case an ad does not align exactly with + // the ad break boundaries. If not specified, the default is `CUT_CURRENT`. + StitchingPolicy stitching_policy = 8; + + // The configuration for prefetching ads. + PrefetchConfig prefetch_config = 10; +} + +// The configuration for prefetch ads. +message PrefetchConfig { + // Required. Indicates whether the option to prefetch ad requests is enabled. + bool enabled = 1 [(google.api.field_behavior) = REQUIRED]; + + // The duration in seconds of the part of the break to be prefetched. + // This field is only relevant if prefetch is enabled. + // You should set this duration to as long as possible to increase the + // benefits of prefetching, but not longer than the shortest ad break + // expected. For example, for a live event with 30s and 60s ad breaks, the + // initial duration should be set to 30s. + google.protobuf.Duration initial_ad_request_duration = 2; +} + +// Metadata used to register a live stream with Google Ad Manager (GAM) +message GamLiveConfig { + // Required. Ad Manager network code to associate with the live config. + string network_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The asset key identifier generated for the live config. + string asset_key = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The custom asset key identifier generated for the live config. + string custom_asset_key = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/sessions.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/sessions.proto index 035e274f2021..70c30bdfd78f 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/sessions.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/sessions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/video/stitcher/v1/companions.proto"; import "google/cloud/video/stitcher/v1/events.proto"; +import "google/cloud/video/stitcher/v1/live_configs.proto"; import "google/protobuf/duration.proto"; option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb"; @@ -27,13 +28,23 @@ option java_multiple_files = true; option java_outer_classname = "SessionsProto"; option java_package = "com.google.cloud.video.stitcher.v1"; -// Metadata for a VOD session. +// Metadata for a VOD session. The session expires 4 hours after its creation. message VodSession { option (google.api.resource) = { type: "videostitcher.googleapis.com/VodSession" pattern: "projects/{project}/locations/{location}/vodSessions/{vod_session}" }; + // Defines fields related to Google Ad Manager (GAM). This should be set if + // GAM is being used for ads. + message GamSettings { + // Required. Ad Manager network code. + string network_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The stream ID generated by Ad Manager. + string stream_id = 2 [(google.api.field_behavior) = REQUIRED]; + } + // Output only. The name of the VOD session, in the form of // `projects/{project_number}/locations/{location}/vodSessions/{id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -64,19 +75,20 @@ message VodSession { // `"`https://doubleclick.google.com/ad/1?geo_id=123"` map ad_tag_macro_map = 7; - // Indicates whether client side ad tracking is enabled. If client - // side ad tracking is enabled, then the client player is expected - // to trigger playback and activity events itself. - // If this is set to false, server side ad tracking is enabled, - // causing the Video Stitcher service will trigger playback events - // on behalf of the client player. - bool client_ad_tracking = 8; - // Additional options that affect the output of the manifest. ManifestOptions manifest_options = 9; // Output only. The generated ID of the VodSession's source media. string asset_id = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Determines how the ad should be tracked. If + // [gam_vod_config][google.cloud.video.stitcher.v1.VodSession.gam_vod_config] + // is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. + AdTracking ad_tracking = 11 [(google.api.field_behavior) = REQUIRED]; + + // This field should be set with appropriate values if GAM is being used for + // ads. + GamSettings gam_settings = 13; } // Describes what was stitched into a VOD session's manifest. @@ -126,24 +138,20 @@ message VodSessionAdBreak { google.protobuf.Duration start_time_offset = 4; } -// Metadata for a live session. +// Metadata for a live session. The session expires 5 minutes after the client +// stops fetching the session's playlists. message LiveSession { option (google.api.resource) = { type: "videostitcher.googleapis.com/LiveSession" pattern: "projects/{project}/locations/{location}/liveSessions/{live_session}" }; - // Defines the stitcher behavior in case an ad does not align exactly with - // the ad break boundaries. If not specified, the default is COMPLETE_AD. - enum StitchingPolicy { - // Stitching policy is not specified. - STITCHING_POLICY_UNSPECIFIED = 0; - - // Finishes stitching the current ad before returning to content. - COMPLETE_AD = 1; - - // Cuts an ad short and returns to content in the middle of the ad. - CUT_CURRENT = 3; + // Defines fields related to Google Ad Manager (GAM). This should be set if + // GAM + // is being used for ads. + message GamSettings { + // Required. The stream ID generated by Ad Manager. + string stream_id = 1 [(google.api.field_behavior) = REQUIRED]; } // Output only. The name of the live session, in the form of @@ -153,20 +161,6 @@ message LiveSession { // Output only. The URI to play the live session's ad-stitched stream. string play_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The URI of the live session's source stream. - string source_uri = 3; - - // The default ad tag to use when no ad tag ids are specified in an ad break's - // SCTE-35 message. - // - // default_ad_tag_id is necessary when `adTagMap` has more than one key. Its - // value must be present in the `adTagMap`. - string default_ad_tag_id = 4; - - // Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos - // each with at least one audio track. - map ad_tag_map = 5; - // Key value pairs for ad tag macro replacement. If the // specified ad tag URI has macros, this field provides the mapping // to the value that will replace the macro in the ad tag URI. @@ -182,33 +176,21 @@ message LiveSession { // `"https://doubleclick.google.com/ad/1?geo_id=123"` map ad_tag_macros = 6; - // Whether client side ad tracking is enabled. If enabled, the client player - // is expected to trigger playback and activity events itself. Otherwise, - // server side ad tracking is enabled and the Video Stitcher API will trigger - // playback events on behalf of the client player. - bool client_ad_tracking = 7; - - // The default slate to use when no slates are specified in an ad break's - // SCTE-35 message. When specified, this value must match the ID for a slate - // that has already been created via the - // [CreateSlate](projects.locations.slates/create) method. - string default_slate_id = 8; - - // Defines the stitcher behavior in case an ad does not align exactly with - // the ad break boundaries. If not specified, the default is `COMPLETE_AD`. - StitchingPolicy stitching_policy = 9; - // Additional options that affect the output of the manifest. ManifestOptions manifest_options = 10; - // Output only. The generated ID of the LiveSession's source stream. - string stream_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Metadata of an ad tag. -message AdTag { - // Ad tag URI template. - string uri = 1; + // This field should be set with appropriate values if GAM is being used for + // ads. + GamSettings gam_settings = 15; + + // Required. The resource name of the live config for this session, in the + // form of `projects/{project}/locations/{location}/liveConfigs/{id}`. + string live_config = 16 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "videostitcher.googleapis.com/LiveConfig" + } + ]; } // Options for manifest generation. diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/slates.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/slates.proto index eaa516713f9e..902a444ef265 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/slates.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/slates.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -31,6 +31,16 @@ message Slate { pattern: "projects/{project}/locations/{location}/slates/{slate}" }; + // GamSlate object has Google Ad Manager (GAM) related properties for the + // slate. + message GamSlate { + // Required. Ad Manager network code to associate with the live config. + string network_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The identifier generated for the slate by GAM. + int64 gam_slate_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // Output only. The name of the slate, in the form of // `projects/{project_number}/locations/{location}/slates/{id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -38,4 +48,7 @@ message Slate { // The URI to fetch the source content for the slate. This URI must return an // MP4 video with at least one audio track. string uri = 2; + + // gam_slate has all the GAM-related attributes of slates. + GamSlate gam_slate = 3; } diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/stitch_details.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/stitch_details.proto index 293f9b14b63d..e51c72d642e9 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/stitch_details.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/stitch_details.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -50,11 +50,13 @@ message AdStitchDetail { string ad_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time offset of the processed ad. - google.protobuf.Duration ad_time_offset = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Duration ad_time_offset = 3 + [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates the reason why the ad has been skipped. string skip_reason = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. The metadata of the chosen media file for the ad. - map media = 5 [(google.api.field_behavior) = OPTIONAL]; + map media = 5 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/video_stitcher_service.proto b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/video_stitcher_service.proto index 8e86835a406b..3cd6a27f0d8b 100644 --- a/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/video_stitcher_service.proto +++ b/packages/google-cloud-video-stitcher/protos/google/cloud/video/stitcher/v1/video_stitcher_service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -22,11 +22,14 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/video/stitcher/v1/ad_tag_details.proto"; import "google/cloud/video/stitcher/v1/cdn_keys.proto"; +import "google/cloud/video/stitcher/v1/live_configs.proto"; import "google/cloud/video/stitcher/v1/sessions.proto"; import "google/cloud/video/stitcher/v1/slates.proto"; import "google/cloud/video/stitcher/v1/stitch_details.proto"; +import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb"; option java_multiple_files = true; @@ -40,15 +43,20 @@ option java_package = "com.google.cloud.video.stitcher.v1"; // content with any standard VMAP compliant ad server. service VideoStitcherService { option (google.api.default_host) = "videostitcher.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a new CDN key. - rpc CreateCdnKey(CreateCdnKeyRequest) returns (CdnKey) { + rpc CreateCdnKey(CreateCdnKeyRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/cdnKeys" body: "cdn_key" }; option (google.api.method_signature) = "parent,cdn_key,cdn_key_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.video.stitcher.v1.CdnKey" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Lists all CDN keys in the specified project and location. @@ -68,21 +76,29 @@ service VideoStitcherService { } // Deletes the specified CDN key. - rpc DeleteCdnKey(DeleteCdnKeyRequest) returns (google.protobuf.Empty) { + rpc DeleteCdnKey(DeleteCdnKeyRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/cdnKeys/*}" }; option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Updates the specified CDN key. Only update fields specified // in the call method body. - rpc UpdateCdnKey(UpdateCdnKeyRequest) returns (CdnKey) { + rpc UpdateCdnKey(UpdateCdnKeyRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{cdn_key.name=projects/*/locations/*/cdnKeys/*}" body: "cdn_key" }; option (google.api.method_signature) = "cdn_key,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.video.stitcher.v1.CdnKey" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Creates a client side playback VOD session and returns the full @@ -106,7 +122,8 @@ service VideoStitcherService { // Returns a list of detailed stitching information of the specified VOD // session. - rpc ListVodStitchDetails(ListVodStitchDetailsRequest) returns (ListVodStitchDetailsResponse) { + rpc ListVodStitchDetails(ListVodStitchDetailsRequest) + returns (ListVodStitchDetailsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/vodSessions/*}/vodStitchDetails" }; @@ -122,7 +139,8 @@ service VideoStitcherService { } // Return the list of ad tag details for the specified VOD session. - rpc ListVodAdTagDetails(ListVodAdTagDetailsRequest) returns (ListVodAdTagDetailsResponse) { + rpc ListVodAdTagDetails(ListVodAdTagDetailsRequest) + returns (ListVodAdTagDetailsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/vodSessions/*}/vodAdTagDetails" }; @@ -138,7 +156,8 @@ service VideoStitcherService { } // Return the list of ad tag details for the specified live session. - rpc ListLiveAdTagDetails(ListLiveAdTagDetailsRequest) returns (ListLiveAdTagDetailsResponse) { + rpc ListLiveAdTagDetails(ListLiveAdTagDetailsRequest) + returns (ListLiveAdTagDetailsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/liveSessions/*}/liveAdTagDetails" }; @@ -154,12 +173,16 @@ service VideoStitcherService { } // Creates a slate. - rpc CreateSlate(CreateSlateRequest) returns (Slate) { + rpc CreateSlate(CreateSlateRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/slates" body: "slate" }; option (google.api.method_signature) = "parent,slate,slate_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.video.stitcher.v1.Slate" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Lists all slates in the specified project and location. @@ -179,20 +202,28 @@ service VideoStitcherService { } // Updates the specified slate. - rpc UpdateSlate(UpdateSlateRequest) returns (Slate) { + rpc UpdateSlate(UpdateSlateRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{slate.name=projects/*/locations/*/slates/*}" body: "slate" }; option (google.api.method_signature) = "slate,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.video.stitcher.v1.Slate" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Deletes the specified slate. - rpc DeleteSlate(DeleteSlateRequest) returns (google.protobuf.Empty) { + rpc DeleteSlate(DeleteSlateRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/slates/*}" }; option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; } // Creates a new live session. @@ -211,12 +242,59 @@ service VideoStitcherService { }; option (google.api.method_signature) = "name"; } + + // Registers the live config with the provided unique ID in + // the specified region. + rpc CreateLiveConfig(CreateLiveConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/liveConfigs" + body: "live_config" + }; + option (google.api.method_signature) = "parent,live_config,live_config_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.video.stitcher.v1.LiveConfig" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; + } + + // Lists all live configs managed by the Video Stitcher that + // belong to the specified project and region. + rpc ListLiveConfigs(ListLiveConfigsRequest) + returns (ListLiveConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/liveConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified live config managed by the Video + // Stitcher service. + rpc GetLiveConfig(GetLiveConfigRequest) returns (LiveConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/liveConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified live config. + rpc DeleteLiveConfig(DeleteLiveConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/liveConfigs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.video.stitcher.v1.OperationMetadata" + }; + } } // Request message for VideoStitcherService.createCdnKey. message CreateCdnKeyRequest { - // Required. The project in which the CDN key should be created, in the form of - // `projects/{project_number}/locations/{location}`. + // Required. The project in which the CDN key should be created, in the form + // of `projects/{project_number}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -227,8 +305,8 @@ message CreateCdnKeyRequest { // Required. The CDN key resource to create. CdnKey cdn_key = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The ID to use for the CDN key, which will become the final component of - // the CDN key's resource name. + // Required. The ID to use for the CDN key, which will become the final + // component of the CDN key's resource name. // // This value should conform to RFC-1034, which restricts to // lower-case letters, numbers, and hyphen, with the first character a @@ -305,13 +383,14 @@ message UpdateCdnKeyRequest { // Required. The update mask applies to the resource. // For the `FieldMask` definition, see // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for VideoStitcherService.createVodSession message CreateVodSessionRequest { - // Required. The project and location in which the VOD session should be created, in the - // form of `projects/{project_number}/locations/{location}`. + // Required. The project and location in which the VOD session should be + // created, in the form of `projects/{project_number}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -337,8 +416,8 @@ message GetVodSessionRequest { // Request message for VideoStitcherService.listVodStitchDetails. message ListVodStitchDetailsRequest { - // Required. The VOD session where the stitch details belong to, in the form of - // `projects/{project}/locations/{location}/vodSessions/{id}`. + // Required. The VOD session where the stitch details belong to, in the form + // of `projects/{project}/locations/{location}/vodSessions/{id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -364,7 +443,8 @@ message ListVodStitchDetailsResponse { // Request message for VideoStitcherService.getVodStitchDetail. message GetVodStitchDetailRequest { - // Required. The name of the stitch detail in the specified VOD session, in the form of + // Required. The name of the stitch detail in the specified VOD session, in + // the form of // `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodStitchDetails/{id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -376,8 +456,8 @@ message GetVodStitchDetailRequest { // Request message for VideoStitcherService.listVodAdTagDetails. message ListVodAdTagDetailsRequest { - // Required. The VOD session which the ad tag details belong to, in the form of - // `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. + // Required. The VOD session which the ad tag details belong to, in the form + // of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -403,7 +483,8 @@ message ListVodAdTagDetailsResponse { // Request message for VideoStitcherService.getVodAdTagDetail message GetVodAdTagDetailRequest { - // Required. The name of the ad tag detail for the specified VOD session, in the form of + // Required. The name of the ad tag detail for the specified VOD session, in + // the form of // `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodAdTagDetails/{vod_ad_tag_detail}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -455,7 +536,7 @@ message GetLiveAdTagDetailRequest { // Request message for VideoStitcherService.createSlate. message CreateSlateRequest { // Required. The project in which the slate should be created, in the form of - // `projects/{project_number}`. + // `projects/{project_number}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -471,12 +552,27 @@ message CreateSlateRequest { // Required. The slate to create. Slate slate = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; } // Request message for VideoStitcherService.getSlate. message GetSlateRequest { - // Required. The name of the slate to be retrieved, of the slate, in the form of - // `projects/{project_number}/locations/{location}/slates/{id}`. + // Required. The name of the slate to be retrieved, of the slate, in the form + // of `projects/{project_number}/locations/{location}/slates/{id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -487,7 +583,8 @@ message GetSlateRequest { // Request message for VideoStitcherService.listSlates. message ListSlatesRequest { - // Required. The project to list slates, in the form of `projects/{project_number}`. + // Required. The project to list slates, in the form of + // `projects/{project_number}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -527,7 +624,8 @@ message UpdateSlateRequest { Slate slate = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The update mask which specifies fields which should be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for VideoStitcherService.deleteSlate. @@ -544,8 +642,8 @@ message DeleteSlateRequest { // Request message for VideoStitcherService.createLiveSession. message CreateLiveSessionRequest { - // Required. The project and location in which the live session should be created, - // in the form of `projects/{project_number}/locations/{location}`. + // Required. The project and location in which the live session should be + // created, in the form of `projects/{project_number}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -568,3 +666,115 @@ message GetLiveSessionRequest { } ]; } + +// Request message for VideoStitcherService.createLiveConfig +message CreateLiveConfigRequest { + // Required. The project in which the live config should be created, in + // the form of `projects/{project_number}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "videostitcher.googleapis.com/LiveConfig" + } + ]; + + // Required. The unique identifier ID to use for the live config. + string live_config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The live config resource to create. + LiveConfig live_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for VideoStitcherService.listLiveConfig. +message ListLiveConfigsRequest { + // Required. The project that contains the list of live configs, in the + // form of `projects/{project_number}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "videostitcher.googleapis.com/LiveConfig" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // Optional. The filter to apply to list results (see + // [Filtering](https://google.aip.dev/160)). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following + // [Cloud API + // syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for VideoStitcher.ListLiveConfig. +message ListLiveConfigsResponse { + // List of live configs. + repeated LiveConfig live_configs = 1; + + // The pagination token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for VideoStitcherService.getLiveConfig. +message GetLiveConfigRequest { + // Required. The name of the live config to be retrieved, in the form + // of + // `projects/{project_number}/locations/{location}/liveConfigs/{id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "videostitcher.googleapis.com/LiveConfig" + } + ]; +} + +// Request message for VideoStitcherService.deleteLiveConfig. +message DeleteLiveConfigRequest { + // Required. The name of the live config to be deleted, in the form of + // `projects/{project_number}/locations/{location}/liveConfigs/{id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "videostitcher.googleapis.com/LiveConfig" + } + ]; +} + +// 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; +} diff --git a/packages/google-cloud-video-stitcher/protos/protos.d.ts b/packages/google-cloud-video-stitcher/protos/protos.d.ts index 4cd8bfcdf9de..7cad6c54b8f0 100644 --- a/packages/google-cloud-video-stitcher/protos/protos.d.ts +++ b/packages/google-cloud-video-stitcher/protos/protos.d.ts @@ -1822,6 +1822,388 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** AdTracking enum. */ + enum AdTracking { + AD_TRACKING_UNSPECIFIED = 0, + CLIENT = 1, + SERVER = 2 + } + + /** Properties of a LiveConfig. */ + interface ILiveConfig { + + /** LiveConfig name */ + name?: (string|null); + + /** LiveConfig sourceUri */ + sourceUri?: (string|null); + + /** LiveConfig adTagUri */ + adTagUri?: (string|null); + + /** LiveConfig gamLiveConfig */ + gamLiveConfig?: (google.cloud.video.stitcher.v1.IGamLiveConfig|null); + + /** LiveConfig state */ + state?: (google.cloud.video.stitcher.v1.LiveConfig.State|keyof typeof google.cloud.video.stitcher.v1.LiveConfig.State|null); + + /** LiveConfig adTracking */ + adTracking?: (google.cloud.video.stitcher.v1.AdTracking|keyof typeof google.cloud.video.stitcher.v1.AdTracking|null); + + /** LiveConfig defaultSlate */ + defaultSlate?: (string|null); + + /** LiveConfig stitchingPolicy */ + stitchingPolicy?: (google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy|keyof typeof google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy|null); + + /** LiveConfig prefetchConfig */ + prefetchConfig?: (google.cloud.video.stitcher.v1.IPrefetchConfig|null); + } + + /** Represents a LiveConfig. */ + class LiveConfig implements ILiveConfig { + + /** + * Constructs a new LiveConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.ILiveConfig); + + /** LiveConfig name. */ + public name: string; + + /** LiveConfig sourceUri. */ + public sourceUri: string; + + /** LiveConfig adTagUri. */ + public adTagUri: string; + + /** LiveConfig gamLiveConfig. */ + public gamLiveConfig?: (google.cloud.video.stitcher.v1.IGamLiveConfig|null); + + /** LiveConfig state. */ + public state: (google.cloud.video.stitcher.v1.LiveConfig.State|keyof typeof google.cloud.video.stitcher.v1.LiveConfig.State); + + /** LiveConfig adTracking. */ + public adTracking: (google.cloud.video.stitcher.v1.AdTracking|keyof typeof google.cloud.video.stitcher.v1.AdTracking); + + /** LiveConfig defaultSlate. */ + public defaultSlate: string; + + /** LiveConfig stitchingPolicy. */ + public stitchingPolicy: (google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy|keyof typeof google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy); + + /** LiveConfig prefetchConfig. */ + public prefetchConfig?: (google.cloud.video.stitcher.v1.IPrefetchConfig|null); + + /** + * Creates a new LiveConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LiveConfig instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.ILiveConfig): google.cloud.video.stitcher.v1.LiveConfig; + + /** + * Encodes the specified LiveConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveConfig.verify|verify} messages. + * @param message LiveConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.ILiveConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LiveConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveConfig.verify|verify} messages. + * @param message LiveConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.ILiveConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LiveConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LiveConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.LiveConfig; + + /** + * Decodes a LiveConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LiveConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.LiveConfig; + + /** + * Verifies a LiveConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LiveConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LiveConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.LiveConfig; + + /** + * Creates a plain object from a LiveConfig message. Also converts values to other types if specified. + * @param message LiveConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.LiveConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LiveConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LiveConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LiveConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3 + } + + /** StitchingPolicy enum. */ + enum StitchingPolicy { + STITCHING_POLICY_UNSPECIFIED = 0, + CUT_CURRENT = 1, + COMPLETE_AD = 2 + } + } + + /** Properties of a PrefetchConfig. */ + interface IPrefetchConfig { + + /** PrefetchConfig enabled */ + enabled?: (boolean|null); + + /** PrefetchConfig initialAdRequestDuration */ + initialAdRequestDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a PrefetchConfig. */ + class PrefetchConfig implements IPrefetchConfig { + + /** + * Constructs a new PrefetchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IPrefetchConfig); + + /** PrefetchConfig enabled. */ + public enabled: boolean; + + /** PrefetchConfig initialAdRequestDuration. */ + public initialAdRequestDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new PrefetchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrefetchConfig instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IPrefetchConfig): google.cloud.video.stitcher.v1.PrefetchConfig; + + /** + * Encodes the specified PrefetchConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.PrefetchConfig.verify|verify} messages. + * @param message PrefetchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IPrefetchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrefetchConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.PrefetchConfig.verify|verify} messages. + * @param message PrefetchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IPrefetchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrefetchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrefetchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.PrefetchConfig; + + /** + * Decodes a PrefetchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrefetchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.PrefetchConfig; + + /** + * Verifies a PrefetchConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrefetchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrefetchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.PrefetchConfig; + + /** + * Creates a plain object from a PrefetchConfig message. Also converts values to other types if specified. + * @param message PrefetchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.PrefetchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrefetchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrefetchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GamLiveConfig. */ + interface IGamLiveConfig { + + /** GamLiveConfig networkCode */ + networkCode?: (string|null); + + /** GamLiveConfig assetKey */ + assetKey?: (string|null); + + /** GamLiveConfig customAssetKey */ + customAssetKey?: (string|null); + } + + /** Represents a GamLiveConfig. */ + class GamLiveConfig implements IGamLiveConfig { + + /** + * Constructs a new GamLiveConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IGamLiveConfig); + + /** GamLiveConfig networkCode. */ + public networkCode: string; + + /** GamLiveConfig assetKey. */ + public assetKey: string; + + /** GamLiveConfig customAssetKey. */ + public customAssetKey: string; + + /** + * Creates a new GamLiveConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GamLiveConfig instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IGamLiveConfig): google.cloud.video.stitcher.v1.GamLiveConfig; + + /** + * Encodes the specified GamLiveConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.GamLiveConfig.verify|verify} messages. + * @param message GamLiveConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IGamLiveConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GamLiveConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GamLiveConfig.verify|verify} messages. + * @param message GamLiveConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IGamLiveConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GamLiveConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GamLiveConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.GamLiveConfig; + + /** + * Decodes a GamLiveConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GamLiveConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.GamLiveConfig; + + /** + * Verifies a GamLiveConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GamLiveConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GamLiveConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.GamLiveConfig; + + /** + * Creates a plain object from a GamLiveConfig message. Also converts values to other types if specified. + * @param message GamLiveConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.GamLiveConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GamLiveConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GamLiveConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a VodSession. */ interface IVodSession { @@ -1843,14 +2225,17 @@ export namespace google { /** VodSession adTagMacroMap */ adTagMacroMap?: ({ [k: string]: string }|null); - /** VodSession clientAdTracking */ - clientAdTracking?: (boolean|null); - /** VodSession manifestOptions */ manifestOptions?: (google.cloud.video.stitcher.v1.IManifestOptions|null); /** VodSession assetId */ assetId?: (string|null); + + /** VodSession adTracking */ + adTracking?: (google.cloud.video.stitcher.v1.AdTracking|keyof typeof google.cloud.video.stitcher.v1.AdTracking|null); + + /** VodSession gamSettings */ + gamSettings?: (google.cloud.video.stitcher.v1.VodSession.IGamSettings|null); } /** Represents a VodSession. */ @@ -1880,15 +2265,18 @@ export namespace google { /** VodSession adTagMacroMap. */ public adTagMacroMap: { [k: string]: string }; - /** VodSession clientAdTracking. */ - public clientAdTracking: boolean; - /** VodSession manifestOptions. */ public manifestOptions?: (google.cloud.video.stitcher.v1.IManifestOptions|null); /** VodSession assetId. */ public assetId: string; + /** VodSession adTracking. */ + public adTracking: (google.cloud.video.stitcher.v1.AdTracking|keyof typeof google.cloud.video.stitcher.v1.AdTracking); + + /** VodSession gamSettings. */ + public gamSettings?: (google.cloud.video.stitcher.v1.VodSession.IGamSettings|null); + /** * Creates a new VodSession instance using the specified properties. * @param [properties] Properties to set @@ -1967,6 +2355,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace VodSession { + + /** Properties of a GamSettings. */ + interface IGamSettings { + + /** GamSettings networkCode */ + networkCode?: (string|null); + + /** GamSettings streamId */ + streamId?: (string|null); + } + + /** Represents a GamSettings. */ + class GamSettings implements IGamSettings { + + /** + * Constructs a new GamSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.VodSession.IGamSettings); + + /** GamSettings networkCode. */ + public networkCode: string; + + /** GamSettings streamId. */ + public streamId: string; + + /** + * Creates a new GamSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GamSettings instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.VodSession.IGamSettings): google.cloud.video.stitcher.v1.VodSession.GamSettings; + + /** + * Encodes the specified GamSettings message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.GamSettings.verify|verify} messages. + * @param message GamSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.VodSession.IGamSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GamSettings message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.GamSettings.verify|verify} messages. + * @param message GamSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.VodSession.IGamSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GamSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.VodSession.GamSettings; + + /** + * Decodes a GamSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.VodSession.GamSettings; + + /** + * Verifies a GamSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GamSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GamSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.VodSession.GamSettings; + + /** + * Creates a plain object from a GamSettings message. Also converts values to other types if specified. + * @param message GamSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.VodSession.GamSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GamSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GamSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an Interstitials. */ interface IInterstitials { @@ -2400,32 +2894,17 @@ export namespace google { /** LiveSession playUri */ playUri?: (string|null); - /** LiveSession sourceUri */ - sourceUri?: (string|null); - - /** LiveSession defaultAdTagId */ - defaultAdTagId?: (string|null); - - /** LiveSession adTagMap */ - adTagMap?: ({ [k: string]: google.cloud.video.stitcher.v1.IAdTag }|null); - /** LiveSession adTagMacros */ adTagMacros?: ({ [k: string]: string }|null); - /** LiveSession clientAdTracking */ - clientAdTracking?: (boolean|null); - - /** LiveSession defaultSlateId */ - defaultSlateId?: (string|null); - - /** LiveSession stitchingPolicy */ - stitchingPolicy?: (google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy|keyof typeof google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy|null); - /** LiveSession manifestOptions */ manifestOptions?: (google.cloud.video.stitcher.v1.IManifestOptions|null); - /** LiveSession streamId */ - streamId?: (string|null); + /** LiveSession gamSettings */ + gamSettings?: (google.cloud.video.stitcher.v1.LiveSession.IGamSettings|null); + + /** LiveSession liveConfig */ + liveConfig?: (string|null); } /** Represents a LiveSession. */ @@ -2443,32 +2922,17 @@ export namespace google { /** LiveSession playUri. */ public playUri: string; - /** LiveSession sourceUri. */ - public sourceUri: string; - - /** LiveSession defaultAdTagId. */ - public defaultAdTagId: string; - - /** LiveSession adTagMap. */ - public adTagMap: { [k: string]: google.cloud.video.stitcher.v1.IAdTag }; - /** LiveSession adTagMacros. */ public adTagMacros: { [k: string]: string }; - /** LiveSession clientAdTracking. */ - public clientAdTracking: boolean; + /** LiveSession manifestOptions. */ + public manifestOptions?: (google.cloud.video.stitcher.v1.IManifestOptions|null); - /** LiveSession defaultSlateId. */ - public defaultSlateId: string; + /** LiveSession gamSettings. */ + public gamSettings?: (google.cloud.video.stitcher.v1.LiveSession.IGamSettings|null); - /** LiveSession stitchingPolicy. */ - public stitchingPolicy: (google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy|keyof typeof google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy); - - /** LiveSession manifestOptions. */ - public manifestOptions?: (google.cloud.video.stitcher.v1.IManifestOptions|null); - - /** LiveSession streamId. */ - public streamId: string; + /** LiveSession liveConfig. */ + public liveConfig: string; /** * Creates a new LiveSession instance using the specified properties. @@ -2550,109 +3014,102 @@ export namespace google { namespace LiveSession { - /** StitchingPolicy enum. */ - enum StitchingPolicy { - STITCHING_POLICY_UNSPECIFIED = 0, - COMPLETE_AD = 1, - CUT_CURRENT = 3 - } - } - - /** Properties of an AdTag. */ - interface IAdTag { - - /** AdTag uri */ - uri?: (string|null); - } - - /** Represents an AdTag. */ - class AdTag implements IAdTag { - - /** - * Constructs a new AdTag. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.video.stitcher.v1.IAdTag); - - /** AdTag uri. */ - public uri: string; - - /** - * Creates a new AdTag instance using the specified properties. - * @param [properties] Properties to set - * @returns AdTag instance - */ - public static create(properties?: google.cloud.video.stitcher.v1.IAdTag): google.cloud.video.stitcher.v1.AdTag; - - /** - * Encodes the specified AdTag message. Does not implicitly {@link google.cloud.video.stitcher.v1.AdTag.verify|verify} messages. - * @param message AdTag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.video.stitcher.v1.IAdTag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdTag message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.AdTag.verify|verify} messages. - * @param message AdTag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.video.stitcher.v1.IAdTag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdTag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.AdTag; - - /** - * Decodes an AdTag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdTag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.AdTag; - - /** - * Verifies an AdTag message. - * @param message Plain 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 AdTag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdTag - */ - public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.AdTag; - - /** - * Creates a plain object from an AdTag message. Also converts values to other types if specified. - * @param message AdTag - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.video.stitcher.v1.AdTag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a GamSettings. */ + interface IGamSettings { - /** - * Converts this AdTag to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** GamSettings streamId */ + streamId?: (string|null); + } - /** - * Gets the default type url for AdTag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** Represents a GamSettings. */ + class GamSettings implements IGamSettings { + + /** + * Constructs a new GamSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.LiveSession.IGamSettings); + + /** GamSettings streamId. */ + public streamId: string; + + /** + * Creates a new GamSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GamSettings instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.LiveSession.IGamSettings): google.cloud.video.stitcher.v1.LiveSession.GamSettings; + + /** + * Encodes the specified GamSettings message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.GamSettings.verify|verify} messages. + * @param message GamSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.LiveSession.IGamSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GamSettings message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.GamSettings.verify|verify} messages. + * @param message GamSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.LiveSession.IGamSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GamSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.LiveSession.GamSettings; + + /** + * Decodes a GamSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.LiveSession.GamSettings; + + /** + * Verifies a GamSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GamSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GamSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.LiveSession.GamSettings; + + /** + * Creates a plain object from a GamSettings message. Also converts values to other types if specified. + * @param message GamSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.LiveSession.GamSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GamSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GamSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a ManifestOptions. */ @@ -2879,6 +3336,9 @@ export namespace google { /** Slate uri */ uri?: (string|null); + + /** Slate gamSlate */ + gamSlate?: (google.cloud.video.stitcher.v1.Slate.IGamSlate|null); } /** Represents a Slate. */ @@ -2896,6 +3356,9 @@ export namespace google { /** Slate uri. */ public uri: string; + /** Slate gamSlate. */ + public gamSlate?: (google.cloud.video.stitcher.v1.Slate.IGamSlate|null); + /** * Creates a new Slate instance using the specified properties. * @param [properties] Properties to set @@ -2974,6 +3437,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Slate { + + /** Properties of a GamSlate. */ + interface IGamSlate { + + /** GamSlate networkCode */ + networkCode?: (string|null); + + /** GamSlate gamSlateId */ + gamSlateId?: (number|Long|string|null); + } + + /** Represents a GamSlate. */ + class GamSlate implements IGamSlate { + + /** + * Constructs a new GamSlate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.Slate.IGamSlate); + + /** GamSlate networkCode. */ + public networkCode: string; + + /** GamSlate gamSlateId. */ + public gamSlateId: (number|Long|string); + + /** + * Creates a new GamSlate instance using the specified properties. + * @param [properties] Properties to set + * @returns GamSlate instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.Slate.IGamSlate): google.cloud.video.stitcher.v1.Slate.GamSlate; + + /** + * Encodes the specified GamSlate message. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.GamSlate.verify|verify} messages. + * @param message GamSlate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.Slate.IGamSlate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GamSlate message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.GamSlate.verify|verify} messages. + * @param message GamSlate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.Slate.IGamSlate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GamSlate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GamSlate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.Slate.GamSlate; + + /** + * Decodes a GamSlate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GamSlate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.Slate.GamSlate; + + /** + * Verifies a GamSlate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GamSlate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GamSlate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.Slate.GamSlate; + + /** + * Creates a plain object from a GamSlate message. Also converts values to other types if specified. + * @param message GamSlate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.Slate.GamSlate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GamSlate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GamSlate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a VodStitchDetail. */ interface IVodStitchDetail { @@ -3221,7 +3790,7 @@ export namespace google { /** * Calls CreateCdnKey. * @param request CreateCdnKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CdnKey + * @param callback Node-style callback called with the error, if any, and Operation */ public createCdnKey(request: google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.CreateCdnKeyCallback): void; @@ -3230,7 +3799,7 @@ export namespace google { * @param request CreateCdnKeyRequest message or plain object * @returns Promise */ - public createCdnKey(request: google.cloud.video.stitcher.v1.ICreateCdnKeyRequest): Promise; + public createCdnKey(request: google.cloud.video.stitcher.v1.ICreateCdnKeyRequest): Promise; /** * Calls ListCdnKeys. @@ -3263,7 +3832,7 @@ export namespace google { /** * Calls DeleteCdnKey. * @param request DeleteCdnKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * @param callback Node-style callback called with the error, if any, and Operation */ public deleteCdnKey(request: google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.DeleteCdnKeyCallback): void; @@ -3272,12 +3841,12 @@ export namespace google { * @param request DeleteCdnKeyRequest message or plain object * @returns Promise */ - public deleteCdnKey(request: google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest): Promise; + public deleteCdnKey(request: google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest): Promise; /** * Calls UpdateCdnKey. * @param request UpdateCdnKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CdnKey + * @param callback Node-style callback called with the error, if any, and Operation */ public updateCdnKey(request: google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.UpdateCdnKeyCallback): void; @@ -3286,7 +3855,7 @@ export namespace google { * @param request UpdateCdnKeyRequest message or plain object * @returns Promise */ - public updateCdnKey(request: google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest): Promise; + public updateCdnKey(request: google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest): Promise; /** * Calls CreateVodSession. @@ -3403,7 +3972,7 @@ export namespace google { /** * Calls CreateSlate. * @param request CreateSlateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Slate + * @param callback Node-style callback called with the error, if any, and Operation */ public createSlate(request: google.cloud.video.stitcher.v1.ICreateSlateRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.CreateSlateCallback): void; @@ -3412,7 +3981,7 @@ export namespace google { * @param request CreateSlateRequest message or plain object * @returns Promise */ - public createSlate(request: google.cloud.video.stitcher.v1.ICreateSlateRequest): Promise; + public createSlate(request: google.cloud.video.stitcher.v1.ICreateSlateRequest): Promise; /** * Calls ListSlates. @@ -3445,7 +4014,7 @@ export namespace google { /** * Calls UpdateSlate. * @param request UpdateSlateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Slate + * @param callback Node-style callback called with the error, if any, and Operation */ public updateSlate(request: google.cloud.video.stitcher.v1.IUpdateSlateRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.UpdateSlateCallback): void; @@ -3454,12 +4023,12 @@ export namespace google { * @param request UpdateSlateRequest message or plain object * @returns Promise */ - public updateSlate(request: google.cloud.video.stitcher.v1.IUpdateSlateRequest): Promise; + public updateSlate(request: google.cloud.video.stitcher.v1.IUpdateSlateRequest): Promise; /** * Calls DeleteSlate. * @param request DeleteSlateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * @param callback Node-style callback called with the error, if any, and Operation */ public deleteSlate(request: google.cloud.video.stitcher.v1.IDeleteSlateRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.DeleteSlateCallback): void; @@ -3468,7 +4037,7 @@ export namespace google { * @param request DeleteSlateRequest message or plain object * @returns Promise */ - public deleteSlate(request: google.cloud.video.stitcher.v1.IDeleteSlateRequest): Promise; + public deleteSlate(request: google.cloud.video.stitcher.v1.IDeleteSlateRequest): Promise; /** * Calls CreateLiveSession. @@ -3497,6 +4066,62 @@ export namespace google { * @returns Promise */ public getLiveSession(request: google.cloud.video.stitcher.v1.IGetLiveSessionRequest): Promise; + + /** + * Calls CreateLiveConfig. + * @param request CreateLiveConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createLiveConfig(request: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveConfigCallback): void; + + /** + * Calls CreateLiveConfig. + * @param request CreateLiveConfigRequest message or plain object + * @returns Promise + */ + public createLiveConfig(request: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest): Promise; + + /** + * Calls ListLiveConfigs. + * @param request ListLiveConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLiveConfigsResponse + */ + public listLiveConfigs(request: google.cloud.video.stitcher.v1.IListLiveConfigsRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveConfigsCallback): void; + + /** + * Calls ListLiveConfigs. + * @param request ListLiveConfigsRequest message or plain object + * @returns Promise + */ + public listLiveConfigs(request: google.cloud.video.stitcher.v1.IListLiveConfigsRequest): Promise; + + /** + * Calls GetLiveConfig. + * @param request GetLiveConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LiveConfig + */ + public getLiveConfig(request: google.cloud.video.stitcher.v1.IGetLiveConfigRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveConfigCallback): void; + + /** + * Calls GetLiveConfig. + * @param request GetLiveConfigRequest message or plain object + * @returns Promise + */ + public getLiveConfig(request: google.cloud.video.stitcher.v1.IGetLiveConfigRequest): Promise; + + /** + * Calls DeleteLiveConfig. + * @param request DeleteLiveConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteLiveConfig(request: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, callback: google.cloud.video.stitcher.v1.VideoStitcherService.DeleteLiveConfigCallback): void; + + /** + * Calls DeleteLiveConfig. + * @param request DeleteLiveConfigRequest message or plain object + * @returns Promise + */ + public deleteLiveConfig(request: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest): Promise; } namespace VideoStitcherService { @@ -3504,9 +4129,9 @@ export namespace google { /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createCdnKey}. * @param error Error, if any - * @param [response] CdnKey + * @param [response] Operation */ - type CreateCdnKeyCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.CdnKey) => void; + type CreateCdnKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listCdnKeys}. @@ -3525,16 +4150,16 @@ export namespace google { /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteCdnKey}. * @param error Error, if any - * @param [response] Empty + * @param [response] Operation */ - type DeleteCdnKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type DeleteCdnKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateCdnKey}. * @param error Error, if any - * @param [response] CdnKey + * @param [response] Operation */ - type UpdateCdnKeyCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.CdnKey) => void; + type UpdateCdnKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createVodSession}. @@ -3595,9 +4220,9 @@ export namespace google { /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createSlate}. * @param error Error, if any - * @param [response] Slate + * @param [response] Operation */ - type CreateSlateCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.Slate) => void; + type CreateSlateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listSlates}. @@ -3616,16 +4241,16 @@ export namespace google { /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateSlate}. * @param error Error, if any - * @param [response] Slate + * @param [response] Operation */ - type UpdateSlateCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.Slate) => void; + type UpdateSlateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteSlate}. * @param error Error, if any - * @param [response] Empty + * @param [response] Operation */ - type DeleteSlateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type DeleteSlateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createLiveSession}. @@ -3640,6 +4265,34 @@ export namespace google { * @param [response] LiveSession */ type GetLiveSessionCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.LiveSession) => void; + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createLiveConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateLiveConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listLiveConfigs}. + * @param error Error, if any + * @param [response] ListLiveConfigsResponse + */ + type ListLiveConfigsCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.ListLiveConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveConfig}. + * @param error Error, if any + * @param [response] LiveConfig + */ + type GetLiveConfigCallback = (error: (Error|null), response?: google.cloud.video.stitcher.v1.LiveConfig) => void; + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteLiveConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteLiveConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateCdnKeyRequest. */ @@ -5416,6 +6069,9 @@ export namespace google { /** CreateSlateRequest slate */ slate?: (google.cloud.video.stitcher.v1.ISlate|null); + + /** CreateSlateRequest requestId */ + requestId?: (string|null); } /** Represents a CreateSlateRequest. */ @@ -5436,6 +6092,9 @@ export namespace google { /** CreateSlateRequest slate. */ public slate?: (google.cloud.video.stitcher.v1.ISlate|null); + /** CreateSlateRequest requestId. */ + public requestId: string; + /** * Creates a new CreateSlateRequest instance using the specified properties. * @param [properties] Properties to set @@ -6240,4599 +6899,6547 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - } - } - } - /** Namespace api. */ - namespace api { + /** Properties of a CreateLiveConfigRequest. */ + interface ICreateLiveConfigRequest { - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** CreateLiveConfigRequest parent */ + parent?: (string|null); - /** ResourceDescriptor type */ - type?: (string|null); + /** CreateLiveConfigRequest liveConfigId */ + liveConfigId?: (string|null); - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** CreateLiveConfigRequest liveConfig */ + liveConfig?: (google.cloud.video.stitcher.v1.ILiveConfig|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** CreateLiveConfigRequest requestId */ + requestId?: (string|null); + } - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** Represents a CreateLiveConfigRequest. */ + class CreateLiveConfigRequest implements ICreateLiveConfigRequest { - /** ResourceDescriptor plural */ - plural?: (string|null); + /** + * Constructs a new CreateLiveConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest); - /** ResourceDescriptor singular */ - singular?: (string|null); + /** CreateLiveConfigRequest parent. */ + public parent: string; - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } + /** CreateLiveConfigRequest liveConfigId. */ + public liveConfigId: string; - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** CreateLiveConfigRequest liveConfig. */ + public liveConfig?: (google.cloud.video.stitcher.v1.ILiveConfig|null); - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); + /** CreateLiveConfigRequest requestId. */ + public requestId: string; - /** ResourceDescriptor type. */ - public type: string; + /** + * Creates a new CreateLiveConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLiveConfigRequest instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest): google.cloud.video.stitcher.v1.CreateLiveConfigRequest; - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** + * Encodes the specified CreateLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveConfigRequest.verify|verify} messages. + * @param message CreateLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor nameField. */ - public nameField: string; + /** + * Encodes the specified CreateLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveConfigRequest.verify|verify} messages. + * @param message CreateLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** + * Decodes a CreateLiveConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.CreateLiveConfigRequest; - /** ResourceDescriptor plural. */ - public plural: string; + /** + * Decodes a CreateLiveConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.CreateLiveConfigRequest; - /** ResourceDescriptor singular. */ - public singular: string; + /** + * Verifies a CreateLiveConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** + * Creates a CreateLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLiveConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.CreateLiveConfigRequest; - /** - * 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; + /** + * Creates a plain object from a CreateLiveConfigRequest message. Also converts values to other types if specified. + * @param message CreateLiveConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.CreateLiveConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this CreateLiveConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * Gets the default type url for CreateLiveConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * 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 + /** Properties of a ListLiveConfigsRequest. */ + interface IListLiveConfigsRequest { + + /** ListLiveConfigsRequest parent */ + parent?: (string|null); + + /** ListLiveConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListLiveConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListLiveConfigsRequest filter */ + filter?: (string|null); + + /** ListLiveConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListLiveConfigsRequest. */ + class ListLiveConfigsRequest implements IListLiveConfigsRequest { + + /** + * Constructs a new ListLiveConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IListLiveConfigsRequest); + + /** ListLiveConfigsRequest parent. */ + public parent: string; + + /** ListLiveConfigsRequest pageSize. */ + public pageSize: number; + + /** ListLiveConfigsRequest pageToken. */ + public pageToken: string; + + /** ListLiveConfigsRequest filter. */ + public filter: string; + + /** ListLiveConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListLiveConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLiveConfigsRequest instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IListLiveConfigsRequest): google.cloud.video.stitcher.v1.ListLiveConfigsRequest; + + /** + * Encodes the specified ListLiveConfigsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsRequest.verify|verify} messages. + * @param message ListLiveConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IListLiveConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLiveConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsRequest.verify|verify} messages. + * @param message ListLiveConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IListLiveConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLiveConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLiveConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.ListLiveConfigsRequest; + + /** + * Decodes a ListLiveConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLiveConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.ListLiveConfigsRequest; + + /** + * Verifies a ListLiveConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLiveConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLiveConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.ListLiveConfigsRequest; + + /** + * Creates a plain object from a ListLiveConfigsRequest message. Also converts values to other types if specified. + * @param message ListLiveConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.ListLiveConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLiveConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLiveConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLiveConfigsResponse. */ + interface IListLiveConfigsResponse { + + /** ListLiveConfigsResponse liveConfigs */ + liveConfigs?: (google.cloud.video.stitcher.v1.ILiveConfig[]|null); + + /** ListLiveConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListLiveConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListLiveConfigsResponse. */ + class ListLiveConfigsResponse implements IListLiveConfigsResponse { + + /** + * Constructs a new ListLiveConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IListLiveConfigsResponse); + + /** ListLiveConfigsResponse liveConfigs. */ + public liveConfigs: google.cloud.video.stitcher.v1.ILiveConfig[]; + + /** ListLiveConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListLiveConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListLiveConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLiveConfigsResponse instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IListLiveConfigsResponse): google.cloud.video.stitcher.v1.ListLiveConfigsResponse; + + /** + * Encodes the specified ListLiveConfigsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsResponse.verify|verify} messages. + * @param message ListLiveConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IListLiveConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLiveConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsResponse.verify|verify} messages. + * @param message ListLiveConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IListLiveConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLiveConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLiveConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.ListLiveConfigsResponse; + + /** + * Decodes a ListLiveConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLiveConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.ListLiveConfigsResponse; + + /** + * Verifies a ListLiveConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLiveConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLiveConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.ListLiveConfigsResponse; + + /** + * Creates a plain object from a ListLiveConfigsResponse message. Also converts values to other types if specified. + * @param message ListLiveConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.ListLiveConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLiveConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLiveConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLiveConfigRequest. */ + interface IGetLiveConfigRequest { + + /** GetLiveConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetLiveConfigRequest. */ + class GetLiveConfigRequest implements IGetLiveConfigRequest { + + /** + * Constructs a new GetLiveConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IGetLiveConfigRequest); + + /** GetLiveConfigRequest name. */ + public name: string; + + /** + * Creates a new GetLiveConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLiveConfigRequest instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IGetLiveConfigRequest): google.cloud.video.stitcher.v1.GetLiveConfigRequest; + + /** + * Encodes the specified GetLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveConfigRequest.verify|verify} messages. + * @param message GetLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IGetLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveConfigRequest.verify|verify} messages. + * @param message GetLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IGetLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLiveConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.GetLiveConfigRequest; + + /** + * Decodes a GetLiveConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.GetLiveConfigRequest; + + /** + * Verifies a GetLiveConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLiveConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.GetLiveConfigRequest; + + /** + * Creates a plain object from a GetLiveConfigRequest message. Also converts values to other types if specified. + * @param message GetLiveConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.GetLiveConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLiveConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLiveConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteLiveConfigRequest. */ + interface IDeleteLiveConfigRequest { + + /** DeleteLiveConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteLiveConfigRequest. */ + class DeleteLiveConfigRequest implements IDeleteLiveConfigRequest { + + /** + * Constructs a new DeleteLiveConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest); + + /** DeleteLiveConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteLiveConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLiveConfigRequest instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest): google.cloud.video.stitcher.v1.DeleteLiveConfigRequest; + + /** + * Encodes the specified DeleteLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteLiveConfigRequest.verify|verify} messages. + * @param message DeleteLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteLiveConfigRequest.verify|verify} messages. + * @param message DeleteLiveConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLiveConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.stitcher.v1.DeleteLiveConfigRequest; + + /** + * Decodes a DeleteLiveConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.stitcher.v1.DeleteLiveConfigRequest; + + /** + * Verifies a DeleteLiveConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLiveConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.stitcher.v1.DeleteLiveConfigRequest; + + /** + * Creates a plain object from a DeleteLiveConfigRequest message. Also converts values to other types if specified. + * @param message DeleteLiveConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.stitcher.v1.DeleteLiveConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLiveConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLiveConfigRequest + * @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); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.stitcher.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; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.video.stitcher.v1.IOperationMetadata): google.cloud.video.stitcher.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.stitcher.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.video.stitcher.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.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.video.stitcher.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.video.stitcher.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.video.stitcher.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.video.stitcher.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.video.stitcher.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; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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; + } + + /** 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 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; + } + } + + /** 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.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; /** - * Verifies a ResourceDescriptor message. + * 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 a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns ExtensionRangeOptions */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * 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.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this ExtensionRangeOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourceDescriptor + * Gets the default type url for ExtensionRangeOptions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ResourceDescriptor { + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } + /** FieldDescriptorProto name */ + name?: (string|null); - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** FieldDescriptorProto number */ + number?: (number|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - /** ResourceReference type */ - type?: (string|null); + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - /** ResourceReference childType */ - childType?: (string|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 ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { /** - * Constructs a new ResourceReference. + * Constructs a new FieldDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** ResourceReference type. */ - public type: string; + /** FieldDescriptorProto name. */ + public name: string; - /** ResourceReference childType. */ - public childType: 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 ResourceReference instance using the specified properties. + * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns FieldDescriptorProto instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldDescriptorProto, 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 + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * 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 ResourceReference + * @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.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @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.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; /** - * Verifies a ResourceReference message. + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns FieldDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * 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.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this FieldDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourceReference + * 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; } - /** 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 + 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 a Http. */ - interface IHttp { + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** OneofDescriptorProto name */ + name?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { /** - * Constructs a new Http. + * Constructs a new OneofDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.protobuf.IOneofDescriptorProto); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** OneofDescriptorProto name. */ + public name: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); /** - * Creates a new Http instance using the specified properties. + * Creates a new OneofDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns OneofDescriptorProto instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofDescriptorProto, 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 + * 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * 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 Http + * @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.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @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.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; /** - * Verifies a Http message. + * 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 a Http message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns OneofDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * 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.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this OneofDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Http + * 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 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); + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { - /** HttpRule patch */ - patch?: (string|null); + /** EnumDescriptorProto name */ + name?: (string|null); - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - /** HttpRule body */ - body?: (string|null); + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); - /** HttpRule responseBody */ - responseBody?: (string|null); + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { /** - * Constructs a new HttpRule. + * Constructs a new EnumDescriptorProto. * @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); + constructor(properties?: google.protobuf.IEnumDescriptorProto); - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** EnumDescriptorProto name. */ + public name: string; - /** HttpRule body. */ - public body: string; + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; - /** HttpRule responseBody. */ - public responseBody: string; + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns EnumDescriptorProto instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * 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.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumDescriptorProto, 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 + * 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.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * 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 HttpRule + * @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.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @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.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; /** - * Verifies a HttpRule message. + * 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 a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns EnumDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * 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.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this EnumDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for HttpRule + * 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; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + namespace EnumDescriptorProto { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { - /** CustomHttpPattern path */ - path?: (string|null); - } + /** EnumReservedRange start */ + start?: (number|null); - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** EnumReservedRange end */ + end?: (number|null); + } - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { - /** CustomHttpPattern kind. */ - public kind: string; + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - /** CustomHttpPattern path. */ - public path: string; + /** EnumReservedRange start. */ + public start: number; - /** - * 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; + /** EnumReservedRange end. */ + public end: number; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; - /** - * 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; + /** + * 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; + } } - } - /** Namespace protobuf. */ - namespace protobuf { + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** EnumValueDescriptorProto name */ + name?: (string|null); - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { /** - * Constructs a new FileDescriptorSet. + * Constructs a new EnumValueDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new EnumValueDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorSet instance + * @returns EnumValueDescriptorProto instance */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueDescriptorProto, 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 + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * 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 FileDescriptorSet + * @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.FileDescriptorSet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet + * @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.FileDescriptorSet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; /** - * Verifies a FileDescriptorSet message. + * 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 a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorSet + * @returns EnumValueDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet + * 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.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorSet to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorSet + * 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 FileDescriptorProto. */ - interface IFileDescriptorProto { + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { - /** FileDescriptorProto name */ + /** ServiceDescriptorProto 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); + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** FileDescriptorProto edition */ - edition?: (string|null); + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|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[]; + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** ServiceDescriptorProto name. */ + public name: string; - /** FileDescriptorProto syntax. */ - public syntax: string; + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** FileDescriptorProto edition. */ - public edition: string; + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new ServiceDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorProto instance + * @returns ServiceDescriptorProto instance */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceDescriptorProto, 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 + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * 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 FileDescriptorProto + * @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.FileDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto + * @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.FileDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; /** - * Verifies a FileDescriptorProto message. + * 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorProto + * @returns ServiceDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto + * 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.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this ServiceDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorProto + * 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 DescriptorProto. */ - interface IDescriptorProto { + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** DescriptorProto name */ + /** MethodDescriptorProto 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); + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); } - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { /** - * Constructs a new DescriptorProto. + * Constructs a new MethodDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDescriptorProto); + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** DescriptorProto name. */ + /** MethodDescriptorProto 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[]; + /** MethodDescriptorProto inputType. */ + public inputType: string; - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** MethodDescriptorProto outputType. */ + public outputType: string; - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new MethodDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns DescriptorProto instance + * @returns MethodDescriptorProto instance */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodDescriptorProto, 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 + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * 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 DescriptorProto + * @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.DescriptorProto; + 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); - /** - * 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; + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); - /** - * 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); + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (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; + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); - /** - * 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 }; + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** - * 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; - } + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - namespace DescriptorProto { + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** ExtensionRange start */ - start?: (number|null); + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** ExtensionRange end */ - end?: (number|null); + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + /** FileOptions javaPackage. */ + public javaPackage: string; - /** ExtensionRange start. */ - public start: number; + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** ExtensionRange end. */ - public end: number; + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; - /** - * 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; + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; - /** - * 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; + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - /** - * 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; + /** FileOptions goPackage. */ + public goPackage: string; - /** - * 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; + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; - /** - * 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; + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; - /** - * 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); + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; - /** - * 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; + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; - /** - * 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 }; + /** FileOptions deprecated. */ + public deprecated: boolean; - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; - /** - * 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; - } + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; - /** Properties of a ReservedRange. */ - interface IReservedRange { + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; - /** ReservedRange start */ - start?: (number|null); + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; - /** ReservedRange end */ - end?: (number|null); - } + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** FileOptions phpNamespace. */ + public phpNamespace: string; - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; - /** ReservedRange start. */ - public start: number; + /** FileOptions rubyPackage. */ + public rubyPackage: string; - /** ReservedRange end. */ - public end: number; + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * 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; + /** + * 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 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 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; - /** - * 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 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; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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; - /** - * 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 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 }; - /** - * 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; + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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 }; + /** + * 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; + } - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + namespace FileOptions { - /** - * 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; + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 } } - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** ExtensionRangeOptions uninterpretedOption */ + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { /** - * Constructs a new ExtensionRangeOptions. + * Constructs a new MessageOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + constructor(properties?: google.protobuf.IMessageOptions); - /** ExtensionRangeOptions uninterpretedOption. */ + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance + * @returns MessageOptions instance */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMessageOptions, 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 + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * 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 ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; /** - * Verifies an ExtensionRangeOptions message. + * 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 an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRangeOptions + * @returns MessageOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions + * 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.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRangeOptions to JSON. + * Converts this MessageOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExtensionRangeOptions + * 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 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); + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** FieldDescriptorProto typeName */ - typeName?: (string|null); + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** FieldDescriptorProto extendee */ - extendee?: (string|null); + /** FieldOptions packed */ + packed?: (boolean|null); - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } + /** FieldOptions weak */ + weak?: (boolean|null); - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); - /** FieldDescriptorProto name. */ - public name: string; + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } - /** FieldDescriptorProto number. */ - public number: number; + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** FieldDescriptorProto typeName. */ - public typeName: string; + /** FieldOptions packed. */ + public packed: boolean; - /** FieldDescriptorProto extendee. */ - public extendee: string; + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; + /** FieldOptions lazy. */ + public lazy: boolean; - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** FieldOptions weak. */ + public weak: boolean; - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FieldDescriptorProto instance + * @returns FieldOptions instance */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldOptions, 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 + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * 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 FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; /** - * Verifies a FieldDescriptorProto message. + * 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldDescriptorProto + * @returns FieldOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto + * 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.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this FieldOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldDescriptorProto + * 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 FieldDescriptorProto { + namespace FieldOptions { - /** 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 + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 } - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 } } - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { /** - * Constructs a new OneofDescriptorProto. + * Constructs a new OneofOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; + constructor(properties?: google.protobuf.IOneofOptions); - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @param [properties] Properties to set - * @returns OneofDescriptorProto instance + * @returns OneofOptions instance */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofOptions, 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 + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * 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 OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; /** - * Verifies an OneofDescriptorProto message. + * 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofDescriptorProto + * @returns OneofOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto + * 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.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofDescriptorProto to JSON. + * Converts this OneofOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofDescriptorProto + * 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 EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { /** - * Constructs a new EnumDescriptorProto. + * Constructs a new EnumOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; + constructor(properties?: google.protobuf.IEnumOptions); - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumDescriptorProto instance + * @returns EnumOptions instance */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumOptions, 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 + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * 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 EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; /** - * Verifies an EnumDescriptorProto message. + * 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumDescriptorProto + * @returns EnumOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto + * 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.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this EnumOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumDescriptorProto + * 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; } - 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); + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new EnumValueOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; + constructor(properties?: google.protobuf.IEnumValueOptions); - /** EnumValueDescriptorProto number. */ - public number: number; + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance + * @returns EnumValueOptions instance */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueOptions, 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 + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * 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 EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; /** - * Verifies an EnumValueDescriptorProto message. + * 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueDescriptorProto + * @returns EnumValueOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto + * 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.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueDescriptorProto + * 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 ServiceDescriptorProto. */ - interface IServiceDescriptorProto { + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** ServiceDescriptorProto name */ - name?: (string|null); + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); } - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new ServiceOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; + constructor(properties?: google.protobuf.IServiceOptions); - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance + * @returns ServiceOptions instance */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceOptions, 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 + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * 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 ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; /** - * Verifies a ServiceDescriptorProto message. + * 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceDescriptorProto + * @returns ServiceOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto + * 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.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServiceDescriptorProto + * 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 MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** MethodDescriptorProto name */ - name?: (string|null); + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); } - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { /** - * Constructs a new MethodDescriptorProto. + * Constructs a new MethodOptions. * @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; + constructor(properties?: google.protobuf.IMethodOptions); - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @param [properties] Properties to set - * @returns MethodDescriptorProto instance + * @returns MethodOptions instance */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodOptions, 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 + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * 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 MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; /** - * Verifies a MethodDescriptorProto message. + * 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodDescriptorProto + * @returns MethodOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto + * 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.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodDescriptorProto to JSON. + * Converts this MethodOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodDescriptorProto + * 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; } - /** 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; + namespace MethodOptions { - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** FileOptions goPackage. */ - public goPackage: string; + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** FileOptions deprecated. */ - public deprecated: boolean; + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns FileOptions instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, 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 + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileOptions message from the specified reader or buffer. + * 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 FileOptions + * @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.FileOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileOptions + * @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.FileOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies a FileOptions message. + * 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 a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileOptions + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions + * 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.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileOptions to JSON. + * Converts this UninterpretedOption to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileOptions + * 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 FileOptions { + namespace UninterpretedOption { - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; } - } - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** Represents a NamePart. */ + class NamePart implements INamePart { - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** NamePart namePart. */ + public namePart: string; - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** NamePart isExtension. */ + public isExtension: boolean; - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** + * 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; - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * 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; - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } + /** + * 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; - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** + * 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; - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); + /** + * 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; - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; + /** + * 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); - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; + /** + * 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); + } - /** MessageOptions deprecated. */ - public deprecated: boolean; + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { - /** MessageOptions mapEntry. */ - public mapEntry: boolean; + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MessageOptions instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, 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 + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * 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 MessageOptions + * @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.MessageOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageOptions + * @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.MessageOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a MessageOptions message. + * 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageOptions + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions + * 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.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageOptions to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MessageOptions + * 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; } - /** Properties of a FieldOptions. */ - interface IFieldOptions { + namespace SourceCodeInfo { - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** Properties of a Location. */ + interface ILocation { - /** FieldOptions packed */ - packed?: (boolean|null); + /** Location path */ + path?: (number[]|null); - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** Location span */ + span?: (number[]|null); - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); + /** Location trailingComments */ + trailingComments?: (string|null); - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } - /** FieldOptions weak */ - weak?: (boolean|null); + /** Represents a Location. */ + class Location implements ILocation { - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); + /** Location path. */ + public path: number[]; - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - } + /** Location span. */ + public span: number[]; - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** Location leadingComments. */ + public leadingComments: string; - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); + /** Location trailingComments. */ + public trailingComments: string; - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** FieldOptions packed. */ - public packed: boolean; + /** + * 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; - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + /** + * 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; - /** FieldOptions lazy. */ - public lazy: boolean; + /** + * 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; - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; + /** + * 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; - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** + * 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; - /** FieldOptions weak. */ - public weak: boolean; + /** + * 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); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * 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 { /** - * Creates a new FieldOptions instance using the specified properties. + * Constructs a new GeneratedCodeInfo. * @param [properties] Properties to set - * @returns FieldOptions instance */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, 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 + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * 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 FieldOptions + * @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.FieldOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldOptions + * @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.FieldOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies a FieldOptions message. + * 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldOptions + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions + * 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.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldOptions to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldOptions + * 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 FieldOptions { + namespace GeneratedCodeInfo { - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 + /** 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); } - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 + /** 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 an OneofOptions. */ - interface IOneofOptions { + /** Properties of a Duration. */ + interface IDuration { - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); } - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new OneofOptions. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofOptions); + constructor(properties?: google.protobuf.IDuration); - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns OneofOptions instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode + * 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.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, 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 + * 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.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * 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 OneofOptions + * @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.OneofOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofOptions + * @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.OneofOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies an OneofOptions message. + * 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 an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofOptions + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions + * 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.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofOptions to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofOptions + * 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 EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** Properties of a Struct. */ + interface IStruct { - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** Represents a Struct. */ + class Struct implements IStruct { /** - * Constructs a new EnumOptions. + * Constructs a new Struct. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.IStruct); - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @param [properties] Properties to set - * @returns EnumOptions instance + * @returns Struct instance */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IStruct, 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 + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumOptions + * @returns Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumOptions + * @returns Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; /** - * Verifies an EnumOptions message. + * Verifies a Struct message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumOptions + * @returns Struct */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumOptions to JSON. + * Converts this Struct to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for Struct * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** Properties of a Value. */ + interface IValue { - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); } - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** Represents a Value. */ + class Value implements IValue { /** - * Constructs a new EnumValueOptions. + * Constructs a new Value. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueOptions); + constructor(properties?: google.protobuf.IValue); - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Value instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueOptions instance + * @returns Value instance */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IValue, 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 + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumValueOptions + * @returns Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueOptions + * @returns Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; /** - * Verifies an EnumValueOptions message. + * Verifies a Value message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueOptions + * @returns Value */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for Value * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** Properties of a ListValue. */ + interface IListValue { - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); } - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** Represents a ListValue. */ + class ListValue implements IListValue { /** - * Constructs a new ServiceOptions. + * Constructs a new ListValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.IListValue); - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** ListValue values. */ + public values: google.protobuf.IValue[]; /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceOptions instance + * @returns ListValue instance */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IListValue, 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 + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceOptions + * @returns ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceOptions + * @returns ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; /** - * Verifies a ServiceOptions message. + * Verifies a ListValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceOptions + * @returns ListValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceOptions to JSON. + * Converts this ListValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for ListValue * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a 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); + /** Properties of an Any. */ + interface IAny { - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Any type_url */ + type_url?: (string|null); - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new MethodOptions. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.IAny); - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** Any type_url. */ + public type_url: string; - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns Any instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * 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.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IAny, 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 + * 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.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * 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 MethodOptions + * @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.MethodOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @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.MethodOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; /** - * Verifies a MethodOptions message. + * 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 a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * 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.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this Any to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for Any * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace 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); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new UninterpretedOption. + * Constructs a new Empty. * @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; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns UninterpretedOption instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * 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.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, 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 + * 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.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * 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 UninterpretedOption + * @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.UninterpretedOption; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @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.UninterpretedOption; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies an UninterpretedOption message. + * 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * 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.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for Empty * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } + /** Properties of a FieldMask. */ + interface IFieldMask { - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** FieldMask paths */ + paths?: (string[]|null); + } - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { - /** NamePart namePart. */ - public namePart: string; + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); - /** NamePart isExtension. */ - public isExtension: boolean; + /** FieldMask paths. */ + public paths: string[]; - /** - * 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; + /** + * 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 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 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 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; + /** + * 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 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 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 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this FieldMask 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; - } + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new SourceCodeInfo. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + constructor(properties?: google.protobuf.ITimestamp); - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, 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 + * 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.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * 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 SourceCodeInfo + * @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.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @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.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies a SourceCodeInfo message. + * 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * 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.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SourceCodeInfo + * 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; } + } - namespace SourceCodeInfo { + /** Namespace longrunning. */ + namespace longrunning { - /** Properties of a Location. */ - interface ILocation { + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { - /** Location path */ - path?: (number[]|null); + /** + * 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); - /** Location span */ - span?: (number[]|null); + /** + * 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; - /** Location leadingComments */ - leadingComments?: (string|null); + /** + * 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; - /** Location trailingComments */ - trailingComments?: (string|null); + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } + /** + * 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; - /** Represents a Location. */ - class Location implements ILocation { + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** + * 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; - /** Location path. */ - public path: number[]; + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - /** Location span. */ - public span: number[]; + /** + * 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; - /** Location leadingComments. */ - public leadingComments: string; + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - /** Location trailingComments. */ - public trailingComments: string; + /** + * 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; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } - /** - * 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; + namespace Operations { - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this Operation 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; - } + /** + * 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 GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + /** GetOperationRequest name */ + name?: (string|null); } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new GetOperationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + constructor(properties?: google.longrunning.IGetOperationRequest); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** GetOperationRequest name. */ + public name: string; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new GetOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns GetOperationRequest instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IGetOperationRequest, 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 + * 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * 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 GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; /** - * Verifies a GeneratedCodeInfo message. + * 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns GetOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * 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.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this GetOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GeneratedCodeInfo + * 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; } - 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); + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } + /** ListOperationsRequest name */ + name?: (string|null); - /** Represents an Annotation. */ - class Annotation implements IAnnotation { + /** ListOperationsRequest filter */ + filter?: (string|null); - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); - /** Annotation path. */ - public path: number[]; + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } - /** Annotation sourceFile. */ - public sourceFile: string; + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { - /** Annotation begin. */ - public begin: number; + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); - /** Annotation end. */ - public end: number; + /** ListOperationsRequest name. */ + public name: string; - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** ListOperationsRequest filter. */ + public filter: string; - /** - * 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; + /** ListOperationsRequest pageSize. */ + public pageSize: number; - /** - * 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; + /** ListOperationsRequest pageToken. */ + public pageToken: string; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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); - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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 }; - namespace Annotation { + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } + /** + * 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 Duration. */ - interface IDuration { + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); - /** Duration nanos */ - nanos?: (number|null); + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { /** - * Constructs a new Duration. + * Constructs a new ListOperationsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.longrunning.IListOperationsResponse); - /** Duration seconds. */ - public seconds: (number|Long|string); + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; - /** Duration nanos. */ - public nanos: number; + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Duration instance using the specified properties. + * Creates a new ListOperationsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Duration instance + * @returns ListOperationsResponse instance */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * 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.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IListOperationsResponse, 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 + * 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.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Duration message from the specified reader or buffer. + * 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 Duration + * @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.protobuf.Duration; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Duration + * @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.protobuf.Duration; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; /** - * Verifies a Duration message. + * 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns ListOperationsResponse */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * 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.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this ListOperationsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Duration + * 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 Struct. */ - interface IStruct { + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); + /** CancelOperationRequest name */ + name?: (string|null); } - /** Represents a Struct. */ - class Struct implements IStruct { + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { /** - * Constructs a new Struct. + * Constructs a new CancelOperationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IStruct); + constructor(properties?: google.longrunning.ICancelOperationRequest); - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; + /** CancelOperationRequest name. */ + public name: string; /** - * Creates a new Struct instance using the specified properties. + * Creates a new CancelOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Struct instance + * @returns CancelOperationRequest instance */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode + * 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.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode + * 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.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Struct message from the specified reader or buffer. + * 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 Struct + * @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.protobuf.Struct; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; /** - * Decodes a Struct message from the specified reader or buffer, length delimited. + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Struct + * @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.protobuf.Struct; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; /** - * Verifies a Struct message. + * 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 Struct message from a plain object. Also converts values to their respective internal types. + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Struct + * @returns CancelOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct + * 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.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Struct to JSON. + * Converts this CancelOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Struct + * 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 Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); + /** DeleteOperationRequest name */ + name?: (string|null); } - /** Represents a Value. */ - class Value implements IValue { + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { /** - * Constructs a new Value. + * Constructs a new DeleteOperationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IValue); + constructor(properties?: google.longrunning.IDeleteOperationRequest); - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** DeleteOperationRequest name. */ + public name: string; /** - * Creates a new Value instance using the specified properties. + * Creates a new DeleteOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Value instance + * @returns DeleteOperationRequest instance */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * 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.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * 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.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Value message from the specified reader or buffer. + * 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 Value + * @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.protobuf.Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Value + * @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.protobuf.Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; /** - * Verifies a Value message. + * 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 Value message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Value + * @returns DeleteOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value + * 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.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Value to JSON. + * Converts this DeleteOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Value + * 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; } - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { - /** Properties of a ListValue. */ - interface IListValue { + /** WaitOperationRequest name */ + name?: (string|null); - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); } - /** Represents a ListValue. */ - class ListValue implements IListValue { + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { /** - * Constructs a new ListValue. + * Constructs a new WaitOperationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IListValue); + constructor(properties?: google.longrunning.IWaitOperationRequest); - /** ListValue values. */ - public values: google.protobuf.IValue[]; + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); /** - * Creates a new ListValue instance using the specified properties. + * Creates a new WaitOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListValue instance + * @returns WaitOperationRequest instance */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * 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.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * 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.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListValue message from the specified reader or buffer. + * 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 ListValue + * @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.protobuf.ListValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListValue + * @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.protobuf.ListValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; /** - * Verifies a ListValue message. + * 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 ListValue message from a plain object. Also converts values to their respective internal types. + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListValue + * @returns WaitOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue + * 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.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListValue to JSON. + * Converts this WaitOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListValue + * 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 Empty. */ - interface IEmpty { + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); } - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { /** - * Constructs a new Empty. + * Constructs a new OperationInfo. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; /** - * Creates a new Empty instance using the specified properties. + * Creates a new OperationInfo instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns OperationInfo instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * 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.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IOperationInfo, 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 + * 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.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * 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 Empty + * @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.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @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.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; /** - * Verifies an Empty message. + * 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 Empty message from a plain object. Also converts values to their respective internal types. + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns OperationInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * 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.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this OperationInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Empty + * 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; } + } - /** Properties of a FieldMask. */ - interface IFieldMask { + /** Namespace rpc. */ + namespace rpc { - /** FieldMask paths */ - paths?: (string[]|null); + /** 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 FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents a Status. */ + class Status implements IStatus { /** - * Constructs a new FieldMask. + * Constructs a new Status. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); + constructor(properties?: google.rpc.IStatus); - /** FieldMask paths. */ - public paths: string[]; + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Status instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns Status instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.rpc.IStatus): google.rpc.Status; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * 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.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.rpc.IStatus, 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 + * 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.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * 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 FieldMask + * @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.protobuf.FieldMask; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @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.protobuf.FieldMask; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; /** - * Verifies a FieldMask message. + * 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Status */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.rpc.Status; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * 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.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Status to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Status * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-video-stitcher/protos/protos.js b/packages/google-cloud-video-stitcher/protos/protos.js index 44453ecd0333..98696b8efa89 100644 --- a/packages/google-cloud-video-stitcher/protos/protos.js +++ b/packages/google-cloud-video-stitcher/protos/protos.js @@ -4578,33 +4578,48 @@ return ProgressEvent; })(); - v1.VodSession = (function() { + /** + * AdTracking enum. + * @name google.cloud.video.stitcher.v1.AdTracking + * @enum {number} + * @property {number} AD_TRACKING_UNSPECIFIED=0 AD_TRACKING_UNSPECIFIED value + * @property {number} CLIENT=1 CLIENT value + * @property {number} SERVER=2 SERVER value + */ + v1.AdTracking = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AD_TRACKING_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT"] = 1; + values[valuesById[2] = "SERVER"] = 2; + return values; + })(); + + v1.LiveConfig = (function() { /** - * Properties of a VodSession. + * Properties of a LiveConfig. * @memberof google.cloud.video.stitcher.v1 - * @interface IVodSession - * @property {string|null} [name] VodSession name - * @property {google.cloud.video.stitcher.v1.IInterstitials|null} [interstitials] VodSession interstitials - * @property {string|null} [playUri] VodSession playUri - * @property {string|null} [sourceUri] VodSession sourceUri - * @property {string|null} [adTagUri] VodSession adTagUri - * @property {Object.|null} [adTagMacroMap] VodSession adTagMacroMap - * @property {boolean|null} [clientAdTracking] VodSession clientAdTracking - * @property {google.cloud.video.stitcher.v1.IManifestOptions|null} [manifestOptions] VodSession manifestOptions - * @property {string|null} [assetId] VodSession assetId + * @interface ILiveConfig + * @property {string|null} [name] LiveConfig name + * @property {string|null} [sourceUri] LiveConfig sourceUri + * @property {string|null} [adTagUri] LiveConfig adTagUri + * @property {google.cloud.video.stitcher.v1.IGamLiveConfig|null} [gamLiveConfig] LiveConfig gamLiveConfig + * @property {google.cloud.video.stitcher.v1.LiveConfig.State|null} [state] LiveConfig state + * @property {google.cloud.video.stitcher.v1.AdTracking|null} [adTracking] LiveConfig adTracking + * @property {string|null} [defaultSlate] LiveConfig defaultSlate + * @property {google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy|null} [stitchingPolicy] LiveConfig stitchingPolicy + * @property {google.cloud.video.stitcher.v1.IPrefetchConfig|null} [prefetchConfig] LiveConfig prefetchConfig */ /** - * Constructs a new VodSession. + * Constructs a new LiveConfig. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VodSession. - * @implements IVodSession + * @classdesc Represents a LiveConfig. + * @implements ILiveConfig * @constructor - * @param {google.cloud.video.stitcher.v1.IVodSession=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.ILiveConfig=} [properties] Properties to set */ - function VodSession(properties) { - this.adTagMacroMap = {}; + function LiveConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4612,151 +4627,150 @@ } /** - * VodSession name. + * LiveConfig name. * @member {string} name - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.name = ""; + LiveConfig.prototype.name = ""; /** - * VodSession interstitials. - * @member {google.cloud.video.stitcher.v1.IInterstitials|null|undefined} interstitials - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.interstitials = null; + LiveConfig.prototype.sourceUri = ""; /** - * VodSession playUri. - * @member {string} playUri - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig adTagUri. + * @member {string} adTagUri + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.playUri = ""; + LiveConfig.prototype.adTagUri = ""; /** - * VodSession sourceUri. - * @member {string} sourceUri - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig gamLiveConfig. + * @member {google.cloud.video.stitcher.v1.IGamLiveConfig|null|undefined} gamLiveConfig + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.sourceUri = ""; + LiveConfig.prototype.gamLiveConfig = null; /** - * VodSession adTagUri. - * @member {string} adTagUri - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig state. + * @member {google.cloud.video.stitcher.v1.LiveConfig.State} state + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.adTagUri = ""; + LiveConfig.prototype.state = 0; /** - * VodSession adTagMacroMap. - * @member {Object.} adTagMacroMap - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig adTracking. + * @member {google.cloud.video.stitcher.v1.AdTracking} adTracking + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.adTagMacroMap = $util.emptyObject; + LiveConfig.prototype.adTracking = 0; /** - * VodSession clientAdTracking. - * @member {boolean} clientAdTracking - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig defaultSlate. + * @member {string} defaultSlate + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.clientAdTracking = false; + LiveConfig.prototype.defaultSlate = ""; /** - * VodSession manifestOptions. - * @member {google.cloud.video.stitcher.v1.IManifestOptions|null|undefined} manifestOptions - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig stitchingPolicy. + * @member {google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy} stitchingPolicy + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.manifestOptions = null; + LiveConfig.prototype.stitchingPolicy = 0; /** - * VodSession assetId. - * @member {string} assetId - * @memberof google.cloud.video.stitcher.v1.VodSession + * LiveConfig prefetchConfig. + * @member {google.cloud.video.stitcher.v1.IPrefetchConfig|null|undefined} prefetchConfig + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance */ - VodSession.prototype.assetId = ""; + LiveConfig.prototype.prefetchConfig = null; /** - * Creates a new VodSession instance using the specified properties. + * Creates a new LiveConfig instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSession=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession instance + * @param {google.cloud.video.stitcher.v1.ILiveConfig=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.LiveConfig} LiveConfig instance */ - VodSession.create = function create(properties) { - return new VodSession(properties); + LiveConfig.create = function create(properties) { + return new LiveConfig(properties); }; /** - * Encodes the specified VodSession message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.verify|verify} messages. + * Encodes the specified LiveConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSession} message VodSession message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ILiveConfig} message LiveConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSession.encode = function encode(message, writer) { + LiveConfig.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.interstitials != null && Object.hasOwnProperty.call(message, "interstitials")) - $root.google.cloud.video.stitcher.v1.Interstitials.encode(message.interstitials, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.playUri != null && Object.hasOwnProperty.call(message, "playUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.playUri); if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceUri); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceUri); if (message.adTagUri != null && Object.hasOwnProperty.call(message, "adTagUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.adTagUri); - if (message.adTagMacroMap != null && Object.hasOwnProperty.call(message, "adTagMacroMap")) - for (var keys = Object.keys(message.adTagMacroMap), 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.adTagMacroMap[keys[i]]).ldelim(); - if (message.clientAdTracking != null && Object.hasOwnProperty.call(message, "clientAdTracking")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.clientAdTracking); - if (message.manifestOptions != null && Object.hasOwnProperty.call(message, "manifestOptions")) - $root.google.cloud.video.stitcher.v1.ManifestOptions.encode(message.manifestOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.assetId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.adTagUri); + if (message.gamLiveConfig != null && Object.hasOwnProperty.call(message, "gamLiveConfig")) + $root.google.cloud.video.stitcher.v1.GamLiveConfig.encode(message.gamLiveConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.adTracking != null && Object.hasOwnProperty.call(message, "adTracking")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.adTracking); + if (message.defaultSlate != null && Object.hasOwnProperty.call(message, "defaultSlate")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultSlate); + if (message.stitchingPolicy != null && Object.hasOwnProperty.call(message, "stitchingPolicy")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.stitchingPolicy); + if (message.prefetchConfig != null && Object.hasOwnProperty.call(message, "prefetchConfig")) + $root.google.cloud.video.stitcher.v1.PrefetchConfig.encode(message.prefetchConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified VodSession message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.verify|verify} messages. + * Encodes the specified LiveConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSession} message VodSession message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ILiveConfig} message LiveConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSession.encodeDelimited = function encodeDelimited(message, writer) { + LiveConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VodSession message from the specified reader or buffer. + * Decodes a LiveConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession + * @returns {google.cloud.video.stitcher.v1.LiveConfig} LiveConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSession.decode = function decode(reader, length) { + LiveConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSession(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.LiveConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4765,54 +4779,35 @@ break; } case 2: { - message.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.decode(reader, reader.uint32()); + message.sourceUri = reader.string(); + break; + } + case 3: { + message.adTagUri = reader.string(); break; } case 4: { - message.playUri = reader.string(); + message.gamLiveConfig = $root.google.cloud.video.stitcher.v1.GamLiveConfig.decode(reader, reader.uint32()); break; } case 5: { - message.sourceUri = reader.string(); + message.state = reader.int32(); break; } case 6: { - message.adTagUri = reader.string(); + message.adTracking = reader.int32(); break; } case 7: { - if (message.adTagMacroMap === $util.emptyObject) - message.adTagMacroMap = {}; - 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.adTagMacroMap[key] = value; + message.defaultSlate = reader.string(); break; } case 8: { - message.clientAdTracking = reader.bool(); - break; - } - case 9: { - message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.decode(reader, reader.uint32()); + message.stitchingPolicy = reader.int32(); break; } case 10: { - message.assetId = reader.string(); + message.prefetchConfig = $root.google.cloud.video.stitcher.v1.PrefetchConfig.decode(reader, reader.uint32()); break; } default: @@ -4824,214 +4819,309 @@ }; /** - * Decodes a VodSession message from the specified reader or buffer, length delimited. + * Decodes a LiveConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession + * @returns {google.cloud.video.stitcher.v1.LiveConfig} LiveConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSession.decodeDelimited = function decodeDelimited(reader) { + LiveConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VodSession message. + * Verifies a LiveConfig message. * @function verify - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VodSession.verify = function verify(message) { + LiveConfig.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.interstitials != null && message.hasOwnProperty("interstitials")) { - var error = $root.google.cloud.video.stitcher.v1.Interstitials.verify(message.interstitials); - if (error) - return "interstitials." + error; - } - if (message.playUri != null && message.hasOwnProperty("playUri")) - if (!$util.isString(message.playUri)) - return "playUri: string expected"; if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) if (!$util.isString(message.sourceUri)) return "sourceUri: string expected"; if (message.adTagUri != null && message.hasOwnProperty("adTagUri")) if (!$util.isString(message.adTagUri)) return "adTagUri: string expected"; - if (message.adTagMacroMap != null && message.hasOwnProperty("adTagMacroMap")) { - if (!$util.isObject(message.adTagMacroMap)) - return "adTagMacroMap: object expected"; - var key = Object.keys(message.adTagMacroMap); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.adTagMacroMap[key[i]])) - return "adTagMacroMap: string{k:string} expected"; + if (message.gamLiveConfig != null && message.hasOwnProperty("gamLiveConfig")) { + var error = $root.google.cloud.video.stitcher.v1.GamLiveConfig.verify(message.gamLiveConfig); + if (error) + return "gamLiveConfig." + error; } - if (message.clientAdTracking != null && message.hasOwnProperty("clientAdTracking")) - if (typeof message.clientAdTracking !== "boolean") - return "clientAdTracking: boolean expected"; - if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) { - var error = $root.google.cloud.video.stitcher.v1.ManifestOptions.verify(message.manifestOptions); + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.adTracking != null && message.hasOwnProperty("adTracking")) + switch (message.adTracking) { + default: + return "adTracking: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSlate != null && message.hasOwnProperty("defaultSlate")) + if (!$util.isString(message.defaultSlate)) + return "defaultSlate: string expected"; + if (message.stitchingPolicy != null && message.hasOwnProperty("stitchingPolicy")) + switch (message.stitchingPolicy) { + default: + return "stitchingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.prefetchConfig != null && message.hasOwnProperty("prefetchConfig")) { + var error = $root.google.cloud.video.stitcher.v1.PrefetchConfig.verify(message.prefetchConfig); if (error) - return "manifestOptions." + error; + return "prefetchConfig." + error; } - if (message.assetId != null && message.hasOwnProperty("assetId")) - if (!$util.isString(message.assetId)) - return "assetId: string expected"; return null; }; /** - * Creates a VodSession message from a plain object. Also converts values to their respective internal types. + * Creates a LiveConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession + * @returns {google.cloud.video.stitcher.v1.LiveConfig} LiveConfig */ - VodSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.VodSession) + LiveConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.LiveConfig) return object; - var message = new $root.google.cloud.video.stitcher.v1.VodSession(); + var message = new $root.google.cloud.video.stitcher.v1.LiveConfig(); if (object.name != null) message.name = String(object.name); - if (object.interstitials != null) { - if (typeof object.interstitials !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSession.interstitials: object expected"); - message.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.fromObject(object.interstitials); - } - if (object.playUri != null) - message.playUri = String(object.playUri); if (object.sourceUri != null) message.sourceUri = String(object.sourceUri); if (object.adTagUri != null) message.adTagUri = String(object.adTagUri); - if (object.adTagMacroMap) { - if (typeof object.adTagMacroMap !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSession.adTagMacroMap: object expected"); - message.adTagMacroMap = {}; - for (var keys = Object.keys(object.adTagMacroMap), i = 0; i < keys.length; ++i) - message.adTagMacroMap[keys[i]] = String(object.adTagMacroMap[keys[i]]); + if (object.gamLiveConfig != null) { + if (typeof object.gamLiveConfig !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.LiveConfig.gamLiveConfig: object expected"); + message.gamLiveConfig = $root.google.cloud.video.stitcher.v1.GamLiveConfig.fromObject(object.gamLiveConfig); } - if (object.clientAdTracking != null) - message.clientAdTracking = Boolean(object.clientAdTracking); - if (object.manifestOptions != null) { - if (typeof object.manifestOptions !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSession.manifestOptions: object expected"); - message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.fromObject(object.manifestOptions); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + } + switch (object.adTracking) { + default: + if (typeof object.adTracking === "number") { + message.adTracking = object.adTracking; + break; + } + break; + case "AD_TRACKING_UNSPECIFIED": + case 0: + message.adTracking = 0; + break; + case "CLIENT": + case 1: + message.adTracking = 1; + break; + case "SERVER": + case 2: + message.adTracking = 2; + break; + } + if (object.defaultSlate != null) + message.defaultSlate = String(object.defaultSlate); + switch (object.stitchingPolicy) { + default: + if (typeof object.stitchingPolicy === "number") { + message.stitchingPolicy = object.stitchingPolicy; + break; + } + break; + case "STITCHING_POLICY_UNSPECIFIED": + case 0: + message.stitchingPolicy = 0; + break; + case "CUT_CURRENT": + case 1: + message.stitchingPolicy = 1; + break; + case "COMPLETE_AD": + case 2: + message.stitchingPolicy = 2; + break; + } + if (object.prefetchConfig != null) { + if (typeof object.prefetchConfig !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.LiveConfig.prefetchConfig: object expected"); + message.prefetchConfig = $root.google.cloud.video.stitcher.v1.PrefetchConfig.fromObject(object.prefetchConfig); } - if (object.assetId != null) - message.assetId = String(object.assetId); return message; }; /** - * Creates a plain object from a VodSession message. Also converts values to other types if specified. + * Creates a plain object from a LiveConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static - * @param {google.cloud.video.stitcher.v1.VodSession} message VodSession + * @param {google.cloud.video.stitcher.v1.LiveConfig} message LiveConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VodSession.toObject = function toObject(message, options) { + LiveConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.adTagMacroMap = {}; if (options.defaults) { object.name = ""; - object.interstitials = null; - object.playUri = ""; object.sourceUri = ""; object.adTagUri = ""; - object.clientAdTracking = false; - object.manifestOptions = null; - object.assetId = ""; + object.gamLiveConfig = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.adTracking = options.enums === String ? "AD_TRACKING_UNSPECIFIED" : 0; + object.defaultSlate = ""; + object.stitchingPolicy = options.enums === String ? "STITCHING_POLICY_UNSPECIFIED" : 0; + object.prefetchConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.interstitials != null && message.hasOwnProperty("interstitials")) - object.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.toObject(message.interstitials, options); - if (message.playUri != null && message.hasOwnProperty("playUri")) - object.playUri = message.playUri; if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) object.sourceUri = message.sourceUri; if (message.adTagUri != null && message.hasOwnProperty("adTagUri")) object.adTagUri = message.adTagUri; - var keys2; - if (message.adTagMacroMap && (keys2 = Object.keys(message.adTagMacroMap)).length) { - object.adTagMacroMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.adTagMacroMap[keys2[j]] = message.adTagMacroMap[keys2[j]]; - } - if (message.clientAdTracking != null && message.hasOwnProperty("clientAdTracking")) - object.clientAdTracking = message.clientAdTracking; - if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) - object.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.toObject(message.manifestOptions, options); - if (message.assetId != null && message.hasOwnProperty("assetId")) - object.assetId = message.assetId; + if (message.gamLiveConfig != null && message.hasOwnProperty("gamLiveConfig")) + object.gamLiveConfig = $root.google.cloud.video.stitcher.v1.GamLiveConfig.toObject(message.gamLiveConfig, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.video.stitcher.v1.LiveConfig.State[message.state] === undefined ? message.state : $root.google.cloud.video.stitcher.v1.LiveConfig.State[message.state] : message.state; + if (message.adTracking != null && message.hasOwnProperty("adTracking")) + object.adTracking = options.enums === String ? $root.google.cloud.video.stitcher.v1.AdTracking[message.adTracking] === undefined ? message.adTracking : $root.google.cloud.video.stitcher.v1.AdTracking[message.adTracking] : message.adTracking; + if (message.defaultSlate != null && message.hasOwnProperty("defaultSlate")) + object.defaultSlate = message.defaultSlate; + if (message.stitchingPolicy != null && message.hasOwnProperty("stitchingPolicy")) + object.stitchingPolicy = options.enums === String ? $root.google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy[message.stitchingPolicy] === undefined ? message.stitchingPolicy : $root.google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy[message.stitchingPolicy] : message.stitchingPolicy; + if (message.prefetchConfig != null && message.hasOwnProperty("prefetchConfig")) + object.prefetchConfig = $root.google.cloud.video.stitcher.v1.PrefetchConfig.toObject(message.prefetchConfig, options); return object; }; /** - * Converts this VodSession to JSON. + * Converts this LiveConfig to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @instance * @returns {Object.} JSON object */ - VodSession.prototype.toJSON = function toJSON() { + LiveConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VodSession + * Gets the default type url for LiveConfig * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.VodSession + * @memberof google.cloud.video.stitcher.v1.LiveConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VodSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LiveConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSession"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.LiveConfig"; }; - return VodSession; + /** + * State enum. + * @name google.cloud.video.stitcher.v1.LiveConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=3 DELETING value + */ + LiveConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "DELETING"] = 3; + return values; + })(); + + /** + * StitchingPolicy enum. + * @name google.cloud.video.stitcher.v1.LiveConfig.StitchingPolicy + * @enum {number} + * @property {number} STITCHING_POLICY_UNSPECIFIED=0 STITCHING_POLICY_UNSPECIFIED value + * @property {number} CUT_CURRENT=1 CUT_CURRENT value + * @property {number} COMPLETE_AD=2 COMPLETE_AD value + */ + LiveConfig.StitchingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STITCHING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUT_CURRENT"] = 1; + values[valuesById[2] = "COMPLETE_AD"] = 2; + return values; + })(); + + return LiveConfig; })(); - v1.Interstitials = (function() { + v1.PrefetchConfig = (function() { /** - * Properties of an Interstitials. + * Properties of a PrefetchConfig. * @memberof google.cloud.video.stitcher.v1 - * @interface IInterstitials - * @property {Array.|null} [adBreaks] Interstitials adBreaks - * @property {google.cloud.video.stitcher.v1.IVodSessionContent|null} [sessionContent] Interstitials sessionContent + * @interface IPrefetchConfig + * @property {boolean|null} [enabled] PrefetchConfig enabled + * @property {google.protobuf.IDuration|null} [initialAdRequestDuration] PrefetchConfig initialAdRequestDuration */ /** - * Constructs a new Interstitials. + * Constructs a new PrefetchConfig. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents an Interstitials. - * @implements IInterstitials + * @classdesc Represents a PrefetchConfig. + * @implements IPrefetchConfig * @constructor - * @param {google.cloud.video.stitcher.v1.IInterstitials=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IPrefetchConfig=} [properties] Properties to set */ - function Interstitials(properties) { - this.adBreaks = []; + function PrefetchConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5039,92 +5129,89 @@ } /** - * Interstitials adBreaks. - * @member {Array.} adBreaks - * @memberof google.cloud.video.stitcher.v1.Interstitials + * PrefetchConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @instance */ - Interstitials.prototype.adBreaks = $util.emptyArray; + PrefetchConfig.prototype.enabled = false; /** - * Interstitials sessionContent. - * @member {google.cloud.video.stitcher.v1.IVodSessionContent|null|undefined} sessionContent - * @memberof google.cloud.video.stitcher.v1.Interstitials + * PrefetchConfig initialAdRequestDuration. + * @member {google.protobuf.IDuration|null|undefined} initialAdRequestDuration + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @instance */ - Interstitials.prototype.sessionContent = null; + PrefetchConfig.prototype.initialAdRequestDuration = null; /** - * Creates a new Interstitials instance using the specified properties. + * Creates a new PrefetchConfig instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static - * @param {google.cloud.video.stitcher.v1.IInterstitials=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials instance + * @param {google.cloud.video.stitcher.v1.IPrefetchConfig=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.PrefetchConfig} PrefetchConfig instance */ - Interstitials.create = function create(properties) { - return new Interstitials(properties); + PrefetchConfig.create = function create(properties) { + return new PrefetchConfig(properties); }; /** - * Encodes the specified Interstitials message. Does not implicitly {@link google.cloud.video.stitcher.v1.Interstitials.verify|verify} messages. + * Encodes the specified PrefetchConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.PrefetchConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static - * @param {google.cloud.video.stitcher.v1.IInterstitials} message Interstitials message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IPrefetchConfig} message PrefetchConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interstitials.encode = function encode(message, writer) { + PrefetchConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.adBreaks != null && message.adBreaks.length) - for (var i = 0; i < message.adBreaks.length; ++i) - $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.encode(message.adBreaks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.sessionContent != null && Object.hasOwnProperty.call(message, "sessionContent")) - $root.google.cloud.video.stitcher.v1.VodSessionContent.encode(message.sessionContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.initialAdRequestDuration != null && Object.hasOwnProperty.call(message, "initialAdRequestDuration")) + $root.google.protobuf.Duration.encode(message.initialAdRequestDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Interstitials message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Interstitials.verify|verify} messages. + * Encodes the specified PrefetchConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.PrefetchConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static - * @param {google.cloud.video.stitcher.v1.IInterstitials} message Interstitials message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IPrefetchConfig} message PrefetchConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interstitials.encodeDelimited = function encodeDelimited(message, writer) { + PrefetchConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Interstitials message from the specified reader or buffer. + * Decodes a PrefetchConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials + * @returns {google.cloud.video.stitcher.v1.PrefetchConfig} PrefetchConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Interstitials.decode = function decode(reader, length) { + PrefetchConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.Interstitials(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.PrefetchConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.adBreaks && message.adBreaks.length)) - message.adBreaks = []; - message.adBreaks.push($root.google.cloud.video.stitcher.v1.VodSessionAdBreak.decode(reader, reader.uint32())); + message.enabled = reader.bool(); break; } case 2: { - message.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.decode(reader, reader.uint32()); + message.initialAdRequestDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -5136,156 +5223,138 @@ }; /** - * Decodes an Interstitials message from the specified reader or buffer, length delimited. + * Decodes a PrefetchConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials + * @returns {google.cloud.video.stitcher.v1.PrefetchConfig} PrefetchConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Interstitials.decodeDelimited = function decodeDelimited(reader) { + PrefetchConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Interstitials message. + * Verifies a PrefetchConfig message. * @function verify - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Interstitials.verify = function verify(message) { + PrefetchConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.adBreaks != null && message.hasOwnProperty("adBreaks")) { - if (!Array.isArray(message.adBreaks)) - return "adBreaks: array expected"; - for (var i = 0; i < message.adBreaks.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.verify(message.adBreaks[i]); - if (error) - return "adBreaks." + error; - } - } - if (message.sessionContent != null && message.hasOwnProperty("sessionContent")) { - var error = $root.google.cloud.video.stitcher.v1.VodSessionContent.verify(message.sessionContent); + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.initialAdRequestDuration != null && message.hasOwnProperty("initialAdRequestDuration")) { + var error = $root.google.protobuf.Duration.verify(message.initialAdRequestDuration); if (error) - return "sessionContent." + error; + return "initialAdRequestDuration." + error; } return null; }; /** - * Creates an Interstitials message from a plain object. Also converts values to their respective internal types. + * Creates a PrefetchConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials + * @returns {google.cloud.video.stitcher.v1.PrefetchConfig} PrefetchConfig */ - Interstitials.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.Interstitials) + PrefetchConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.PrefetchConfig) return object; - var message = new $root.google.cloud.video.stitcher.v1.Interstitials(); - if (object.adBreaks) { - if (!Array.isArray(object.adBreaks)) - throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.adBreaks: array expected"); - message.adBreaks = []; - for (var i = 0; i < object.adBreaks.length; ++i) { - if (typeof object.adBreaks[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.adBreaks: object expected"); - message.adBreaks[i] = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.fromObject(object.adBreaks[i]); - } - } - if (object.sessionContent != null) { - if (typeof object.sessionContent !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.sessionContent: object expected"); - message.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.fromObject(object.sessionContent); + var message = new $root.google.cloud.video.stitcher.v1.PrefetchConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.initialAdRequestDuration != null) { + if (typeof object.initialAdRequestDuration !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.PrefetchConfig.initialAdRequestDuration: object expected"); + message.initialAdRequestDuration = $root.google.protobuf.Duration.fromObject(object.initialAdRequestDuration); } return message; }; /** - * Creates a plain object from an Interstitials message. Also converts values to other types if specified. + * Creates a plain object from a PrefetchConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static - * @param {google.cloud.video.stitcher.v1.Interstitials} message Interstitials + * @param {google.cloud.video.stitcher.v1.PrefetchConfig} message PrefetchConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Interstitials.toObject = function toObject(message, options) { + PrefetchConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.adBreaks = []; - if (options.defaults) - object.sessionContent = null; - if (message.adBreaks && message.adBreaks.length) { - object.adBreaks = []; - for (var j = 0; j < message.adBreaks.length; ++j) - object.adBreaks[j] = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.toObject(message.adBreaks[j], options); + if (options.defaults) { + object.enabled = false; + object.initialAdRequestDuration = null; } - if (message.sessionContent != null && message.hasOwnProperty("sessionContent")) - object.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.toObject(message.sessionContent, options); + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.initialAdRequestDuration != null && message.hasOwnProperty("initialAdRequestDuration")) + object.initialAdRequestDuration = $root.google.protobuf.Duration.toObject(message.initialAdRequestDuration, options); return object; }; /** - * Converts this Interstitials to JSON. + * Converts this PrefetchConfig to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @instance * @returns {Object.} JSON object */ - Interstitials.prototype.toJSON = function toJSON() { + PrefetchConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Interstitials + * Gets the default type url for PrefetchConfig * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.Interstitials + * @memberof google.cloud.video.stitcher.v1.PrefetchConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Interstitials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PrefetchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.Interstitials"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.PrefetchConfig"; }; - return Interstitials; + return PrefetchConfig; })(); - v1.VodSessionAd = (function() { + v1.GamLiveConfig = (function() { /** - * Properties of a VodSessionAd. + * Properties of a GamLiveConfig. * @memberof google.cloud.video.stitcher.v1 - * @interface IVodSessionAd - * @property {google.protobuf.IDuration|null} [duration] VodSessionAd duration - * @property {google.cloud.video.stitcher.v1.ICompanionAds|null} [companionAds] VodSessionAd companionAds - * @property {Array.|null} [activityEvents] VodSessionAd activityEvents + * @interface IGamLiveConfig + * @property {string|null} [networkCode] GamLiveConfig networkCode + * @property {string|null} [assetKey] GamLiveConfig assetKey + * @property {string|null} [customAssetKey] GamLiveConfig customAssetKey */ /** - * Constructs a new VodSessionAd. + * Constructs a new GamLiveConfig. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VodSessionAd. - * @implements IVodSessionAd + * @classdesc Represents a GamLiveConfig. + * @implements IGamLiveConfig * @constructor - * @param {google.cloud.video.stitcher.v1.IVodSessionAd=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGamLiveConfig=} [properties] Properties to set */ - function VodSessionAd(properties) { - this.activityEvents = []; + function GamLiveConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5293,106 +5362,103 @@ } /** - * VodSessionAd duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * GamLiveConfig networkCode. + * @member {string} networkCode + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @instance */ - VodSessionAd.prototype.duration = null; + GamLiveConfig.prototype.networkCode = ""; /** - * VodSessionAd companionAds. - * @member {google.cloud.video.stitcher.v1.ICompanionAds|null|undefined} companionAds - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * GamLiveConfig assetKey. + * @member {string} assetKey + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @instance */ - VodSessionAd.prototype.companionAds = null; + GamLiveConfig.prototype.assetKey = ""; /** - * VodSessionAd activityEvents. - * @member {Array.} activityEvents - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * GamLiveConfig customAssetKey. + * @member {string} customAssetKey + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @instance */ - VodSessionAd.prototype.activityEvents = $util.emptyArray; + GamLiveConfig.prototype.customAssetKey = ""; /** - * Creates a new VodSessionAd instance using the specified properties. + * Creates a new GamLiveConfig instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAd=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd instance + * @param {google.cloud.video.stitcher.v1.IGamLiveConfig=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GamLiveConfig} GamLiveConfig instance */ - VodSessionAd.create = function create(properties) { - return new VodSessionAd(properties); + GamLiveConfig.create = function create(properties) { + return new GamLiveConfig(properties); }; /** - * Encodes the specified VodSessionAd message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAd.verify|verify} messages. + * Encodes the specified GamLiveConfig message. Does not implicitly {@link google.cloud.video.stitcher.v1.GamLiveConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAd} message VodSessionAd message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGamLiveConfig} message GamLiveConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionAd.encode = function encode(message, writer) { + GamLiveConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.companionAds != null && Object.hasOwnProperty.call(message, "companionAds")) - $root.google.cloud.video.stitcher.v1.CompanionAds.encode(message.companionAds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.activityEvents != null && message.activityEvents.length) - for (var i = 0; i < message.activityEvents.length; ++i) - $root.google.cloud.video.stitcher.v1.Event.encode(message.activityEvents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.networkCode != null && Object.hasOwnProperty.call(message, "networkCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkCode); + if (message.assetKey != null && Object.hasOwnProperty.call(message, "assetKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetKey); + if (message.customAssetKey != null && Object.hasOwnProperty.call(message, "customAssetKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customAssetKey); return writer; }; /** - * Encodes the specified VodSessionAd message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAd.verify|verify} messages. + * Encodes the specified GamLiveConfig message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GamLiveConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAd} message VodSessionAd message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGamLiveConfig} message GamLiveConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionAd.encodeDelimited = function encodeDelimited(message, writer) { + GamLiveConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VodSessionAd message from the specified reader or buffer. + * Decodes a GamLiveConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd + * @returns {google.cloud.video.stitcher.v1.GamLiveConfig} GamLiveConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionAd.decode = function decode(reader, length) { + GamLiveConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionAd(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GamLiveConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.networkCode = reader.string(); break; } case 2: { - message.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.decode(reader, reader.uint32()); + message.assetKey = reader.string(); break; } case 3: { - if (!(message.activityEvents && message.activityEvents.length)) - message.activityEvents = []; - message.activityEvents.push($root.google.cloud.video.stitcher.v1.Event.decode(reader, reader.uint32())); + message.customAssetKey = reader.string(); break; } default: @@ -5404,167 +5470,149 @@ }; /** - * Decodes a VodSessionAd message from the specified reader or buffer, length delimited. + * Decodes a GamLiveConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd + * @returns {google.cloud.video.stitcher.v1.GamLiveConfig} GamLiveConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionAd.decodeDelimited = function decodeDelimited(reader) { + GamLiveConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VodSessionAd message. + * Verifies a GamLiveConfig message. * @function verify - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VodSessionAd.verify = function verify(message) { + GamLiveConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.companionAds != null && message.hasOwnProperty("companionAds")) { - var error = $root.google.cloud.video.stitcher.v1.CompanionAds.verify(message.companionAds); - if (error) - return "companionAds." + error; - } - if (message.activityEvents != null && message.hasOwnProperty("activityEvents")) { - if (!Array.isArray(message.activityEvents)) - return "activityEvents: array expected"; - for (var i = 0; i < message.activityEvents.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.Event.verify(message.activityEvents[i]); - if (error) - return "activityEvents." + error; - } - } + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + if (!$util.isString(message.networkCode)) + return "networkCode: string expected"; + if (message.assetKey != null && message.hasOwnProperty("assetKey")) + if (!$util.isString(message.assetKey)) + return "assetKey: string expected"; + if (message.customAssetKey != null && message.hasOwnProperty("customAssetKey")) + if (!$util.isString(message.customAssetKey)) + return "customAssetKey: string expected"; return null; }; /** - * Creates a VodSessionAd message from a plain object. Also converts values to their respective internal types. + * Creates a GamLiveConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd + * @returns {google.cloud.video.stitcher.v1.GamLiveConfig} GamLiveConfig */ - VodSessionAd.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionAd) + GamLiveConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GamLiveConfig) return object; - var message = new $root.google.cloud.video.stitcher.v1.VodSessionAd(); - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.companionAds != null) { - if (typeof object.companionAds !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.companionAds: object expected"); - message.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.fromObject(object.companionAds); - } - if (object.activityEvents) { - if (!Array.isArray(object.activityEvents)) - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.activityEvents: array expected"); - message.activityEvents = []; - for (var i = 0; i < object.activityEvents.length; ++i) { - if (typeof object.activityEvents[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.activityEvents: object expected"); - message.activityEvents[i] = $root.google.cloud.video.stitcher.v1.Event.fromObject(object.activityEvents[i]); - } - } + var message = new $root.google.cloud.video.stitcher.v1.GamLiveConfig(); + if (object.networkCode != null) + message.networkCode = String(object.networkCode); + if (object.assetKey != null) + message.assetKey = String(object.assetKey); + if (object.customAssetKey != null) + message.customAssetKey = String(object.customAssetKey); return message; }; /** - * Creates a plain object from a VodSessionAd message. Also converts values to other types if specified. + * Creates a plain object from a GamLiveConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static - * @param {google.cloud.video.stitcher.v1.VodSessionAd} message VodSessionAd + * @param {google.cloud.video.stitcher.v1.GamLiveConfig} message GamLiveConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VodSessionAd.toObject = function toObject(message, options) { + GamLiveConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.activityEvents = []; if (options.defaults) { - object.duration = null; - object.companionAds = null; - } - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.companionAds != null && message.hasOwnProperty("companionAds")) - object.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.toObject(message.companionAds, options); - if (message.activityEvents && message.activityEvents.length) { - object.activityEvents = []; - for (var j = 0; j < message.activityEvents.length; ++j) - object.activityEvents[j] = $root.google.cloud.video.stitcher.v1.Event.toObject(message.activityEvents[j], options); - } + object.networkCode = ""; + object.assetKey = ""; + object.customAssetKey = ""; + } + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + object.networkCode = message.networkCode; + if (message.assetKey != null && message.hasOwnProperty("assetKey")) + object.assetKey = message.assetKey; + if (message.customAssetKey != null && message.hasOwnProperty("customAssetKey")) + object.customAssetKey = message.customAssetKey; return object; }; /** - * Converts this VodSessionAd to JSON. + * Converts this GamLiveConfig to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @instance * @returns {Object.} JSON object */ - VodSessionAd.prototype.toJSON = function toJSON() { + GamLiveConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VodSessionAd + * Gets the default type url for GamLiveConfig * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @memberof google.cloud.video.stitcher.v1.GamLiveConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VodSessionAd.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GamLiveConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionAd"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GamLiveConfig"; }; - return VodSessionAd; + return GamLiveConfig; })(); - v1.VodSessionContent = (function() { + v1.VodSession = (function() { /** - * Properties of a VodSessionContent. + * Properties of a VodSession. * @memberof google.cloud.video.stitcher.v1 - * @interface IVodSessionContent - * @property {google.protobuf.IDuration|null} [duration] VodSessionContent duration + * @interface IVodSession + * @property {string|null} [name] VodSession name + * @property {google.cloud.video.stitcher.v1.IInterstitials|null} [interstitials] VodSession interstitials + * @property {string|null} [playUri] VodSession playUri + * @property {string|null} [sourceUri] VodSession sourceUri + * @property {string|null} [adTagUri] VodSession adTagUri + * @property {Object.|null} [adTagMacroMap] VodSession adTagMacroMap + * @property {google.cloud.video.stitcher.v1.IManifestOptions|null} [manifestOptions] VodSession manifestOptions + * @property {string|null} [assetId] VodSession assetId + * @property {google.cloud.video.stitcher.v1.AdTracking|null} [adTracking] VodSession adTracking + * @property {google.cloud.video.stitcher.v1.VodSession.IGamSettings|null} [gamSettings] VodSession gamSettings */ /** - * Constructs a new VodSessionContent. + * Constructs a new VodSession. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VodSessionContent. - * @implements IVodSessionContent + * @classdesc Represents a VodSession. + * @implements IVodSession * @constructor - * @param {google.cloud.video.stitcher.v1.IVodSessionContent=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IVodSession=} [properties] Properties to set */ - function VodSessionContent(properties) { + function VodSession(properties) { + this.adTagMacroMap = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5572,75 +5620,221 @@ } /** - * VodSessionContent duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * VodSession name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.VodSession * @instance */ - VodSessionContent.prototype.duration = null; + VodSession.prototype.name = ""; /** - * Creates a new VodSessionContent instance using the specified properties. + * VodSession interstitials. + * @member {google.cloud.video.stitcher.v1.IInterstitials|null|undefined} interstitials + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.interstitials = null; + + /** + * VodSession playUri. + * @member {string} playUri + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.playUri = ""; + + /** + * VodSession sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.sourceUri = ""; + + /** + * VodSession adTagUri. + * @member {string} adTagUri + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.adTagUri = ""; + + /** + * VodSession adTagMacroMap. + * @member {Object.} adTagMacroMap + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.adTagMacroMap = $util.emptyObject; + + /** + * VodSession manifestOptions. + * @member {google.cloud.video.stitcher.v1.IManifestOptions|null|undefined} manifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.manifestOptions = null; + + /** + * VodSession assetId. + * @member {string} assetId + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.assetId = ""; + + /** + * VodSession adTracking. + * @member {google.cloud.video.stitcher.v1.AdTracking} adTracking + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.adTracking = 0; + + /** + * VodSession gamSettings. + * @member {google.cloud.video.stitcher.v1.VodSession.IGamSettings|null|undefined} gamSettings + * @memberof google.cloud.video.stitcher.v1.VodSession + * @instance + */ + VodSession.prototype.gamSettings = null; + + /** + * Creates a new VodSession instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionContent=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent instance + * @param {google.cloud.video.stitcher.v1.IVodSession=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession instance */ - VodSessionContent.create = function create(properties) { - return new VodSessionContent(properties); + VodSession.create = function create(properties) { + return new VodSession(properties); }; /** - * Encodes the specified VodSessionContent message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionContent.verify|verify} messages. + * Encodes the specified VodSession message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionContent} message VodSessionContent message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSession} message VodSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionContent.encode = function encode(message, writer) { + VodSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.interstitials != null && Object.hasOwnProperty.call(message, "interstitials")) + $root.google.cloud.video.stitcher.v1.Interstitials.encode(message.interstitials, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.playUri != null && Object.hasOwnProperty.call(message, "playUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.playUri); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceUri); + if (message.adTagUri != null && Object.hasOwnProperty.call(message, "adTagUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.adTagUri); + if (message.adTagMacroMap != null && Object.hasOwnProperty.call(message, "adTagMacroMap")) + for (var keys = Object.keys(message.adTagMacroMap), 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.adTagMacroMap[keys[i]]).ldelim(); + if (message.manifestOptions != null && Object.hasOwnProperty.call(message, "manifestOptions")) + $root.google.cloud.video.stitcher.v1.ManifestOptions.encode(message.manifestOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.assetId); + if (message.adTracking != null && Object.hasOwnProperty.call(message, "adTracking")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.adTracking); + if (message.gamSettings != null && Object.hasOwnProperty.call(message, "gamSettings")) + $root.google.cloud.video.stitcher.v1.VodSession.GamSettings.encode(message.gamSettings, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; /** - * Encodes the specified VodSessionContent message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionContent.verify|verify} messages. + * Encodes the specified VodSession message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionContent} message VodSessionContent message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSession} message VodSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionContent.encodeDelimited = function encodeDelimited(message, writer) { + VodSession.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VodSessionContent message from the specified reader or buffer. + * Decodes a VodSession message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent + * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionContent.decode = function decode(reader, length) { + VodSession.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionContent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSession(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + } + case 2: { + message.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.decode(reader, reader.uint32()); + break; + } + case 4: { + message.playUri = reader.string(); + break; + } + case 5: { + message.sourceUri = reader.string(); + break; + } + case 6: { + message.adTagUri = reader.string(); + break; + } + case 7: { + if (message.adTagMacroMap === $util.emptyObject) + message.adTagMacroMap = {}; + 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.adTagMacroMap[key] = value; + break; + } + case 9: { + message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.assetId = reader.string(); + break; + } + case 11: { + message.adTracking = reader.int32(); + break; + } + case 13: { + message.gamSettings = $root.google.cloud.video.stitcher.v1.VodSession.GamSettings.decode(reader, reader.uint32()); break; } default: @@ -5652,132 +5846,478 @@ }; /** - * Decodes a VodSessionContent message from the specified reader or buffer, length delimited. + * Decodes a VodSession message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent + * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionContent.decodeDelimited = function decodeDelimited(reader) { + VodSession.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VodSessionContent message. + * Verifies a VodSession message. * @function verify - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VodSessionContent.verify = function verify(message) { + VodSession.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.interstitials != null && message.hasOwnProperty("interstitials")) { + var error = $root.google.cloud.video.stitcher.v1.Interstitials.verify(message.interstitials); if (error) - return "duration." + error; + return "interstitials." + error; + } + if (message.playUri != null && message.hasOwnProperty("playUri")) + if (!$util.isString(message.playUri)) + return "playUri: string expected"; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: string expected"; + if (message.adTagUri != null && message.hasOwnProperty("adTagUri")) + if (!$util.isString(message.adTagUri)) + return "adTagUri: string expected"; + if (message.adTagMacroMap != null && message.hasOwnProperty("adTagMacroMap")) { + if (!$util.isObject(message.adTagMacroMap)) + return "adTagMacroMap: object expected"; + var key = Object.keys(message.adTagMacroMap); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.adTagMacroMap[key[i]])) + return "adTagMacroMap: string{k:string} expected"; + } + if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) { + var error = $root.google.cloud.video.stitcher.v1.ManifestOptions.verify(message.manifestOptions); + if (error) + return "manifestOptions." + error; + } + if (message.assetId != null && message.hasOwnProperty("assetId")) + if (!$util.isString(message.assetId)) + return "assetId: string expected"; + if (message.adTracking != null && message.hasOwnProperty("adTracking")) + switch (message.adTracking) { + default: + return "adTracking: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gamSettings != null && message.hasOwnProperty("gamSettings")) { + var error = $root.google.cloud.video.stitcher.v1.VodSession.GamSettings.verify(message.gamSettings); + if (error) + return "gamSettings." + error; } return null; }; /** - * Creates a VodSessionContent message from a plain object. Also converts values to their respective internal types. + * Creates a VodSession message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent + * @returns {google.cloud.video.stitcher.v1.VodSession} VodSession */ - VodSessionContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionContent) + VodSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodSession) return object; - var message = new $root.google.cloud.video.stitcher.v1.VodSessionContent(); - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionContent.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + var message = new $root.google.cloud.video.stitcher.v1.VodSession(); + if (object.name != null) + message.name = String(object.name); + if (object.interstitials != null) { + if (typeof object.interstitials !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSession.interstitials: object expected"); + message.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.fromObject(object.interstitials); + } + if (object.playUri != null) + message.playUri = String(object.playUri); + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + if (object.adTagUri != null) + message.adTagUri = String(object.adTagUri); + if (object.adTagMacroMap) { + if (typeof object.adTagMacroMap !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSession.adTagMacroMap: object expected"); + message.adTagMacroMap = {}; + for (var keys = Object.keys(object.adTagMacroMap), i = 0; i < keys.length; ++i) + message.adTagMacroMap[keys[i]] = String(object.adTagMacroMap[keys[i]]); + } + if (object.manifestOptions != null) { + if (typeof object.manifestOptions !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSession.manifestOptions: object expected"); + message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.fromObject(object.manifestOptions); + } + if (object.assetId != null) + message.assetId = String(object.assetId); + switch (object.adTracking) { + default: + if (typeof object.adTracking === "number") { + message.adTracking = object.adTracking; + break; + } + break; + case "AD_TRACKING_UNSPECIFIED": + case 0: + message.adTracking = 0; + break; + case "CLIENT": + case 1: + message.adTracking = 1; + break; + case "SERVER": + case 2: + message.adTracking = 2; + break; + } + if (object.gamSettings != null) { + if (typeof object.gamSettings !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSession.gamSettings: object expected"); + message.gamSettings = $root.google.cloud.video.stitcher.v1.VodSession.GamSettings.fromObject(object.gamSettings); } return message; }; /** - * Creates a plain object from a VodSessionContent message. Also converts values to other types if specified. + * Creates a plain object from a VodSession message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static - * @param {google.cloud.video.stitcher.v1.VodSessionContent} message VodSessionContent + * @param {google.cloud.video.stitcher.v1.VodSession} message VodSession * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VodSessionContent.toObject = function toObject(message, options) { + VodSession.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.duration = null; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (options.objects || options.defaults) + object.adTagMacroMap = {}; + if (options.defaults) { + object.name = ""; + object.interstitials = null; + object.playUri = ""; + object.sourceUri = ""; + object.adTagUri = ""; + object.manifestOptions = null; + object.assetId = ""; + object.adTracking = options.enums === String ? "AD_TRACKING_UNSPECIFIED" : 0; + object.gamSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.interstitials != null && message.hasOwnProperty("interstitials")) + object.interstitials = $root.google.cloud.video.stitcher.v1.Interstitials.toObject(message.interstitials, options); + if (message.playUri != null && message.hasOwnProperty("playUri")) + object.playUri = message.playUri; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + if (message.adTagUri != null && message.hasOwnProperty("adTagUri")) + object.adTagUri = message.adTagUri; + var keys2; + if (message.adTagMacroMap && (keys2 = Object.keys(message.adTagMacroMap)).length) { + object.adTagMacroMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.adTagMacroMap[keys2[j]] = message.adTagMacroMap[keys2[j]]; + } + if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) + object.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.toObject(message.manifestOptions, options); + if (message.assetId != null && message.hasOwnProperty("assetId")) + object.assetId = message.assetId; + if (message.adTracking != null && message.hasOwnProperty("adTracking")) + object.adTracking = options.enums === String ? $root.google.cloud.video.stitcher.v1.AdTracking[message.adTracking] === undefined ? message.adTracking : $root.google.cloud.video.stitcher.v1.AdTracking[message.adTracking] : message.adTracking; + if (message.gamSettings != null && message.hasOwnProperty("gamSettings")) + object.gamSettings = $root.google.cloud.video.stitcher.v1.VodSession.GamSettings.toObject(message.gamSettings, options); return object; }; /** - * Converts this VodSessionContent to JSON. + * Converts this VodSession to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @instance * @returns {Object.} JSON object */ - VodSessionContent.prototype.toJSON = function toJSON() { + VodSession.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VodSessionContent + * Gets the default type url for VodSession * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.VodSessionContent + * @memberof google.cloud.video.stitcher.v1.VodSession * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VodSessionContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VodSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionContent"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSession"; }; - return VodSessionContent; + VodSession.GamSettings = (function() { + + /** + * Properties of a GamSettings. + * @memberof google.cloud.video.stitcher.v1.VodSession + * @interface IGamSettings + * @property {string|null} [networkCode] GamSettings networkCode + * @property {string|null} [streamId] GamSettings streamId + */ + + /** + * Constructs a new GamSettings. + * @memberof google.cloud.video.stitcher.v1.VodSession + * @classdesc Represents a GamSettings. + * @implements IGamSettings + * @constructor + * @param {google.cloud.video.stitcher.v1.VodSession.IGamSettings=} [properties] Properties to set + */ + function GamSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GamSettings networkCode. + * @member {string} networkCode + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @instance + */ + GamSettings.prototype.networkCode = ""; + + /** + * GamSettings streamId. + * @member {string} streamId + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @instance + */ + GamSettings.prototype.streamId = ""; + + /** + * Creates a new GamSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.VodSession.IGamSettings=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodSession.GamSettings} GamSettings instance + */ + GamSettings.create = function create(properties) { + return new GamSettings(properties); + }; + + /** + * Encodes the specified GamSettings message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.GamSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.VodSession.IGamSettings} message GamSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkCode != null && Object.hasOwnProperty.call(message, "networkCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkCode); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamId); + return writer; + }; + + /** + * Encodes the specified GamSettings message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSession.GamSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.VodSession.IGamSettings} message GamSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GamSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.VodSession.GamSettings} GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSession.GamSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.networkCode = reader.string(); + break; + } + case 2: { + message.streamId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GamSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.VodSession.GamSettings} GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GamSettings message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GamSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + if (!$util.isString(message.networkCode)) + return "networkCode: string expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + return null; + }; + + /** + * Creates a GamSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.VodSession.GamSettings} GamSettings + */ + GamSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodSession.GamSettings) + return object; + var message = new $root.google.cloud.video.stitcher.v1.VodSession.GamSettings(); + if (object.networkCode != null) + message.networkCode = String(object.networkCode); + if (object.streamId != null) + message.streamId = String(object.streamId); + return message; + }; + + /** + * Creates a plain object from a GamSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.VodSession.GamSettings} message GamSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GamSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkCode = ""; + object.streamId = ""; + } + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + object.networkCode = message.networkCode; + if (message.streamId != null && message.hasOwnProperty("streamId")) + object.streamId = message.streamId; + return object; + }; + + /** + * Converts this GamSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @instance + * @returns {Object.} JSON object + */ + GamSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GamSettings + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.VodSession.GamSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GamSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSession.GamSettings"; + }; + + return GamSettings; + })(); + + return VodSession; })(); - v1.VodSessionAdBreak = (function() { + v1.Interstitials = (function() { /** - * Properties of a VodSessionAdBreak. + * Properties of an Interstitials. * @memberof google.cloud.video.stitcher.v1 - * @interface IVodSessionAdBreak - * @property {Array.|null} [progressEvents] VodSessionAdBreak progressEvents - * @property {Array.|null} [ads] VodSessionAdBreak ads - * @property {google.protobuf.IDuration|null} [endTimeOffset] VodSessionAdBreak endTimeOffset - * @property {google.protobuf.IDuration|null} [startTimeOffset] VodSessionAdBreak startTimeOffset + * @interface IInterstitials + * @property {Array.|null} [adBreaks] Interstitials adBreaks + * @property {google.cloud.video.stitcher.v1.IVodSessionContent|null} [sessionContent] Interstitials sessionContent */ /** - * Constructs a new VodSessionAdBreak. + * Constructs a new Interstitials. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VodSessionAdBreak. - * @implements IVodSessionAdBreak + * @classdesc Represents an Interstitials. + * @implements IInterstitials * @constructor - * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IInterstitials=} [properties] Properties to set */ - function VodSessionAdBreak(properties) { - this.progressEvents = []; - this.ads = []; + function Interstitials(properties) { + this.adBreaks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5785,123 +6325,92 @@ } /** - * VodSessionAdBreak progressEvents. - * @member {Array.} progressEvents - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak - * @instance - */ - VodSessionAdBreak.prototype.progressEvents = $util.emptyArray; - - /** - * VodSessionAdBreak ads. - * @member {Array.} ads - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak - * @instance - */ - VodSessionAdBreak.prototype.ads = $util.emptyArray; - - /** - * VodSessionAdBreak endTimeOffset. - * @member {google.protobuf.IDuration|null|undefined} endTimeOffset - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * Interstitials adBreaks. + * @member {Array.} adBreaks + * @memberof google.cloud.video.stitcher.v1.Interstitials * @instance */ - VodSessionAdBreak.prototype.endTimeOffset = null; + Interstitials.prototype.adBreaks = $util.emptyArray; /** - * VodSessionAdBreak startTimeOffset. - * @member {google.protobuf.IDuration|null|undefined} startTimeOffset - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * Interstitials sessionContent. + * @member {google.cloud.video.stitcher.v1.IVodSessionContent|null|undefined} sessionContent + * @memberof google.cloud.video.stitcher.v1.Interstitials * @instance */ - VodSessionAdBreak.prototype.startTimeOffset = null; + Interstitials.prototype.sessionContent = null; /** - * Creates a new VodSessionAdBreak instance using the specified properties. + * Creates a new Interstitials instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak instance + * @param {google.cloud.video.stitcher.v1.IInterstitials=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials instance */ - VodSessionAdBreak.create = function create(properties) { - return new VodSessionAdBreak(properties); + Interstitials.create = function create(properties) { + return new Interstitials(properties); }; /** - * Encodes the specified VodSessionAdBreak message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAdBreak.verify|verify} messages. + * Encodes the specified Interstitials message. Does not implicitly {@link google.cloud.video.stitcher.v1.Interstitials.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak} message VodSessionAdBreak message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IInterstitials} message Interstitials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionAdBreak.encode = function encode(message, writer) { + Interstitials.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.progressEvents != null && message.progressEvents.length) - for (var i = 0; i < message.progressEvents.length; ++i) - $root.google.cloud.video.stitcher.v1.ProgressEvent.encode(message.progressEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ads != null && message.ads.length) - for (var i = 0; i < message.ads.length; ++i) - $root.google.cloud.video.stitcher.v1.VodSessionAd.encode(message.ads[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) - $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) - $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.adBreaks != null && message.adBreaks.length) + for (var i = 0; i < message.adBreaks.length; ++i) + $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.encode(message.adBreaks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sessionContent != null && Object.hasOwnProperty.call(message, "sessionContent")) + $root.google.cloud.video.stitcher.v1.VodSessionContent.encode(message.sessionContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified VodSessionAdBreak message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAdBreak.verify|verify} messages. + * Encodes the specified Interstitials message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Interstitials.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static - * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak} message VodSessionAdBreak message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IInterstitials} message Interstitials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodSessionAdBreak.encodeDelimited = function encodeDelimited(message, writer) { + Interstitials.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VodSessionAdBreak message from the specified reader or buffer. + * Decodes an Interstitials message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak + * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionAdBreak.decode = function decode(reader, length) { + Interstitials.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionAdBreak(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.Interstitials(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.progressEvents && message.progressEvents.length)) - message.progressEvents = []; - message.progressEvents.push($root.google.cloud.video.stitcher.v1.ProgressEvent.decode(reader, reader.uint32())); + if (!(message.adBreaks && message.adBreaks.length)) + message.adBreaks = []; + message.adBreaks.push($root.google.cloud.video.stitcher.v1.VodSessionAdBreak.decode(reader, reader.uint32())); break; } case 2: { - if (!(message.ads && message.ads.length)) - message.ads = []; - message.ads.push($root.google.cloud.video.stitcher.v1.VodSessionAd.decode(reader, reader.uint32())); - break; - } - case 3: { - message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.decode(reader, reader.uint32()); break; } default: @@ -5913,205 +6422,156 @@ }; /** - * Decodes a VodSessionAdBreak message from the specified reader or buffer, length delimited. + * Decodes an Interstitials message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak + * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodSessionAdBreak.decodeDelimited = function decodeDelimited(reader) { + Interstitials.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VodSessionAdBreak message. + * Verifies an Interstitials message. * @function verify - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VodSessionAdBreak.verify = function verify(message) { + Interstitials.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.progressEvents != null && message.hasOwnProperty("progressEvents")) { - if (!Array.isArray(message.progressEvents)) - return "progressEvents: array expected"; - for (var i = 0; i < message.progressEvents.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.ProgressEvent.verify(message.progressEvents[i]); - if (error) - return "progressEvents." + error; - } - } - if (message.ads != null && message.hasOwnProperty("ads")) { - if (!Array.isArray(message.ads)) - return "ads: array expected"; - for (var i = 0; i < message.ads.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.VodSessionAd.verify(message.ads[i]); + if (message.adBreaks != null && message.hasOwnProperty("adBreaks")) { + if (!Array.isArray(message.adBreaks)) + return "adBreaks: array expected"; + for (var i = 0; i < message.adBreaks.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.verify(message.adBreaks[i]); if (error) - return "ads." + error; + return "adBreaks." + error; } } - if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { - var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); - if (error) - return "endTimeOffset." + error; - } - if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { - var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (message.sessionContent != null && message.hasOwnProperty("sessionContent")) { + var error = $root.google.cloud.video.stitcher.v1.VodSessionContent.verify(message.sessionContent); if (error) - return "startTimeOffset." + error; + return "sessionContent." + error; } return null; }; /** - * Creates a VodSessionAdBreak message from a plain object. Also converts values to their respective internal types. + * Creates an Interstitials message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak + * @returns {google.cloud.video.stitcher.v1.Interstitials} Interstitials */ - VodSessionAdBreak.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionAdBreak) + Interstitials.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.Interstitials) return object; - var message = new $root.google.cloud.video.stitcher.v1.VodSessionAdBreak(); - if (object.progressEvents) { - if (!Array.isArray(object.progressEvents)) - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.progressEvents: array expected"); - message.progressEvents = []; - for (var i = 0; i < object.progressEvents.length; ++i) { - if (typeof object.progressEvents[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.progressEvents: object expected"); - message.progressEvents[i] = $root.google.cloud.video.stitcher.v1.ProgressEvent.fromObject(object.progressEvents[i]); - } - } - if (object.ads) { - if (!Array.isArray(object.ads)) - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.ads: array expected"); - message.ads = []; - for (var i = 0; i < object.ads.length; ++i) { - if (typeof object.ads[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.ads: object expected"); - message.ads[i] = $root.google.cloud.video.stitcher.v1.VodSessionAd.fromObject(object.ads[i]); + var message = new $root.google.cloud.video.stitcher.v1.Interstitials(); + if (object.adBreaks) { + if (!Array.isArray(object.adBreaks)) + throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.adBreaks: array expected"); + message.adBreaks = []; + for (var i = 0; i < object.adBreaks.length; ++i) { + if (typeof object.adBreaks[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.adBreaks: object expected"); + message.adBreaks[i] = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.fromObject(object.adBreaks[i]); } } - if (object.endTimeOffset != null) { - if (typeof object.endTimeOffset !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.endTimeOffset: object expected"); - message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); - } - if (object.startTimeOffset != null) { - if (typeof object.startTimeOffset !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.startTimeOffset: object expected"); - message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + if (object.sessionContent != null) { + if (typeof object.sessionContent !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.Interstitials.sessionContent: object expected"); + message.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.fromObject(object.sessionContent); } return message; }; /** - * Creates a plain object from a VodSessionAdBreak message. Also converts values to other types if specified. + * Creates a plain object from an Interstitials message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static - * @param {google.cloud.video.stitcher.v1.VodSessionAdBreak} message VodSessionAdBreak + * @param {google.cloud.video.stitcher.v1.Interstitials} message Interstitials * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VodSessionAdBreak.toObject = function toObject(message, options) { + Interstitials.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.progressEvents = []; - object.ads = []; - } - if (options.defaults) { - object.endTimeOffset = null; - object.startTimeOffset = null; - } - if (message.progressEvents && message.progressEvents.length) { - object.progressEvents = []; - for (var j = 0; j < message.progressEvents.length; ++j) - object.progressEvents[j] = $root.google.cloud.video.stitcher.v1.ProgressEvent.toObject(message.progressEvents[j], options); - } - if (message.ads && message.ads.length) { - object.ads = []; - for (var j = 0; j < message.ads.length; ++j) - object.ads[j] = $root.google.cloud.video.stitcher.v1.VodSessionAd.toObject(message.ads[j], options); + if (options.arrays || options.defaults) + object.adBreaks = []; + if (options.defaults) + object.sessionContent = null; + if (message.adBreaks && message.adBreaks.length) { + object.adBreaks = []; + for (var j = 0; j < message.adBreaks.length; ++j) + object.adBreaks[j] = $root.google.cloud.video.stitcher.v1.VodSessionAdBreak.toObject(message.adBreaks[j], options); } - if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) - object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); - if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) - object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + if (message.sessionContent != null && message.hasOwnProperty("sessionContent")) + object.sessionContent = $root.google.cloud.video.stitcher.v1.VodSessionContent.toObject(message.sessionContent, options); return object; }; /** - * Converts this VodSessionAdBreak to JSON. + * Converts this Interstitials to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @instance * @returns {Object.} JSON object */ - VodSessionAdBreak.prototype.toJSON = function toJSON() { + Interstitials.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VodSessionAdBreak + * Gets the default type url for Interstitials * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @memberof google.cloud.video.stitcher.v1.Interstitials * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VodSessionAdBreak.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Interstitials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionAdBreak"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.Interstitials"; }; - return VodSessionAdBreak; + return Interstitials; })(); - v1.LiveSession = (function() { + v1.VodSessionAd = (function() { /** - * Properties of a LiveSession. + * Properties of a VodSessionAd. * @memberof google.cloud.video.stitcher.v1 - * @interface ILiveSession - * @property {string|null} [name] LiveSession name - * @property {string|null} [playUri] LiveSession playUri - * @property {string|null} [sourceUri] LiveSession sourceUri - * @property {string|null} [defaultAdTagId] LiveSession defaultAdTagId - * @property {Object.|null} [adTagMap] LiveSession adTagMap - * @property {Object.|null} [adTagMacros] LiveSession adTagMacros - * @property {boolean|null} [clientAdTracking] LiveSession clientAdTracking - * @property {string|null} [defaultSlateId] LiveSession defaultSlateId - * @property {google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy|null} [stitchingPolicy] LiveSession stitchingPolicy - * @property {google.cloud.video.stitcher.v1.IManifestOptions|null} [manifestOptions] LiveSession manifestOptions - * @property {string|null} [streamId] LiveSession streamId + * @interface IVodSessionAd + * @property {google.protobuf.IDuration|null} [duration] VodSessionAd duration + * @property {google.cloud.video.stitcher.v1.ICompanionAds|null} [companionAds] VodSessionAd companionAds + * @property {Array.|null} [activityEvents] VodSessionAd activityEvents */ /** - * Constructs a new LiveSession. + * Constructs a new VodSessionAd. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a LiveSession. - * @implements ILiveSession + * @classdesc Represents a VodSessionAd. + * @implements IVodSessionAd * @constructor - * @param {google.cloud.video.stitcher.v1.ILiveSession=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IVodSessionAd=} [properties] Properties to set */ - function LiveSession(properties) { - this.adTagMap = {}; - this.adTagMacros = {}; + function VodSessionAd(properties) { + this.activityEvents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6119,257 +6579,106 @@ } /** - * LiveSession name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.name = ""; - - /** - * LiveSession playUri. - * @member {string} playUri - * @memberof google.cloud.video.stitcher.v1.LiveSession + * VodSessionAd duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @instance */ - LiveSession.prototype.playUri = ""; + VodSessionAd.prototype.duration = null; /** - * LiveSession sourceUri. - * @member {string} sourceUri - * @memberof google.cloud.video.stitcher.v1.LiveSession + * VodSessionAd companionAds. + * @member {google.cloud.video.stitcher.v1.ICompanionAds|null|undefined} companionAds + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @instance */ - LiveSession.prototype.sourceUri = ""; + VodSessionAd.prototype.companionAds = null; /** - * LiveSession defaultAdTagId. - * @member {string} defaultAdTagId - * @memberof google.cloud.video.stitcher.v1.LiveSession + * VodSessionAd activityEvents. + * @member {Array.} activityEvents + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @instance */ - LiveSession.prototype.defaultAdTagId = ""; + VodSessionAd.prototype.activityEvents = $util.emptyArray; /** - * LiveSession adTagMap. - * @member {Object.} adTagMap - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance + * Creates a new VodSessionAd instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @static + * @param {google.cloud.video.stitcher.v1.IVodSessionAd=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd instance */ - LiveSession.prototype.adTagMap = $util.emptyObject; + VodSessionAd.create = function create(properties) { + return new VodSessionAd(properties); + }; /** - * LiveSession adTagMacros. - * @member {Object.} adTagMacros - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance + * Encodes the specified VodSessionAd message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAd.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.VodSessionAd + * @static + * @param {google.cloud.video.stitcher.v1.IVodSessionAd} message VodSessionAd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - LiveSession.prototype.adTagMacros = $util.emptyObject; - - /** - * LiveSession clientAdTracking. - * @member {boolean} clientAdTracking - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.clientAdTracking = false; - - /** - * LiveSession defaultSlateId. - * @member {string} defaultSlateId - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.defaultSlateId = ""; - - /** - * LiveSession stitchingPolicy. - * @member {google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy} stitchingPolicy - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.stitchingPolicy = 0; - - /** - * LiveSession manifestOptions. - * @member {google.cloud.video.stitcher.v1.IManifestOptions|null|undefined} manifestOptions - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.manifestOptions = null; - - /** - * LiveSession streamId. - * @member {string} streamId - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @instance - */ - LiveSession.prototype.streamId = ""; - - /** - * Creates a new LiveSession instance using the specified properties. - * @function create - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @static - * @param {google.cloud.video.stitcher.v1.ILiveSession=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession instance - */ - LiveSession.create = function create(properties) { - return new LiveSession(properties); - }; - - /** - * Encodes the specified LiveSession message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.stitcher.v1.LiveSession - * @static - * @param {google.cloud.video.stitcher.v1.ILiveSession} message LiveSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LiveSession.encode = function encode(message, writer) { + VodSessionAd.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.playUri != null && Object.hasOwnProperty.call(message, "playUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.playUri); - if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceUri); - if (message.defaultAdTagId != null && Object.hasOwnProperty.call(message, "defaultAdTagId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultAdTagId); - if (message.adTagMap != null && Object.hasOwnProperty.call(message, "adTagMap")) - for (var keys = Object.keys(message.adTagMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.video.stitcher.v1.AdTag.encode(message.adTagMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.adTagMacros != null && Object.hasOwnProperty.call(message, "adTagMacros")) - for (var keys = Object.keys(message.adTagMacros), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.adTagMacros[keys[i]]).ldelim(); - if (message.clientAdTracking != null && Object.hasOwnProperty.call(message, "clientAdTracking")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.clientAdTracking); - if (message.defaultSlateId != null && Object.hasOwnProperty.call(message, "defaultSlateId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.defaultSlateId); - if (message.stitchingPolicy != null && Object.hasOwnProperty.call(message, "stitchingPolicy")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.stitchingPolicy); - if (message.manifestOptions != null && Object.hasOwnProperty.call(message, "manifestOptions")) - $root.google.cloud.video.stitcher.v1.ManifestOptions.encode(message.manifestOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.streamId); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.companionAds != null && Object.hasOwnProperty.call(message, "companionAds")) + $root.google.cloud.video.stitcher.v1.CompanionAds.encode(message.companionAds, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.activityEvents != null && message.activityEvents.length) + for (var i = 0; i < message.activityEvents.length; ++i) + $root.google.cloud.video.stitcher.v1.Event.encode(message.activityEvents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified LiveSession message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.verify|verify} messages. + * Encodes the specified VodSessionAd message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAd.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static - * @param {google.cloud.video.stitcher.v1.ILiveSession} message LiveSession message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSessionAd} message VodSessionAd message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LiveSession.encodeDelimited = function encodeDelimited(message, writer) { + VodSessionAd.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LiveSession message from the specified reader or buffer. + * Decodes a VodSessionAd message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession + * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LiveSession.decode = function decode(reader, length) { + VodSessionAd.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.LiveSession(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionAd(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } case 2: { - message.playUri = reader.string(); + message.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.decode(reader, reader.uint32()); break; } case 3: { - message.sourceUri = reader.string(); - break; - } - case 4: { - message.defaultAdTagId = reader.string(); - break; - } - case 5: { - if (message.adTagMap === $util.emptyObject) - message.adTagMap = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.video.stitcher.v1.AdTag.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.adTagMap[key] = value; - break; - } - case 6: { - if (message.adTagMacros === $util.emptyObject) - message.adTagMacros = {}; - 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.adTagMacros[key] = value; - break; - } - case 7: { - message.clientAdTracking = reader.bool(); - break; - } - case 8: { - message.defaultSlateId = reader.string(); - break; - } - case 9: { - message.stitchingPolicy = reader.int32(); - break; - } - case 10: { - message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.decode(reader, reader.uint32()); - break; - } - case 11: { - message.streamId = reader.string(); + if (!(message.activityEvents && message.activityEvents.length)) + message.activityEvents = []; + message.activityEvents.push($root.google.cloud.video.stitcher.v1.Event.decode(reader, reader.uint32())); break; } default: @@ -6381,282 +6690,167 @@ }; /** - * Decodes a LiveSession message from the specified reader or buffer, length delimited. + * Decodes a VodSessionAd message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession + * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LiveSession.decodeDelimited = function decodeDelimited(reader) { + VodSessionAd.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LiveSession message. + * Verifies a VodSessionAd message. * @function verify - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LiveSession.verify = function verify(message) { + VodSessionAd.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.playUri != null && message.hasOwnProperty("playUri")) - if (!$util.isString(message.playUri)) - return "playUri: string expected"; - if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) - if (!$util.isString(message.sourceUri)) - return "sourceUri: string expected"; - if (message.defaultAdTagId != null && message.hasOwnProperty("defaultAdTagId")) - if (!$util.isString(message.defaultAdTagId)) - return "defaultAdTagId: string expected"; - if (message.adTagMap != null && message.hasOwnProperty("adTagMap")) { - if (!$util.isObject(message.adTagMap)) - return "adTagMap: object expected"; - var key = Object.keys(message.adTagMap); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.AdTag.verify(message.adTagMap[key[i]]); - if (error) - return "adTagMap." + error; - } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; } - if (message.adTagMacros != null && message.hasOwnProperty("adTagMacros")) { - if (!$util.isObject(message.adTagMacros)) - return "adTagMacros: object expected"; - var key = Object.keys(message.adTagMacros); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.adTagMacros[key[i]])) - return "adTagMacros: string{k:string} expected"; + if (message.companionAds != null && message.hasOwnProperty("companionAds")) { + var error = $root.google.cloud.video.stitcher.v1.CompanionAds.verify(message.companionAds); + if (error) + return "companionAds." + error; } - if (message.clientAdTracking != null && message.hasOwnProperty("clientAdTracking")) - if (typeof message.clientAdTracking !== "boolean") - return "clientAdTracking: boolean expected"; - if (message.defaultSlateId != null && message.hasOwnProperty("defaultSlateId")) - if (!$util.isString(message.defaultSlateId)) - return "defaultSlateId: string expected"; - if (message.stitchingPolicy != null && message.hasOwnProperty("stitchingPolicy")) - switch (message.stitchingPolicy) { - default: - return "stitchingPolicy: enum value expected"; - case 0: - case 1: - case 3: - break; + if (message.activityEvents != null && message.hasOwnProperty("activityEvents")) { + if (!Array.isArray(message.activityEvents)) + return "activityEvents: array expected"; + for (var i = 0; i < message.activityEvents.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.Event.verify(message.activityEvents[i]); + if (error) + return "activityEvents." + error; } - if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) { - var error = $root.google.cloud.video.stitcher.v1.ManifestOptions.verify(message.manifestOptions); - if (error) - return "manifestOptions." + error; } - if (message.streamId != null && message.hasOwnProperty("streamId")) - if (!$util.isString(message.streamId)) - return "streamId: string expected"; return null; }; /** - * Creates a LiveSession message from a plain object. Also converts values to their respective internal types. + * Creates a VodSessionAd message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession + * @returns {google.cloud.video.stitcher.v1.VodSessionAd} VodSessionAd */ - LiveSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.LiveSession) + VodSessionAd.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionAd) return object; - var message = new $root.google.cloud.video.stitcher.v1.LiveSession(); - if (object.name != null) - message.name = String(object.name); - if (object.playUri != null) - message.playUri = String(object.playUri); - if (object.sourceUri != null) - message.sourceUri = String(object.sourceUri); - if (object.defaultAdTagId != null) - message.defaultAdTagId = String(object.defaultAdTagId); - if (object.adTagMap) { - if (typeof object.adTagMap !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.adTagMap: object expected"); - message.adTagMap = {}; - for (var keys = Object.keys(object.adTagMap), i = 0; i < keys.length; ++i) { - if (typeof object.adTagMap[keys[i]] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.adTagMap: object expected"); - message.adTagMap[keys[i]] = $root.google.cloud.video.stitcher.v1.AdTag.fromObject(object.adTagMap[keys[i]]); - } + var message = new $root.google.cloud.video.stitcher.v1.VodSessionAd(); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } - if (object.adTagMacros) { - if (typeof object.adTagMacros !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.adTagMacros: object expected"); - message.adTagMacros = {}; - for (var keys = Object.keys(object.adTagMacros), i = 0; i < keys.length; ++i) - message.adTagMacros[keys[i]] = String(object.adTagMacros[keys[i]]); + if (object.companionAds != null) { + if (typeof object.companionAds !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.companionAds: object expected"); + message.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.fromObject(object.companionAds); } - if (object.clientAdTracking != null) - message.clientAdTracking = Boolean(object.clientAdTracking); - if (object.defaultSlateId != null) - message.defaultSlateId = String(object.defaultSlateId); - switch (object.stitchingPolicy) { - default: - if (typeof object.stitchingPolicy === "number") { - message.stitchingPolicy = object.stitchingPolicy; - break; + if (object.activityEvents) { + if (!Array.isArray(object.activityEvents)) + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.activityEvents: array expected"); + message.activityEvents = []; + for (var i = 0; i < object.activityEvents.length; ++i) { + if (typeof object.activityEvents[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAd.activityEvents: object expected"); + message.activityEvents[i] = $root.google.cloud.video.stitcher.v1.Event.fromObject(object.activityEvents[i]); } - break; - case "STITCHING_POLICY_UNSPECIFIED": - case 0: - message.stitchingPolicy = 0; - break; - case "COMPLETE_AD": - case 1: - message.stitchingPolicy = 1; - break; - case "CUT_CURRENT": - case 3: - message.stitchingPolicy = 3; - break; - } - if (object.manifestOptions != null) { - if (typeof object.manifestOptions !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.manifestOptions: object expected"); - message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.fromObject(object.manifestOptions); } - if (object.streamId != null) - message.streamId = String(object.streamId); return message; }; /** - * Creates a plain object from a LiveSession message. Also converts values to other types if specified. + * Creates a plain object from a VodSessionAd message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static - * @param {google.cloud.video.stitcher.v1.LiveSession} message LiveSession + * @param {google.cloud.video.stitcher.v1.VodSessionAd} message VodSessionAd * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LiveSession.toObject = function toObject(message, options) { + VodSessionAd.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.adTagMap = {}; - object.adTagMacros = {}; - } + if (options.arrays || options.defaults) + object.activityEvents = []; if (options.defaults) { - object.name = ""; - object.playUri = ""; - object.sourceUri = ""; - object.defaultAdTagId = ""; - object.clientAdTracking = false; - object.defaultSlateId = ""; - object.stitchingPolicy = options.enums === String ? "STITCHING_POLICY_UNSPECIFIED" : 0; - object.manifestOptions = null; - object.streamId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.playUri != null && message.hasOwnProperty("playUri")) - object.playUri = message.playUri; - if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) - object.sourceUri = message.sourceUri; - if (message.defaultAdTagId != null && message.hasOwnProperty("defaultAdTagId")) - object.defaultAdTagId = message.defaultAdTagId; - var keys2; - if (message.adTagMap && (keys2 = Object.keys(message.adTagMap)).length) { - object.adTagMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.adTagMap[keys2[j]] = $root.google.cloud.video.stitcher.v1.AdTag.toObject(message.adTagMap[keys2[j]], options); + object.duration = null; + object.companionAds = null; } - if (message.adTagMacros && (keys2 = Object.keys(message.adTagMacros)).length) { - object.adTagMacros = {}; - for (var j = 0; j < keys2.length; ++j) - object.adTagMacros[keys2[j]] = message.adTagMacros[keys2[j]]; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.companionAds != null && message.hasOwnProperty("companionAds")) + object.companionAds = $root.google.cloud.video.stitcher.v1.CompanionAds.toObject(message.companionAds, options); + if (message.activityEvents && message.activityEvents.length) { + object.activityEvents = []; + for (var j = 0; j < message.activityEvents.length; ++j) + object.activityEvents[j] = $root.google.cloud.video.stitcher.v1.Event.toObject(message.activityEvents[j], options); } - if (message.clientAdTracking != null && message.hasOwnProperty("clientAdTracking")) - object.clientAdTracking = message.clientAdTracking; - if (message.defaultSlateId != null && message.hasOwnProperty("defaultSlateId")) - object.defaultSlateId = message.defaultSlateId; - if (message.stitchingPolicy != null && message.hasOwnProperty("stitchingPolicy")) - object.stitchingPolicy = options.enums === String ? $root.google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy[message.stitchingPolicy] === undefined ? message.stitchingPolicy : $root.google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy[message.stitchingPolicy] : message.stitchingPolicy; - if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) - object.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.toObject(message.manifestOptions, options); - if (message.streamId != null && message.hasOwnProperty("streamId")) - object.streamId = message.streamId; return object; }; /** - * Converts this LiveSession to JSON. + * Converts this VodSessionAd to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @instance * @returns {Object.} JSON object */ - LiveSession.prototype.toJSON = function toJSON() { + VodSessionAd.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LiveSession + * Gets the default type url for VodSessionAd * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.LiveSession + * @memberof google.cloud.video.stitcher.v1.VodSessionAd * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LiveSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VodSessionAd.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.LiveSession"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionAd"; }; - /** - * StitchingPolicy enum. - * @name google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy - * @enum {number} - * @property {number} STITCHING_POLICY_UNSPECIFIED=0 STITCHING_POLICY_UNSPECIFIED value - * @property {number} COMPLETE_AD=1 COMPLETE_AD value - * @property {number} CUT_CURRENT=3 CUT_CURRENT value - */ - LiveSession.StitchingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STITCHING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPLETE_AD"] = 1; - values[valuesById[3] = "CUT_CURRENT"] = 3; - return values; - })(); - - return LiveSession; + return VodSessionAd; })(); - v1.AdTag = (function() { + v1.VodSessionContent = (function() { /** - * Properties of an AdTag. + * Properties of a VodSessionContent. * @memberof google.cloud.video.stitcher.v1 - * @interface IAdTag - * @property {string|null} [uri] AdTag uri + * @interface IVodSessionContent + * @property {google.protobuf.IDuration|null} [duration] VodSessionContent duration */ /** - * Constructs a new AdTag. + * Constructs a new VodSessionContent. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents an AdTag. - * @implements IAdTag + * @classdesc Represents a VodSessionContent. + * @implements IVodSessionContent * @constructor - * @param {google.cloud.video.stitcher.v1.IAdTag=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IVodSessionContent=} [properties] Properties to set */ - function AdTag(properties) { + function VodSessionContent(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6664,75 +6858,75 @@ } /** - * AdTag uri. - * @member {string} uri - * @memberof google.cloud.video.stitcher.v1.AdTag + * VodSessionContent duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @instance */ - AdTag.prototype.uri = ""; + VodSessionContent.prototype.duration = null; /** - * Creates a new AdTag instance using the specified properties. + * Creates a new VodSessionContent instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static - * @param {google.cloud.video.stitcher.v1.IAdTag=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.AdTag} AdTag instance + * @param {google.cloud.video.stitcher.v1.IVodSessionContent=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent instance */ - AdTag.create = function create(properties) { - return new AdTag(properties); + VodSessionContent.create = function create(properties) { + return new VodSessionContent(properties); }; /** - * Encodes the specified AdTag message. Does not implicitly {@link google.cloud.video.stitcher.v1.AdTag.verify|verify} messages. + * Encodes the specified VodSessionContent message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionContent.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static - * @param {google.cloud.video.stitcher.v1.IAdTag} message AdTag message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSessionContent} message VodSessionContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdTag.encode = function encode(message, writer) { + VodSessionContent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified AdTag message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.AdTag.verify|verify} messages. + * Encodes the specified VodSessionContent message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionContent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static - * @param {google.cloud.video.stitcher.v1.IAdTag} message AdTag message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSessionContent} message VodSessionContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdTag.encodeDelimited = function encodeDelimited(message, writer) { + VodSessionContent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AdTag message from the specified reader or buffer. + * Decodes a VodSessionContent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.AdTag} AdTag + * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdTag.decode = function decode(reader, length) { + VodSessionContent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.AdTag(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionContent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.uri = reader.string(); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -6744,124 +6938,132 @@ }; /** - * Decodes an AdTag message from the specified reader or buffer, length delimited. + * Decodes a VodSessionContent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.AdTag} AdTag + * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdTag.decodeDelimited = function decodeDelimited(reader) { + VodSessionContent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AdTag message. + * Verifies a VodSessionContent message. * @function verify - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AdTag.verify = function verify(message) { + VodSessionContent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } return null; }; /** - * Creates an AdTag message from a plain object. Also converts values to their respective internal types. + * Creates a VodSessionContent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.AdTag} AdTag + * @returns {google.cloud.video.stitcher.v1.VodSessionContent} VodSessionContent */ - AdTag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.AdTag) + VodSessionContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionContent) return object; - var message = new $root.google.cloud.video.stitcher.v1.AdTag(); - if (object.uri != null) - message.uri = String(object.uri); + var message = new $root.google.cloud.video.stitcher.v1.VodSessionContent(); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionContent.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } return message; }; /** - * Creates a plain object from an AdTag message. Also converts values to other types if specified. + * Creates a plain object from a VodSessionContent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static - * @param {google.cloud.video.stitcher.v1.AdTag} message AdTag + * @param {google.cloud.video.stitcher.v1.VodSessionContent} message VodSessionContent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdTag.toObject = function toObject(message, options) { + VodSessionContent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; + object.duration = null; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); return object; }; /** - * Converts this AdTag to JSON. + * Converts this VodSessionContent to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @instance * @returns {Object.} JSON object */ - AdTag.prototype.toJSON = function toJSON() { + VodSessionContent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AdTag + * Gets the default type url for VodSessionContent * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.AdTag + * @memberof google.cloud.video.stitcher.v1.VodSessionContent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AdTag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VodSessionContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.AdTag"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionContent"; }; - return AdTag; + return VodSessionContent; })(); - v1.ManifestOptions = (function() { + v1.VodSessionAdBreak = (function() { /** - * Properties of a ManifestOptions. + * Properties of a VodSessionAdBreak. * @memberof google.cloud.video.stitcher.v1 - * @interface IManifestOptions - * @property {Array.|null} [includeRenditions] ManifestOptions includeRenditions - * @property {google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy|null} [bitrateOrder] ManifestOptions bitrateOrder + * @interface IVodSessionAdBreak + * @property {Array.|null} [progressEvents] VodSessionAdBreak progressEvents + * @property {Array.|null} [ads] VodSessionAdBreak ads + * @property {google.protobuf.IDuration|null} [endTimeOffset] VodSessionAdBreak endTimeOffset + * @property {google.protobuf.IDuration|null} [startTimeOffset] VodSessionAdBreak startTimeOffset */ /** - * Constructs a new ManifestOptions. + * Constructs a new VodSessionAdBreak. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ManifestOptions. - * @implements IManifestOptions + * @classdesc Represents a VodSessionAdBreak. + * @implements IVodSessionAdBreak * @constructor - * @param {google.cloud.video.stitcher.v1.IManifestOptions=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak=} [properties] Properties to set */ - function ManifestOptions(properties) { - this.includeRenditions = []; + function VodSessionAdBreak(properties) { + this.progressEvents = []; + this.ads = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6869,92 +7071,123 @@ } /** - * ManifestOptions includeRenditions. - * @member {Array.} includeRenditions - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * VodSessionAdBreak progressEvents. + * @member {Array.} progressEvents + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @instance */ - ManifestOptions.prototype.includeRenditions = $util.emptyArray; + VodSessionAdBreak.prototype.progressEvents = $util.emptyArray; /** - * ManifestOptions bitrateOrder. - * @member {google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy} bitrateOrder - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * VodSessionAdBreak ads. + * @member {Array.} ads + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @instance */ - ManifestOptions.prototype.bitrateOrder = 0; + VodSessionAdBreak.prototype.ads = $util.emptyArray; /** - * Creates a new ManifestOptions instance using the specified properties. + * VodSessionAdBreak endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @instance + */ + VodSessionAdBreak.prototype.endTimeOffset = null; + + /** + * VodSessionAdBreak startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak + * @instance + */ + VodSessionAdBreak.prototype.startTimeOffset = null; + + /** + * Creates a new VodSessionAdBreak instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static - * @param {google.cloud.video.stitcher.v1.IManifestOptions=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions instance + * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak instance */ - ManifestOptions.create = function create(properties) { - return new ManifestOptions(properties); + VodSessionAdBreak.create = function create(properties) { + return new VodSessionAdBreak(properties); }; /** - * Encodes the specified ManifestOptions message. Does not implicitly {@link google.cloud.video.stitcher.v1.ManifestOptions.verify|verify} messages. + * Encodes the specified VodSessionAdBreak message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAdBreak.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static - * @param {google.cloud.video.stitcher.v1.IManifestOptions} message ManifestOptions message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak} message VodSessionAdBreak message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ManifestOptions.encode = function encode(message, writer) { + VodSessionAdBreak.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.includeRenditions != null && message.includeRenditions.length) - for (var i = 0; i < message.includeRenditions.length; ++i) - $root.google.cloud.video.stitcher.v1.RenditionFilter.encode(message.includeRenditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bitrateOrder != null && Object.hasOwnProperty.call(message, "bitrateOrder")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bitrateOrder); + if (message.progressEvents != null && message.progressEvents.length) + for (var i = 0; i < message.progressEvents.length; ++i) + $root.google.cloud.video.stitcher.v1.ProgressEvent.encode(message.progressEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ads != null && message.ads.length) + for (var i = 0; i < message.ads.length; ++i) + $root.google.cloud.video.stitcher.v1.VodSessionAd.encode(message.ads[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ManifestOptions message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ManifestOptions.verify|verify} messages. + * Encodes the specified VodSessionAdBreak message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodSessionAdBreak.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static - * @param {google.cloud.video.stitcher.v1.IManifestOptions} message ManifestOptions message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IVodSessionAdBreak} message VodSessionAdBreak message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ManifestOptions.encodeDelimited = function encodeDelimited(message, writer) { + VodSessionAdBreak.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ManifestOptions message from the specified reader or buffer. + * Decodes a VodSessionAdBreak message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions + * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ManifestOptions.decode = function decode(reader, length) { + VodSessionAdBreak.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ManifestOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodSessionAdBreak(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.includeRenditions && message.includeRenditions.length)) - message.includeRenditions = []; - message.includeRenditions.push($root.google.cloud.video.stitcher.v1.RenditionFilter.decode(reader, reader.uint32())); + if (!(message.progressEvents && message.progressEvents.length)) + message.progressEvents = []; + message.progressEvents.push($root.google.cloud.video.stitcher.v1.ProgressEvent.decode(reader, reader.uint32())); break; } case 2: { - message.bitrateOrder = reader.int32(); + if (!(message.ads && message.ads.length)) + message.ads = []; + message.ads.push($root.google.cloud.video.stitcher.v1.VodSessionAd.decode(reader, reader.uint32())); + break; + } + case 3: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -6966,189 +7199,199 @@ }; /** - * Decodes a ManifestOptions message from the specified reader or buffer, length delimited. + * Decodes a VodSessionAdBreak message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions + * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ManifestOptions.decodeDelimited = function decodeDelimited(reader) { + VodSessionAdBreak.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ManifestOptions message. + * Verifies a VodSessionAdBreak message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ManifestOptions.verify = function verify(message) { + VodSessionAdBreak.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.includeRenditions != null && message.hasOwnProperty("includeRenditions")) { - if (!Array.isArray(message.includeRenditions)) - return "includeRenditions: array expected"; - for (var i = 0; i < message.includeRenditions.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.RenditionFilter.verify(message.includeRenditions[i]); + if (message.progressEvents != null && message.hasOwnProperty("progressEvents")) { + if (!Array.isArray(message.progressEvents)) + return "progressEvents: array expected"; + for (var i = 0; i < message.progressEvents.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.ProgressEvent.verify(message.progressEvents[i]); if (error) - return "includeRenditions." + error; + return "progressEvents." + error; } } - if (message.bitrateOrder != null && message.hasOwnProperty("bitrateOrder")) - switch (message.bitrateOrder) { - default: - return "bitrateOrder: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.ads != null && message.hasOwnProperty("ads")) { + if (!Array.isArray(message.ads)) + return "ads: array expected"; + for (var i = 0; i < message.ads.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.VodSessionAd.verify(message.ads[i]); + if (error) + return "ads." + error; } + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } return null; }; /** - * Creates a ManifestOptions message from a plain object. Also converts values to their respective internal types. + * Creates a VodSessionAdBreak message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions + * @returns {google.cloud.video.stitcher.v1.VodSessionAdBreak} VodSessionAdBreak */ - ManifestOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ManifestOptions) + VodSessionAdBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodSessionAdBreak) return object; - var message = new $root.google.cloud.video.stitcher.v1.ManifestOptions(); - if (object.includeRenditions) { - if (!Array.isArray(object.includeRenditions)) - throw TypeError(".google.cloud.video.stitcher.v1.ManifestOptions.includeRenditions: array expected"); - message.includeRenditions = []; - for (var i = 0; i < object.includeRenditions.length; ++i) { - if (typeof object.includeRenditions[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ManifestOptions.includeRenditions: object expected"); - message.includeRenditions[i] = $root.google.cloud.video.stitcher.v1.RenditionFilter.fromObject(object.includeRenditions[i]); + var message = new $root.google.cloud.video.stitcher.v1.VodSessionAdBreak(); + if (object.progressEvents) { + if (!Array.isArray(object.progressEvents)) + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.progressEvents: array expected"); + message.progressEvents = []; + for (var i = 0; i < object.progressEvents.length; ++i) { + if (typeof object.progressEvents[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.progressEvents: object expected"); + message.progressEvents[i] = $root.google.cloud.video.stitcher.v1.ProgressEvent.fromObject(object.progressEvents[i]); } } - switch (object.bitrateOrder) { - default: - if (typeof object.bitrateOrder === "number") { - message.bitrateOrder = object.bitrateOrder; - break; + if (object.ads) { + if (!Array.isArray(object.ads)) + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.ads: array expected"); + message.ads = []; + for (var i = 0; i < object.ads.length; ++i) { + if (typeof object.ads[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.ads: object expected"); + message.ads[i] = $root.google.cloud.video.stitcher.v1.VodSessionAd.fromObject(object.ads[i]); } - break; - case "ORDER_POLICY_UNSPECIFIED": - case 0: - message.bitrateOrder = 0; - break; - case "ASCENDING": - case 1: - message.bitrateOrder = 1; - break; - case "DESCENDING": - case 2: - message.bitrateOrder = 2; - break; + } + if (object.endTimeOffset != null) { + if (typeof object.endTimeOffset !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodSessionAdBreak.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); } return message; }; /** - * Creates a plain object from a ManifestOptions message. Also converts values to other types if specified. + * Creates a plain object from a VodSessionAdBreak message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static - * @param {google.cloud.video.stitcher.v1.ManifestOptions} message ManifestOptions + * @param {google.cloud.video.stitcher.v1.VodSessionAdBreak} message VodSessionAdBreak * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ManifestOptions.toObject = function toObject(message, options) { + VodSessionAdBreak.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.includeRenditions = []; - if (options.defaults) - object.bitrateOrder = options.enums === String ? "ORDER_POLICY_UNSPECIFIED" : 0; - if (message.includeRenditions && message.includeRenditions.length) { - object.includeRenditions = []; - for (var j = 0; j < message.includeRenditions.length; ++j) - object.includeRenditions[j] = $root.google.cloud.video.stitcher.v1.RenditionFilter.toObject(message.includeRenditions[j], options); + if (options.arrays || options.defaults) { + object.progressEvents = []; + object.ads = []; } - if (message.bitrateOrder != null && message.hasOwnProperty("bitrateOrder")) - object.bitrateOrder = options.enums === String ? $root.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy[message.bitrateOrder] === undefined ? message.bitrateOrder : $root.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy[message.bitrateOrder] : message.bitrateOrder; + if (options.defaults) { + object.endTimeOffset = null; + object.startTimeOffset = null; + } + if (message.progressEvents && message.progressEvents.length) { + object.progressEvents = []; + for (var j = 0; j < message.progressEvents.length; ++j) + object.progressEvents[j] = $root.google.cloud.video.stitcher.v1.ProgressEvent.toObject(message.progressEvents[j], options); + } + if (message.ads && message.ads.length) { + object.ads = []; + for (var j = 0; j < message.ads.length; ++j) + object.ads[j] = $root.google.cloud.video.stitcher.v1.VodSessionAd.toObject(message.ads[j], options); + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) + object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); return object; }; /** - * Converts this ManifestOptions to JSON. + * Converts this VodSessionAdBreak to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @instance * @returns {Object.} JSON object */ - ManifestOptions.prototype.toJSON = function toJSON() { + VodSessionAdBreak.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ManifestOptions + * Gets the default type url for VodSessionAdBreak * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ManifestOptions + * @memberof google.cloud.video.stitcher.v1.VodSessionAdBreak * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ManifestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VodSessionAdBreak.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ManifestOptions"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodSessionAdBreak"; }; - /** - * OrderPolicy enum. - * @name google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy - * @enum {number} - * @property {number} ORDER_POLICY_UNSPECIFIED=0 ORDER_POLICY_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - ManifestOptions.OrderPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); - - return ManifestOptions; + return VodSessionAdBreak; })(); - v1.RenditionFilter = (function() { + v1.LiveSession = (function() { /** - * Properties of a RenditionFilter. + * Properties of a LiveSession. * @memberof google.cloud.video.stitcher.v1 - * @interface IRenditionFilter - * @property {number|null} [bitrateBps] RenditionFilter bitrateBps - * @property {string|null} [codecs] RenditionFilter codecs + * @interface ILiveSession + * @property {string|null} [name] LiveSession name + * @property {string|null} [playUri] LiveSession playUri + * @property {Object.|null} [adTagMacros] LiveSession adTagMacros + * @property {google.cloud.video.stitcher.v1.IManifestOptions|null} [manifestOptions] LiveSession manifestOptions + * @property {google.cloud.video.stitcher.v1.LiveSession.IGamSettings|null} [gamSettings] LiveSession gamSettings + * @property {string|null} [liveConfig] LiveSession liveConfig */ /** - * Constructs a new RenditionFilter. + * Constructs a new LiveSession. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a RenditionFilter. - * @implements IRenditionFilter + * @classdesc Represents a LiveSession. + * @implements ILiveSession * @constructor - * @param {google.cloud.video.stitcher.v1.IRenditionFilter=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.ILiveSession=} [properties] Properties to set */ - function RenditionFilter(properties) { + function LiveSession(properties) { + this.adTagMacros = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7156,89 +7399,165 @@ } /** - * RenditionFilter bitrateBps. - * @member {number} bitrateBps - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * LiveSession name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.LiveSession * @instance */ - RenditionFilter.prototype.bitrateBps = 0; + LiveSession.prototype.name = ""; /** - * RenditionFilter codecs. - * @member {string} codecs - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * LiveSession playUri. + * @member {string} playUri + * @memberof google.cloud.video.stitcher.v1.LiveSession * @instance */ - RenditionFilter.prototype.codecs = ""; + LiveSession.prototype.playUri = ""; /** - * Creates a new RenditionFilter instance using the specified properties. + * LiveSession adTagMacros. + * @member {Object.} adTagMacros + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @instance + */ + LiveSession.prototype.adTagMacros = $util.emptyObject; + + /** + * LiveSession manifestOptions. + * @member {google.cloud.video.stitcher.v1.IManifestOptions|null|undefined} manifestOptions + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @instance + */ + LiveSession.prototype.manifestOptions = null; + + /** + * LiveSession gamSettings. + * @member {google.cloud.video.stitcher.v1.LiveSession.IGamSettings|null|undefined} gamSettings + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @instance + */ + LiveSession.prototype.gamSettings = null; + + /** + * LiveSession liveConfig. + * @member {string} liveConfig + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @instance + */ + LiveSession.prototype.liveConfig = ""; + + /** + * Creates a new LiveSession instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static - * @param {google.cloud.video.stitcher.v1.IRenditionFilter=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter instance + * @param {google.cloud.video.stitcher.v1.ILiveSession=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession instance */ - RenditionFilter.create = function create(properties) { - return new RenditionFilter(properties); + LiveSession.create = function create(properties) { + return new LiveSession(properties); }; /** - * Encodes the specified RenditionFilter message. Does not implicitly {@link google.cloud.video.stitcher.v1.RenditionFilter.verify|verify} messages. + * Encodes the specified LiveSession message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static - * @param {google.cloud.video.stitcher.v1.IRenditionFilter} message RenditionFilter message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ILiveSession} message LiveSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RenditionFilter.encode = function encode(message, writer) { + LiveSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bitrateBps != null && Object.hasOwnProperty.call(message, "bitrateBps")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.bitrateBps); - if (message.codecs != null && Object.hasOwnProperty.call(message, "codecs")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.codecs); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.playUri != null && Object.hasOwnProperty.call(message, "playUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.playUri); + if (message.adTagMacros != null && Object.hasOwnProperty.call(message, "adTagMacros")) + for (var keys = Object.keys(message.adTagMacros), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.adTagMacros[keys[i]]).ldelim(); + if (message.manifestOptions != null && Object.hasOwnProperty.call(message, "manifestOptions")) + $root.google.cloud.video.stitcher.v1.ManifestOptions.encode(message.manifestOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.gamSettings != null && Object.hasOwnProperty.call(message, "gamSettings")) + $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings.encode(message.gamSettings, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.liveConfig != null && Object.hasOwnProperty.call(message, "liveConfig")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.liveConfig); return writer; }; /** - * Encodes the specified RenditionFilter message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.RenditionFilter.verify|verify} messages. + * Encodes the specified LiveSession message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static - * @param {google.cloud.video.stitcher.v1.IRenditionFilter} message RenditionFilter message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ILiveSession} message LiveSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RenditionFilter.encodeDelimited = function encodeDelimited(message, writer) { + LiveSession.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RenditionFilter message from the specified reader or buffer. + * Decodes a LiveSession message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter + * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RenditionFilter.decode = function decode(reader, length) { + LiveSession.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.RenditionFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.LiveSession(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.bitrateBps = reader.int32(); + message.name = reader.string(); break; } case 2: { - message.codecs = reader.string(); + message.playUri = reader.string(); + break; + } + case 6: { + if (message.adTagMacros === $util.emptyObject) + message.adTagMacros = {}; + 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.adTagMacros[key] = value; + break; + } + case 10: { + message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.gamSettings = $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings.decode(reader, reader.uint32()); + break; + } + case 16: { + message.liveConfig = reader.string(); break; } default: @@ -7250,132 +7569,393 @@ }; /** - * Decodes a RenditionFilter message from the specified reader or buffer, length delimited. + * Decodes a LiveSession message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter + * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RenditionFilter.decodeDelimited = function decodeDelimited(reader) { + LiveSession.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RenditionFilter message. + * Verifies a LiveSession message. * @function verify - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RenditionFilter.verify = function verify(message) { + LiveSession.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) - if (!$util.isInteger(message.bitrateBps)) - return "bitrateBps: integer expected"; - if (message.codecs != null && message.hasOwnProperty("codecs")) - if (!$util.isString(message.codecs)) - return "codecs: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.playUri != null && message.hasOwnProperty("playUri")) + if (!$util.isString(message.playUri)) + return "playUri: string expected"; + if (message.adTagMacros != null && message.hasOwnProperty("adTagMacros")) { + if (!$util.isObject(message.adTagMacros)) + return "adTagMacros: object expected"; + var key = Object.keys(message.adTagMacros); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.adTagMacros[key[i]])) + return "adTagMacros: string{k:string} expected"; + } + if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) { + var error = $root.google.cloud.video.stitcher.v1.ManifestOptions.verify(message.manifestOptions); + if (error) + return "manifestOptions." + error; + } + if (message.gamSettings != null && message.hasOwnProperty("gamSettings")) { + var error = $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings.verify(message.gamSettings); + if (error) + return "gamSettings." + error; + } + if (message.liveConfig != null && message.hasOwnProperty("liveConfig")) + if (!$util.isString(message.liveConfig)) + return "liveConfig: string expected"; return null; }; /** - * Creates a RenditionFilter message from a plain object. Also converts values to their respective internal types. + * Creates a LiveSession message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter + * @returns {google.cloud.video.stitcher.v1.LiveSession} LiveSession */ - RenditionFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.RenditionFilter) + LiveSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.LiveSession) return object; - var message = new $root.google.cloud.video.stitcher.v1.RenditionFilter(); - if (object.bitrateBps != null) - message.bitrateBps = object.bitrateBps | 0; - if (object.codecs != null) - message.codecs = String(object.codecs); + var message = new $root.google.cloud.video.stitcher.v1.LiveSession(); + if (object.name != null) + message.name = String(object.name); + if (object.playUri != null) + message.playUri = String(object.playUri); + if (object.adTagMacros) { + if (typeof object.adTagMacros !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.adTagMacros: object expected"); + message.adTagMacros = {}; + for (var keys = Object.keys(object.adTagMacros), i = 0; i < keys.length; ++i) + message.adTagMacros[keys[i]] = String(object.adTagMacros[keys[i]]); + } + if (object.manifestOptions != null) { + if (typeof object.manifestOptions !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.manifestOptions: object expected"); + message.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.fromObject(object.manifestOptions); + } + if (object.gamSettings != null) { + if (typeof object.gamSettings !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.LiveSession.gamSettings: object expected"); + message.gamSettings = $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings.fromObject(object.gamSettings); + } + if (object.liveConfig != null) + message.liveConfig = String(object.liveConfig); return message; }; /** - * Creates a plain object from a RenditionFilter message. Also converts values to other types if specified. + * Creates a plain object from a LiveSession message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static - * @param {google.cloud.video.stitcher.v1.RenditionFilter} message RenditionFilter + * @param {google.cloud.video.stitcher.v1.LiveSession} message LiveSession * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RenditionFilter.toObject = function toObject(message, options) { + LiveSession.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.adTagMacros = {}; if (options.defaults) { - object.bitrateBps = 0; - object.codecs = ""; + object.name = ""; + object.playUri = ""; + object.manifestOptions = null; + object.gamSettings = null; + object.liveConfig = ""; } - if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) - object.bitrateBps = message.bitrateBps; - if (message.codecs != null && message.hasOwnProperty("codecs")) - object.codecs = message.codecs; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.playUri != null && message.hasOwnProperty("playUri")) + object.playUri = message.playUri; + var keys2; + if (message.adTagMacros && (keys2 = Object.keys(message.adTagMacros)).length) { + object.adTagMacros = {}; + for (var j = 0; j < keys2.length; ++j) + object.adTagMacros[keys2[j]] = message.adTagMacros[keys2[j]]; + } + if (message.manifestOptions != null && message.hasOwnProperty("manifestOptions")) + object.manifestOptions = $root.google.cloud.video.stitcher.v1.ManifestOptions.toObject(message.manifestOptions, options); + if (message.gamSettings != null && message.hasOwnProperty("gamSettings")) + object.gamSettings = $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings.toObject(message.gamSettings, options); + if (message.liveConfig != null && message.hasOwnProperty("liveConfig")) + object.liveConfig = message.liveConfig; return object; }; /** - * Converts this RenditionFilter to JSON. + * Converts this LiveSession to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @instance * @returns {Object.} JSON object */ - RenditionFilter.prototype.toJSON = function toJSON() { + LiveSession.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RenditionFilter + * Gets the default type url for LiveSession * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.RenditionFilter + * @memberof google.cloud.video.stitcher.v1.LiveSession * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RenditionFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LiveSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.RenditionFilter"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.LiveSession"; }; - return RenditionFilter; + LiveSession.GamSettings = (function() { + + /** + * Properties of a GamSettings. + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @interface IGamSettings + * @property {string|null} [streamId] GamSettings streamId + */ + + /** + * Constructs a new GamSettings. + * @memberof google.cloud.video.stitcher.v1.LiveSession + * @classdesc Represents a GamSettings. + * @implements IGamSettings + * @constructor + * @param {google.cloud.video.stitcher.v1.LiveSession.IGamSettings=} [properties] Properties to set + */ + function GamSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GamSettings streamId. + * @member {string} streamId + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @instance + */ + GamSettings.prototype.streamId = ""; + + /** + * Creates a new GamSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.LiveSession.IGamSettings=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.LiveSession.GamSettings} GamSettings instance + */ + GamSettings.create = function create(properties) { + return new GamSettings(properties); + }; + + /** + * Encodes the specified GamSettings message. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.GamSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.LiveSession.IGamSettings} message GamSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streamId); + return writer; + }; + + /** + * Encodes the specified GamSettings message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.LiveSession.GamSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.LiveSession.IGamSettings} message GamSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GamSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.LiveSession.GamSettings} GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.streamId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GamSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.LiveSession.GamSettings} GamSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GamSettings message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GamSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + return null; + }; + + /** + * Creates a GamSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.LiveSession.GamSettings} GamSettings + */ + GamSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings) + return object; + var message = new $root.google.cloud.video.stitcher.v1.LiveSession.GamSettings(); + if (object.streamId != null) + message.streamId = String(object.streamId); + return message; + }; + + /** + * Creates a plain object from a GamSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {google.cloud.video.stitcher.v1.LiveSession.GamSettings} message GamSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GamSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.streamId = ""; + if (message.streamId != null && message.hasOwnProperty("streamId")) + object.streamId = message.streamId; + return object; + }; + + /** + * Converts this GamSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @instance + * @returns {Object.} JSON object + */ + GamSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GamSettings + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.LiveSession.GamSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GamSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.LiveSession.GamSettings"; + }; + + return GamSettings; + })(); + + return LiveSession; })(); - v1.Slate = (function() { + v1.ManifestOptions = (function() { /** - * Properties of a Slate. + * Properties of a ManifestOptions. * @memberof google.cloud.video.stitcher.v1 - * @interface ISlate - * @property {string|null} [name] Slate name - * @property {string|null} [uri] Slate uri + * @interface IManifestOptions + * @property {Array.|null} [includeRenditions] ManifestOptions includeRenditions + * @property {google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy|null} [bitrateOrder] ManifestOptions bitrateOrder */ /** - * Constructs a new Slate. + * Constructs a new ManifestOptions. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a Slate. - * @implements ISlate + * @classdesc Represents a ManifestOptions. + * @implements IManifestOptions * @constructor - * @param {google.cloud.video.stitcher.v1.ISlate=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IManifestOptions=} [properties] Properties to set */ - function Slate(properties) { + function ManifestOptions(properties) { + this.includeRenditions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7383,89 +7963,92 @@ } /** - * Slate name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.Slate + * ManifestOptions includeRenditions. + * @member {Array.} includeRenditions + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @instance */ - Slate.prototype.name = ""; + ManifestOptions.prototype.includeRenditions = $util.emptyArray; /** - * Slate uri. - * @member {string} uri - * @memberof google.cloud.video.stitcher.v1.Slate + * ManifestOptions bitrateOrder. + * @member {google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy} bitrateOrder + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @instance */ - Slate.prototype.uri = ""; + ManifestOptions.prototype.bitrateOrder = 0; /** - * Creates a new Slate instance using the specified properties. + * Creates a new ManifestOptions instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static - * @param {google.cloud.video.stitcher.v1.ISlate=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.Slate} Slate instance + * @param {google.cloud.video.stitcher.v1.IManifestOptions=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions instance */ - Slate.create = function create(properties) { - return new Slate(properties); + ManifestOptions.create = function create(properties) { + return new ManifestOptions(properties); }; /** - * Encodes the specified Slate message. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.verify|verify} messages. + * Encodes the specified ManifestOptions message. Does not implicitly {@link google.cloud.video.stitcher.v1.ManifestOptions.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static - * @param {google.cloud.video.stitcher.v1.ISlate} message Slate message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IManifestOptions} message ManifestOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Slate.encode = function encode(message, writer) { + ManifestOptions.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.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.includeRenditions != null && message.includeRenditions.length) + for (var i = 0; i < message.includeRenditions.length; ++i) + $root.google.cloud.video.stitcher.v1.RenditionFilter.encode(message.includeRenditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bitrateOrder != null && Object.hasOwnProperty.call(message, "bitrateOrder")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bitrateOrder); return writer; }; /** - * Encodes the specified Slate message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.verify|verify} messages. + * Encodes the specified ManifestOptions message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ManifestOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static - * @param {google.cloud.video.stitcher.v1.ISlate} message Slate message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IManifestOptions} message ManifestOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Slate.encodeDelimited = function encodeDelimited(message, writer) { + ManifestOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Slate message from the specified reader or buffer. + * Decodes a ManifestOptions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.Slate} Slate + * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Slate.decode = function decode(reader, length) { + ManifestOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.Slate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ManifestOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.includeRenditions && message.includeRenditions.length)) + message.includeRenditions = []; + message.includeRenditions.push($root.google.cloud.video.stitcher.v1.RenditionFilter.decode(reader, reader.uint32())); break; } case 2: { - message.uri = reader.string(); + message.bitrateOrder = reader.int32(); break; } default: @@ -7477,133 +8060,189 @@ }; /** - * Decodes a Slate message from the specified reader or buffer, length delimited. + * Decodes a ManifestOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.Slate} Slate + * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Slate.decodeDelimited = function decodeDelimited(reader) { + ManifestOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Slate message. + * Verifies a ManifestOptions message. * @function verify - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Slate.verify = function verify(message) { + ManifestOptions.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.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.includeRenditions != null && message.hasOwnProperty("includeRenditions")) { + if (!Array.isArray(message.includeRenditions)) + return "includeRenditions: array expected"; + for (var i = 0; i < message.includeRenditions.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.RenditionFilter.verify(message.includeRenditions[i]); + if (error) + return "includeRenditions." + error; + } + } + if (message.bitrateOrder != null && message.hasOwnProperty("bitrateOrder")) + switch (message.bitrateOrder) { + default: + return "bitrateOrder: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a Slate message from a plain object. Also converts values to their respective internal types. + * Creates a ManifestOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.Slate} Slate + * @returns {google.cloud.video.stitcher.v1.ManifestOptions} ManifestOptions */ - Slate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.Slate) + ManifestOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ManifestOptions) return object; - var message = new $root.google.cloud.video.stitcher.v1.Slate(); - if (object.name != null) - message.name = String(object.name); - if (object.uri != null) - message.uri = String(object.uri); + var message = new $root.google.cloud.video.stitcher.v1.ManifestOptions(); + if (object.includeRenditions) { + if (!Array.isArray(object.includeRenditions)) + throw TypeError(".google.cloud.video.stitcher.v1.ManifestOptions.includeRenditions: array expected"); + message.includeRenditions = []; + for (var i = 0; i < object.includeRenditions.length; ++i) { + if (typeof object.includeRenditions[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ManifestOptions.includeRenditions: object expected"); + message.includeRenditions[i] = $root.google.cloud.video.stitcher.v1.RenditionFilter.fromObject(object.includeRenditions[i]); + } + } + switch (object.bitrateOrder) { + default: + if (typeof object.bitrateOrder === "number") { + message.bitrateOrder = object.bitrateOrder; + break; + } + break; + case "ORDER_POLICY_UNSPECIFIED": + case 0: + message.bitrateOrder = 0; + break; + case "ASCENDING": + case 1: + message.bitrateOrder = 1; + break; + case "DESCENDING": + case 2: + message.bitrateOrder = 2; + break; + } return message; }; /** - * Creates a plain object from a Slate message. Also converts values to other types if specified. + * Creates a plain object from a ManifestOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static - * @param {google.cloud.video.stitcher.v1.Slate} message Slate + * @param {google.cloud.video.stitcher.v1.ManifestOptions} message ManifestOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Slate.toObject = function toObject(message, options) { + ManifestOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.uri = ""; + if (options.arrays || options.defaults) + object.includeRenditions = []; + if (options.defaults) + object.bitrateOrder = options.enums === String ? "ORDER_POLICY_UNSPECIFIED" : 0; + if (message.includeRenditions && message.includeRenditions.length) { + object.includeRenditions = []; + for (var j = 0; j < message.includeRenditions.length; ++j) + object.includeRenditions[j] = $root.google.cloud.video.stitcher.v1.RenditionFilter.toObject(message.includeRenditions[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; + if (message.bitrateOrder != null && message.hasOwnProperty("bitrateOrder")) + object.bitrateOrder = options.enums === String ? $root.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy[message.bitrateOrder] === undefined ? message.bitrateOrder : $root.google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy[message.bitrateOrder] : message.bitrateOrder; return object; }; /** - * Converts this Slate to JSON. + * Converts this ManifestOptions to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @instance * @returns {Object.} JSON object */ - Slate.prototype.toJSON = function toJSON() { + ManifestOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Slate + * Gets the default type url for ManifestOptions * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.Slate + * @memberof google.cloud.video.stitcher.v1.ManifestOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Slate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ManifestOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.Slate"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ManifestOptions"; }; - return Slate; + /** + * OrderPolicy enum. + * @name google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy + * @enum {number} + * @property {number} ORDER_POLICY_UNSPECIFIED=0 ORDER_POLICY_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value + */ + ManifestOptions.OrderPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORDER_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); + + return ManifestOptions; })(); - v1.VodStitchDetail = (function() { + v1.RenditionFilter = (function() { /** - * Properties of a VodStitchDetail. + * Properties of a RenditionFilter. * @memberof google.cloud.video.stitcher.v1 - * @interface IVodStitchDetail - * @property {string|null} [name] VodStitchDetail name - * @property {Array.|null} [adStitchDetails] VodStitchDetail adStitchDetails + * @interface IRenditionFilter + * @property {number|null} [bitrateBps] RenditionFilter bitrateBps + * @property {string|null} [codecs] RenditionFilter codecs */ /** - * Constructs a new VodStitchDetail. + * Constructs a new RenditionFilter. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VodStitchDetail. - * @implements IVodStitchDetail - * @constructor - * @param {google.cloud.video.stitcher.v1.IVodStitchDetail=} [properties] Properties to set + * @classdesc Represents a RenditionFilter. + * @implements IRenditionFilter + * @constructor + * @param {google.cloud.video.stitcher.v1.IRenditionFilter=} [properties] Properties to set */ - function VodStitchDetail(properties) { - this.adStitchDetails = []; + function RenditionFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7611,92 +8250,89 @@ } /** - * VodStitchDetail name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * RenditionFilter bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @instance */ - VodStitchDetail.prototype.name = ""; + RenditionFilter.prototype.bitrateBps = 0; /** - * VodStitchDetail adStitchDetails. - * @member {Array.} adStitchDetails - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * RenditionFilter codecs. + * @member {string} codecs + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @instance */ - VodStitchDetail.prototype.adStitchDetails = $util.emptyArray; + RenditionFilter.prototype.codecs = ""; /** - * Creates a new VodStitchDetail instance using the specified properties. + * Creates a new RenditionFilter instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static - * @param {google.cloud.video.stitcher.v1.IVodStitchDetail=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail instance + * @param {google.cloud.video.stitcher.v1.IRenditionFilter=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter instance */ - VodStitchDetail.create = function create(properties) { - return new VodStitchDetail(properties); + RenditionFilter.create = function create(properties) { + return new RenditionFilter(properties); }; /** - * Encodes the specified VodStitchDetail message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodStitchDetail.verify|verify} messages. + * Encodes the specified RenditionFilter message. Does not implicitly {@link google.cloud.video.stitcher.v1.RenditionFilter.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static - * @param {google.cloud.video.stitcher.v1.IVodStitchDetail} message VodStitchDetail message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IRenditionFilter} message RenditionFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodStitchDetail.encode = function encode(message, writer) { + RenditionFilter.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.adStitchDetails != null && message.adStitchDetails.length) - for (var i = 0; i < message.adStitchDetails.length; ++i) - $root.google.cloud.video.stitcher.v1.AdStitchDetail.encode(message.adStitchDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bitrateBps != null && Object.hasOwnProperty.call(message, "bitrateBps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.bitrateBps); + if (message.codecs != null && Object.hasOwnProperty.call(message, "codecs")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.codecs); return writer; }; /** - * Encodes the specified VodStitchDetail message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodStitchDetail.verify|verify} messages. + * Encodes the specified RenditionFilter message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.RenditionFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static - * @param {google.cloud.video.stitcher.v1.IVodStitchDetail} message VodStitchDetail message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IRenditionFilter} message RenditionFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VodStitchDetail.encodeDelimited = function encodeDelimited(message, writer) { + RenditionFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VodStitchDetail message from the specified reader or buffer. + * Decodes a RenditionFilter message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail + * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodStitchDetail.decode = function decode(reader, length) { + RenditionFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodStitchDetail(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.RenditionFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.bitrateBps = reader.int32(); break; } - case 3: { - if (!(message.adStitchDetails && message.adStitchDetails.length)) - message.adStitchDetails = []; - message.adStitchDetails.push($root.google.cloud.video.stitcher.v1.AdStitchDetail.decode(reader, reader.uint32())); + case 2: { + message.codecs = reader.string(); break; } default: @@ -7708,153 +8344,133 @@ }; /** - * Decodes a VodStitchDetail message from the specified reader or buffer, length delimited. + * Decodes a RenditionFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail + * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VodStitchDetail.decodeDelimited = function decodeDelimited(reader) { + RenditionFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VodStitchDetail message. + * Verifies a RenditionFilter message. * @function verify - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VodStitchDetail.verify = function verify(message) { + RenditionFilter.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.adStitchDetails != null && message.hasOwnProperty("adStitchDetails")) { - if (!Array.isArray(message.adStitchDetails)) - return "adStitchDetails: array expected"; - for (var i = 0; i < message.adStitchDetails.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.AdStitchDetail.verify(message.adStitchDetails[i]); - if (error) - return "adStitchDetails." + error; - } - } + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + if (!$util.isInteger(message.bitrateBps)) + return "bitrateBps: integer expected"; + if (message.codecs != null && message.hasOwnProperty("codecs")) + if (!$util.isString(message.codecs)) + return "codecs: string expected"; return null; }; /** - * Creates a VodStitchDetail message from a plain object. Also converts values to their respective internal types. + * Creates a RenditionFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail + * @returns {google.cloud.video.stitcher.v1.RenditionFilter} RenditionFilter */ - VodStitchDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.VodStitchDetail) + RenditionFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.RenditionFilter) return object; - var message = new $root.google.cloud.video.stitcher.v1.VodStitchDetail(); - if (object.name != null) - message.name = String(object.name); - if (object.adStitchDetails) { - if (!Array.isArray(object.adStitchDetails)) - throw TypeError(".google.cloud.video.stitcher.v1.VodStitchDetail.adStitchDetails: array expected"); - message.adStitchDetails = []; - for (var i = 0; i < object.adStitchDetails.length; ++i) { - if (typeof object.adStitchDetails[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.VodStitchDetail.adStitchDetails: object expected"); - message.adStitchDetails[i] = $root.google.cloud.video.stitcher.v1.AdStitchDetail.fromObject(object.adStitchDetails[i]); - } - } + var message = new $root.google.cloud.video.stitcher.v1.RenditionFilter(); + if (object.bitrateBps != null) + message.bitrateBps = object.bitrateBps | 0; + if (object.codecs != null) + message.codecs = String(object.codecs); return message; }; /** - * Creates a plain object from a VodStitchDetail message. Also converts values to other types if specified. + * Creates a plain object from a RenditionFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static - * @param {google.cloud.video.stitcher.v1.VodStitchDetail} message VodStitchDetail + * @param {google.cloud.video.stitcher.v1.RenditionFilter} message RenditionFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VodStitchDetail.toObject = function toObject(message, options) { + RenditionFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.adStitchDetails = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.adStitchDetails && message.adStitchDetails.length) { - object.adStitchDetails = []; - for (var j = 0; j < message.adStitchDetails.length; ++j) - object.adStitchDetails[j] = $root.google.cloud.video.stitcher.v1.AdStitchDetail.toObject(message.adStitchDetails[j], options); + if (options.defaults) { + object.bitrateBps = 0; + object.codecs = ""; } + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + object.bitrateBps = message.bitrateBps; + if (message.codecs != null && message.hasOwnProperty("codecs")) + object.codecs = message.codecs; return object; }; /** - * Converts this VodStitchDetail to JSON. + * Converts this RenditionFilter to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @instance * @returns {Object.} JSON object */ - VodStitchDetail.prototype.toJSON = function toJSON() { + RenditionFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VodStitchDetail + * Gets the default type url for RenditionFilter * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @memberof google.cloud.video.stitcher.v1.RenditionFilter * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VodStitchDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RenditionFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodStitchDetail"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.RenditionFilter"; }; - return VodStitchDetail; + return RenditionFilter; })(); - v1.AdStitchDetail = (function() { + v1.Slate = (function() { /** - * Properties of an AdStitchDetail. + * Properties of a Slate. * @memberof google.cloud.video.stitcher.v1 - * @interface IAdStitchDetail - * @property {string|null} [adBreakId] AdStitchDetail adBreakId - * @property {string|null} [adId] AdStitchDetail adId - * @property {google.protobuf.IDuration|null} [adTimeOffset] AdStitchDetail adTimeOffset - * @property {string|null} [skipReason] AdStitchDetail skipReason - * @property {Object.|null} [media] AdStitchDetail media + * @interface ISlate + * @property {string|null} [name] Slate name + * @property {string|null} [uri] Slate uri + * @property {google.cloud.video.stitcher.v1.Slate.IGamSlate|null} [gamSlate] Slate gamSlate */ /** - * Constructs a new AdStitchDetail. + * Constructs a new Slate. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents an AdStitchDetail. - * @implements IAdStitchDetail + * @classdesc Represents a Slate. + * @implements ISlate * @constructor - * @param {google.cloud.video.stitcher.v1.IAdStitchDetail=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.ISlate=} [properties] Properties to set */ - function AdStitchDetail(properties) { - this.media = {}; + function Slate(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7862,153 +8478,103 @@ } /** - * AdStitchDetail adBreakId. - * @member {string} adBreakId - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail - * @instance - */ - AdStitchDetail.prototype.adBreakId = ""; - - /** - * AdStitchDetail adId. - * @member {string} adId - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail - * @instance - */ - AdStitchDetail.prototype.adId = ""; - - /** - * AdStitchDetail adTimeOffset. - * @member {google.protobuf.IDuration|null|undefined} adTimeOffset - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * Slate name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.Slate * @instance */ - AdStitchDetail.prototype.adTimeOffset = null; + Slate.prototype.name = ""; /** - * AdStitchDetail skipReason. - * @member {string} skipReason - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * Slate uri. + * @member {string} uri + * @memberof google.cloud.video.stitcher.v1.Slate * @instance */ - AdStitchDetail.prototype.skipReason = ""; + Slate.prototype.uri = ""; /** - * AdStitchDetail media. - * @member {Object.} media - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * Slate gamSlate. + * @member {google.cloud.video.stitcher.v1.Slate.IGamSlate|null|undefined} gamSlate + * @memberof google.cloud.video.stitcher.v1.Slate * @instance */ - AdStitchDetail.prototype.media = $util.emptyObject; + Slate.prototype.gamSlate = null; /** - * Creates a new AdStitchDetail instance using the specified properties. + * Creates a new Slate instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static - * @param {google.cloud.video.stitcher.v1.IAdStitchDetail=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail instance + * @param {google.cloud.video.stitcher.v1.ISlate=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.Slate} Slate instance */ - AdStitchDetail.create = function create(properties) { - return new AdStitchDetail(properties); + Slate.create = function create(properties) { + return new Slate(properties); }; /** - * Encodes the specified AdStitchDetail message. Does not implicitly {@link google.cloud.video.stitcher.v1.AdStitchDetail.verify|verify} messages. + * Encodes the specified Slate message. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static - * @param {google.cloud.video.stitcher.v1.IAdStitchDetail} message AdStitchDetail message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ISlate} message Slate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdStitchDetail.encode = function encode(message, writer) { + Slate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.adBreakId != null && Object.hasOwnProperty.call(message, "adBreakId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.adBreakId); - if (message.adId != null && Object.hasOwnProperty.call(message, "adId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.adId); - if (message.adTimeOffset != null && Object.hasOwnProperty.call(message, "adTimeOffset")) - $root.google.protobuf.Duration.encode(message.adTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.skipReason != null && Object.hasOwnProperty.call(message, "skipReason")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.skipReason); - if (message.media != null && Object.hasOwnProperty.call(message, "media")) - for (var keys = Object.keys(message.media), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.media[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.gamSlate != null && Object.hasOwnProperty.call(message, "gamSlate")) + $root.google.cloud.video.stitcher.v1.Slate.GamSlate.encode(message.gamSlate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AdStitchDetail message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.AdStitchDetail.verify|verify} messages. + * Encodes the specified Slate message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static - * @param {google.cloud.video.stitcher.v1.IAdStitchDetail} message AdStitchDetail message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ISlate} message Slate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdStitchDetail.encodeDelimited = function encodeDelimited(message, writer) { + Slate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AdStitchDetail message from the specified reader or buffer. + * Decodes a Slate message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail + * @returns {google.cloud.video.stitcher.v1.Slate} Slate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdStitchDetail.decode = function decode(reader, length) { + Slate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.AdStitchDetail(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.Slate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.adBreakId = reader.string(); + message.name = reader.string(); break; } case 2: { - message.adId = reader.string(); + message.uri = reader.string(); break; } case 3: { - message.adTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.skipReason = reader.string(); - break; - } - case 5: { - if (message.media === $util.emptyObject) - message.media = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.media[key] = value; + message.gamSlate = $root.google.cloud.video.stitcher.v1.Slate.GamSlate.decode(reader, reader.uint32()); break; } default: @@ -8020,1540 +8586,1910 @@ }; /** - * Decodes an AdStitchDetail message from the specified reader or buffer, length delimited. + * Decodes a Slate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail + * @returns {google.cloud.video.stitcher.v1.Slate} Slate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdStitchDetail.decodeDelimited = function decodeDelimited(reader) { + Slate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AdStitchDetail message. + * Verifies a Slate message. * @function verify - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AdStitchDetail.verify = function verify(message) { + Slate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.adBreakId != null && message.hasOwnProperty("adBreakId")) - if (!$util.isString(message.adBreakId)) - return "adBreakId: string expected"; - if (message.adId != null && message.hasOwnProperty("adId")) - if (!$util.isString(message.adId)) - return "adId: string expected"; - if (message.adTimeOffset != null && message.hasOwnProperty("adTimeOffset")) { - var error = $root.google.protobuf.Duration.verify(message.adTimeOffset); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.gamSlate != null && message.hasOwnProperty("gamSlate")) { + var error = $root.google.cloud.video.stitcher.v1.Slate.GamSlate.verify(message.gamSlate); if (error) - return "adTimeOffset." + error; - } - if (message.skipReason != null && message.hasOwnProperty("skipReason")) - if (!$util.isString(message.skipReason)) - return "skipReason: string expected"; - if (message.media != null && message.hasOwnProperty("media")) { - if (!$util.isObject(message.media)) - return "media: object expected"; - var key = Object.keys(message.media); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.media[key[i]]); - if (error) - return "media." + error; - } + return "gamSlate." + error; } return null; }; /** - * Creates an AdStitchDetail message from a plain object. Also converts values to their respective internal types. + * Creates a Slate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail + * @returns {google.cloud.video.stitcher.v1.Slate} Slate */ - AdStitchDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.AdStitchDetail) + Slate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.Slate) return object; - var message = new $root.google.cloud.video.stitcher.v1.AdStitchDetail(); - if (object.adBreakId != null) - message.adBreakId = String(object.adBreakId); - if (object.adId != null) - message.adId = String(object.adId); - if (object.adTimeOffset != null) { - if (typeof object.adTimeOffset !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.adTimeOffset: object expected"); - message.adTimeOffset = $root.google.protobuf.Duration.fromObject(object.adTimeOffset); - } - if (object.skipReason != null) - message.skipReason = String(object.skipReason); - if (object.media) { - if (typeof object.media !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.media: object expected"); - message.media = {}; - for (var keys = Object.keys(object.media), i = 0; i < keys.length; ++i) { - if (typeof object.media[keys[i]] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.media: object expected"); - message.media[keys[i]] = $root.google.protobuf.Value.fromObject(object.media[keys[i]]); - } + var message = new $root.google.cloud.video.stitcher.v1.Slate(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.gamSlate != null) { + if (typeof object.gamSlate !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.Slate.gamSlate: object expected"); + message.gamSlate = $root.google.cloud.video.stitcher.v1.Slate.GamSlate.fromObject(object.gamSlate); } return message; }; /** - * Creates a plain object from an AdStitchDetail message. Also converts values to other types if specified. + * Creates a plain object from a Slate message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static - * @param {google.cloud.video.stitcher.v1.AdStitchDetail} message AdStitchDetail + * @param {google.cloud.video.stitcher.v1.Slate} message Slate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdStitchDetail.toObject = function toObject(message, options) { + Slate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.media = {}; if (options.defaults) { - object.adBreakId = ""; - object.adId = ""; - object.adTimeOffset = null; - object.skipReason = ""; - } - if (message.adBreakId != null && message.hasOwnProperty("adBreakId")) - object.adBreakId = message.adBreakId; - if (message.adId != null && message.hasOwnProperty("adId")) - object.adId = message.adId; - if (message.adTimeOffset != null && message.hasOwnProperty("adTimeOffset")) - object.adTimeOffset = $root.google.protobuf.Duration.toObject(message.adTimeOffset, options); - if (message.skipReason != null && message.hasOwnProperty("skipReason")) - object.skipReason = message.skipReason; - var keys2; - if (message.media && (keys2 = Object.keys(message.media)).length) { - object.media = {}; - for (var j = 0; j < keys2.length; ++j) - object.media[keys2[j]] = $root.google.protobuf.Value.toObject(message.media[keys2[j]], options); + object.name = ""; + object.uri = ""; + object.gamSlate = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.gamSlate != null && message.hasOwnProperty("gamSlate")) + object.gamSlate = $root.google.cloud.video.stitcher.v1.Slate.GamSlate.toObject(message.gamSlate, options); return object; }; /** - * Converts this AdStitchDetail to JSON. + * Converts this Slate to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @instance * @returns {Object.} JSON object */ - AdStitchDetail.prototype.toJSON = function toJSON() { + Slate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AdStitchDetail + * Gets the default type url for Slate * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @memberof google.cloud.video.stitcher.v1.Slate * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AdStitchDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Slate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.AdStitchDetail"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.Slate"; }; - return AdStitchDetail; + Slate.GamSlate = (function() { + + /** + * Properties of a GamSlate. + * @memberof google.cloud.video.stitcher.v1.Slate + * @interface IGamSlate + * @property {string|null} [networkCode] GamSlate networkCode + * @property {number|Long|null} [gamSlateId] GamSlate gamSlateId + */ + + /** + * Constructs a new GamSlate. + * @memberof google.cloud.video.stitcher.v1.Slate + * @classdesc Represents a GamSlate. + * @implements IGamSlate + * @constructor + * @param {google.cloud.video.stitcher.v1.Slate.IGamSlate=} [properties] Properties to set + */ + function GamSlate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GamSlate networkCode. + * @member {string} networkCode + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @instance + */ + GamSlate.prototype.networkCode = ""; + + /** + * GamSlate gamSlateId. + * @member {number|Long} gamSlateId + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @instance + */ + GamSlate.prototype.gamSlateId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GamSlate instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {google.cloud.video.stitcher.v1.Slate.IGamSlate=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.Slate.GamSlate} GamSlate instance + */ + GamSlate.create = function create(properties) { + return new GamSlate(properties); + }; + + /** + * Encodes the specified GamSlate message. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.GamSlate.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {google.cloud.video.stitcher.v1.Slate.IGamSlate} message GamSlate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSlate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkCode != null && Object.hasOwnProperty.call(message, "networkCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkCode); + if (message.gamSlateId != null && Object.hasOwnProperty.call(message, "gamSlateId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.gamSlateId); + return writer; + }; + + /** + * Encodes the specified GamSlate message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.Slate.GamSlate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {google.cloud.video.stitcher.v1.Slate.IGamSlate} message GamSlate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GamSlate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GamSlate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.Slate.GamSlate} GamSlate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSlate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.Slate.GamSlate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.networkCode = reader.string(); + break; + } + case 2: { + message.gamSlateId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GamSlate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.Slate.GamSlate} GamSlate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GamSlate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GamSlate message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GamSlate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + if (!$util.isString(message.networkCode)) + return "networkCode: string expected"; + if (message.gamSlateId != null && message.hasOwnProperty("gamSlateId")) + if (!$util.isInteger(message.gamSlateId) && !(message.gamSlateId && $util.isInteger(message.gamSlateId.low) && $util.isInteger(message.gamSlateId.high))) + return "gamSlateId: integer|Long expected"; + return null; + }; + + /** + * Creates a GamSlate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.Slate.GamSlate} GamSlate + */ + GamSlate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.Slate.GamSlate) + return object; + var message = new $root.google.cloud.video.stitcher.v1.Slate.GamSlate(); + if (object.networkCode != null) + message.networkCode = String(object.networkCode); + if (object.gamSlateId != null) + if ($util.Long) + (message.gamSlateId = $util.Long.fromValue(object.gamSlateId)).unsigned = false; + else if (typeof object.gamSlateId === "string") + message.gamSlateId = parseInt(object.gamSlateId, 10); + else if (typeof object.gamSlateId === "number") + message.gamSlateId = object.gamSlateId; + else if (typeof object.gamSlateId === "object") + message.gamSlateId = new $util.LongBits(object.gamSlateId.low >>> 0, object.gamSlateId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GamSlate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {google.cloud.video.stitcher.v1.Slate.GamSlate} message GamSlate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GamSlate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gamSlateId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gamSlateId = options.longs === String ? "0" : 0; + } + if (message.networkCode != null && message.hasOwnProperty("networkCode")) + object.networkCode = message.networkCode; + if (message.gamSlateId != null && message.hasOwnProperty("gamSlateId")) + if (typeof message.gamSlateId === "number") + object.gamSlateId = options.longs === String ? String(message.gamSlateId) : message.gamSlateId; + else + object.gamSlateId = options.longs === String ? $util.Long.prototype.toString.call(message.gamSlateId) : options.longs === Number ? new $util.LongBits(message.gamSlateId.low >>> 0, message.gamSlateId.high >>> 0).toNumber() : message.gamSlateId; + return object; + }; + + /** + * Converts this GamSlate to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @instance + * @returns {Object.} JSON object + */ + GamSlate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GamSlate + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.Slate.GamSlate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GamSlate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.Slate.GamSlate"; + }; + + return GamSlate; + })(); + + return Slate; })(); - v1.VideoStitcherService = (function() { + v1.VodStitchDetail = (function() { /** - * Constructs a new VideoStitcherService service. + * Properties of a VodStitchDetail. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a VideoStitcherService - * @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 + * @interface IVodStitchDetail + * @property {string|null} [name] VodStitchDetail name + * @property {Array.|null} [adStitchDetails] VodStitchDetail adStitchDetails */ - function VideoStitcherService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (VideoStitcherService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoStitcherService; /** - * Creates new VideoStitcherService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @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 {VideoStitcherService} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new VodStitchDetail. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a VodStitchDetail. + * @implements IVodStitchDetail + * @constructor + * @param {google.cloud.video.stitcher.v1.IVodStitchDetail=} [properties] Properties to set */ - VideoStitcherService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function VodStitchDetail(properties) { + this.adStitchDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createCdnKey}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef CreateCdnKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.CdnKey} [response] CdnKey - */ - - /** - * Calls CreateCdnKey. - * @function createCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * VodStitchDetail name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} request CreateCdnKeyRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateCdnKeyCallback} callback Node-style callback called with the error, if any, and CdnKey - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.createCdnKey = function createCdnKey(request, callback) { - return this.rpcCall(createCdnKey, $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest, $root.google.cloud.video.stitcher.v1.CdnKey, request, callback); - }, "name", { value: "CreateCdnKey" }); + VodStitchDetail.prototype.name = ""; /** - * Calls CreateCdnKey. - * @function createCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * VodStitchDetail adStitchDetails. + * @member {Array.} adStitchDetails + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} request CreateCdnKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + VodStitchDetail.prototype.adStitchDetails = $util.emptyArray; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listCdnKeys}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef ListCdnKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.ListCdnKeysResponse} [response] ListCdnKeysResponse + * Creates a new VodStitchDetail instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IVodStitchDetail=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail instance */ + VodStitchDetail.create = function create(properties) { + return new VodStitchDetail(properties); + }; /** - * Calls ListCdnKeys. - * @function listCdnKeys - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} request ListCdnKeysRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListCdnKeysCallback} callback Node-style callback called with the error, if any, and ListCdnKeysResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified VodStitchDetail message. Does not implicitly {@link google.cloud.video.stitcher.v1.VodStitchDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IVodStitchDetail} message VodStitchDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(VideoStitcherService.prototype.listCdnKeys = function listCdnKeys(request, callback) { - return this.rpcCall(listCdnKeys, $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest, $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse, request, callback); - }, "name", { value: "ListCdnKeys" }); + VodStitchDetail.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.adStitchDetails != null && message.adStitchDetails.length) + for (var i = 0; i < message.adStitchDetails.length; ++i) + $root.google.cloud.video.stitcher.v1.AdStitchDetail.encode(message.adStitchDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls ListCdnKeys. - * @function listCdnKeys - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} request ListCdnKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified VodStitchDetail message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.VodStitchDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IVodStitchDetail} message VodStitchDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + VodStitchDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getCdnKey}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetCdnKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.CdnKey} [response] CdnKey + * Decodes a VodStitchDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + VodStitchDetail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.VodStitchDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + if (!(message.adStitchDetails && message.adStitchDetails.length)) + message.adStitchDetails = []; + message.adStitchDetails.push($root.google.cloud.video.stitcher.v1.AdStitchDetail.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GetCdnKey. - * @function getCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} request GetCdnKeyRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetCdnKeyCallback} callback Node-style callback called with the error, if any, and CdnKey - * @returns {undefined} - * @variation 1 + * Decodes a VodStitchDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(VideoStitcherService.prototype.getCdnKey = function getCdnKey(request, callback) { - return this.rpcCall(getCdnKey, $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest, $root.google.cloud.video.stitcher.v1.CdnKey, request, callback); - }, "name", { value: "GetCdnKey" }); + VodStitchDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetCdnKey. - * @function getCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} request GetCdnKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a VodStitchDetail message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + VodStitchDetail.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.adStitchDetails != null && message.hasOwnProperty("adStitchDetails")) { + if (!Array.isArray(message.adStitchDetails)) + return "adStitchDetails: array expected"; + for (var i = 0; i < message.adStitchDetails.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.AdStitchDetail.verify(message.adStitchDetails[i]); + if (error) + return "adStitchDetails." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteCdnKey}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef DeleteCdnKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a VodStitchDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.VodStitchDetail} VodStitchDetail */ + VodStitchDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.VodStitchDetail) + return object; + var message = new $root.google.cloud.video.stitcher.v1.VodStitchDetail(); + if (object.name != null) + message.name = String(object.name); + if (object.adStitchDetails) { + if (!Array.isArray(object.adStitchDetails)) + throw TypeError(".google.cloud.video.stitcher.v1.VodStitchDetail.adStitchDetails: array expected"); + message.adStitchDetails = []; + for (var i = 0; i < object.adStitchDetails.length; ++i) { + if (typeof object.adStitchDetails[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.VodStitchDetail.adStitchDetails: object expected"); + message.adStitchDetails[i] = $root.google.cloud.video.stitcher.v1.AdStitchDetail.fromObject(object.adStitchDetails[i]); + } + } + return message; + }; /** - * Calls DeleteCdnKey. - * @function deleteCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} request DeleteCdnKeyRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.DeleteCdnKeyCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from a VodStitchDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.VodStitchDetail} message VodStitchDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(VideoStitcherService.prototype.deleteCdnKey = function deleteCdnKey(request, callback) { - return this.rpcCall(deleteCdnKey, $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteCdnKey" }); + VodStitchDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.adStitchDetails = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.adStitchDetails && message.adStitchDetails.length) { + object.adStitchDetails = []; + for (var j = 0; j < message.adStitchDetails.length; ++j) + object.adStitchDetails[j] = $root.google.cloud.video.stitcher.v1.AdStitchDetail.toObject(message.adStitchDetails[j], options); + } + return object; + }; /** - * Calls DeleteCdnKey. - * @function deleteCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * Converts this VodStitchDetail to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} request DeleteCdnKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + VodStitchDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateCdnKey}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef UpdateCdnKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.CdnKey} [response] CdnKey + * Gets the default type url for VodStitchDetail + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.VodStitchDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + VodStitchDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.VodStitchDetail"; + }; - /** - * Calls UpdateCdnKey. - * @function updateCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} request UpdateCdnKeyRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.UpdateCdnKeyCallback} callback Node-style callback called with the error, if any, and CdnKey - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(VideoStitcherService.prototype.updateCdnKey = function updateCdnKey(request, callback) { - return this.rpcCall(updateCdnKey, $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest, $root.google.cloud.video.stitcher.v1.CdnKey, request, callback); - }, "name", { value: "UpdateCdnKey" }); + return VodStitchDetail; + })(); - /** - * Calls UpdateCdnKey. - * @function updateCdnKey - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} request UpdateCdnKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1.AdStitchDetail = (function() { /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createVodSession}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef CreateVodSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.VodSession} [response] VodSession + * Properties of an AdStitchDetail. + * @memberof google.cloud.video.stitcher.v1 + * @interface IAdStitchDetail + * @property {string|null} [adBreakId] AdStitchDetail adBreakId + * @property {string|null} [adId] AdStitchDetail adId + * @property {google.protobuf.IDuration|null} [adTimeOffset] AdStitchDetail adTimeOffset + * @property {string|null} [skipReason] AdStitchDetail skipReason + * @property {Object.|null} [media] AdStitchDetail media */ /** - * Calls CreateVodSession. - * @function createVodSession - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} request CreateVodSessionRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateVodSessionCallback} callback Node-style callback called with the error, if any, and VodSession - * @returns {undefined} - * @variation 1 + * Constructs a new AdStitchDetail. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents an AdStitchDetail. + * @implements IAdStitchDetail + * @constructor + * @param {google.cloud.video.stitcher.v1.IAdStitchDetail=} [properties] Properties to set */ - Object.defineProperty(VideoStitcherService.prototype.createVodSession = function createVodSession(request, callback) { - return this.rpcCall(createVodSession, $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest, $root.google.cloud.video.stitcher.v1.VodSession, request, callback); - }, "name", { value: "CreateVodSession" }); + function AdStitchDetail(properties) { + this.media = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls CreateVodSession. - * @function createVodSession - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * AdStitchDetail adBreakId. + * @member {string} adBreakId + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} request CreateVodSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodSession}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetVodSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.VodSession} [response] VodSession */ + AdStitchDetail.prototype.adBreakId = ""; /** - * Calls GetVodSession. - * @function getVodSession - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * AdStitchDetail adId. + * @member {string} adId + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} request GetVodSessionRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodSessionCallback} callback Node-style callback called with the error, if any, and VodSession - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.getVodSession = function getVodSession(request, callback) { - return this.rpcCall(getVodSession, $root.google.cloud.video.stitcher.v1.GetVodSessionRequest, $root.google.cloud.video.stitcher.v1.VodSession, request, callback); - }, "name", { value: "GetVodSession" }); + AdStitchDetail.prototype.adId = ""; /** - * Calls GetVodSession. - * @function getVodSession - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * AdStitchDetail adTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} adTimeOffset + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} request GetVodSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listVodStitchDetails}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef ListVodStitchDetailsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} [response] ListVodStitchDetailsResponse */ + AdStitchDetail.prototype.adTimeOffset = null; /** - * Calls ListVodStitchDetails. - * @function listVodStitchDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * AdStitchDetail skipReason. + * @member {string} skipReason + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} request ListVodStitchDetailsRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListVodStitchDetailsCallback} callback Node-style callback called with the error, if any, and ListVodStitchDetailsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.listVodStitchDetails = function listVodStitchDetails(request, callback) { - return this.rpcCall(listVodStitchDetails, $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest, $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse, request, callback); - }, "name", { value: "ListVodStitchDetails" }); + AdStitchDetail.prototype.skipReason = ""; /** - * Calls ListVodStitchDetails. - * @function listVodStitchDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * AdStitchDetail media. + * @member {Object.} media + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} request ListVodStitchDetailsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodStitchDetail}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetVodStitchDetailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.VodStitchDetail} [response] VodStitchDetail */ + AdStitchDetail.prototype.media = $util.emptyObject; /** - * Calls GetVodStitchDetail. - * @function getVodStitchDetail - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} request GetVodStitchDetailRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodStitchDetailCallback} callback Node-style callback called with the error, if any, and VodStitchDetail - * @returns {undefined} - * @variation 1 + * Creates a new AdStitchDetail instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IAdStitchDetail=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail instance */ - Object.defineProperty(VideoStitcherService.prototype.getVodStitchDetail = function getVodStitchDetail(request, callback) { - return this.rpcCall(getVodStitchDetail, $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest, $root.google.cloud.video.stitcher.v1.VodStitchDetail, request, callback); - }, "name", { value: "GetVodStitchDetail" }); + AdStitchDetail.create = function create(properties) { + return new AdStitchDetail(properties); + }; /** - * Calls GetVodStitchDetail. - * @function getVodStitchDetail - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} request GetVodStitchDetailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AdStitchDetail message. Does not implicitly {@link google.cloud.video.stitcher.v1.AdStitchDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IAdStitchDetail} message AdStitchDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AdStitchDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adBreakId != null && Object.hasOwnProperty.call(message, "adBreakId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.adBreakId); + if (message.adId != null && Object.hasOwnProperty.call(message, "adId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.adId); + if (message.adTimeOffset != null && Object.hasOwnProperty.call(message, "adTimeOffset")) + $root.google.protobuf.Duration.encode(message.adTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.skipReason != null && Object.hasOwnProperty.call(message, "skipReason")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.skipReason); + if (message.media != null && Object.hasOwnProperty.call(message, "media")) + for (var keys = Object.keys(message.media), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.media[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listVodAdTagDetails}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef ListVodAdTagDetailsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} [response] ListVodAdTagDetailsResponse + * Encodes the specified AdStitchDetail message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.AdStitchDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.IAdStitchDetail} message AdStitchDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AdStitchDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListVodAdTagDetails. - * @function listVodAdTagDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} request ListVodAdTagDetailsRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListVodAdTagDetailsCallback} callback Node-style callback called with the error, if any, and ListVodAdTagDetailsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(VideoStitcherService.prototype.listVodAdTagDetails = function listVodAdTagDetails(request, callback) { - return this.rpcCall(listVodAdTagDetails, $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest, $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse, request, callback); - }, "name", { value: "ListVodAdTagDetails" }); - - /** - * Calls ListVodAdTagDetails. - * @function listVodAdTagDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} request ListVodAdTagDetailsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AdStitchDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AdStitchDetail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.AdStitchDetail(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.adBreakId = reader.string(); + break; + } + case 2: { + message.adId = reader.string(); + break; + } + case 3: { + message.adTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.skipReason = reader.string(); + break; + } + case 5: { + if (message.media === $util.emptyObject) + message.media = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.media[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodAdTagDetail}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetVodAdTagDetailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.VodAdTagDetail} [response] VodAdTagDetail + * Decodes an AdStitchDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AdStitchDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetVodAdTagDetail. - * @function getVodAdTagDetail - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} request GetVodAdTagDetailRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodAdTagDetailCallback} callback Node-style callback called with the error, if any, and VodAdTagDetail - * @returns {undefined} - * @variation 1 + * Verifies an AdStitchDetail message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(VideoStitcherService.prototype.getVodAdTagDetail = function getVodAdTagDetail(request, callback) { - return this.rpcCall(getVodAdTagDetail, $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest, $root.google.cloud.video.stitcher.v1.VodAdTagDetail, request, callback); - }, "name", { value: "GetVodAdTagDetail" }); + AdStitchDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adBreakId != null && message.hasOwnProperty("adBreakId")) + if (!$util.isString(message.adBreakId)) + return "adBreakId: string expected"; + if (message.adId != null && message.hasOwnProperty("adId")) + if (!$util.isString(message.adId)) + return "adId: string expected"; + if (message.adTimeOffset != null && message.hasOwnProperty("adTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.adTimeOffset); + if (error) + return "adTimeOffset." + error; + } + if (message.skipReason != null && message.hasOwnProperty("skipReason")) + if (!$util.isString(message.skipReason)) + return "skipReason: string expected"; + if (message.media != null && message.hasOwnProperty("media")) { + if (!$util.isObject(message.media)) + return "media: object expected"; + var key = Object.keys(message.media); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.media[key[i]]); + if (error) + return "media." + error; + } + } + return null; + }; /** - * Calls GetVodAdTagDetail. - * @function getVodAdTagDetail - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} request GetVodAdTagDetailRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AdStitchDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.AdStitchDetail} AdStitchDetail */ + AdStitchDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.AdStitchDetail) + return object; + var message = new $root.google.cloud.video.stitcher.v1.AdStitchDetail(); + if (object.adBreakId != null) + message.adBreakId = String(object.adBreakId); + if (object.adId != null) + message.adId = String(object.adId); + if (object.adTimeOffset != null) { + if (typeof object.adTimeOffset !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.adTimeOffset: object expected"); + message.adTimeOffset = $root.google.protobuf.Duration.fromObject(object.adTimeOffset); + } + if (object.skipReason != null) + message.skipReason = String(object.skipReason); + if (object.media) { + if (typeof object.media !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.media: object expected"); + message.media = {}; + for (var keys = Object.keys(object.media), i = 0; i < keys.length; ++i) { + if (typeof object.media[keys[i]] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.AdStitchDetail.media: object expected"); + message.media[keys[i]] = $root.google.protobuf.Value.fromObject(object.media[keys[i]]); + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listLiveAdTagDetails}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef ListLiveAdTagDetailsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} [response] ListLiveAdTagDetailsResponse + * Creates a plain object from an AdStitchDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {google.cloud.video.stitcher.v1.AdStitchDetail} message AdStitchDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AdStitchDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.media = {}; + if (options.defaults) { + object.adBreakId = ""; + object.adId = ""; + object.adTimeOffset = null; + object.skipReason = ""; + } + if (message.adBreakId != null && message.hasOwnProperty("adBreakId")) + object.adBreakId = message.adBreakId; + if (message.adId != null && message.hasOwnProperty("adId")) + object.adId = message.adId; + if (message.adTimeOffset != null && message.hasOwnProperty("adTimeOffset")) + object.adTimeOffset = $root.google.protobuf.Duration.toObject(message.adTimeOffset, options); + if (message.skipReason != null && message.hasOwnProperty("skipReason")) + object.skipReason = message.skipReason; + var keys2; + if (message.media && (keys2 = Object.keys(message.media)).length) { + object.media = {}; + for (var j = 0; j < keys2.length; ++j) + object.media[keys2[j]] = $root.google.protobuf.Value.toObject(message.media[keys2[j]], options); + } + return object; + }; /** - * Calls ListLiveAdTagDetails. - * @function listLiveAdTagDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * Converts this AdStitchDetail to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail * @instance - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} request ListLiveAdTagDetailsRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveAdTagDetailsCallback} callback Node-style callback called with the error, if any, and ListLiveAdTagDetailsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(VideoStitcherService.prototype.listLiveAdTagDetails = function listLiveAdTagDetails(request, callback) { - return this.rpcCall(listLiveAdTagDetails, $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest, $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse, request, callback); - }, "name", { value: "ListLiveAdTagDetails" }); + AdStitchDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ListLiveAdTagDetails. - * @function listLiveAdTagDetails - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} request ListLiveAdTagDetailsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AdStitchDetail + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.AdStitchDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AdStitchDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.AdStitchDetail"; + }; - /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveAdTagDetail}. - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetLiveAdTagDetailCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.LiveAdTagDetail} [response] LiveAdTagDetail - */ + return AdStitchDetail; + })(); + + v1.VideoStitcherService = (function() { /** - * Calls GetLiveAdTagDetail. - * @function getLiveAdTagDetail - * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @instance - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} request GetLiveAdTagDetailRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveAdTagDetailCallback} callback Node-style callback called with the error, if any, and LiveAdTagDetail + * Constructs a new VideoStitcherService service. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a VideoStitcherService + * @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 VideoStitcherService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoStitcherService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoStitcherService; + + /** + * Creates new VideoStitcherService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @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 {VideoStitcherService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoStitcherService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createCdnKey}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef CreateCdnKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCdnKey. + * @function createCdnKey + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} request CreateCdnKeyRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateCdnKeyCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.getLiveAdTagDetail = function getLiveAdTagDetail(request, callback) { - return this.rpcCall(getLiveAdTagDetail, $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest, $root.google.cloud.video.stitcher.v1.LiveAdTagDetail, request, callback); - }, "name", { value: "GetLiveAdTagDetail" }); + Object.defineProperty(VideoStitcherService.prototype.createCdnKey = function createCdnKey(request, callback) { + return this.rpcCall(createCdnKey, $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCdnKey" }); /** - * Calls GetLiveAdTagDetail. - * @function getLiveAdTagDetail + * Calls CreateCdnKey. + * @function createCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} request GetLiveAdTagDetailRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} request CreateCdnKeyRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createSlate}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listCdnKeys}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef CreateSlateCallback + * @typedef ListCdnKeysCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.Slate} [response] Slate + * @param {google.cloud.video.stitcher.v1.ListCdnKeysResponse} [response] ListCdnKeysResponse */ /** - * Calls CreateSlate. - * @function createSlate + * Calls ListCdnKeys. + * @function listCdnKeys * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} request CreateSlateRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateSlateCallback} callback Node-style callback called with the error, if any, and Slate + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} request ListCdnKeysRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListCdnKeysCallback} callback Node-style callback called with the error, if any, and ListCdnKeysResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.createSlate = function createSlate(request, callback) { - return this.rpcCall(createSlate, $root.google.cloud.video.stitcher.v1.CreateSlateRequest, $root.google.cloud.video.stitcher.v1.Slate, request, callback); - }, "name", { value: "CreateSlate" }); + Object.defineProperty(VideoStitcherService.prototype.listCdnKeys = function listCdnKeys(request, callback) { + return this.rpcCall(listCdnKeys, $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest, $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse, request, callback); + }, "name", { value: "ListCdnKeys" }); /** - * Calls CreateSlate. - * @function createSlate + * Calls ListCdnKeys. + * @function listCdnKeys * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} request CreateSlateRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} request ListCdnKeysRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listSlates}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getCdnKey}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef ListSlatesCallback + * @typedef GetCdnKeyCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.ListSlatesResponse} [response] ListSlatesResponse + * @param {google.cloud.video.stitcher.v1.CdnKey} [response] CdnKey */ /** - * Calls ListSlates. - * @function listSlates + * Calls GetCdnKey. + * @function getCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} request ListSlatesRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListSlatesCallback} callback Node-style callback called with the error, if any, and ListSlatesResponse + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} request GetCdnKeyRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetCdnKeyCallback} callback Node-style callback called with the error, if any, and CdnKey * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.listSlates = function listSlates(request, callback) { - return this.rpcCall(listSlates, $root.google.cloud.video.stitcher.v1.ListSlatesRequest, $root.google.cloud.video.stitcher.v1.ListSlatesResponse, request, callback); - }, "name", { value: "ListSlates" }); + Object.defineProperty(VideoStitcherService.prototype.getCdnKey = function getCdnKey(request, callback) { + return this.rpcCall(getCdnKey, $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest, $root.google.cloud.video.stitcher.v1.CdnKey, request, callback); + }, "name", { value: "GetCdnKey" }); /** - * Calls ListSlates. - * @function listSlates + * Calls GetCdnKey. + * @function getCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} request ListSlatesRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} request GetCdnKeyRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getSlate}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteCdnKey}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetSlateCallback + * @typedef DeleteCdnKeyCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.Slate} [response] Slate + * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls GetSlate. - * @function getSlate + * Calls DeleteCdnKey. + * @function deleteCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} request GetSlateRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetSlateCallback} callback Node-style callback called with the error, if any, and Slate + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} request DeleteCdnKeyRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.DeleteCdnKeyCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.getSlate = function getSlate(request, callback) { - return this.rpcCall(getSlate, $root.google.cloud.video.stitcher.v1.GetSlateRequest, $root.google.cloud.video.stitcher.v1.Slate, request, callback); - }, "name", { value: "GetSlate" }); + Object.defineProperty(VideoStitcherService.prototype.deleteCdnKey = function deleteCdnKey(request, callback) { + return this.rpcCall(deleteCdnKey, $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCdnKey" }); /** - * Calls GetSlate. - * @function getSlate + * Calls DeleteCdnKey. + * @function deleteCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} request GetSlateRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} request DeleteCdnKeyRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateSlate}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateCdnKey}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef UpdateSlateCallback + * @typedef UpdateCdnKeyCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.Slate} [response] Slate + * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls UpdateSlate. - * @function updateSlate + * Calls UpdateCdnKey. + * @function updateCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} request UpdateSlateRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.UpdateSlateCallback} callback Node-style callback called with the error, if any, and Slate + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} request UpdateCdnKeyRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.UpdateCdnKeyCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.updateSlate = function updateSlate(request, callback) { - return this.rpcCall(updateSlate, $root.google.cloud.video.stitcher.v1.UpdateSlateRequest, $root.google.cloud.video.stitcher.v1.Slate, request, callback); - }, "name", { value: "UpdateSlate" }); + Object.defineProperty(VideoStitcherService.prototype.updateCdnKey = function updateCdnKey(request, callback) { + return this.rpcCall(updateCdnKey, $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCdnKey" }); /** - * Calls UpdateSlate. - * @function updateSlate + * Calls UpdateCdnKey. + * @function updateCdnKey * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} request UpdateSlateRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} request UpdateCdnKeyRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteSlate}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createVodSession}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef DeleteSlateCallback + * @typedef CreateVodSessionCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.video.stitcher.v1.VodSession} [response] VodSession */ /** - * Calls DeleteSlate. - * @function deleteSlate + * Calls CreateVodSession. + * @function createVodSession * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} request DeleteSlateRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.DeleteSlateCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} request CreateVodSessionRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateVodSessionCallback} callback Node-style callback called with the error, if any, and VodSession * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.deleteSlate = function deleteSlate(request, callback) { - return this.rpcCall(deleteSlate, $root.google.cloud.video.stitcher.v1.DeleteSlateRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSlate" }); + Object.defineProperty(VideoStitcherService.prototype.createVodSession = function createVodSession(request, callback) { + return this.rpcCall(createVodSession, $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest, $root.google.cloud.video.stitcher.v1.VodSession, request, callback); + }, "name", { value: "CreateVodSession" }); /** - * Calls DeleteSlate. - * @function deleteSlate + * Calls CreateVodSession. + * @function createVodSession * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} request DeleteSlateRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} request CreateVodSessionRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createLiveSession}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodSession}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef CreateLiveSessionCallback + * @typedef GetVodSessionCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.LiveSession} [response] LiveSession + * @param {google.cloud.video.stitcher.v1.VodSession} [response] VodSession */ /** - * Calls CreateLiveSession. - * @function createLiveSession + * Calls GetVodSession. + * @function getVodSession * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} request CreateLiveSessionRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveSessionCallback} callback Node-style callback called with the error, if any, and LiveSession + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} request GetVodSessionRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodSessionCallback} callback Node-style callback called with the error, if any, and VodSession * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.createLiveSession = function createLiveSession(request, callback) { - return this.rpcCall(createLiveSession, $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest, $root.google.cloud.video.stitcher.v1.LiveSession, request, callback); - }, "name", { value: "CreateLiveSession" }); + Object.defineProperty(VideoStitcherService.prototype.getVodSession = function getVodSession(request, callback) { + return this.rpcCall(getVodSession, $root.google.cloud.video.stitcher.v1.GetVodSessionRequest, $root.google.cloud.video.stitcher.v1.VodSession, request, callback); + }, "name", { value: "GetVodSession" }); /** - * Calls CreateLiveSession. - * @function createLiveSession + * Calls GetVodSession. + * @function getVodSession * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} request CreateLiveSessionRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} request GetVodSessionRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveSession}. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listVodStitchDetails}. * @memberof google.cloud.video.stitcher.v1.VideoStitcherService - * @typedef GetLiveSessionCallback + * @typedef ListVodStitchDetailsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.video.stitcher.v1.LiveSession} [response] LiveSession + * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} [response] ListVodStitchDetailsResponse */ /** - * Calls GetLiveSession. - * @function getLiveSession + * Calls ListVodStitchDetails. + * @function listVodStitchDetails * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} request GetLiveSessionRequest message or plain object - * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveSessionCallback} callback Node-style callback called with the error, if any, and LiveSession + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} request ListVodStitchDetailsRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListVodStitchDetailsCallback} callback Node-style callback called with the error, if any, and ListVodStitchDetailsResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(VideoStitcherService.prototype.getLiveSession = function getLiveSession(request, callback) { - return this.rpcCall(getLiveSession, $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest, $root.google.cloud.video.stitcher.v1.LiveSession, request, callback); - }, "name", { value: "GetLiveSession" }); + Object.defineProperty(VideoStitcherService.prototype.listVodStitchDetails = function listVodStitchDetails(request, callback) { + return this.rpcCall(listVodStitchDetails, $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest, $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse, request, callback); + }, "name", { value: "ListVodStitchDetails" }); /** - * Calls GetLiveSession. - * @function getLiveSession + * Calls ListVodStitchDetails. + * @function listVodStitchDetails * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} request GetLiveSessionRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} request ListVodStitchDetailsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return VideoStitcherService; - })(); - - v1.CreateCdnKeyRequest = (function() { - /** - * Properties of a CreateCdnKeyRequest. - * @memberof google.cloud.video.stitcher.v1 - * @interface ICreateCdnKeyRequest - * @property {string|null} [parent] CreateCdnKeyRequest parent - * @property {google.cloud.video.stitcher.v1.ICdnKey|null} [cdnKey] CreateCdnKeyRequest cdnKey - * @property {string|null} [cdnKeyId] CreateCdnKeyRequest cdnKeyId + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodStitchDetail}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetVodStitchDetailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.VodStitchDetail} [response] VodStitchDetail */ /** - * Constructs a new CreateCdnKeyRequest. - * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a CreateCdnKeyRequest. - * @implements ICreateCdnKeyRequest - * @constructor - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest=} [properties] Properties to set + * Calls GetVodStitchDetail. + * @function getVodStitchDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} request GetVodStitchDetailRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodStitchDetailCallback} callback Node-style callback called with the error, if any, and VodStitchDetail + * @returns {undefined} + * @variation 1 */ - function CreateCdnKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(VideoStitcherService.prototype.getVodStitchDetail = function getVodStitchDetail(request, callback) { + return this.rpcCall(getVodStitchDetail, $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest, $root.google.cloud.video.stitcher.v1.VodStitchDetail, request, callback); + }, "name", { value: "GetVodStitchDetail" }); /** - * CreateCdnKeyRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * Calls GetVodStitchDetail. + * @function getVodStitchDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} request GetVodStitchDetailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateCdnKeyRequest.prototype.parent = ""; /** - * CreateCdnKeyRequest cdnKey. - * @member {google.cloud.video.stitcher.v1.ICdnKey|null|undefined} cdnKey - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @instance + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listVodAdTagDetails}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef ListVodAdTagDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} [response] ListVodAdTagDetailsResponse */ - CreateCdnKeyRequest.prototype.cdnKey = null; /** - * CreateCdnKeyRequest cdnKeyId. - * @member {string} cdnKeyId - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * Calls ListVodAdTagDetails. + * @function listVodAdTagDetails + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} request ListVodAdTagDetailsRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListVodAdTagDetailsCallback} callback Node-style callback called with the error, if any, and ListVodAdTagDetailsResponse + * @returns {undefined} + * @variation 1 */ - CreateCdnKeyRequest.prototype.cdnKeyId = ""; + Object.defineProperty(VideoStitcherService.prototype.listVodAdTagDetails = function listVodAdTagDetails(request, callback) { + return this.rpcCall(listVodAdTagDetails, $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest, $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse, request, callback); + }, "name", { value: "ListVodAdTagDetails" }); /** - * Creates a new CreateCdnKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest instance + * Calls ListVodAdTagDetails. + * @function listVodAdTagDetails + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} request ListVodAdTagDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateCdnKeyRequest.create = function create(properties) { - return new CreateCdnKeyRequest(properties); - }; /** - * Encodes the specified CreateCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateCdnKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} message CreateCdnKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getVodAdTagDetail}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetVodAdTagDetailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.VodAdTagDetail} [response] VodAdTagDetail */ - CreateCdnKeyRequest.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.cdnKey != null && Object.hasOwnProperty.call(message, "cdnKey")) - $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cdnKeyId != null && Object.hasOwnProperty.call(message, "cdnKeyId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.cdnKeyId); - return writer; - }; /** - * Encodes the specified CreateCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateCdnKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} message CreateCdnKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetVodAdTagDetail. + * @function getVodAdTagDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} request GetVodAdTagDetailRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetVodAdTagDetailCallback} callback Node-style callback called with the error, if any, and VodAdTagDetail + * @returns {undefined} + * @variation 1 */ - CreateCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(VideoStitcherService.prototype.getVodAdTagDetail = function getVodAdTagDetail(request, callback) { + return this.rpcCall(getVodAdTagDetail, $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest, $root.google.cloud.video.stitcher.v1.VodAdTagDetail, request, callback); + }, "name", { value: "GetVodAdTagDetail" }); /** - * Decodes a CreateCdnKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetVodAdTagDetail. + * @function getVodAdTagDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} request GetVodAdTagDetailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateCdnKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cdnKeyId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CreateCdnKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listLiveAdTagDetails}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef ListLiveAdTagDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} [response] ListLiveAdTagDetailsResponse */ - CreateCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a CreateCdnKeyRequest message. - * @function verify - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListLiveAdTagDetails. + * @function listLiveAdTagDetails + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} request ListLiveAdTagDetailsRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveAdTagDetailsCallback} callback Node-style callback called with the error, if any, and ListLiveAdTagDetailsResponse + * @returns {undefined} + * @variation 1 */ - CreateCdnKeyRequest.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.cdnKey != null && message.hasOwnProperty("cdnKey")) { - var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKey); - if (error) - return "cdnKey." + error; - } - if (message.cdnKeyId != null && message.hasOwnProperty("cdnKeyId")) - if (!$util.isString(message.cdnKeyId)) - return "cdnKeyId: string expected"; - return null; - }; + Object.defineProperty(VideoStitcherService.prototype.listLiveAdTagDetails = function listLiveAdTagDetails(request, callback) { + return this.rpcCall(listLiveAdTagDetails, $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest, $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse, request, callback); + }, "name", { value: "ListLiveAdTagDetails" }); /** - * Creates a CreateCdnKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest + * Calls ListLiveAdTagDetails. + * @function listLiveAdTagDetails + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} request ListLiveAdTagDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateCdnKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest) - return object; - var message = new $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.cdnKey != null) { - if (typeof object.cdnKey !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.CreateCdnKeyRequest.cdnKey: object expected"); - message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKey); - } - if (object.cdnKeyId != null) - message.cdnKeyId = String(object.cdnKeyId); - return message; - }; /** - * Creates a plain object from a CreateCdnKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} message CreateCdnKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveAdTagDetail}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetLiveAdTagDetailCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.LiveAdTagDetail} [response] LiveAdTagDetail */ - CreateCdnKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.cdnKey = null; - object.cdnKeyId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) - object.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKey, options); - if (message.cdnKeyId != null && message.hasOwnProperty("cdnKeyId")) - object.cdnKeyId = message.cdnKeyId; - return object; - }; /** - * Converts this CreateCdnKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * Calls GetLiveAdTagDetail. + * @function getLiveAdTagDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} request GetLiveAdTagDetailRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveAdTagDetailCallback} callback Node-style callback called with the error, if any, and LiveAdTagDetail + * @returns {undefined} + * @variation 1 */ - CreateCdnKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(VideoStitcherService.prototype.getLiveAdTagDetail = function getLiveAdTagDetail(request, callback) { + return this.rpcCall(getLiveAdTagDetail, $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest, $root.google.cloud.video.stitcher.v1.LiveAdTagDetail, request, callback); + }, "name", { value: "GetLiveAdTagDetail" }); /** - * Gets the default type url for CreateCdnKeyRequest - * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetLiveAdTagDetail. + * @function getLiveAdTagDetail + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} request GetLiveAdTagDetailRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateCdnKeyRequest"; - }; - return CreateCdnKeyRequest; - })(); + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createSlate}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef CreateSlateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - v1.ListCdnKeysRequest = (function() { + /** + * Calls CreateSlate. + * @function createSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} request CreateSlateRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateSlateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoStitcherService.prototype.createSlate = function createSlate(request, callback) { + return this.rpcCall(createSlate, $root.google.cloud.video.stitcher.v1.CreateSlateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSlate" }); /** - * Properties of a ListCdnKeysRequest. - * @memberof google.cloud.video.stitcher.v1 - * @interface IListCdnKeysRequest - * @property {string|null} [parent] ListCdnKeysRequest parent - * @property {number|null} [pageSize] ListCdnKeysRequest pageSize - * @property {string|null} [pageToken] ListCdnKeysRequest pageToken - * @property {string|null} [filter] ListCdnKeysRequest filter - * @property {string|null} [orderBy] ListCdnKeysRequest orderBy + * Calls CreateSlate. + * @function createSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} request CreateSlateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListCdnKeysRequest. - * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListCdnKeysRequest. - * @implements IListCdnKeysRequest - * @constructor - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listSlates}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef ListSlatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.ListSlatesResponse} [response] ListSlatesResponse */ - function ListCdnKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListCdnKeysRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Calls ListSlates. + * @function listSlates + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} request ListSlatesRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListSlatesCallback} callback Node-style callback called with the error, if any, and ListSlatesResponse + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.prototype.parent = ""; + Object.defineProperty(VideoStitcherService.prototype.listSlates = function listSlates(request, callback) { + return this.rpcCall(listSlates, $root.google.cloud.video.stitcher.v1.ListSlatesRequest, $root.google.cloud.video.stitcher.v1.ListSlatesResponse, request, callback); + }, "name", { value: "ListSlates" }); /** - * ListCdnKeysRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Calls ListSlates. + * @function listSlates + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} request ListSlatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.prototype.pageSize = 0; /** - * ListCdnKeysRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getSlate}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetSlateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.Slate} [response] Slate + */ + + /** + * Calls GetSlate. + * @function getSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} request GetSlateRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetSlateCallback} callback Node-style callback called with the error, if any, and Slate + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.prototype.pageToken = ""; + Object.defineProperty(VideoStitcherService.prototype.getSlate = function getSlate(request, callback) { + return this.rpcCall(getSlate, $root.google.cloud.video.stitcher.v1.GetSlateRequest, $root.google.cloud.video.stitcher.v1.Slate, request, callback); + }, "name", { value: "GetSlate" }); /** - * ListCdnKeysRequest filter. - * @member {string} filter - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Calls GetSlate. + * @function getSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} request GetSlateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.prototype.filter = ""; /** - * ListCdnKeysRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|updateSlate}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef UpdateSlateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSlate. + * @function updateSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} request UpdateSlateRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.UpdateSlateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.prototype.orderBy = ""; + Object.defineProperty(VideoStitcherService.prototype.updateSlate = function updateSlate(request, callback) { + return this.rpcCall(updateSlate, $root.google.cloud.video.stitcher.v1.UpdateSlateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSlate" }); /** - * Creates a new ListCdnKeysRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest instance + * Calls UpdateSlate. + * @function updateSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} request UpdateSlateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.create = function create(properties) { - return new ListCdnKeysRequest(properties); - }; /** - * Encodes the specified ListCdnKeysRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} message ListCdnKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteSlate}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef DeleteSlateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListCdnKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; /** - * Encodes the specified ListCdnKeysRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} message ListCdnKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteSlate. + * @function deleteSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} request DeleteSlateRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.DeleteSlateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(VideoStitcherService.prototype.deleteSlate = function deleteSlate(request, callback) { + return this.rpcCall(deleteSlate, $root.google.cloud.video.stitcher.v1.DeleteSlateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSlate" }); /** - * Decodes a ListCdnKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteSlate. + * @function deleteSlate + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} request DeleteSlateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListCdnKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createLiveSession}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef CreateLiveSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.LiveSession} [response] LiveSession */ - ListCdnKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ListCdnKeysRequest message. - * @function verify - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateLiveSession. + * @function createLiveSession + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} request CreateLiveSessionRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveSessionCallback} callback Node-style callback called with the error, if any, and LiveSession + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + Object.defineProperty(VideoStitcherService.prototype.createLiveSession = function createLiveSession(request, callback) { + return this.rpcCall(createLiveSession, $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest, $root.google.cloud.video.stitcher.v1.LiveSession, request, callback); + }, "name", { value: "CreateLiveSession" }); /** - * Creates a ListCdnKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest + * Calls CreateLiveSession. + * @function createLiveSession + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} request CreateLiveSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest) - return object; - var message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; /** - * Creates a plain object from a ListCdnKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {google.cloud.video.stitcher.v1.ListCdnKeysRequest} message ListCdnKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveSession}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetLiveSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.LiveSession} [response] LiveSession */ - ListCdnKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; /** - * Converts this ListCdnKeysRequest to JSON. - * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * Calls GetLiveSession. + * @function getLiveSession + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} request GetLiveSessionRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveSessionCallback} callback Node-style callback called with the error, if any, and LiveSession + * @returns {undefined} + * @variation 1 */ - ListCdnKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(VideoStitcherService.prototype.getLiveSession = function getLiveSession(request, callback) { + return this.rpcCall(getLiveSession, $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest, $root.google.cloud.video.stitcher.v1.LiveSession, request, callback); + }, "name", { value: "GetLiveSession" }); /** - * Gets the default type url for ListCdnKeysRequest - * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetLiveSession. + * @function getLiveSession + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} request GetLiveSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListCdnKeysRequest"; - }; - - return ListCdnKeysRequest; - })(); - - v1.ListCdnKeysResponse = (function() { /** - * Properties of a ListCdnKeysResponse. - * @memberof google.cloud.video.stitcher.v1 - * @interface IListCdnKeysResponse - * @property {Array.|null} [cdnKeys] ListCdnKeysResponse cdnKeys - * @property {string|null} [nextPageToken] ListCdnKeysResponse nextPageToken - * @property {Array.|null} [unreachable] ListCdnKeysResponse unreachable + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|createLiveConfig}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef CreateLiveConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new ListCdnKeysResponse. - * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListCdnKeysResponse. - * @implements IListCdnKeysResponse - * @constructor - * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse=} [properties] Properties to set + * Calls CreateLiveConfig. + * @function createLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest} request CreateLiveConfigRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - function ListCdnKeysResponse(properties) { - this.cdnKeys = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(VideoStitcherService.prototype.createLiveConfig = function createLiveConfig(request, callback) { + return this.rpcCall(createLiveConfig, $root.google.cloud.video.stitcher.v1.CreateLiveConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateLiveConfig" }); /** - * ListCdnKeysResponse cdnKeys. - * @member {Array.} cdnKeys - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * Calls CreateLiveConfig. + * @function createLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest} request CreateLiveConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysResponse.prototype.cdnKeys = $util.emptyArray; /** - * ListCdnKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse - * @instance + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|listLiveConfigs}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef ListLiveConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} [response] ListLiveConfigsResponse */ - ListCdnKeysResponse.prototype.nextPageToken = ""; /** - * ListCdnKeysResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * Calls ListLiveConfigs. + * @function listLiveConfigs + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService * @instance + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest} request ListLiveConfigsRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveConfigsCallback} callback Node-style callback called with the error, if any, and ListLiveConfigsResponse + * @returns {undefined} + * @variation 1 */ - ListCdnKeysResponse.prototype.unreachable = $util.emptyArray; + Object.defineProperty(VideoStitcherService.prototype.listLiveConfigs = function listLiveConfigs(request, callback) { + return this.rpcCall(listLiveConfigs, $root.google.cloud.video.stitcher.v1.ListLiveConfigsRequest, $root.google.cloud.video.stitcher.v1.ListLiveConfigsResponse, request, callback); + }, "name", { value: "ListLiveConfigs" }); /** - * Creates a new ListCdnKeysResponse instance using the specified properties. - * @function create - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse - * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse instance + * Calls ListLiveConfigs. + * @function listLiveConfigs + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest} request ListLiveConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListCdnKeysResponse.create = function create(properties) { - return new ListCdnKeysResponse(properties); - }; /** - * Encodes the specified ListCdnKeysResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysResponse.verify|verify} messages. + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|getLiveConfig}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef GetLiveConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.stitcher.v1.LiveConfig} [response] LiveConfig + */ + + /** + * Calls GetLiveConfig. + * @function getLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest} request GetLiveConfigRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveConfigCallback} callback Node-style callback called with the error, if any, and LiveConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoStitcherService.prototype.getLiveConfig = function getLiveConfig(request, callback) { + return this.rpcCall(getLiveConfig, $root.google.cloud.video.stitcher.v1.GetLiveConfigRequest, $root.google.cloud.video.stitcher.v1.LiveConfig, request, callback); + }, "name", { value: "GetLiveConfig" }); + + /** + * Calls GetLiveConfig. + * @function getLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest} request GetLiveConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.stitcher.v1.VideoStitcherService|deleteLiveConfig}. + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @typedef DeleteLiveConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteLiveConfig. + * @function deleteLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest} request DeleteLiveConfigRequest message or plain object + * @param {google.cloud.video.stitcher.v1.VideoStitcherService.DeleteLiveConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoStitcherService.prototype.deleteLiveConfig = function deleteLiveConfig(request, callback) { + return this.rpcCall(deleteLiveConfig, $root.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteLiveConfig" }); + + /** + * Calls DeleteLiveConfig. + * @function deleteLiveConfig + * @memberof google.cloud.video.stitcher.v1.VideoStitcherService + * @instance + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest} request DeleteLiveConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoStitcherService; + })(); + + v1.CreateCdnKeyRequest = (function() { + + /** + * Properties of a CreateCdnKeyRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface ICreateCdnKeyRequest + * @property {string|null} [parent] CreateCdnKeyRequest parent + * @property {google.cloud.video.stitcher.v1.ICdnKey|null} [cdnKey] CreateCdnKeyRequest cdnKey + * @property {string|null} [cdnKeyId] CreateCdnKeyRequest cdnKeyId + */ + + /** + * Constructs a new CreateCdnKeyRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a CreateCdnKeyRequest. + * @implements ICreateCdnKeyRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest=} [properties] Properties to set + */ + function CreateCdnKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCdnKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * @instance + */ + CreateCdnKeyRequest.prototype.parent = ""; + + /** + * CreateCdnKeyRequest cdnKey. + * @member {google.cloud.video.stitcher.v1.ICdnKey|null|undefined} cdnKey + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * @instance + */ + CreateCdnKeyRequest.prototype.cdnKey = null; + + /** + * CreateCdnKeyRequest cdnKeyId. + * @member {string} cdnKeyId + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * @instance + */ + CreateCdnKeyRequest.prototype.cdnKeyId = ""; + + /** + * Creates a new CreateCdnKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest instance + */ + CreateCdnKeyRequest.create = function create(properties) { + return new CreateCdnKeyRequest(properties); + }; + + /** + * Encodes the specified CreateCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateCdnKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse} message ListCdnKeysResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} message CreateCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCdnKeysResponse.encode = function encode(message, writer) { + CreateCdnKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cdnKeys != null && message.cdnKeys.length) - for (var i = 0; i < message.cdnKeys.length; ++i) - $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.cdnKey != null && Object.hasOwnProperty.call(message, "cdnKey")) + $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cdnKeyId != null && Object.hasOwnProperty.call(message, "cdnKeyId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cdnKeyId); return writer; }; /** - * Encodes the specified ListCdnKeysResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysResponse.verify|verify} messages. + * Encodes the specified CreateCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateCdnKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse} message ListCdnKeysResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateCdnKeyRequest} message CreateCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCdnKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCdnKeysResponse message from the specified reader or buffer. + * Decodes a CreateCdnKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse + * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCdnKeysResponse.decode = function decode(reader, length) { + CreateCdnKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.cdnKeys && message.cdnKeys.length)) - message.cdnKeys = []; - message.cdnKeys.push($root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.cdnKeyId = reader.string(); break; } default: @@ -9565,169 +10501,148 @@ }; /** - * Decodes a ListCdnKeysResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateCdnKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse + * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCdnKeysResponse.decodeDelimited = function decodeDelimited(reader) { + CreateCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCdnKeysResponse message. + * Verifies a CreateCdnKeyRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCdnKeysResponse.verify = function verify(message) { + CreateCdnKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cdnKeys != null && message.hasOwnProperty("cdnKeys")) { - if (!Array.isArray(message.cdnKeys)) - return "cdnKeys: array expected"; - for (var i = 0; i < message.cdnKeys.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKeys[i]); - if (error) - return "cdnKeys." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) { + var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKey); + if (error) + return "cdnKey." + error; } + if (message.cdnKeyId != null && message.hasOwnProperty("cdnKeyId")) + if (!$util.isString(message.cdnKeyId)) + return "cdnKeyId: string expected"; return null; }; /** - * Creates a ListCdnKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateCdnKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse + * @returns {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} CreateCdnKeyRequest */ - ListCdnKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse) + CreateCdnKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse(); - if (object.cdnKeys) { - if (!Array.isArray(object.cdnKeys)) - throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.cdnKeys: array expected"); - message.cdnKeys = []; - for (var i = 0; i < object.cdnKeys.length; ++i) { - if (typeof object.cdnKeys[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.cdnKeys: object expected"); - message.cdnKeys[i] = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKeys[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + var message = new $root.google.cloud.video.stitcher.v1.CreateCdnKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cdnKey != null) { + if (typeof object.cdnKey !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.CreateCdnKeyRequest.cdnKey: object expected"); + message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKey); } + if (object.cdnKeyId != null) + message.cdnKeyId = String(object.cdnKeyId); return message; }; /** - * Creates a plain object from a ListCdnKeysResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateCdnKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.ListCdnKeysResponse} message ListCdnKeysResponse + * @param {google.cloud.video.stitcher.v1.CreateCdnKeyRequest} message CreateCdnKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCdnKeysResponse.toObject = function toObject(message, options) { + CreateCdnKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.cdnKeys = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.cdnKeys && message.cdnKeys.length) { - object.cdnKeys = []; - for (var j = 0; j < message.cdnKeys.length; ++j) - object.cdnKeys[j] = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKeys[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.parent = ""; + object.cdnKey = null; + object.cdnKeyId = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) + object.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKey, options); + if (message.cdnKeyId != null && message.hasOwnProperty("cdnKeyId")) + object.cdnKeyId = message.cdnKeyId; return object; }; /** - * Converts this ListCdnKeysResponse to JSON. + * Converts this CreateCdnKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @instance * @returns {Object.} JSON object */ - ListCdnKeysResponse.prototype.toJSON = function toJSON() { + CreateCdnKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListCdnKeysResponse + * Gets the default type url for CreateCdnKeyRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @memberof google.cloud.video.stitcher.v1.CreateCdnKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListCdnKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListCdnKeysResponse"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateCdnKeyRequest"; }; - return ListCdnKeysResponse; + return CreateCdnKeyRequest; })(); - v1.GetCdnKeyRequest = (function() { + v1.ListCdnKeysRequest = (function() { /** - * Properties of a GetCdnKeyRequest. + * Properties of a ListCdnKeysRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetCdnKeyRequest - * @property {string|null} [name] GetCdnKeyRequest name + * @interface IListCdnKeysRequest + * @property {string|null} [parent] ListCdnKeysRequest parent + * @property {number|null} [pageSize] ListCdnKeysRequest pageSize + * @property {string|null} [pageToken] ListCdnKeysRequest pageToken + * @property {string|null} [filter] ListCdnKeysRequest filter + * @property {string|null} [orderBy] ListCdnKeysRequest orderBy */ /** - * Constructs a new GetCdnKeyRequest. + * Constructs a new ListCdnKeysRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetCdnKeyRequest. - * @implements IGetCdnKeyRequest + * @classdesc Represents a ListCdnKeysRequest. + * @implements IListCdnKeysRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest=} [properties] Properties to set */ - function GetCdnKeyRequest(properties) { + function ListCdnKeysRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9735,75 +10650,131 @@ } /** - * GetCdnKeyRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * ListCdnKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @instance */ - GetCdnKeyRequest.prototype.name = ""; + ListCdnKeysRequest.prototype.parent = ""; /** - * Creates a new GetCdnKeyRequest instance using the specified properties. + * ListCdnKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * @instance + */ + ListCdnKeysRequest.prototype.pageSize = 0; + + /** + * ListCdnKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * @instance + */ + ListCdnKeysRequest.prototype.pageToken = ""; + + /** + * ListCdnKeysRequest filter. + * @member {string} filter + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * @instance + */ + ListCdnKeysRequest.prototype.filter = ""; + + /** + * ListCdnKeysRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest + * @instance + */ + ListCdnKeysRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCdnKeysRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest instance + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest instance */ - GetCdnKeyRequest.create = function create(properties) { - return new GetCdnKeyRequest(properties); + ListCdnKeysRequest.create = function create(properties) { + return new ListCdnKeysRequest(properties); }; /** - * Encodes the specified GetCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetCdnKeyRequest.verify|verify} messages. + * Encodes the specified ListCdnKeysRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} message GetCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} message ListCdnKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCdnKeyRequest.encode = function encode(message, writer) { + ListCdnKeysRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified GetCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetCdnKeyRequest.verify|verify} messages. + * Encodes the specified ListCdnKeysRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} message GetCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListCdnKeysRequest} message ListCdnKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListCdnKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetCdnKeyRequest message from the specified reader or buffer. + * Decodes a ListCdnKeysRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCdnKeyRequest.decode = function decode(reader, length) { + ListCdnKeysRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -9815,122 +10786,159 @@ }; /** - * Decodes a GetCdnKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCdnKeysRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListCdnKeysRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetCdnKeyRequest message. + * Verifies a ListCdnKeysRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetCdnKeyRequest.verify = function verify(message) { + ListCdnKeysRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a GetCdnKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListCdnKeysRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysRequest} ListCdnKeysRequest */ - GetCdnKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest) + ListCdnKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a GetCdnKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListCdnKeysRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static - * @param {google.cloud.video.stitcher.v1.GetCdnKeyRequest} message GetCdnKeyRequest + * @param {google.cloud.video.stitcher.v1.ListCdnKeysRequest} message ListCdnKeysRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCdnKeyRequest.toObject = function toObject(message, options) { + ListCdnKeysRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this GetCdnKeyRequest to JSON. + * Converts this ListCdnKeysRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @instance * @returns {Object.} JSON object */ - GetCdnKeyRequest.prototype.toJSON = function toJSON() { + ListCdnKeysRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetCdnKeyRequest + * Gets the default type url for ListCdnKeysRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListCdnKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetCdnKeyRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListCdnKeysRequest"; }; - return GetCdnKeyRequest; + return ListCdnKeysRequest; })(); - v1.DeleteCdnKeyRequest = (function() { + v1.ListCdnKeysResponse = (function() { /** - * Properties of a DeleteCdnKeyRequest. + * Properties of a ListCdnKeysResponse. * @memberof google.cloud.video.stitcher.v1 - * @interface IDeleteCdnKeyRequest - * @property {string|null} [name] DeleteCdnKeyRequest name + * @interface IListCdnKeysResponse + * @property {Array.|null} [cdnKeys] ListCdnKeysResponse cdnKeys + * @property {string|null} [nextPageToken] ListCdnKeysResponse nextPageToken + * @property {Array.|null} [unreachable] ListCdnKeysResponse unreachable */ /** - * Constructs a new DeleteCdnKeyRequest. + * Constructs a new ListCdnKeysResponse. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a DeleteCdnKeyRequest. - * @implements IDeleteCdnKeyRequest + * @classdesc Represents a ListCdnKeysResponse. + * @implements IListCdnKeysResponse * @constructor - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse=} [properties] Properties to set */ - function DeleteCdnKeyRequest(properties) { + function ListCdnKeysResponse(properties) { + this.cdnKeys = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9938,75 +10946,109 @@ } /** - * DeleteCdnKeyRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * ListCdnKeysResponse cdnKeys. + * @member {Array.} cdnKeys + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @instance */ - DeleteCdnKeyRequest.prototype.name = ""; + ListCdnKeysResponse.prototype.cdnKeys = $util.emptyArray; /** - * Creates a new DeleteCdnKeyRequest instance using the specified properties. + * ListCdnKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @instance + */ + ListCdnKeysResponse.prototype.nextPageToken = ""; + + /** + * ListCdnKeysResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse + * @instance + */ + ListCdnKeysResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCdnKeysResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest instance + * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse instance */ - DeleteCdnKeyRequest.create = function create(properties) { - return new DeleteCdnKeyRequest(properties); + ListCdnKeysResponse.create = function create(properties) { + return new ListCdnKeysResponse(properties); }; /** - * Encodes the specified DeleteCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteCdnKeyRequest.verify|verify} messages. + * Encodes the specified ListCdnKeysResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} message DeleteCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse} message ListCdnKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteCdnKeyRequest.encode = function encode(message, writer) { + ListCdnKeysResponse.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.cdnKeys != null && message.cdnKeys.length) + for (var i = 0; i < message.cdnKeys.length; ++i) + $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified DeleteCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteCdnKeyRequest.verify|verify} messages. + * Encodes the specified ListCdnKeysResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListCdnKeysResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} message DeleteCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListCdnKeysResponse} message ListCdnKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListCdnKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteCdnKeyRequest message from the specified reader or buffer. + * Decodes a ListCdnKeysResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteCdnKeyRequest.decode = function decode(reader, length) { + ListCdnKeysResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.cdnKeys && message.cdnKeys.length)) + message.cdnKeys = []; + message.cdnKeys.push($root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -10018,123 +11060,169 @@ }; /** - * Decodes a DeleteCdnKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCdnKeysResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListCdnKeysResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteCdnKeyRequest message. + * Verifies a ListCdnKeysResponse message. * @function verify - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteCdnKeyRequest.verify = function verify(message) { + ListCdnKeysResponse.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.cdnKeys != null && message.hasOwnProperty("cdnKeys")) { + if (!Array.isArray(message.cdnKeys)) + return "cdnKeys: array expected"; + for (var i = 0; i < message.cdnKeys.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKeys[i]); + if (error) + return "cdnKeys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a DeleteCdnKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListCdnKeysResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.ListCdnKeysResponse} ListCdnKeysResponse */ - DeleteCdnKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest) + ListCdnKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse) return object; - var message = new $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListCdnKeysResponse(); + if (object.cdnKeys) { + if (!Array.isArray(object.cdnKeys)) + throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.cdnKeys: array expected"); + message.cdnKeys = []; + for (var i = 0; i < object.cdnKeys.length; ++i) { + if (typeof object.cdnKeys[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.cdnKeys: object expected"); + message.cdnKeys[i] = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKeys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.stitcher.v1.ListCdnKeysResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a DeleteCdnKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListCdnKeysResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static - * @param {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} message DeleteCdnKeyRequest + * @param {google.cloud.video.stitcher.v1.ListCdnKeysResponse} message ListCdnKeysResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteCdnKeyRequest.toObject = function toObject(message, options) { + ListCdnKeysResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.cdnKeys = []; + object.unreachable = []; + } if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.cdnKeys && message.cdnKeys.length) { + object.cdnKeys = []; + for (var j = 0; j < message.cdnKeys.length; ++j) + object.cdnKeys[j] = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKeys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this DeleteCdnKeyRequest to JSON. + * Converts this ListCdnKeysResponse to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @instance * @returns {Object.} JSON object */ - DeleteCdnKeyRequest.prototype.toJSON = function toJSON() { + ListCdnKeysResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteCdnKeyRequest + * Gets the default type url for ListCdnKeysResponse * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.ListCdnKeysResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListCdnKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.DeleteCdnKeyRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListCdnKeysResponse"; }; - return DeleteCdnKeyRequest; + return ListCdnKeysResponse; })(); - v1.UpdateCdnKeyRequest = (function() { + v1.GetCdnKeyRequest = (function() { /** - * Properties of an UpdateCdnKeyRequest. + * Properties of a GetCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IUpdateCdnKeyRequest - * @property {google.cloud.video.stitcher.v1.ICdnKey|null} [cdnKey] UpdateCdnKeyRequest cdnKey - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCdnKeyRequest updateMask + * @interface IGetCdnKeyRequest + * @property {string|null} [name] GetCdnKeyRequest name */ /** - * Constructs a new UpdateCdnKeyRequest. + * Constructs a new GetCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents an UpdateCdnKeyRequest. - * @implements IUpdateCdnKeyRequest + * @classdesc Represents a GetCdnKeyRequest. + * @implements IGetCdnKeyRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest=} [properties] Properties to set */ - function UpdateCdnKeyRequest(properties) { + function GetCdnKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10142,89 +11230,75 @@ } /** - * UpdateCdnKeyRequest cdnKey. - * @member {google.cloud.video.stitcher.v1.ICdnKey|null|undefined} cdnKey - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * GetCdnKeyRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @instance */ - UpdateCdnKeyRequest.prototype.cdnKey = null; + GetCdnKeyRequest.prototype.name = ""; /** - * UpdateCdnKeyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest - * @instance - */ - UpdateCdnKeyRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateCdnKeyRequest instance using the specified properties. + * Creates a new GetCdnKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest instance + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest instance */ - UpdateCdnKeyRequest.create = function create(properties) { - return new UpdateCdnKeyRequest(properties); + GetCdnKeyRequest.create = function create(properties) { + return new GetCdnKeyRequest(properties); }; /** - * Encodes the specified UpdateCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.verify|verify} messages. + * Encodes the specified GetCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetCdnKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} message UpdateCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} message GetCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCdnKeyRequest.encode = function encode(message, writer) { + GetCdnKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cdnKey != null && Object.hasOwnProperty.call(message, "cdnKey")) - $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKey, 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.verify|verify} messages. + * Encodes the specified GetCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetCdnKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} message UpdateCdnKeyRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetCdnKeyRequest} message GetCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateCdnKeyRequest message from the specified reader or buffer. + * Decodes a GetCdnKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCdnKeyRequest.decode = function decode(reader, length) { + GetCdnKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -10236,142 +11310,122 @@ }; /** - * Decodes an UpdateCdnKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a GetCdnKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { + GetCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateCdnKeyRequest message. + * Verifies a GetCdnKeyRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateCdnKeyRequest.verify = function verify(message) { + GetCdnKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) { - var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKey); - if (error) - return "cdnKey." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateCdnKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetCdnKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest + * @returns {google.cloud.video.stitcher.v1.GetCdnKeyRequest} GetCdnKeyRequest */ - UpdateCdnKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest) + GetCdnKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest(); - if (object.cdnKey != null) { - if (typeof object.cdnKey !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.cdnKey: object expected"); - message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKey); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.video.stitcher.v1.GetCdnKeyRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateCdnKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetCdnKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} message UpdateCdnKeyRequest + * @param {google.cloud.video.stitcher.v1.GetCdnKeyRequest} message GetCdnKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCdnKeyRequest.toObject = function toObject(message, options) { + GetCdnKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.cdnKey = null; - object.updateMask = null; - } - if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) - object.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKey, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateCdnKeyRequest to JSON. + * Converts this GetCdnKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @instance * @returns {Object.} JSON object */ - UpdateCdnKeyRequest.prototype.toJSON = function toJSON() { + GetCdnKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateCdnKeyRequest + * Gets the default type url for GetCdnKeyRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @memberof google.cloud.video.stitcher.v1.GetCdnKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.UpdateCdnKeyRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetCdnKeyRequest"; }; - return UpdateCdnKeyRequest; + return GetCdnKeyRequest; })(); - v1.CreateVodSessionRequest = (function() { + v1.DeleteCdnKeyRequest = (function() { /** - * Properties of a CreateVodSessionRequest. + * Properties of a DeleteCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface ICreateVodSessionRequest - * @property {string|null} [parent] CreateVodSessionRequest parent - * @property {google.cloud.video.stitcher.v1.IVodSession|null} [vodSession] CreateVodSessionRequest vodSession + * @interface IDeleteCdnKeyRequest + * @property {string|null} [name] DeleteCdnKeyRequest name */ /** - * Constructs a new CreateVodSessionRequest. + * Constructs a new DeleteCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a CreateVodSessionRequest. - * @implements ICreateVodSessionRequest + * @classdesc Represents a DeleteCdnKeyRequest. + * @implements IDeleteCdnKeyRequest * @constructor - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest=} [properties] Properties to set */ - function CreateVodSessionRequest(properties) { + function DeleteCdnKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10379,89 +11433,75 @@ } /** - * CreateVodSessionRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest - * @instance - */ - CreateVodSessionRequest.prototype.parent = ""; - - /** - * CreateVodSessionRequest vodSession. - * @member {google.cloud.video.stitcher.v1.IVodSession|null|undefined} vodSession - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * DeleteCdnKeyRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @instance */ - CreateVodSessionRequest.prototype.vodSession = null; + DeleteCdnKeyRequest.prototype.name = ""; /** - * Creates a new CreateVodSessionRequest instance using the specified properties. + * Creates a new DeleteCdnKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest instance + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest instance */ - CreateVodSessionRequest.create = function create(properties) { - return new CreateVodSessionRequest(properties); + DeleteCdnKeyRequest.create = function create(properties) { + return new DeleteCdnKeyRequest(properties); }; /** - * Encodes the specified CreateVodSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateVodSessionRequest.verify|verify} messages. + * Encodes the specified DeleteCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteCdnKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} message CreateVodSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} message DeleteCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateVodSessionRequest.encode = function encode(message, writer) { + DeleteCdnKeyRequest.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.vodSession != null && Object.hasOwnProperty.call(message, "vodSession")) - $root.google.cloud.video.stitcher.v1.VodSession.encode(message.vodSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateVodSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateVodSessionRequest.verify|verify} messages. + * Encodes the specified DeleteCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteCdnKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} message CreateVodSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest} message DeleteCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateVodSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateVodSessionRequest message from the specified reader or buffer. + * Decodes a DeleteCdnKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateVodSessionRequest.decode = function decode(reader, length) { + DeleteCdnKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -10473,136 +11513,123 @@ }; /** - * Decodes a CreateVodSessionRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteCdnKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateVodSessionRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateVodSessionRequest message. + * Verifies a DeleteCdnKeyRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateVodSessionRequest.verify = function verify(message) { + DeleteCdnKeyRequest.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.vodSession != null && message.hasOwnProperty("vodSession")) { - var error = $root.google.cloud.video.stitcher.v1.VodSession.verify(message.vodSession); - if (error) - return "vodSession." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateVodSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteCdnKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} DeleteCdnKeyRequest */ - CreateVodSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest) + DeleteCdnKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.vodSession != null) { - if (typeof object.vodSession !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.CreateVodSessionRequest.vodSession: object expected"); - message.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.fromObject(object.vodSession); - } + var message = new $root.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateVodSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteCdnKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.CreateVodSessionRequest} message CreateVodSessionRequest + * @param {google.cloud.video.stitcher.v1.DeleteCdnKeyRequest} message DeleteCdnKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateVodSessionRequest.toObject = function toObject(message, options) { + DeleteCdnKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.vodSession = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.vodSession != null && message.hasOwnProperty("vodSession")) - object.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.toObject(message.vodSession, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateVodSessionRequest to JSON. + * Converts this DeleteCdnKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @instance * @returns {Object.} JSON object */ - CreateVodSessionRequest.prototype.toJSON = function toJSON() { + DeleteCdnKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateVodSessionRequest + * Gets the default type url for DeleteCdnKeyRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteCdnKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateVodSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateVodSessionRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.DeleteCdnKeyRequest"; }; - return CreateVodSessionRequest; + return DeleteCdnKeyRequest; })(); - v1.GetVodSessionRequest = (function() { + v1.UpdateCdnKeyRequest = (function() { /** - * Properties of a GetVodSessionRequest. + * Properties of an UpdateCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetVodSessionRequest - * @property {string|null} [name] GetVodSessionRequest name + * @interface IUpdateCdnKeyRequest + * @property {google.cloud.video.stitcher.v1.ICdnKey|null} [cdnKey] UpdateCdnKeyRequest cdnKey + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCdnKeyRequest updateMask */ /** - * Constructs a new GetVodSessionRequest. + * Constructs a new UpdateCdnKeyRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetVodSessionRequest. - * @implements IGetVodSessionRequest + * @classdesc Represents an UpdateCdnKeyRequest. + * @implements IUpdateCdnKeyRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest=} [properties] Properties to set */ - function GetVodSessionRequest(properties) { + function UpdateCdnKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10610,75 +11637,89 @@ } /** - * GetVodSessionRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * UpdateCdnKeyRequest cdnKey. + * @member {google.cloud.video.stitcher.v1.ICdnKey|null|undefined} cdnKey + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @instance */ - GetVodSessionRequest.prototype.name = ""; + UpdateCdnKeyRequest.prototype.cdnKey = null; /** - * Creates a new GetVodSessionRequest instance using the specified properties. + * UpdateCdnKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest + * @instance + */ + UpdateCdnKeyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCdnKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest instance + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest instance */ - GetVodSessionRequest.create = function create(properties) { - return new GetVodSessionRequest(properties); + UpdateCdnKeyRequest.create = function create(properties) { + return new UpdateCdnKeyRequest(properties); }; /** - * Encodes the specified GetVodSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodSessionRequest.verify|verify} messages. + * Encodes the specified UpdateCdnKeyRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} message GetVodSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} message UpdateCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodSessionRequest.encode = function encode(message, writer) { + UpdateCdnKeyRequest.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.cdnKey != null && Object.hasOwnProperty.call(message, "cdnKey")) + $root.google.cloud.video.stitcher.v1.CdnKey.encode(message.cdnKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetVodSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodSessionRequest.verify|verify} messages. + * Encodes the specified UpdateCdnKeyRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} message GetVodSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest} message UpdateCdnKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateCdnKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetVodSessionRequest message from the specified reader or buffer. + * Decodes an UpdateCdnKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodSessionRequest.decode = function decode(reader, length) { + UpdateCdnKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodSessionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -10690,124 +11731,142 @@ }; /** - * Decodes a GetVodSessionRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateCdnKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodSessionRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateCdnKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetVodSessionRequest message. + * Verifies an UpdateCdnKeyRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetVodSessionRequest.verify = function verify(message) { + UpdateCdnKeyRequest.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.cdnKey != null && message.hasOwnProperty("cdnKey")) { + var error = $root.google.cloud.video.stitcher.v1.CdnKey.verify(message.cdnKey); + if (error) + return "cdnKey." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a GetVodSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCdnKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} UpdateCdnKeyRequest */ - GetVodSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodSessionRequest) + UpdateCdnKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetVodSessionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest(); + if (object.cdnKey != null) { + if (typeof object.cdnKey !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.cdnKey: object expected"); + message.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.fromObject(object.cdnKey); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.UpdateCdnKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a GetVodSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateCdnKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static - * @param {google.cloud.video.stitcher.v1.GetVodSessionRequest} message GetVodSessionRequest + * @param {google.cloud.video.stitcher.v1.UpdateCdnKeyRequest} message UpdateCdnKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetVodSessionRequest.toObject = function toObject(message, options) { + UpdateCdnKeyRequest.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; + if (options.defaults) { + object.cdnKey = null; + object.updateMask = null; + } + if (message.cdnKey != null && message.hasOwnProperty("cdnKey")) + object.cdnKey = $root.google.cloud.video.stitcher.v1.CdnKey.toObject(message.cdnKey, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this GetVodSessionRequest to JSON. + * Converts this UpdateCdnKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @instance * @returns {Object.} JSON object */ - GetVodSessionRequest.prototype.toJSON = function toJSON() { + UpdateCdnKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetVodSessionRequest + * Gets the default type url for UpdateCdnKeyRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateCdnKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetVodSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateCdnKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodSessionRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.UpdateCdnKeyRequest"; }; - return GetVodSessionRequest; + return UpdateCdnKeyRequest; })(); - v1.ListVodStitchDetailsRequest = (function() { + v1.CreateVodSessionRequest = (function() { /** - * Properties of a ListVodStitchDetailsRequest. + * Properties of a CreateVodSessionRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListVodStitchDetailsRequest - * @property {string|null} [parent] ListVodStitchDetailsRequest parent - * @property {number|null} [pageSize] ListVodStitchDetailsRequest pageSize - * @property {string|null} [pageToken] ListVodStitchDetailsRequest pageToken + * @interface ICreateVodSessionRequest + * @property {string|null} [parent] CreateVodSessionRequest parent + * @property {google.cloud.video.stitcher.v1.IVodSession|null} [vodSession] CreateVodSessionRequest vodSession */ /** - * Constructs a new ListVodStitchDetailsRequest. + * Constructs a new CreateVodSessionRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListVodStitchDetailsRequest. - * @implements IListVodStitchDetailsRequest + * @classdesc Represents a CreateVodSessionRequest. + * @implements ICreateVodSessionRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest=} [properties] Properties to set */ - function ListVodStitchDetailsRequest(properties) { + function CreateVodSessionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10815,90 +11874,80 @@ } /** - * ListVodStitchDetailsRequest parent. + * CreateVodSessionRequest parent. * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @instance */ - ListVodStitchDetailsRequest.prototype.parent = ""; + CreateVodSessionRequest.prototype.parent = ""; /** - * ListVodStitchDetailsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * CreateVodSessionRequest vodSession. + * @member {google.cloud.video.stitcher.v1.IVodSession|null|undefined} vodSession + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @instance */ - ListVodStitchDetailsRequest.prototype.pageSize = 0; - - /** - * ListVodStitchDetailsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest - * @instance - */ - ListVodStitchDetailsRequest.prototype.pageToken = ""; + CreateVodSessionRequest.prototype.vodSession = null; /** - * Creates a new ListVodStitchDetailsRequest instance using the specified properties. + * Creates a new CreateVodSessionRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest instance + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest instance */ - ListVodStitchDetailsRequest.create = function create(properties) { - return new ListVodStitchDetailsRequest(properties); + CreateVodSessionRequest.create = function create(properties) { + return new CreateVodSessionRequest(properties); }; /** - * Encodes the specified ListVodStitchDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest.verify|verify} messages. + * Encodes the specified CreateVodSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateVodSessionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} message ListVodStitchDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} message CreateVodSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodStitchDetailsRequest.encode = function encode(message, writer) { + CreateVodSessionRequest.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.vodSession != null && Object.hasOwnProperty.call(message, "vodSession")) + $root.google.cloud.video.stitcher.v1.VodSession.encode(message.vodSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListVodStitchDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest.verify|verify} messages. + * Encodes the specified CreateVodSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateVodSessionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} message ListVodStitchDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateVodSessionRequest} message CreateVodSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodStitchDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateVodSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVodStitchDetailsRequest message from the specified reader or buffer. + * Decodes a CreateVodSessionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest + * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodStitchDetailsRequest.decode = function decode(reader, length) { + CreateVodSessionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10907,11 +11956,7 @@ break; } case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + message.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.decode(reader, reader.uint32()); break; } default: @@ -10923,141 +11968,136 @@ }; /** - * Decodes a ListVodStitchDetailsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateVodSessionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest + * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodStitchDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateVodSessionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVodStitchDetailsRequest message. + * Verifies a CreateVodSessionRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVodStitchDetailsRequest.verify = function verify(message) { + CreateVodSessionRequest.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.vodSession != null && message.hasOwnProperty("vodSession")) { + var error = $root.google.cloud.video.stitcher.v1.VodSession.verify(message.vodSession); + if (error) + return "vodSession." + error; + } return null; }; /** - * Creates a ListVodStitchDetailsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateVodSessionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest + * @returns {google.cloud.video.stitcher.v1.CreateVodSessionRequest} CreateVodSessionRequest */ - ListVodStitchDetailsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest) + CreateVodSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest(); + var message = new $root.google.cloud.video.stitcher.v1.CreateVodSessionRequest(); 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.vodSession != null) { + if (typeof object.vodSession !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.CreateVodSessionRequest.vodSession: object expected"); + message.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.fromObject(object.vodSession); + } return message; }; /** - * Creates a plain object from a ListVodStitchDetailsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateVodSessionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} message ListVodStitchDetailsRequest + * @param {google.cloud.video.stitcher.v1.CreateVodSessionRequest} message CreateVodSessionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVodStitchDetailsRequest.toObject = function toObject(message, options) { + CreateVodSessionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.vodSession = null; } 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.vodSession != null && message.hasOwnProperty("vodSession")) + object.vodSession = $root.google.cloud.video.stitcher.v1.VodSession.toObject(message.vodSession, options); return object; }; /** - * Converts this ListVodStitchDetailsRequest to JSON. + * Converts this CreateVodSessionRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @instance * @returns {Object.} JSON object */ - ListVodStitchDetailsRequest.prototype.toJSON = function toJSON() { + CreateVodSessionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVodStitchDetailsRequest + * Gets the default type url for CreateVodSessionRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @memberof google.cloud.video.stitcher.v1.CreateVodSessionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVodStitchDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateVodSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateVodSessionRequest"; }; - return ListVodStitchDetailsRequest; + return CreateVodSessionRequest; })(); - v1.ListVodStitchDetailsResponse = (function() { + v1.GetVodSessionRequest = (function() { /** - * Properties of a ListVodStitchDetailsResponse. + * Properties of a GetVodSessionRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListVodStitchDetailsResponse - * @property {Array.|null} [vodStitchDetails] ListVodStitchDetailsResponse vodStitchDetails - * @property {string|null} [nextPageToken] ListVodStitchDetailsResponse nextPageToken + * @interface IGetVodSessionRequest + * @property {string|null} [name] GetVodSessionRequest name */ /** - * Constructs a new ListVodStitchDetailsResponse. + * Constructs a new GetVodSessionRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListVodStitchDetailsResponse. - * @implements IListVodStitchDetailsResponse + * @classdesc Represents a GetVodSessionRequest. + * @implements IGetVodSessionRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest=} [properties] Properties to set */ - function ListVodStitchDetailsResponse(properties) { - this.vodStitchDetails = []; + function GetVodSessionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11065,92 +12105,75 @@ } /** - * ListVodStitchDetailsResponse vodStitchDetails. - * @member {Array.} vodStitchDetails - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse - * @instance - */ - ListVodStitchDetailsResponse.prototype.vodStitchDetails = $util.emptyArray; - - /** - * ListVodStitchDetailsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * GetVodSessionRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @instance */ - ListVodStitchDetailsResponse.prototype.nextPageToken = ""; + GetVodSessionRequest.prototype.name = ""; /** - * Creates a new ListVodStitchDetailsResponse instance using the specified properties. + * Creates a new GetVodSessionRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse instance + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest instance */ - ListVodStitchDetailsResponse.create = function create(properties) { - return new ListVodStitchDetailsResponse(properties); + GetVodSessionRequest.create = function create(properties) { + return new GetVodSessionRequest(properties); }; /** - * Encodes the specified ListVodStitchDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodSessionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse} message ListVodStitchDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} message GetVodSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodStitchDetailsResponse.encode = function encode(message, writer) { + GetVodSessionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vodStitchDetails != null && message.vodStitchDetails.length) - for (var i = 0; i < message.vodStitchDetails.length; ++i) - $root.google.cloud.video.stitcher.v1.VodStitchDetail.encode(message.vodStitchDetails[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListVodStitchDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodSessionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse} message ListVodStitchDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodSessionRequest} message GetVodSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodStitchDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetVodSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVodStitchDetailsResponse message from the specified reader or buffer. + * Decodes a GetVodSessionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodStitchDetailsResponse.decode = function decode(reader, length) { + GetVodSessionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodSessionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.vodStitchDetails && message.vodStitchDetails.length)) - message.vodStitchDetails = []; - message.vodStitchDetails.push($root.google.cloud.video.stitcher.v1.VodStitchDetail.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.name = reader.string(); break; } default: @@ -11162,148 +12185,124 @@ }; /** - * Decodes a ListVodStitchDetailsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetVodSessionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodStitchDetailsResponse.decodeDelimited = function decodeDelimited(reader) { + GetVodSessionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVodStitchDetailsResponse message. + * Verifies a GetVodSessionRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVodStitchDetailsResponse.verify = function verify(message) { + GetVodSessionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vodStitchDetails != null && message.hasOwnProperty("vodStitchDetails")) { - if (!Array.isArray(message.vodStitchDetails)) - return "vodStitchDetails: array expected"; - for (var i = 0; i < message.vodStitchDetails.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.VodStitchDetail.verify(message.vodStitchDetails[i]); - if (error) - return "vodStitchDetails." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListVodStitchDetailsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetVodSessionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodSessionRequest} GetVodSessionRequest */ - ListVodStitchDetailsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse) + GetVodSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodSessionRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse(); - if (object.vodStitchDetails) { - if (!Array.isArray(object.vodStitchDetails)) - throw TypeError(".google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.vodStitchDetails: array expected"); - message.vodStitchDetails = []; - for (var i = 0; i < object.vodStitchDetails.length; ++i) { - if (typeof object.vodStitchDetails[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.vodStitchDetails: object expected"); - message.vodStitchDetails[i] = $root.google.cloud.video.stitcher.v1.VodStitchDetail.fromObject(object.vodStitchDetails[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.video.stitcher.v1.GetVodSessionRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListVodStitchDetailsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetVodSessionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static - * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} message ListVodStitchDetailsResponse + * @param {google.cloud.video.stitcher.v1.GetVodSessionRequest} message GetVodSessionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVodStitchDetailsResponse.toObject = function toObject(message, options) { + GetVodSessionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.vodStitchDetails = []; if (options.defaults) - object.nextPageToken = ""; - if (message.vodStitchDetails && message.vodStitchDetails.length) { - object.vodStitchDetails = []; - for (var j = 0; j < message.vodStitchDetails.length; ++j) - object.vodStitchDetails[j] = $root.google.cloud.video.stitcher.v1.VodStitchDetail.toObject(message.vodStitchDetails[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListVodStitchDetailsResponse to JSON. + * Converts this GetVodSessionRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @instance * @returns {Object.} JSON object */ - ListVodStitchDetailsResponse.prototype.toJSON = function toJSON() { + GetVodSessionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVodStitchDetailsResponse + * Gets the default type url for GetVodSessionRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodSessionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVodStitchDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetVodSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodSessionRequest"; }; - return ListVodStitchDetailsResponse; + return GetVodSessionRequest; })(); - v1.GetVodStitchDetailRequest = (function() { + v1.ListVodStitchDetailsRequest = (function() { /** - * Properties of a GetVodStitchDetailRequest. + * Properties of a ListVodStitchDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetVodStitchDetailRequest - * @property {string|null} [name] GetVodStitchDetailRequest name + * @interface IListVodStitchDetailsRequest + * @property {string|null} [parent] ListVodStitchDetailsRequest parent + * @property {number|null} [pageSize] ListVodStitchDetailsRequest pageSize + * @property {string|null} [pageToken] ListVodStitchDetailsRequest pageToken */ /** - * Constructs a new GetVodStitchDetailRequest. + * Constructs a new ListVodStitchDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetVodStitchDetailRequest. - * @implements IGetVodStitchDetailRequest + * @classdesc Represents a ListVodStitchDetailsRequest. + * @implements IListVodStitchDetailsRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest=} [properties] Properties to set */ - function GetVodStitchDetailRequest(properties) { + function ListVodStitchDetailsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11311,75 +12310,103 @@ } /** - * GetVodStitchDetailRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * ListVodStitchDetailsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @instance */ - GetVodStitchDetailRequest.prototype.name = ""; + ListVodStitchDetailsRequest.prototype.parent = ""; /** - * Creates a new GetVodStitchDetailRequest instance using the specified properties. + * ListVodStitchDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @instance + */ + ListVodStitchDetailsRequest.prototype.pageSize = 0; + + /** + * ListVodStitchDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest + * @instance + */ + ListVodStitchDetailsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVodStitchDetailsRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest instance + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest instance */ - GetVodStitchDetailRequest.create = function create(properties) { - return new GetVodStitchDetailRequest(properties); + ListVodStitchDetailsRequest.create = function create(properties) { + return new ListVodStitchDetailsRequest(properties); }; /** - * Encodes the specified GetVodStitchDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodStitchDetailRequest.verify|verify} messages. + * Encodes the specified ListVodStitchDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} message GetVodStitchDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} message ListVodStitchDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodStitchDetailRequest.encode = function encode(message, writer) { + ListVodStitchDetailsRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GetVodStitchDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodStitchDetailRequest.verify|verify} messages. + * Encodes the specified ListVodStitchDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} message GetVodStitchDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsRequest} message ListVodStitchDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodStitchDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListVodStitchDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetVodStitchDetailRequest message from the specified reader or buffer. + * Decodes a ListVodStitchDetailsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodStitchDetailRequest.decode = function decode(reader, length) { + ListVodStitchDetailsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -11391,124 +12418,141 @@ }; /** - * Decodes a GetVodStitchDetailRequest message from the specified reader or buffer, length delimited. + * Decodes a ListVodStitchDetailsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodStitchDetailRequest.decodeDelimited = function decodeDelimited(reader) { + ListVodStitchDetailsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetVodStitchDetailRequest message. + * Verifies a ListVodStitchDetailsRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetVodStitchDetailRequest.verify = function verify(message) { + ListVodStitchDetailsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GetVodStitchDetailRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListVodStitchDetailsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} ListVodStitchDetailsRequest */ - GetVodStitchDetailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest) + ListVodStitchDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetVodStitchDetailRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListVodStitchDetailsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} message GetVodStitchDetailRequest + * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest} message ListVodStitchDetailsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetVodStitchDetailRequest.toObject = function toObject(message, options) { + ListVodStitchDetailsRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetVodStitchDetailRequest to JSON. + * Converts this ListVodStitchDetailsRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @instance * @returns {Object.} JSON object */ - GetVodStitchDetailRequest.prototype.toJSON = function toJSON() { + ListVodStitchDetailsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetVodStitchDetailRequest + * Gets the default type url for ListVodStitchDetailsRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetVodStitchDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVodStitchDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodStitchDetailRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest"; }; - return GetVodStitchDetailRequest; + return ListVodStitchDetailsRequest; })(); - v1.ListVodAdTagDetailsRequest = (function() { + v1.ListVodStitchDetailsResponse = (function() { /** - * Properties of a ListVodAdTagDetailsRequest. + * Properties of a ListVodStitchDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @interface IListVodAdTagDetailsRequest - * @property {string|null} [parent] ListVodAdTagDetailsRequest parent - * @property {number|null} [pageSize] ListVodAdTagDetailsRequest pageSize - * @property {string|null} [pageToken] ListVodAdTagDetailsRequest pageToken + * @interface IListVodStitchDetailsResponse + * @property {Array.|null} [vodStitchDetails] ListVodStitchDetailsResponse vodStitchDetails + * @property {string|null} [nextPageToken] ListVodStitchDetailsResponse nextPageToken */ /** - * Constructs a new ListVodAdTagDetailsRequest. + * Constructs a new ListVodStitchDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListVodAdTagDetailsRequest. - * @implements IListVodAdTagDetailsRequest + * @classdesc Represents a ListVodStitchDetailsResponse. + * @implements IListVodStitchDetailsResponse * @constructor - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse=} [properties] Properties to set */ - function ListVodAdTagDetailsRequest(properties) { + function ListVodStitchDetailsResponse(properties) { + this.vodStitchDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11516,103 +12560,92 @@ } /** - * ListVodAdTagDetailsRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest - * @instance - */ - ListVodAdTagDetailsRequest.prototype.parent = ""; - - /** - * ListVodAdTagDetailsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * ListVodStitchDetailsResponse vodStitchDetails. + * @member {Array.} vodStitchDetails + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @instance */ - ListVodAdTagDetailsRequest.prototype.pageSize = 0; + ListVodStitchDetailsResponse.prototype.vodStitchDetails = $util.emptyArray; /** - * ListVodAdTagDetailsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * ListVodStitchDetailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @instance */ - ListVodAdTagDetailsRequest.prototype.pageToken = ""; + ListVodStitchDetailsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListVodAdTagDetailsRequest instance using the specified properties. + * Creates a new ListVodStitchDetailsResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest instance + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse instance */ - ListVodAdTagDetailsRequest.create = function create(properties) { - return new ListVodAdTagDetailsRequest(properties); + ListVodStitchDetailsResponse.create = function create(properties) { + return new ListVodStitchDetailsResponse(properties); }; /** - * Encodes the specified ListVodAdTagDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest.verify|verify} messages. + * Encodes the specified ListVodStitchDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse} message ListVodStitchDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodAdTagDetailsRequest.encode = function encode(message, writer) { + ListVodStitchDetailsResponse.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.vodStitchDetails != null && message.vodStitchDetails.length) + for (var i = 0; i < message.vodStitchDetails.length; ++i) + $root.google.cloud.video.stitcher.v1.VodStitchDetail.encode(message.vodStitchDetails[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 ListVodAdTagDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest.verify|verify} messages. + * Encodes the specified ListVodStitchDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodStitchDetailsResponse} message ListVodStitchDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodAdTagDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListVodStitchDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVodAdTagDetailsRequest message from the specified reader or buffer. + * Decodes a ListVodStitchDetailsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodAdTagDetailsRequest.decode = function decode(reader, length) { + ListVodStitchDetailsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.vodStitchDetails && message.vodStitchDetails.length)) + message.vodStitchDetails = []; + message.vodStitchDetails.push($root.google.cloud.video.stitcher.v1.VodStitchDetail.decode(reader, reader.uint32())); break; } case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + message.nextPageToken = reader.string(); break; } default: @@ -11624,141 +12657,148 @@ }; /** - * Decodes a ListVodAdTagDetailsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListVodStitchDetailsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodAdTagDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + ListVodStitchDetailsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVodAdTagDetailsRequest message. + * Verifies a ListVodStitchDetailsResponse message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVodAdTagDetailsRequest.verify = function verify(message) { + ListVodStitchDetailsResponse.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.vodStitchDetails != null && message.hasOwnProperty("vodStitchDetails")) { + if (!Array.isArray(message.vodStitchDetails)) + return "vodStitchDetails: array expected"; + for (var i = 0; i < message.vodStitchDetails.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.VodStitchDetail.verify(message.vodStitchDetails[i]); + if (error) + return "vodStitchDetails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ListVodAdTagDetailsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListVodStitchDetailsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} ListVodStitchDetailsResponse */ - ListVodAdTagDetailsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest) + ListVodStitchDetailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest(); - 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); + var message = new $root.google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse(); + if (object.vodStitchDetails) { + if (!Array.isArray(object.vodStitchDetails)) + throw TypeError(".google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.vodStitchDetails: array expected"); + message.vodStitchDetails = []; + for (var i = 0; i < object.vodStitchDetails.length; ++i) { + if (typeof object.vodStitchDetails[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse.vodStitchDetails: object expected"); + message.vodStitchDetails[i] = $root.google.cloud.video.stitcher.v1.VodStitchDetail.fromObject(object.vodStitchDetails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListVodAdTagDetailsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListVodStitchDetailsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest + * @param {google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse} message ListVodStitchDetailsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVodAdTagDetailsRequest.toObject = function toObject(message, options) { + ListVodStitchDetailsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.vodStitchDetails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.vodStitchDetails && message.vodStitchDetails.length) { + object.vodStitchDetails = []; + for (var j = 0; j < message.vodStitchDetails.length; ++j) + object.vodStitchDetails[j] = $root.google.cloud.video.stitcher.v1.VodStitchDetail.toObject(message.vodStitchDetails[j], options); } - 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListVodAdTagDetailsRequest to JSON. + * Converts this ListVodStitchDetailsResponse to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @instance * @returns {Object.} JSON object */ - ListVodAdTagDetailsRequest.prototype.toJSON = function toJSON() { + ListVodStitchDetailsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVodAdTagDetailsRequest + * Gets the default type url for ListVodStitchDetailsResponse * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVodAdTagDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVodStitchDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodStitchDetailsResponse"; }; - return ListVodAdTagDetailsRequest; + return ListVodStitchDetailsResponse; })(); - v1.ListVodAdTagDetailsResponse = (function() { + v1.GetVodStitchDetailRequest = (function() { /** - * Properties of a ListVodAdTagDetailsResponse. + * Properties of a GetVodStitchDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListVodAdTagDetailsResponse - * @property {Array.|null} [vodAdTagDetails] ListVodAdTagDetailsResponse vodAdTagDetails - * @property {string|null} [nextPageToken] ListVodAdTagDetailsResponse nextPageToken + * @interface IGetVodStitchDetailRequest + * @property {string|null} [name] GetVodStitchDetailRequest name */ /** - * Constructs a new ListVodAdTagDetailsResponse. + * Constructs a new GetVodStitchDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListVodAdTagDetailsResponse. - * @implements IListVodAdTagDetailsResponse + * @classdesc Represents a GetVodStitchDetailRequest. + * @implements IGetVodStitchDetailRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest=} [properties] Properties to set */ - function ListVodAdTagDetailsResponse(properties) { - this.vodAdTagDetails = []; + function GetVodStitchDetailRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11766,92 +12806,75 @@ } /** - * ListVodAdTagDetailsResponse vodAdTagDetails. - * @member {Array.} vodAdTagDetails - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse - * @instance - */ - ListVodAdTagDetailsResponse.prototype.vodAdTagDetails = $util.emptyArray; - - /** - * ListVodAdTagDetailsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * GetVodStitchDetailRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @instance */ - ListVodAdTagDetailsResponse.prototype.nextPageToken = ""; + GetVodStitchDetailRequest.prototype.name = ""; /** - * Creates a new ListVodAdTagDetailsResponse instance using the specified properties. + * Creates a new GetVodStitchDetailRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse instance + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest instance */ - ListVodAdTagDetailsResponse.create = function create(properties) { - return new ListVodAdTagDetailsResponse(properties); + GetVodStitchDetailRequest.create = function create(properties) { + return new GetVodStitchDetailRequest(properties); }; /** - * Encodes the specified ListVodAdTagDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodStitchDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodStitchDetailRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} message GetVodStitchDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodAdTagDetailsResponse.encode = function encode(message, writer) { + GetVodStitchDetailRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vodAdTagDetails != null && message.vodAdTagDetails.length) - for (var i = 0; i < message.vodAdTagDetails.length; ++i) - $root.google.cloud.video.stitcher.v1.VodAdTagDetail.encode(message.vodAdTagDetails[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListVodAdTagDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodStitchDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodStitchDetailRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest} message GetVodStitchDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVodAdTagDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetVodStitchDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVodAdTagDetailsResponse message from the specified reader or buffer. + * Decodes a GetVodStitchDetailRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodAdTagDetailsResponse.decode = function decode(reader, length) { + GetVodStitchDetailRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.vodAdTagDetails && message.vodAdTagDetails.length)) - message.vodAdTagDetails = []; - message.vodAdTagDetails.push($root.google.cloud.video.stitcher.v1.VodAdTagDetail.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.name = reader.string(); break; } default: @@ -11863,148 +12886,124 @@ }; /** - * Decodes a ListVodAdTagDetailsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetVodStitchDetailRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVodAdTagDetailsResponse.decodeDelimited = function decodeDelimited(reader) { + GetVodStitchDetailRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVodAdTagDetailsResponse message. + * Verifies a GetVodStitchDetailRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVodAdTagDetailsResponse.verify = function verify(message) { + GetVodStitchDetailRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vodAdTagDetails != null && message.hasOwnProperty("vodAdTagDetails")) { - if (!Array.isArray(message.vodAdTagDetails)) - return "vodAdTagDetails: array expected"; - for (var i = 0; i < message.vodAdTagDetails.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.verify(message.vodAdTagDetails[i]); - if (error) - return "vodAdTagDetails." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListVodAdTagDetailsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetVodStitchDetailRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} GetVodStitchDetailRequest */ - ListVodAdTagDetailsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse) + GetVodStitchDetailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse(); - if (object.vodAdTagDetails) { - if (!Array.isArray(object.vodAdTagDetails)) - throw TypeError(".google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.vodAdTagDetails: array expected"); - message.vodAdTagDetails = []; - for (var i = 0; i < object.vodAdTagDetails.length; ++i) { - if (typeof object.vodAdTagDetails[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.vodAdTagDetails: object expected"); - message.vodAdTagDetails[i] = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.fromObject(object.vodAdTagDetails[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListVodAdTagDetailsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetVodStitchDetailRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse + * @param {google.cloud.video.stitcher.v1.GetVodStitchDetailRequest} message GetVodStitchDetailRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVodAdTagDetailsResponse.toObject = function toObject(message, options) { + GetVodStitchDetailRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.vodAdTagDetails = []; if (options.defaults) - object.nextPageToken = ""; - if (message.vodAdTagDetails && message.vodAdTagDetails.length) { - object.vodAdTagDetails = []; - for (var j = 0; j < message.vodAdTagDetails.length; ++j) - object.vodAdTagDetails[j] = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.toObject(message.vodAdTagDetails[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListVodAdTagDetailsResponse to JSON. + * Converts this GetVodStitchDetailRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @instance * @returns {Object.} JSON object */ - ListVodAdTagDetailsResponse.prototype.toJSON = function toJSON() { + GetVodStitchDetailRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVodAdTagDetailsResponse + * Gets the default type url for GetVodStitchDetailRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodStitchDetailRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVodAdTagDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetVodStitchDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodStitchDetailRequest"; }; - return ListVodAdTagDetailsResponse; + return GetVodStitchDetailRequest; })(); - v1.GetVodAdTagDetailRequest = (function() { + v1.ListVodAdTagDetailsRequest = (function() { /** - * Properties of a GetVodAdTagDetailRequest. + * Properties of a ListVodAdTagDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetVodAdTagDetailRequest - * @property {string|null} [name] GetVodAdTagDetailRequest name + * @interface IListVodAdTagDetailsRequest + * @property {string|null} [parent] ListVodAdTagDetailsRequest parent + * @property {number|null} [pageSize] ListVodAdTagDetailsRequest pageSize + * @property {string|null} [pageToken] ListVodAdTagDetailsRequest pageToken */ /** - * Constructs a new GetVodAdTagDetailRequest. + * Constructs a new ListVodAdTagDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetVodAdTagDetailRequest. - * @implements IGetVodAdTagDetailRequest + * @classdesc Represents a ListVodAdTagDetailsRequest. + * @implements IListVodAdTagDetailsRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest=} [properties] Properties to set */ - function GetVodAdTagDetailRequest(properties) { + function ListVodAdTagDetailsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12012,75 +13011,103 @@ } /** - * GetVodAdTagDetailRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * ListVodAdTagDetailsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @instance */ - GetVodAdTagDetailRequest.prototype.name = ""; + ListVodAdTagDetailsRequest.prototype.parent = ""; /** - * Creates a new GetVodAdTagDetailRequest instance using the specified properties. + * ListVodAdTagDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @instance + */ + ListVodAdTagDetailsRequest.prototype.pageSize = 0; + + /** + * ListVodAdTagDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @instance + */ + ListVodAdTagDetailsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVodAdTagDetailsRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest instance + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest instance */ - GetVodAdTagDetailRequest.create = function create(properties) { - return new GetVodAdTagDetailRequest(properties); + ListVodAdTagDetailsRequest.create = function create(properties) { + return new ListVodAdTagDetailsRequest(properties); }; /** - * Encodes the specified GetVodAdTagDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest.verify|verify} messages. + * Encodes the specified ListVodAdTagDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} message GetVodAdTagDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodAdTagDetailRequest.encode = function encode(message, writer) { + ListVodAdTagDetailsRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GetVodAdTagDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest.verify|verify} messages. + * Encodes the specified ListVodAdTagDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} message GetVodAdTagDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVodAdTagDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListVodAdTagDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetVodAdTagDetailRequest message from the specified reader or buffer. + * Decodes a ListVodAdTagDetailsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodAdTagDetailRequest.decode = function decode(reader, length) { + ListVodAdTagDetailsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -12092,124 +13119,141 @@ }; /** - * Decodes a GetVodAdTagDetailRequest message from the specified reader or buffer, length delimited. + * Decodes a ListVodAdTagDetailsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVodAdTagDetailRequest.decodeDelimited = function decodeDelimited(reader) { + ListVodAdTagDetailsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetVodAdTagDetailRequest message. + * Verifies a ListVodAdTagDetailsRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetVodAdTagDetailRequest.verify = function verify(message) { + ListVodAdTagDetailsRequest.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 GetVodAdTagDetailRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest - * @static + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListVodAdTagDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest + * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} ListVodAdTagDetailsRequest */ - GetVodAdTagDetailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest) + ListVodAdTagDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetVodAdTagDetailRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListVodAdTagDetailsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} message GetVodAdTagDetailRequest + * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest} message ListVodAdTagDetailsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetVodAdTagDetailRequest.toObject = function toObject(message, options) { + ListVodAdTagDetailsRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetVodAdTagDetailRequest to JSON. + * Converts this ListVodAdTagDetailsRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @instance * @returns {Object.} JSON object */ - GetVodAdTagDetailRequest.prototype.toJSON = function toJSON() { + ListVodAdTagDetailsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetVodAdTagDetailRequest + * Gets the default type url for ListVodAdTagDetailsRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetVodAdTagDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVodAdTagDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest"; }; - return GetVodAdTagDetailRequest; + return ListVodAdTagDetailsRequest; })(); - v1.ListLiveAdTagDetailsRequest = (function() { + v1.ListVodAdTagDetailsResponse = (function() { /** - * Properties of a ListLiveAdTagDetailsRequest. + * Properties of a ListVodAdTagDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @interface IListLiveAdTagDetailsRequest - * @property {string|null} [parent] ListLiveAdTagDetailsRequest parent - * @property {number|null} [pageSize] ListLiveAdTagDetailsRequest pageSize - * @property {string|null} [pageToken] ListLiveAdTagDetailsRequest pageToken + * @interface IListVodAdTagDetailsResponse + * @property {Array.|null} [vodAdTagDetails] ListVodAdTagDetailsResponse vodAdTagDetails + * @property {string|null} [nextPageToken] ListVodAdTagDetailsResponse nextPageToken */ /** - * Constructs a new ListLiveAdTagDetailsRequest. + * Constructs a new ListVodAdTagDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListLiveAdTagDetailsRequest. - * @implements IListLiveAdTagDetailsRequest + * @classdesc Represents a ListVodAdTagDetailsResponse. + * @implements IListVodAdTagDetailsResponse * @constructor - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse=} [properties] Properties to set */ - function ListLiveAdTagDetailsRequest(properties) { + function ListVodAdTagDetailsResponse(properties) { + this.vodAdTagDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12217,103 +13261,92 @@ } /** - * ListLiveAdTagDetailsRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest - * @instance - */ - ListLiveAdTagDetailsRequest.prototype.parent = ""; - - /** - * ListLiveAdTagDetailsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * ListVodAdTagDetailsResponse vodAdTagDetails. + * @member {Array.} vodAdTagDetails + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @instance */ - ListLiveAdTagDetailsRequest.prototype.pageSize = 0; + ListVodAdTagDetailsResponse.prototype.vodAdTagDetails = $util.emptyArray; /** - * ListLiveAdTagDetailsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * ListVodAdTagDetailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @instance */ - ListLiveAdTagDetailsRequest.prototype.pageToken = ""; + ListVodAdTagDetailsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListLiveAdTagDetailsRequest instance using the specified properties. + * Creates a new ListVodAdTagDetailsResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest instance + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse instance */ - ListLiveAdTagDetailsRequest.create = function create(properties) { - return new ListLiveAdTagDetailsRequest(properties); + ListVodAdTagDetailsResponse.create = function create(properties) { + return new ListVodAdTagDetailsResponse(properties); }; /** - * Encodes the specified ListLiveAdTagDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest.verify|verify} messages. + * Encodes the specified ListVodAdTagDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLiveAdTagDetailsRequest.encode = function encode(message, writer) { + ListVodAdTagDetailsResponse.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.vodAdTagDetails != null && message.vodAdTagDetails.length) + for (var i = 0; i < message.vodAdTagDetails.length; ++i) + $root.google.cloud.video.stitcher.v1.VodAdTagDetail.encode(message.vodAdTagDetails[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 ListLiveAdTagDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest.verify|verify} messages. + * Encodes the specified ListVodAdTagDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLiveAdTagDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListVodAdTagDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListLiveAdTagDetailsRequest message from the specified reader or buffer. + * Decodes a ListVodAdTagDetailsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLiveAdTagDetailsRequest.decode = function decode(reader, length) { + ListVodAdTagDetailsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.vodAdTagDetails && message.vodAdTagDetails.length)) + message.vodAdTagDetails = []; + message.vodAdTagDetails.push($root.google.cloud.video.stitcher.v1.VodAdTagDetail.decode(reader, reader.uint32())); break; } case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + message.nextPageToken = reader.string(); break; } default: @@ -12325,141 +13358,148 @@ }; /** - * Decodes a ListLiveAdTagDetailsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListVodAdTagDetailsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLiveAdTagDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + ListVodAdTagDetailsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListLiveAdTagDetailsRequest message. + * Verifies a ListVodAdTagDetailsResponse message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListLiveAdTagDetailsRequest.verify = function verify(message) { + ListVodAdTagDetailsResponse.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.vodAdTagDetails != null && message.hasOwnProperty("vodAdTagDetails")) { + if (!Array.isArray(message.vodAdTagDetails)) + return "vodAdTagDetails: array expected"; + for (var i = 0; i < message.vodAdTagDetails.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.verify(message.vodAdTagDetails[i]); + if (error) + return "vodAdTagDetails." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ListLiveAdTagDetailsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListVodAdTagDetailsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest + * @returns {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} ListVodAdTagDetailsResponse */ - ListLiveAdTagDetailsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest) + ListVodAdTagDetailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest(); - 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); + var message = new $root.google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse(); + if (object.vodAdTagDetails) { + if (!Array.isArray(object.vodAdTagDetails)) + throw TypeError(".google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.vodAdTagDetails: array expected"); + message.vodAdTagDetails = []; + for (var i = 0; i < object.vodAdTagDetails.length; ++i) { + if (typeof object.vodAdTagDetails[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse.vodAdTagDetails: object expected"); + message.vodAdTagDetails[i] = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.fromObject(object.vodAdTagDetails[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListLiveAdTagDetailsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListVodAdTagDetailsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest + * @param {google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse} message ListVodAdTagDetailsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListLiveAdTagDetailsRequest.toObject = function toObject(message, options) { + ListVodAdTagDetailsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (options.arrays || options.defaults) + object.vodAdTagDetails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.vodAdTagDetails && message.vodAdTagDetails.length) { + object.vodAdTagDetails = []; + for (var j = 0; j < message.vodAdTagDetails.length; ++j) + object.vodAdTagDetails[j] = $root.google.cloud.video.stitcher.v1.VodAdTagDetail.toObject(message.vodAdTagDetails[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListLiveAdTagDetailsRequest to JSON. + * Converts this ListVodAdTagDetailsResponse to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @instance * @returns {Object.} JSON object */ - ListLiveAdTagDetailsRequest.prototype.toJSON = function toJSON() { + ListVodAdTagDetailsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListLiveAdTagDetailsRequest + * Gets the default type url for ListVodAdTagDetailsResponse * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @memberof google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListLiveAdTagDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVodAdTagDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListVodAdTagDetailsResponse"; }; - return ListLiveAdTagDetailsRequest; + return ListVodAdTagDetailsResponse; })(); - v1.ListLiveAdTagDetailsResponse = (function() { + v1.GetVodAdTagDetailRequest = (function() { /** - * Properties of a ListLiveAdTagDetailsResponse. + * Properties of a GetVodAdTagDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListLiveAdTagDetailsResponse - * @property {Array.|null} [liveAdTagDetails] ListLiveAdTagDetailsResponse liveAdTagDetails - * @property {string|null} [nextPageToken] ListLiveAdTagDetailsResponse nextPageToken + * @interface IGetVodAdTagDetailRequest + * @property {string|null} [name] GetVodAdTagDetailRequest name */ /** - * Constructs a new ListLiveAdTagDetailsResponse. + * Constructs a new GetVodAdTagDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListLiveAdTagDetailsResponse. - * @implements IListLiveAdTagDetailsResponse + * @classdesc Represents a GetVodAdTagDetailRequest. + * @implements IGetVodAdTagDetailRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest=} [properties] Properties to set */ - function ListLiveAdTagDetailsResponse(properties) { - this.liveAdTagDetails = []; + function GetVodAdTagDetailRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12467,92 +13507,75 @@ } /** - * ListLiveAdTagDetailsResponse liveAdTagDetails. - * @member {Array.} liveAdTagDetails - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse - * @instance - */ - ListLiveAdTagDetailsResponse.prototype.liveAdTagDetails = $util.emptyArray; - - /** - * ListLiveAdTagDetailsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * GetVodAdTagDetailRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @instance */ - ListLiveAdTagDetailsResponse.prototype.nextPageToken = ""; + GetVodAdTagDetailRequest.prototype.name = ""; /** - * Creates a new ListLiveAdTagDetailsResponse instance using the specified properties. + * Creates a new GetVodAdTagDetailRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse instance + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest instance */ - ListLiveAdTagDetailsResponse.create = function create(properties) { - return new ListLiveAdTagDetailsResponse(properties); + GetVodAdTagDetailRequest.create = function create(properties) { + return new GetVodAdTagDetailRequest(properties); }; /** - * Encodes the specified ListLiveAdTagDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodAdTagDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} message GetVodAdTagDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLiveAdTagDetailsResponse.encode = function encode(message, writer) { + GetVodAdTagDetailRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.liveAdTagDetails != null && message.liveAdTagDetails.length) - for (var i = 0; i < message.liveAdTagDetails.length; ++i) - $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.encode(message.liveAdTagDetails[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListLiveAdTagDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.verify|verify} messages. + * Encodes the specified GetVodAdTagDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest} message GetVodAdTagDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListLiveAdTagDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetVodAdTagDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListLiveAdTagDetailsResponse message from the specified reader or buffer. + * Decodes a GetVodAdTagDetailRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLiveAdTagDetailsResponse.decode = function decode(reader, length) { + GetVodAdTagDetailRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.liveAdTagDetails && message.liveAdTagDetails.length)) - message.liveAdTagDetails = []; - message.liveAdTagDetails.push($root.google.cloud.video.stitcher.v1.LiveAdTagDetail.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.name = reader.string(); break; } default: @@ -12564,148 +13587,124 @@ }; /** - * Decodes a ListLiveAdTagDetailsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetVodAdTagDetailRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListLiveAdTagDetailsResponse.decodeDelimited = function decodeDelimited(reader) { + GetVodAdTagDetailRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListLiveAdTagDetailsResponse message. + * Verifies a GetVodAdTagDetailRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListLiveAdTagDetailsResponse.verify = function verify(message) { + GetVodAdTagDetailRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.liveAdTagDetails != null && message.hasOwnProperty("liveAdTagDetails")) { - if (!Array.isArray(message.liveAdTagDetails)) - return "liveAdTagDetails: array expected"; - for (var i = 0; i < message.liveAdTagDetails.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.verify(message.liveAdTagDetails[i]); - if (error) - return "liveAdTagDetails." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListLiveAdTagDetailsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetVodAdTagDetailRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse + * @returns {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} GetVodAdTagDetailRequest */ - ListLiveAdTagDetailsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse) + GetVodAdTagDetailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse(); - if (object.liveAdTagDetails) { - if (!Array.isArray(object.liveAdTagDetails)) - throw TypeError(".google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.liveAdTagDetails: array expected"); - message.liveAdTagDetails = []; - for (var i = 0; i < object.liveAdTagDetails.length; ++i) { - if (typeof object.liveAdTagDetails[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.liveAdTagDetails: object expected"); - message.liveAdTagDetails[i] = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.fromObject(object.liveAdTagDetails[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListLiveAdTagDetailsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetVodAdTagDetailRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse + * @param {google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest} message GetVodAdTagDetailRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListLiveAdTagDetailsResponse.toObject = function toObject(message, options) { + GetVodAdTagDetailRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.liveAdTagDetails = []; if (options.defaults) - object.nextPageToken = ""; - if (message.liveAdTagDetails && message.liveAdTagDetails.length) { - object.liveAdTagDetails = []; - for (var j = 0; j < message.liveAdTagDetails.length; ++j) - object.liveAdTagDetails[j] = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.toObject(message.liveAdTagDetails[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListLiveAdTagDetailsResponse to JSON. + * Converts this GetVodAdTagDetailRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @instance * @returns {Object.} JSON object */ - ListLiveAdTagDetailsResponse.prototype.toJSON = function toJSON() { + GetVodAdTagDetailRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListLiveAdTagDetailsResponse + * Gets the default type url for GetVodAdTagDetailRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse + * @memberof google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListLiveAdTagDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetVodAdTagDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest"; }; - return ListLiveAdTagDetailsResponse; + return GetVodAdTagDetailRequest; })(); - v1.GetLiveAdTagDetailRequest = (function() { + v1.ListLiveAdTagDetailsRequest = (function() { /** - * Properties of a GetLiveAdTagDetailRequest. + * Properties of a ListLiveAdTagDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetLiveAdTagDetailRequest - * @property {string|null} [name] GetLiveAdTagDetailRequest name + * @interface IListLiveAdTagDetailsRequest + * @property {string|null} [parent] ListLiveAdTagDetailsRequest parent + * @property {number|null} [pageSize] ListLiveAdTagDetailsRequest pageSize + * @property {string|null} [pageToken] ListLiveAdTagDetailsRequest pageToken */ /** - * Constructs a new GetLiveAdTagDetailRequest. + * Constructs a new ListLiveAdTagDetailsRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetLiveAdTagDetailRequest. - * @implements IGetLiveAdTagDetailRequest + * @classdesc Represents a ListLiveAdTagDetailsRequest. + * @implements IListLiveAdTagDetailsRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest=} [properties] Properties to set */ - function GetLiveAdTagDetailRequest(properties) { + function ListLiveAdTagDetailsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12713,75 +13712,103 @@ } /** - * GetLiveAdTagDetailRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * ListLiveAdTagDetailsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @instance */ - GetLiveAdTagDetailRequest.prototype.name = ""; + ListLiveAdTagDetailsRequest.prototype.parent = ""; /** - * Creates a new GetLiveAdTagDetailRequest instance using the specified properties. - * @function create - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest - * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest instance + * ListLiveAdTagDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @instance */ - GetLiveAdTagDetailRequest.create = function create(properties) { - return new GetLiveAdTagDetailRequest(properties); - }; + ListLiveAdTagDetailsRequest.prototype.pageSize = 0; /** - * Encodes the specified GetLiveAdTagDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest.verify|verify} messages. + * ListLiveAdTagDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @instance + */ + ListLiveAdTagDetailsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLiveAdTagDetailsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest instance + */ + ListLiveAdTagDetailsRequest.create = function create(properties) { + return new ListLiveAdTagDetailsRequest(properties); + }; + + /** + * Encodes the specified ListLiveAdTagDetailsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLiveAdTagDetailRequest.encode = function encode(message, writer) { + ListLiveAdTagDetailsRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GetLiveAdTagDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest.verify|verify} messages. + * Encodes the specified ListLiveAdTagDetailsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLiveAdTagDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListLiveAdTagDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetLiveAdTagDetailRequest message from the specified reader or buffer. + * Decodes a ListLiveAdTagDetailsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLiveAdTagDetailRequest.decode = function decode(reader, length) { + ListLiveAdTagDetailsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -12793,124 +13820,141 @@ }; /** - * Decodes a GetLiveAdTagDetailRequest message from the specified reader or buffer, length delimited. + * Decodes a ListLiveAdTagDetailsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLiveAdTagDetailRequest.decodeDelimited = function decodeDelimited(reader) { + ListLiveAdTagDetailsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetLiveAdTagDetailRequest message. + * Verifies a ListLiveAdTagDetailsRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetLiveAdTagDetailRequest.verify = function verify(message) { + ListLiveAdTagDetailsRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GetLiveAdTagDetailRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListLiveAdTagDetailsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} ListLiveAdTagDetailsRequest */ - GetLiveAdTagDetailRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest) + ListLiveAdTagDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetLiveAdTagDetailRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListLiveAdTagDetailsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static - * @param {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest + * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest} message ListLiveAdTagDetailsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetLiveAdTagDetailRequest.toObject = function toObject(message, options) { + ListLiveAdTagDetailsRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetLiveAdTagDetailRequest to JSON. + * Converts this ListLiveAdTagDetailsRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @instance * @returns {Object.} JSON object */ - GetLiveAdTagDetailRequest.prototype.toJSON = function toJSON() { + ListLiveAdTagDetailsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetLiveAdTagDetailRequest + * Gets the default type url for ListLiveAdTagDetailsRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetLiveAdTagDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListLiveAdTagDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest"; }; - return GetLiveAdTagDetailRequest; + return ListLiveAdTagDetailsRequest; })(); - v1.CreateSlateRequest = (function() { + v1.ListLiveAdTagDetailsResponse = (function() { /** - * Properties of a CreateSlateRequest. + * Properties of a ListLiveAdTagDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @interface ICreateSlateRequest - * @property {string|null} [parent] CreateSlateRequest parent - * @property {string|null} [slateId] CreateSlateRequest slateId - * @property {google.cloud.video.stitcher.v1.ISlate|null} [slate] CreateSlateRequest slate + * @interface IListLiveAdTagDetailsResponse + * @property {Array.|null} [liveAdTagDetails] ListLiveAdTagDetailsResponse liveAdTagDetails + * @property {string|null} [nextPageToken] ListLiveAdTagDetailsResponse nextPageToken */ /** - * Constructs a new CreateSlateRequest. + * Constructs a new ListLiveAdTagDetailsResponse. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a CreateSlateRequest. - * @implements ICreateSlateRequest + * @classdesc Represents a ListLiveAdTagDetailsResponse. + * @implements IListLiveAdTagDetailsResponse * @constructor - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse=} [properties] Properties to set */ - function CreateSlateRequest(properties) { + function ListLiveAdTagDetailsResponse(properties) { + this.liveAdTagDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12918,103 +13962,92 @@ } /** - * CreateSlateRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest - * @instance - */ - CreateSlateRequest.prototype.parent = ""; - - /** - * CreateSlateRequest slateId. - * @member {string} slateId - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * ListLiveAdTagDetailsResponse liveAdTagDetails. + * @member {Array.} liveAdTagDetails + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @instance */ - CreateSlateRequest.prototype.slateId = ""; + ListLiveAdTagDetailsResponse.prototype.liveAdTagDetails = $util.emptyArray; /** - * CreateSlateRequest slate. - * @member {google.cloud.video.stitcher.v1.ISlate|null|undefined} slate - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * ListLiveAdTagDetailsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @instance */ - CreateSlateRequest.prototype.slate = null; + ListLiveAdTagDetailsResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateSlateRequest instance using the specified properties. + * Creates a new ListLiveAdTagDetailsResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest instance + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse instance */ - CreateSlateRequest.create = function create(properties) { - return new CreateSlateRequest(properties); + ListLiveAdTagDetailsResponse.create = function create(properties) { + return new ListLiveAdTagDetailsResponse(properties); }; /** - * Encodes the specified CreateSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateSlateRequest.verify|verify} messages. + * Encodes the specified ListLiveAdTagDetailsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} message CreateSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSlateRequest.encode = function encode(message, writer) { + ListLiveAdTagDetailsResponse.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.slateId != null && Object.hasOwnProperty.call(message, "slateId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.slateId); - if (message.slate != null && Object.hasOwnProperty.call(message, "slate")) - $root.google.cloud.video.stitcher.v1.Slate.encode(message.slate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.liveAdTagDetails != null && message.liveAdTagDetails.length) + for (var i = 0; i < message.liveAdTagDetails.length; ++i) + $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.encode(message.liveAdTagDetails[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 CreateSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateSlateRequest.verify|verify} messages. + * Encodes the specified ListLiveAdTagDetailsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} message CreateSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListLiveAdTagDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSlateRequest message from the specified reader or buffer. + * Decodes a ListLiveAdTagDetailsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSlateRequest.decode = function decode(reader, length) { + ListLiveAdTagDetailsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateSlateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.liveAdTagDetails && message.liveAdTagDetails.length)) + message.liveAdTagDetails = []; + message.liveAdTagDetails.push($root.google.cloud.video.stitcher.v1.LiveAdTagDetail.decode(reader, reader.uint32())); break; } case 2: { - message.slateId = reader.string(); - break; - } - case 3: { - message.slate = $root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -13026,144 +14059,148 @@ }; /** - * Decodes a CreateSlateRequest message from the specified reader or buffer, length delimited. + * Decodes a ListLiveAdTagDetailsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSlateRequest.decodeDelimited = function decodeDelimited(reader) { + ListLiveAdTagDetailsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSlateRequest message. + * Verifies a ListLiveAdTagDetailsResponse message. * @function verify - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSlateRequest.verify = function verify(message) { + ListLiveAdTagDetailsResponse.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.slateId != null && message.hasOwnProperty("slateId")) - if (!$util.isString(message.slateId)) - return "slateId: string expected"; - if (message.slate != null && message.hasOwnProperty("slate")) { - var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slate); - if (error) - return "slate." + error; + if (message.liveAdTagDetails != null && message.hasOwnProperty("liveAdTagDetails")) { + if (!Array.isArray(message.liveAdTagDetails)) + return "liveAdTagDetails: array expected"; + for (var i = 0; i < message.liveAdTagDetails.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.verify(message.liveAdTagDetails[i]); + if (error) + return "liveAdTagDetails." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateSlateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListLiveAdTagDetailsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} ListLiveAdTagDetailsResponse */ - CreateSlateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.CreateSlateRequest) + ListLiveAdTagDetailsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse) return object; - var message = new $root.google.cloud.video.stitcher.v1.CreateSlateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.slateId != null) - message.slateId = String(object.slateId); - if (object.slate != null) { - if (typeof object.slate !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.CreateSlateRequest.slate: object expected"); - message.slate = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slate); + var message = new $root.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse(); + if (object.liveAdTagDetails) { + if (!Array.isArray(object.liveAdTagDetails)) + throw TypeError(".google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.liveAdTagDetails: array expected"); + message.liveAdTagDetails = []; + for (var i = 0; i < object.liveAdTagDetails.length; ++i) { + if (typeof object.liveAdTagDetails[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse.liveAdTagDetails: object expected"); + message.liveAdTagDetails[i] = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.fromObject(object.liveAdTagDetails[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateSlateRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListLiveAdTagDetailsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static - * @param {google.cloud.video.stitcher.v1.CreateSlateRequest} message CreateSlateRequest + * @param {google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse} message ListLiveAdTagDetailsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSlateRequest.toObject = function toObject(message, options) { + ListLiveAdTagDetailsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.slateId = ""; - object.slate = null; + if (options.arrays || options.defaults) + object.liveAdTagDetails = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.liveAdTagDetails && message.liveAdTagDetails.length) { + object.liveAdTagDetails = []; + for (var j = 0; j < message.liveAdTagDetails.length; ++j) + object.liveAdTagDetails[j] = $root.google.cloud.video.stitcher.v1.LiveAdTagDetail.toObject(message.liveAdTagDetails[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.slateId != null && message.hasOwnProperty("slateId")) - object.slateId = message.slateId; - if (message.slate != null && message.hasOwnProperty("slate")) - object.slate = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slate, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateSlateRequest to JSON. + * Converts this ListLiveAdTagDetailsResponse to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @instance * @returns {Object.} JSON object */ - CreateSlateRequest.prototype.toJSON = function toJSON() { + ListLiveAdTagDetailsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSlateRequest + * Gets the default type url for ListLiveAdTagDetailsResponse * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListLiveAdTagDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateSlateRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveAdTagDetailsResponse"; }; - return CreateSlateRequest; + return ListLiveAdTagDetailsResponse; })(); - v1.GetSlateRequest = (function() { + v1.GetLiveAdTagDetailRequest = (function() { /** - * Properties of a GetSlateRequest. + * Properties of a GetLiveAdTagDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetSlateRequest - * @property {string|null} [name] GetSlateRequest name + * @interface IGetLiveAdTagDetailRequest + * @property {string|null} [name] GetLiveAdTagDetailRequest name */ /** - * Constructs a new GetSlateRequest. + * Constructs a new GetLiveAdTagDetailRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetSlateRequest. - * @implements IGetSlateRequest + * @classdesc Represents a GetLiveAdTagDetailRequest. + * @implements IGetLiveAdTagDetailRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest=} [properties] Properties to set */ - function GetSlateRequest(properties) { + function GetLiveAdTagDetailRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13171,35 +14208,35 @@ } /** - * GetSlateRequest name. + * GetLiveAdTagDetailRequest name. * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @instance */ - GetSlateRequest.prototype.name = ""; + GetLiveAdTagDetailRequest.prototype.name = ""; /** - * Creates a new GetSlateRequest instance using the specified properties. + * Creates a new GetLiveAdTagDetailRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest instance + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest instance */ - GetSlateRequest.create = function create(properties) { - return new GetSlateRequest(properties); + GetLiveAdTagDetailRequest.create = function create(properties) { + return new GetLiveAdTagDetailRequest(properties); }; /** - * Encodes the specified GetSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetSlateRequest.verify|verify} messages. + * Encodes the specified GetLiveAdTagDetailRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} message GetSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSlateRequest.encode = function encode(message, writer) { + GetLiveAdTagDetailRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -13208,33 +14245,33 @@ }; /** - * Encodes the specified GetSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetSlateRequest.verify|verify} messages. + * Encodes the specified GetLiveAdTagDetailRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} message GetSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetLiveAdTagDetailRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSlateRequest message from the specified reader or buffer. + * Decodes a GetLiveAdTagDetailRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest + * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSlateRequest.decode = function decode(reader, length) { + GetLiveAdTagDetailRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetSlateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13251,30 +14288,30 @@ }; /** - * Decodes a GetSlateRequest message from the specified reader or buffer, length delimited. + * Decodes a GetLiveAdTagDetailRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest + * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSlateRequest.decodeDelimited = function decodeDelimited(reader) { + GetLiveAdTagDetailRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSlateRequest message. + * Verifies a GetLiveAdTagDetailRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSlateRequest.verify = function verify(message) { + GetLiveAdTagDetailRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -13284,32 +14321,32 @@ }; /** - * Creates a GetSlateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetLiveAdTagDetailRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest + * @returns {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} GetLiveAdTagDetailRequest */ - GetSlateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetSlateRequest) + GetLiveAdTagDetailRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetSlateRequest(); + var message = new $root.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetSlateRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetLiveAdTagDetailRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static - * @param {google.cloud.video.stitcher.v1.GetSlateRequest} message GetSlateRequest + * @param {google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest} message GetLiveAdTagDetailRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSlateRequest.toObject = function toObject(message, options) { + GetLiveAdTagDetailRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -13321,56 +14358,55 @@ }; /** - * Converts this GetSlateRequest to JSON. + * Converts this GetLiveAdTagDetailRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @instance * @returns {Object.} JSON object */ - GetSlateRequest.prototype.toJSON = function toJSON() { + GetLiveAdTagDetailRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSlateRequest + * Gets the default type url for GetLiveAdTagDetailRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetSlateRequest + * @memberof google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetLiveAdTagDetailRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetSlateRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest"; }; - return GetSlateRequest; + return GetLiveAdTagDetailRequest; })(); - v1.ListSlatesRequest = (function() { + v1.CreateSlateRequest = (function() { /** - * Properties of a ListSlatesRequest. + * Properties of a CreateSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListSlatesRequest - * @property {string|null} [parent] ListSlatesRequest parent - * @property {number|null} [pageSize] ListSlatesRequest pageSize - * @property {string|null} [pageToken] ListSlatesRequest pageToken - * @property {string|null} [filter] ListSlatesRequest filter - * @property {string|null} [orderBy] ListSlatesRequest orderBy + * @interface ICreateSlateRequest + * @property {string|null} [parent] CreateSlateRequest parent + * @property {string|null} [slateId] CreateSlateRequest slateId + * @property {google.cloud.video.stitcher.v1.ISlate|null} [slate] CreateSlateRequest slate + * @property {string|null} [requestId] CreateSlateRequest requestId */ /** - * Constructs a new ListSlatesRequest. + * Constructs a new CreateSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListSlatesRequest. - * @implements IListSlatesRequest + * @classdesc Represents a CreateSlateRequest. + * @implements ICreateSlateRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest=} [properties] Properties to set */ - function ListSlatesRequest(properties) { + function CreateSlateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13378,110 +14414,100 @@ } /** - * ListSlatesRequest parent. + * CreateSlateRequest parent. * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @instance */ - ListSlatesRequest.prototype.parent = ""; + CreateSlateRequest.prototype.parent = ""; /** - * ListSlatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * CreateSlateRequest slateId. + * @member {string} slateId + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @instance */ - ListSlatesRequest.prototype.pageSize = 0; - - /** - * ListSlatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest - * @instance - */ - ListSlatesRequest.prototype.pageToken = ""; + CreateSlateRequest.prototype.slateId = ""; /** - * ListSlatesRequest filter. - * @member {string} filter - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * CreateSlateRequest slate. + * @member {google.cloud.video.stitcher.v1.ISlate|null|undefined} slate + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @instance */ - ListSlatesRequest.prototype.filter = ""; + CreateSlateRequest.prototype.slate = null; /** - * ListSlatesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * CreateSlateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @instance */ - ListSlatesRequest.prototype.orderBy = ""; + CreateSlateRequest.prototype.requestId = ""; /** - * Creates a new ListSlatesRequest instance using the specified properties. + * Creates a new CreateSlateRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest instance + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest instance */ - ListSlatesRequest.create = function create(properties) { - return new ListSlatesRequest(properties); + CreateSlateRequest.create = function create(properties) { + return new CreateSlateRequest(properties); }; /** - * Encodes the specified ListSlatesRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesRequest.verify|verify} messages. + * Encodes the specified CreateSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateSlateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} message ListSlatesRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} message CreateSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSlatesRequest.encode = function encode(message, writer) { + CreateSlateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.slateId != null && Object.hasOwnProperty.call(message, "slateId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.slateId); + if (message.slate != null && Object.hasOwnProperty.call(message, "slate")) + $root.google.cloud.video.stitcher.v1.Slate.encode(message.slate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified ListSlatesRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesRequest.verify|verify} messages. + * Encodes the specified CreateSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateSlateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} message ListSlatesRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.ICreateSlateRequest} message CreateSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSlatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSlatesRequest message from the specified reader or buffer. + * Decodes a CreateSlateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest + * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSlatesRequest.decode = function decode(reader, length) { + CreateSlateRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListSlatesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateSlateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13490,19 +14516,15 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.slateId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.slate = $root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.requestId = reader.string(); break; } default: @@ -13514,159 +14536,152 @@ }; /** - * Decodes a ListSlatesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSlateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest + * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSlatesRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSlateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSlatesRequest message. + * Verifies a CreateSlateRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSlatesRequest.verify = function verify(message) { + CreateSlateRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.slateId != null && message.hasOwnProperty("slateId")) + if (!$util.isString(message.slateId)) + return "slateId: string expected"; + if (message.slate != null && message.hasOwnProperty("slate")) { + var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slate); + if (error) + return "slate." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListSlatesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSlateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest + * @returns {google.cloud.video.stitcher.v1.CreateSlateRequest} CreateSlateRequest */ - ListSlatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListSlatesRequest) + CreateSlateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.CreateSlateRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListSlatesRequest(); + var message = new $root.google.cloud.video.stitcher.v1.CreateSlateRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + if (object.slateId != null) + message.slateId = String(object.slateId); + if (object.slate != null) { + if (typeof object.slate !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.CreateSlateRequest.slate: object expected"); + message.slate = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slate); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListSlatesRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSlateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.ListSlatesRequest} message ListSlatesRequest + * @param {google.cloud.video.stitcher.v1.CreateSlateRequest} message CreateSlateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSlatesRequest.toObject = function toObject(message, options) { + CreateSlateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.slateId = ""; + object.slate = null; + object.requestId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.slateId != null && message.hasOwnProperty("slateId")) + object.slateId = message.slateId; + if (message.slate != null && message.hasOwnProperty("slate")) + object.slate = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slate, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListSlatesRequest to JSON. + * Converts this CreateSlateRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @instance * @returns {Object.} JSON object */ - ListSlatesRequest.prototype.toJSON = function toJSON() { + CreateSlateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSlatesRequest + * Gets the default type url for CreateSlateRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @memberof google.cloud.video.stitcher.v1.CreateSlateRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSlatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListSlatesRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateSlateRequest"; }; - return ListSlatesRequest; + return CreateSlateRequest; })(); - v1.ListSlatesResponse = (function() { + v1.GetSlateRequest = (function() { /** - * Properties of a ListSlatesResponse. + * Properties of a GetSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IListSlatesResponse - * @property {Array.|null} [slates] ListSlatesResponse slates - * @property {string|null} [nextPageToken] ListSlatesResponse nextPageToken - * @property {Array.|null} [unreachable] ListSlatesResponse unreachable + * @interface IGetSlateRequest + * @property {string|null} [name] GetSlateRequest name */ /** - * Constructs a new ListSlatesResponse. + * Constructs a new GetSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a ListSlatesResponse. - * @implements IListSlatesResponse + * @classdesc Represents a GetSlateRequest. + * @implements IGetSlateRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IListSlatesResponse=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest=} [properties] Properties to set */ - function ListSlatesResponse(properties) { - this.slates = []; - this.unreachable = []; + function GetSlateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13674,109 +14689,75 @@ } /** - * ListSlatesResponse slates. - * @member {Array.} slates - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse - * @instance - */ - ListSlatesResponse.prototype.slates = $util.emptyArray; - - /** - * ListSlatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse - * @instance - */ - ListSlatesResponse.prototype.nextPageToken = ""; - - /** - * ListSlatesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * GetSlateRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @instance */ - ListSlatesResponse.prototype.unreachable = $util.emptyArray; + GetSlateRequest.prototype.name = ""; /** - * Creates a new ListSlatesResponse instance using the specified properties. + * Creates a new GetSlateRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesResponse=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse instance + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest instance */ - ListSlatesResponse.create = function create(properties) { - return new ListSlatesResponse(properties); + GetSlateRequest.create = function create(properties) { + return new GetSlateRequest(properties); }; /** - * Encodes the specified ListSlatesResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesResponse.verify|verify} messages. + * Encodes the specified GetSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetSlateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesResponse} message ListSlatesResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} message GetSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSlatesResponse.encode = function encode(message, writer) { + GetSlateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.slates != null && message.slates.length) - for (var i = 0; i < message.slates.length; ++i) - $root.google.cloud.video.stitcher.v1.Slate.encode(message.slates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListSlatesResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesResponse.verify|verify} messages. + * Encodes the specified GetSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetSlateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IListSlatesResponse} message ListSlatesResponse message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IGetSlateRequest} message GetSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSlatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSlatesResponse message from the specified reader or buffer. + * Decodes a GetSlateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse + * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSlatesResponse.decode = function decode(reader, length) { + GetSlateRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListSlatesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetSlateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.slates && message.slates.length)) - message.slates = []; - message.slates.push($root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.name = reader.string(); break; } default: @@ -13788,170 +14769,126 @@ }; /** - * Decodes a ListSlatesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetSlateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse + * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSlatesResponse.decodeDelimited = function decodeDelimited(reader) { + GetSlateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSlatesResponse message. + * Verifies a GetSlateRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSlatesResponse.verify = function verify(message) { + GetSlateRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.slates != null && message.hasOwnProperty("slates")) { - if (!Array.isArray(message.slates)) - return "slates: array expected"; - for (var i = 0; i < message.slates.length; ++i) { - var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slates[i]); - if (error) - return "slates." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListSlatesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetSlateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse + * @returns {google.cloud.video.stitcher.v1.GetSlateRequest} GetSlateRequest */ - ListSlatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.ListSlatesResponse) + GetSlateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetSlateRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.ListSlatesResponse(); - if (object.slates) { - if (!Array.isArray(object.slates)) - throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.slates: array expected"); - message.slates = []; - for (var i = 0; i < object.slates.length; ++i) { - if (typeof object.slates[i] !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.slates: object expected"); - message.slates[i] = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } + var message = new $root.google.cloud.video.stitcher.v1.GetSlateRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListSlatesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetSlateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.ListSlatesResponse} message ListSlatesResponse + * @param {google.cloud.video.stitcher.v1.GetSlateRequest} message GetSlateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSlatesResponse.toObject = function toObject(message, options) { + GetSlateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.slates = []; - object.unreachable = []; - } if (options.defaults) - object.nextPageToken = ""; - if (message.slates && message.slates.length) { - object.slates = []; - for (var j = 0; j < message.slates.length; ++j) - object.slates[j] = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slates[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListSlatesResponse to JSON. + * Converts this GetSlateRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @instance * @returns {Object.} JSON object */ - ListSlatesResponse.prototype.toJSON = function toJSON() { + GetSlateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSlatesResponse + * Gets the default type url for GetSlateRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @memberof google.cloud.video.stitcher.v1.GetSlateRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSlatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListSlatesResponse"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetSlateRequest"; }; - return ListSlatesResponse; + return GetSlateRequest; })(); - v1.UpdateSlateRequest = (function() { + v1.ListSlatesRequest = (function() { /** - * Properties of an UpdateSlateRequest. + * Properties of a ListSlatesRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IUpdateSlateRequest - * @property {google.cloud.video.stitcher.v1.ISlate|null} [slate] UpdateSlateRequest slate - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSlateRequest updateMask + * @interface IListSlatesRequest + * @property {string|null} [parent] ListSlatesRequest parent + * @property {number|null} [pageSize] ListSlatesRequest pageSize + * @property {string|null} [pageToken] ListSlatesRequest pageToken + * @property {string|null} [filter] ListSlatesRequest filter + * @property {string|null} [orderBy] ListSlatesRequest orderBy */ /** - * Constructs a new UpdateSlateRequest. + * Constructs a new ListSlatesRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents an UpdateSlateRequest. - * @implements IUpdateSlateRequest + * @classdesc Represents a ListSlatesRequest. + * @implements IListSlatesRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest=} [properties] Properties to set */ - function UpdateSlateRequest(properties) { + function ListSlatesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13959,89 +14896,131 @@ } /** - * UpdateSlateRequest slate. - * @member {google.cloud.video.stitcher.v1.ISlate|null|undefined} slate - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * ListSlatesRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @instance */ - UpdateSlateRequest.prototype.slate = null; + ListSlatesRequest.prototype.parent = ""; /** - * UpdateSlateRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * ListSlatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @instance */ - UpdateSlateRequest.prototype.updateMask = null; + ListSlatesRequest.prototype.pageSize = 0; /** - * Creates a new UpdateSlateRequest instance using the specified properties. + * ListSlatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @instance + */ + ListSlatesRequest.prototype.pageToken = ""; + + /** + * ListSlatesRequest filter. + * @member {string} filter + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @instance + */ + ListSlatesRequest.prototype.filter = ""; + + /** + * ListSlatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest + * @instance + */ + ListSlatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListSlatesRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest instance + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest instance */ - UpdateSlateRequest.create = function create(properties) { - return new UpdateSlateRequest(properties); + ListSlatesRequest.create = function create(properties) { + return new ListSlatesRequest(properties); }; /** - * Encodes the specified UpdateSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateSlateRequest.verify|verify} messages. + * Encodes the specified ListSlatesRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} message UpdateSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} message ListSlatesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSlateRequest.encode = function encode(message, writer) { + ListSlatesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.slate != null && Object.hasOwnProperty.call(message, "slate")) - $root.google.cloud.video.stitcher.v1.Slate.encode(message.slate, 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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified UpdateSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateSlateRequest.verify|verify} messages. + * Encodes the specified ListSlatesRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static - * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} message UpdateSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListSlatesRequest} message ListSlatesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSlatesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSlateRequest message from the specified reader or buffer. + * Decodes a ListSlatesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSlateRequest.decode = function decode(reader, length) { + ListSlatesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.UpdateSlateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListSlatesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.slate = $root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -14053,141 +15032,159 @@ }; /** - * Decodes an UpdateSlateRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSlatesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSlateRequest.decodeDelimited = function decodeDelimited(reader) { + ListSlatesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSlateRequest message. + * Verifies a ListSlatesRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSlateRequest.verify = function verify(message) { + ListSlatesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.slate != null && message.hasOwnProperty("slate")) { - var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slate); - if (error) - return "slate." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an UpdateSlateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSlatesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesRequest} ListSlatesRequest */ - UpdateSlateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.UpdateSlateRequest) + ListSlatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListSlatesRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.UpdateSlateRequest(); - if (object.slate != null) { - if (typeof object.slate !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.UpdateSlateRequest.slate: object expected"); - message.slate = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slate); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.UpdateSlateRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.video.stitcher.v1.ListSlatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an UpdateSlateRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSlatesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static - * @param {google.cloud.video.stitcher.v1.UpdateSlateRequest} message UpdateSlateRequest + * @param {google.cloud.video.stitcher.v1.ListSlatesRequest} message ListSlatesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSlateRequest.toObject = function toObject(message, options) { + ListSlatesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.slate = null; - object.updateMask = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.slate != null && message.hasOwnProperty("slate")) - object.slate = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slate, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this UpdateSlateRequest to JSON. + * Converts this ListSlatesRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @instance * @returns {Object.} JSON object */ - UpdateSlateRequest.prototype.toJSON = function toJSON() { + ListSlatesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSlateRequest + * Gets the default type url for ListSlatesRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSlatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.UpdateSlateRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListSlatesRequest"; }; - return UpdateSlateRequest; + return ListSlatesRequest; })(); - v1.DeleteSlateRequest = (function() { + v1.ListSlatesResponse = (function() { /** - * Properties of a DeleteSlateRequest. + * Properties of a ListSlatesResponse. * @memberof google.cloud.video.stitcher.v1 - * @interface IDeleteSlateRequest - * @property {string|null} [name] DeleteSlateRequest name + * @interface IListSlatesResponse + * @property {Array.|null} [slates] ListSlatesResponse slates + * @property {string|null} [nextPageToken] ListSlatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListSlatesResponse unreachable */ /** - * Constructs a new DeleteSlateRequest. + * Constructs a new ListSlatesResponse. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a DeleteSlateRequest. - * @implements IDeleteSlateRequest + * @classdesc Represents a ListSlatesResponse. + * @implements IListSlatesResponse * @constructor - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IListSlatesResponse=} [properties] Properties to set */ - function DeleteSlateRequest(properties) { + function ListSlatesResponse(properties) { + this.slates = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14195,75 +15192,109 @@ } /** - * DeleteSlateRequest name. - * @member {string} name - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * ListSlatesResponse slates. + * @member {Array.} slates + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @instance */ - DeleteSlateRequest.prototype.name = ""; + ListSlatesResponse.prototype.slates = $util.emptyArray; /** - * Creates a new DeleteSlateRequest instance using the specified properties. + * ListSlatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @instance + */ + ListSlatesResponse.prototype.nextPageToken = ""; + + /** + * ListSlatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse + * @instance + */ + ListSlatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListSlatesResponse instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest instance + * @param {google.cloud.video.stitcher.v1.IListSlatesResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse instance */ - DeleteSlateRequest.create = function create(properties) { - return new DeleteSlateRequest(properties); + ListSlatesResponse.create = function create(properties) { + return new ListSlatesResponse(properties); }; /** - * Encodes the specified DeleteSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteSlateRequest.verify|verify} messages. + * Encodes the specified ListSlatesResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} message DeleteSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListSlatesResponse} message ListSlatesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSlateRequest.encode = function encode(message, writer) { + ListSlatesResponse.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.slates != null && message.slates.length) + for (var i = 0; i < message.slates.length; ++i) + $root.google.cloud.video.stitcher.v1.Slate.encode(message.slates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified DeleteSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteSlateRequest.verify|verify} messages. + * Encodes the specified ListSlatesResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListSlatesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static - * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} message DeleteSlateRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IListSlatesResponse} message ListSlatesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSlatesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSlateRequest message from the specified reader or buffer. + * Decodes a ListSlatesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSlateRequest.decode = function decode(reader, length) { + ListSlatesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.DeleteSlateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListSlatesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.slates && message.slates.length)) + message.slates = []; + message.slates.push($root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -14275,123 +15306,170 @@ }; /** - * Decodes a DeleteSlateRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSlatesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSlateRequest.decodeDelimited = function decodeDelimited(reader) { + ListSlatesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSlateRequest message. + * Verifies a ListSlatesResponse message. * @function verify - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSlateRequest.verify = function verify(message) { + ListSlatesResponse.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.slates != null && message.hasOwnProperty("slates")) { + if (!Array.isArray(message.slates)) + return "slates: array expected"; + for (var i = 0; i < message.slates.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slates[i]); + if (error) + return "slates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a DeleteSlateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSlatesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest + * @returns {google.cloud.video.stitcher.v1.ListSlatesResponse} ListSlatesResponse */ - DeleteSlateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.DeleteSlateRequest) + ListSlatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListSlatesResponse) return object; - var message = new $root.google.cloud.video.stitcher.v1.DeleteSlateRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.video.stitcher.v1.ListSlatesResponse(); + if (object.slates) { + if (!Array.isArray(object.slates)) + throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.slates: array expected"); + message.slates = []; + for (var i = 0; i < object.slates.length; ++i) { + if (typeof object.slates[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.slates: object expected"); + message.slates[i] = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.stitcher.v1.ListSlatesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a DeleteSlateRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSlatesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static - * @param {google.cloud.video.stitcher.v1.DeleteSlateRequest} message DeleteSlateRequest + * @param {google.cloud.video.stitcher.v1.ListSlatesResponse} message ListSlatesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSlateRequest.toObject = function toObject(message, options) { + ListSlatesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.slates = []; + object.unreachable = []; + } if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.slates && message.slates.length) { + object.slates = []; + for (var j = 0; j < message.slates.length; ++j) + object.slates[j] = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this DeleteSlateRequest to JSON. + * Converts this ListSlatesResponse to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @instance * @returns {Object.} JSON object */ - DeleteSlateRequest.prototype.toJSON = function toJSON() { + ListSlatesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteSlateRequest + * Gets the default type url for ListSlatesResponse * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest + * @memberof google.cloud.video.stitcher.v1.ListSlatesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSlatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.DeleteSlateRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListSlatesResponse"; }; - return DeleteSlateRequest; + return ListSlatesResponse; })(); - v1.CreateLiveSessionRequest = (function() { + v1.UpdateSlateRequest = (function() { /** - * Properties of a CreateLiveSessionRequest. + * Properties of an UpdateSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface ICreateLiveSessionRequest - * @property {string|null} [parent] CreateLiveSessionRequest parent - * @property {google.cloud.video.stitcher.v1.ILiveSession|null} [liveSession] CreateLiveSessionRequest liveSession + * @interface IUpdateSlateRequest + * @property {google.cloud.video.stitcher.v1.ISlate|null} [slate] UpdateSlateRequest slate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSlateRequest updateMask */ /** - * Constructs a new CreateLiveSessionRequest. + * Constructs a new UpdateSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a CreateLiveSessionRequest. - * @implements ICreateLiveSessionRequest + * @classdesc Represents an UpdateSlateRequest. + * @implements IUpdateSlateRequest * @constructor - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest=} [properties] Properties to set */ - function CreateLiveSessionRequest(properties) { + function UpdateSlateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14399,89 +15477,89 @@ } /** - * CreateLiveSessionRequest parent. - * @member {string} parent - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * UpdateSlateRequest slate. + * @member {google.cloud.video.stitcher.v1.ISlate|null|undefined} slate + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @instance */ - CreateLiveSessionRequest.prototype.parent = ""; + UpdateSlateRequest.prototype.slate = null; /** - * CreateLiveSessionRequest liveSession. - * @member {google.cloud.video.stitcher.v1.ILiveSession|null|undefined} liveSession - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * UpdateSlateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @instance */ - CreateLiveSessionRequest.prototype.liveSession = null; + UpdateSlateRequest.prototype.updateMask = null; /** - * Creates a new CreateLiveSessionRequest instance using the specified properties. + * Creates a new UpdateSlateRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest instance + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest instance */ - CreateLiveSessionRequest.create = function create(properties) { - return new CreateLiveSessionRequest(properties); + UpdateSlateRequest.create = function create(properties) { + return new UpdateSlateRequest(properties); }; /** - * Encodes the specified CreateLiveSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveSessionRequest.verify|verify} messages. + * Encodes the specified UpdateSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateSlateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} message CreateLiveSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} message UpdateSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateLiveSessionRequest.encode = function encode(message, writer) { + UpdateSlateRequest.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.liveSession != null && Object.hasOwnProperty.call(message, "liveSession")) - $root.google.cloud.video.stitcher.v1.LiveSession.encode(message.liveSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.slate != null && Object.hasOwnProperty.call(message, "slate")) + $root.google.cloud.video.stitcher.v1.Slate.encode(message.slate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateLiveSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveSessionRequest.verify|verify} messages. + * Encodes the specified UpdateSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.UpdateSlateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} message CreateLiveSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IUpdateSlateRequest} message UpdateSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateLiveSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateLiveSessionRequest message from the specified reader or buffer. + * Decodes an UpdateSlateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateLiveSessionRequest.decode = function decode(reader, length) { + UpdateSlateRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.UpdateSlateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.slate = $root.google.cloud.video.stitcher.v1.Slate.decode(reader, reader.uint32()); break; } case 2: { - message.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -14493,136 +15571,141 @@ }; /** - * Decodes a CreateLiveSessionRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSlateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateLiveSessionRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSlateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateLiveSessionRequest message. + * Verifies an UpdateSlateRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateLiveSessionRequest.verify = function verify(message) { + UpdateSlateRequest.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.liveSession != null && message.hasOwnProperty("liveSession")) { - var error = $root.google.cloud.video.stitcher.v1.LiveSession.verify(message.liveSession); + if (message.slate != null && message.hasOwnProperty("slate")) { + var error = $root.google.cloud.video.stitcher.v1.Slate.verify(message.slate); if (error) - return "liveSession." + error; + return "slate." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a CreateLiveSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSlateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.UpdateSlateRequest} UpdateSlateRequest */ - CreateLiveSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest) + UpdateSlateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.UpdateSlateRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.liveSession != null) { - if (typeof object.liveSession !== "object") - throw TypeError(".google.cloud.video.stitcher.v1.CreateLiveSessionRequest.liveSession: object expected"); - message.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.fromObject(object.liveSession); + var message = new $root.google.cloud.video.stitcher.v1.UpdateSlateRequest(); + if (object.slate != null) { + if (typeof object.slate !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.UpdateSlateRequest.slate: object expected"); + message.slate = $root.google.cloud.video.stitcher.v1.Slate.fromObject(object.slate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.UpdateSlateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a CreateLiveSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSlateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} message CreateLiveSessionRequest + * @param {google.cloud.video.stitcher.v1.UpdateSlateRequest} message UpdateSlateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateLiveSessionRequest.toObject = function toObject(message, options) { + UpdateSlateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.liveSession = null; + object.slate = null; + object.updateMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.liveSession != null && message.hasOwnProperty("liveSession")) - object.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.toObject(message.liveSession, options); + if (message.slate != null && message.hasOwnProperty("slate")) + object.slate = $root.google.cloud.video.stitcher.v1.Slate.toObject(message.slate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this CreateLiveSessionRequest to JSON. + * Converts this UpdateSlateRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @instance * @returns {Object.} JSON object */ - CreateLiveSessionRequest.prototype.toJSON = function toJSON() { + UpdateSlateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateLiveSessionRequest + * Gets the default type url for UpdateSlateRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.UpdateSlateRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateLiveSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateLiveSessionRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.UpdateSlateRequest"; }; - return CreateLiveSessionRequest; + return UpdateSlateRequest; })(); - v1.GetLiveSessionRequest = (function() { + v1.DeleteSlateRequest = (function() { /** - * Properties of a GetLiveSessionRequest. + * Properties of a DeleteSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @interface IGetLiveSessionRequest - * @property {string|null} [name] GetLiveSessionRequest name + * @interface IDeleteSlateRequest + * @property {string|null} [name] DeleteSlateRequest name */ /** - * Constructs a new GetLiveSessionRequest. + * Constructs a new DeleteSlateRequest. * @memberof google.cloud.video.stitcher.v1 - * @classdesc Represents a GetLiveSessionRequest. - * @implements IGetLiveSessionRequest + * @classdesc Represents a DeleteSlateRequest. + * @implements IDeleteSlateRequest * @constructor - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest=} [properties] Properties to set + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest=} [properties] Properties to set */ - function GetLiveSessionRequest(properties) { + function DeleteSlateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14630,35 +15713,35 @@ } /** - * GetLiveSessionRequest name. + * DeleteSlateRequest name. * @member {string} name - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @instance */ - GetLiveSessionRequest.prototype.name = ""; + DeleteSlateRequest.prototype.name = ""; /** - * Creates a new GetLiveSessionRequest instance using the specified properties. + * Creates a new DeleteSlateRequest instance using the specified properties. * @function create - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest=} [properties] Properties to set - * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest instance + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest instance */ - GetLiveSessionRequest.create = function create(properties) { - return new GetLiveSessionRequest(properties); + DeleteSlateRequest.create = function create(properties) { + return new DeleteSlateRequest(properties); }; /** - * Encodes the specified GetLiveSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveSessionRequest.verify|verify} messages. + * Encodes the specified DeleteSlateRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteSlateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} message GetLiveSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} message DeleteSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLiveSessionRequest.encode = function encode(message, writer) { + DeleteSlateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -14667,33 +15750,33 @@ }; /** - * Encodes the specified GetLiveSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveSessionRequest.verify|verify} messages. + * Encodes the specified DeleteSlateRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteSlateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} message GetLiveSessionRequest message or plain object to encode + * @param {google.cloud.video.stitcher.v1.IDeleteSlateRequest} message DeleteSlateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetLiveSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSlateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetLiveSessionRequest message from the specified reader or buffer. + * Decodes a DeleteSlateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLiveSessionRequest.decode = function decode(reader, length) { + DeleteSlateRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.DeleteSlateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14710,30 +15793,30 @@ }; /** - * Decodes a GetLiveSessionRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSlateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetLiveSessionRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSlateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetLiveSessionRequest message. + * Verifies a DeleteSlateRequest message. * @function verify - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetLiveSessionRequest.verify = function verify(message) { + DeleteSlateRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -14743,32 +15826,32 @@ }; /** - * Creates a GetLiveSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSlateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + * @returns {google.cloud.video.stitcher.v1.DeleteSlateRequest} DeleteSlateRequest */ - GetLiveSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest) + DeleteSlateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.DeleteSlateRequest) return object; - var message = new $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest(); + var message = new $root.google.cloud.video.stitcher.v1.DeleteSlateRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetLiveSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSlateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static - * @param {google.cloud.video.stitcher.v1.GetLiveSessionRequest} message GetLiveSessionRequest + * @param {google.cloud.video.stitcher.v1.DeleteSlateRequest} message DeleteSlateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetLiveSessionRequest.toObject = function toObject(message, options) { + DeleteSlateRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -14780,255 +15863,4262 @@ }; /** - * Converts this GetLiveSessionRequest to JSON. + * Converts this DeleteSlateRequest to JSON. * @function toJSON - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @instance * @returns {Object.} JSON object */ - GetLiveSessionRequest.prototype.toJSON = function toJSON() { + DeleteSlateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetLiveSessionRequest + * Gets the default type url for DeleteSlateRequest * @function getTypeUrl - * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @memberof google.cloud.video.stitcher.v1.DeleteSlateRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetLiveSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSlateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetLiveSessionRequest"; + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.DeleteSlateRequest"; }; - return GetLiveSessionRequest; + return DeleteSlateRequest; })(); - return v1; - })(); + v1.CreateLiveSessionRequest = (function() { - return stitcher; - })(); + /** + * Properties of a CreateLiveSessionRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface ICreateLiveSessionRequest + * @property {string|null} [parent] CreateLiveSessionRequest parent + * @property {google.cloud.video.stitcher.v1.ILiveSession|null} [liveSession] CreateLiveSessionRequest liveSession + */ - return video; - })(); + /** + * Constructs a new CreateLiveSessionRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a CreateLiveSessionRequest. + * @implements ICreateLiveSessionRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest=} [properties] Properties to set + */ + function CreateLiveSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return cloud; - })(); + /** + * CreateLiveSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @instance + */ + CreateLiveSessionRequest.prototype.parent = ""; - google.api = (function() { + /** + * CreateLiveSessionRequest liveSession. + * @member {google.cloud.video.stitcher.v1.ILiveSession|null|undefined} liveSession + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @instance + */ + CreateLiveSessionRequest.prototype.liveSession = null; - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Creates a new CreateLiveSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest instance + */ + CreateLiveSessionRequest.create = function create(properties) { + return new CreateLiveSessionRequest(properties); + }; - api.ResourceDescriptor = (function() { + /** + * Encodes the specified CreateLiveSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} message CreateLiveSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLiveSessionRequest.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.liveSession != null && Object.hasOwnProperty.call(message, "liveSession")) + $root.google.cloud.video.stitcher.v1.LiveSession.encode(message.liveSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * 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 - */ + /** + * Encodes the specified CreateLiveSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveSessionRequest} message CreateLiveSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLiveSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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 = ""; + /** + * Decodes a CreateLiveSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLiveSessionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Decodes a CreateLiveSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLiveSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Verifies a CreateLiveSessionRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLiveSessionRequest.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.liveSession != null && message.hasOwnProperty("liveSession")) { + var error = $root.google.cloud.video.stitcher.v1.LiveSession.verify(message.liveSession); + if (error) + return "liveSession." + error; + } + return null; + }; - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + /** + * Creates a CreateLiveSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} CreateLiveSessionRequest + */ + CreateLiveSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.CreateLiveSessionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.liveSession != null) { + if (typeof object.liveSession !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.CreateLiveSessionRequest.liveSession: object expected"); + message.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.fromObject(object.liveSession); + } + return message; + }; - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + /** + * Creates a plain object from a CreateLiveSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.CreateLiveSessionRequest} message CreateLiveSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLiveSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.liveSession = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.liveSession != null && message.hasOwnProperty("liveSession")) + object.liveSession = $root.google.cloud.video.stitcher.v1.LiveSession.toObject(message.liveSession, options); + return object; + }; - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Converts this CreateLiveSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLiveSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; + /** + * Gets the default type url for CreateLiveSessionRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.CreateLiveSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLiveSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateLiveSessionRequest"; + }; - /** - * 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); - }; + return CreateLiveSessionRequest; + })(); - /** - * 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; - }; + v1.GetLiveSessionRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a GetLiveSessionRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface IGetLiveSessionRequest + * @property {string|null} [name] GetLiveSessionRequest name + */ - /** + /** + * Constructs a new GetLiveSessionRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a GetLiveSessionRequest. + * @implements IGetLiveSessionRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest=} [properties] Properties to set + */ + function GetLiveSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLiveSessionRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @instance + */ + GetLiveSessionRequest.prototype.name = ""; + + /** + * Creates a new GetLiveSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest instance + */ + GetLiveSessionRequest.create = function create(properties) { + return new GetLiveSessionRequest(properties); + }; + + /** + * Encodes the specified GetLiveSessionRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} message GetLiveSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLiveSessionRequest.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 GetLiveSessionRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveSessionRequest} message GetLiveSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLiveSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLiveSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLiveSessionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest(); + 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 GetLiveSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLiveSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLiveSessionRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLiveSessionRequest.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 GetLiveSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.GetLiveSessionRequest} GetLiveSessionRequest + */ + GetLiveSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.GetLiveSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLiveSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {google.cloud.video.stitcher.v1.GetLiveSessionRequest} message GetLiveSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLiveSessionRequest.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 GetLiveSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @instance + * @returns {Object.} JSON object + */ + GetLiveSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLiveSessionRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.GetLiveSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLiveSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetLiveSessionRequest"; + }; + + return GetLiveSessionRequest; + })(); + + v1.CreateLiveConfigRequest = (function() { + + /** + * Properties of a CreateLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface ICreateLiveConfigRequest + * @property {string|null} [parent] CreateLiveConfigRequest parent + * @property {string|null} [liveConfigId] CreateLiveConfigRequest liveConfigId + * @property {google.cloud.video.stitcher.v1.ILiveConfig|null} [liveConfig] CreateLiveConfigRequest liveConfig + * @property {string|null} [requestId] CreateLiveConfigRequest requestId + */ + + /** + * Constructs a new CreateLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a CreateLiveConfigRequest. + * @implements ICreateLiveConfigRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest=} [properties] Properties to set + */ + function CreateLiveConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLiveConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @instance + */ + CreateLiveConfigRequest.prototype.parent = ""; + + /** + * CreateLiveConfigRequest liveConfigId. + * @member {string} liveConfigId + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @instance + */ + CreateLiveConfigRequest.prototype.liveConfigId = ""; + + /** + * CreateLiveConfigRequest liveConfig. + * @member {google.cloud.video.stitcher.v1.ILiveConfig|null|undefined} liveConfig + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @instance + */ + CreateLiveConfigRequest.prototype.liveConfig = null; + + /** + * CreateLiveConfigRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @instance + */ + CreateLiveConfigRequest.prototype.requestId = ""; + + /** + * Creates a new CreateLiveConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.CreateLiveConfigRequest} CreateLiveConfigRequest instance + */ + CreateLiveConfigRequest.create = function create(properties) { + return new CreateLiveConfigRequest(properties); + }; + + /** + * Encodes the specified CreateLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest} message CreateLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLiveConfigRequest.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.liveConfigId != null && Object.hasOwnProperty.call(message, "liveConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.liveConfigId); + if (message.liveConfig != null && Object.hasOwnProperty.call(message, "liveConfig")) + $root.google.cloud.video.stitcher.v1.LiveConfig.encode(message.liveConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.CreateLiveConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.ICreateLiveConfigRequest} message CreateLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLiveConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLiveConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.CreateLiveConfigRequest} CreateLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLiveConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.CreateLiveConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.liveConfigId = reader.string(); + break; + } + case 3: { + message.liveConfig = $root.google.cloud.video.stitcher.v1.LiveConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLiveConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.CreateLiveConfigRequest} CreateLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLiveConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLiveConfigRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLiveConfigRequest.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.liveConfigId != null && message.hasOwnProperty("liveConfigId")) + if (!$util.isString(message.liveConfigId)) + return "liveConfigId: string expected"; + if (message.liveConfig != null && message.hasOwnProperty("liveConfig")) { + var error = $root.google.cloud.video.stitcher.v1.LiveConfig.verify(message.liveConfig); + if (error) + return "liveConfig." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.CreateLiveConfigRequest} CreateLiveConfigRequest + */ + CreateLiveConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.CreateLiveConfigRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.CreateLiveConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.liveConfigId != null) + message.liveConfigId = String(object.liveConfigId); + if (object.liveConfig != null) { + if (typeof object.liveConfig !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.CreateLiveConfigRequest.liveConfig: object expected"); + message.liveConfig = $root.google.cloud.video.stitcher.v1.LiveConfig.fromObject(object.liveConfig); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateLiveConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.CreateLiveConfigRequest} message CreateLiveConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLiveConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.liveConfigId = ""; + object.liveConfig = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.liveConfigId != null && message.hasOwnProperty("liveConfigId")) + object.liveConfigId = message.liveConfigId; + if (message.liveConfig != null && message.hasOwnProperty("liveConfig")) + object.liveConfig = $root.google.cloud.video.stitcher.v1.LiveConfig.toObject(message.liveConfig, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateLiveConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLiveConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLiveConfigRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.CreateLiveConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLiveConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.CreateLiveConfigRequest"; + }; + + return CreateLiveConfigRequest; + })(); + + v1.ListLiveConfigsRequest = (function() { + + /** + * Properties of a ListLiveConfigsRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface IListLiveConfigsRequest + * @property {string|null} [parent] ListLiveConfigsRequest parent + * @property {number|null} [pageSize] ListLiveConfigsRequest pageSize + * @property {string|null} [pageToken] ListLiveConfigsRequest pageToken + * @property {string|null} [filter] ListLiveConfigsRequest filter + * @property {string|null} [orderBy] ListLiveConfigsRequest orderBy + */ + + /** + * Constructs a new ListLiveConfigsRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a ListLiveConfigsRequest. + * @implements IListLiveConfigsRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest=} [properties] Properties to set + */ + function ListLiveConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLiveConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + */ + ListLiveConfigsRequest.prototype.parent = ""; + + /** + * ListLiveConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + */ + ListLiveConfigsRequest.prototype.pageSize = 0; + + /** + * ListLiveConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + */ + ListLiveConfigsRequest.prototype.pageToken = ""; + + /** + * ListLiveConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + */ + ListLiveConfigsRequest.prototype.filter = ""; + + /** + * ListLiveConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + */ + ListLiveConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListLiveConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsRequest} ListLiveConfigsRequest instance + */ + ListLiveConfigsRequest.create = function create(properties) { + return new ListLiveConfigsRequest(properties); + }; + + /** + * Encodes the specified ListLiveConfigsRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest} message ListLiveConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLiveConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListLiveConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsRequest} message ListLiveConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLiveConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLiveConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsRequest} ListLiveConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLiveConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLiveConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsRequest} ListLiveConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLiveConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLiveConfigsRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLiveConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListLiveConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsRequest} ListLiveConfigsRequest + */ + ListLiveConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveConfigsRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.ListLiveConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListLiveConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {google.cloud.video.stitcher.v1.ListLiveConfigsRequest} message ListLiveConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLiveConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListLiveConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLiveConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLiveConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLiveConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveConfigsRequest"; + }; + + return ListLiveConfigsRequest; + })(); + + v1.ListLiveConfigsResponse = (function() { + + /** + * Properties of a ListLiveConfigsResponse. + * @memberof google.cloud.video.stitcher.v1 + * @interface IListLiveConfigsResponse + * @property {Array.|null} [liveConfigs] ListLiveConfigsResponse liveConfigs + * @property {string|null} [nextPageToken] ListLiveConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListLiveConfigsResponse unreachable + */ + + /** + * Constructs a new ListLiveConfigsResponse. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a ListLiveConfigsResponse. + * @implements IListLiveConfigsResponse + * @constructor + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsResponse=} [properties] Properties to set + */ + function ListLiveConfigsResponse(properties) { + this.liveConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLiveConfigsResponse liveConfigs. + * @member {Array.} liveConfigs + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @instance + */ + ListLiveConfigsResponse.prototype.liveConfigs = $util.emptyArray; + + /** + * ListLiveConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @instance + */ + ListLiveConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListLiveConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @instance + */ + ListLiveConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListLiveConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} ListLiveConfigsResponse instance + */ + ListLiveConfigsResponse.create = function create(properties) { + return new ListLiveConfigsResponse(properties); + }; + + /** + * Encodes the specified ListLiveConfigsResponse message. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsResponse} message ListLiveConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLiveConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.liveConfigs != null && message.liveConfigs.length) + for (var i = 0; i < message.liveConfigs.length; ++i) + $root.google.cloud.video.stitcher.v1.LiveConfig.encode(message.liveConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListLiveConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.ListLiveConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {google.cloud.video.stitcher.v1.IListLiveConfigsResponse} message ListLiveConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLiveConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLiveConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} ListLiveConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLiveConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.ListLiveConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.liveConfigs && message.liveConfigs.length)) + message.liveConfigs = []; + message.liveConfigs.push($root.google.cloud.video.stitcher.v1.LiveConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLiveConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} ListLiveConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLiveConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLiveConfigsResponse message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLiveConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.liveConfigs != null && message.hasOwnProperty("liveConfigs")) { + if (!Array.isArray(message.liveConfigs)) + return "liveConfigs: array expected"; + for (var i = 0; i < message.liveConfigs.length; ++i) { + var error = $root.google.cloud.video.stitcher.v1.LiveConfig.verify(message.liveConfigs[i]); + if (error) + return "liveConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListLiveConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} ListLiveConfigsResponse + */ + ListLiveConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.ListLiveConfigsResponse) + return object; + var message = new $root.google.cloud.video.stitcher.v1.ListLiveConfigsResponse(); + if (object.liveConfigs) { + if (!Array.isArray(object.liveConfigs)) + throw TypeError(".google.cloud.video.stitcher.v1.ListLiveConfigsResponse.liveConfigs: array expected"); + message.liveConfigs = []; + for (var i = 0; i < object.liveConfigs.length; ++i) { + if (typeof object.liveConfigs[i] !== "object") + throw TypeError(".google.cloud.video.stitcher.v1.ListLiveConfigsResponse.liveConfigs: object expected"); + message.liveConfigs[i] = $root.google.cloud.video.stitcher.v1.LiveConfig.fromObject(object.liveConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.stitcher.v1.ListLiveConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListLiveConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {google.cloud.video.stitcher.v1.ListLiveConfigsResponse} message ListLiveConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLiveConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.liveConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.liveConfigs && message.liveConfigs.length) { + object.liveConfigs = []; + for (var j = 0; j < message.liveConfigs.length; ++j) + object.liveConfigs[j] = $root.google.cloud.video.stitcher.v1.LiveConfig.toObject(message.liveConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListLiveConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLiveConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLiveConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.ListLiveConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLiveConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.ListLiveConfigsResponse"; + }; + + return ListLiveConfigsResponse; + })(); + + v1.GetLiveConfigRequest = (function() { + + /** + * Properties of a GetLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface IGetLiveConfigRequest + * @property {string|null} [name] GetLiveConfigRequest name + */ + + /** + * Constructs a new GetLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a GetLiveConfigRequest. + * @implements IGetLiveConfigRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest=} [properties] Properties to set + */ + function GetLiveConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLiveConfigRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @instance + */ + GetLiveConfigRequest.prototype.name = ""; + + /** + * Creates a new GetLiveConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.GetLiveConfigRequest} GetLiveConfigRequest instance + */ + GetLiveConfigRequest.create = function create(properties) { + return new GetLiveConfigRequest(properties); + }; + + /** + * Encodes the specified GetLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest} message GetLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLiveConfigRequest.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 GetLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.GetLiveConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IGetLiveConfigRequest} message GetLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLiveConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLiveConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.GetLiveConfigRequest} GetLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLiveConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.GetLiveConfigRequest(); + 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 GetLiveConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.GetLiveConfigRequest} GetLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLiveConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLiveConfigRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLiveConfigRequest.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 GetLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.GetLiveConfigRequest} GetLiveConfigRequest + */ + GetLiveConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.GetLiveConfigRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.GetLiveConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLiveConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.GetLiveConfigRequest} message GetLiveConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLiveConfigRequest.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 GetLiveConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetLiveConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLiveConfigRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.GetLiveConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLiveConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.GetLiveConfigRequest"; + }; + + return GetLiveConfigRequest; + })(); + + v1.DeleteLiveConfigRequest = (function() { + + /** + * Properties of a DeleteLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @interface IDeleteLiveConfigRequest + * @property {string|null} [name] DeleteLiveConfigRequest name + */ + + /** + * Constructs a new DeleteLiveConfigRequest. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents a DeleteLiveConfigRequest. + * @implements IDeleteLiveConfigRequest + * @constructor + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest=} [properties] Properties to set + */ + function DeleteLiveConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLiveConfigRequest name. + * @member {string} name + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @instance + */ + DeleteLiveConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteLiveConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.DeleteLiveConfigRequest} DeleteLiveConfigRequest instance + */ + DeleteLiveConfigRequest.create = function create(properties) { + return new DeleteLiveConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteLiveConfigRequest message. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteLiveConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest} message DeleteLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLiveConfigRequest.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 DeleteLiveConfigRequest message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.DeleteLiveConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest} message DeleteLiveConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLiveConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteLiveConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.stitcher.v1.DeleteLiveConfigRequest} DeleteLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLiveConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest(); + 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 DeleteLiveConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.v1.DeleteLiveConfigRequest} DeleteLiveConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLiveConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLiveConfigRequest message. + * @function verify + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLiveConfigRequest.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 DeleteLiveConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.DeleteLiveConfigRequest} DeleteLiveConfigRequest + */ + DeleteLiveConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest) + return object; + var message = new $root.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteLiveConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {google.cloud.video.stitcher.v1.DeleteLiveConfigRequest} message DeleteLiveConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLiveConfigRequest.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 DeleteLiveConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLiveConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLiveConfigRequest + * @function getTypeUrl + * @memberof google.cloud.video.stitcher.v1.DeleteLiveConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLiveConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.stitcher.v1.DeleteLiveConfigRequest"; + }; + + return DeleteLiveConfigRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.video.stitcher.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 + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.video.stitcher.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.video.stitcher.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.video.stitcher.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @static + * @param {google.cloud.video.stitcher.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.video.stitcher.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.stitcher.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @static + * @param {google.cloud.video.stitcher.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); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.stitcher.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @static + * @param {google.cloud.video.stitcher.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.video.stitcher.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.video.stitcher.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.video.stitcher.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; + } + 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.video.stitcher.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.stitcher.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.video.stitcher.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"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.stitcher.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.stitcher.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.video.stitcher.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.stitcher.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.video.stitcher.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); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.stitcher.v1.OperationMetadata + * @static + * @param {google.cloud.video.stitcher.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 = ""; + } + 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; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.video.stitcher.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.video.stitcher.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.video.stitcher.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + return stitcher; + })(); + + return video; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + 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 + * @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; + })(); + + /** + * 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.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; + })(); + + 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.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.api.ResourceDescriptor(); + 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.type = reader.string(); + message.name = reader.string(); break; } case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + 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 3: { - message.nameField = reader.string(); + 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: { - message.history = reader.int32(); + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; } case 5: { - message.plural = reader.string(); + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; } case 6: { - message.singular = reader.string(); + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); 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()); + 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: @@ -15040,361 +20130,578 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a FileDescriptorProto message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + FileDescriptorProto.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.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.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.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.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; - } } + 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) 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]); + 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.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; + 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]); } - 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; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.FileDescriptorProto * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; } if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; } - 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.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.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]; + 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 ResourceDescriptor to JSON. + * Converts this FileDescriptorProto to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResourceDescriptor + * Gets the default type url for FileDescriptorProto * @function getTypeUrl - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.FileDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; }; + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + /** - * 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 + * 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 */ - 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 + * 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 */ - 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; - })(); + DescriptorProto.prototype.enumType = $util.emptyArray; - api.ResourceReference = (function() { + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance */ - 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]]; - } + DescriptorProto.prototype.options = null; /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto * @instance */ - ResourceReference.prototype.type = ""; + DescriptorProto.prototype.reservedRange = $util.emptyArray; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto * @instance */ - ResourceReference.prototype.childType = ""; + DescriptorProto.prototype.reservedName = $util.emptyArray; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new DescriptorProto instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + DescriptorProto.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); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.api.ResourceReference(); + 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.type = reader.string(); + message.name = reader.string(); break; } case 2: { - message.childType = reader.string(); + 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: @@ -15406,634 +20713,895 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a DescriptorProto message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + DescriptorProto.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.DescriptorProto} DescriptorProto */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; } - 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"; + if (options.defaults) { + object.name = ""; + object.options = null; } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - /** - * 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.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; + 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; + }; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto * @instance + * @returns {Object.} JSON object */ - 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); + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto * @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 + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - 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; + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; }; - /** - * 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(); - }; + DescriptorProto.ExtensionRange = (function() { - /** - * 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(); + /** + * 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; - } - default: - reader.skipType(tag & 7); - break; + } } - } - return message; - }; + 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()); - }; + /** + * 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 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]); + /** + * 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 "rules." + error; + return "options." + error; } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; + 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) + /** + * 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; - 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]); + }; + + /** + * 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"; } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; - /** - * 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; - }; + return ExtensionRange; + })(); - /** - * 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); - }; + DescriptorProto.ReservedRange = (function() { - /** - * 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"; + /** + * 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]]; } - return typeUrlPrefix + "/google.api.Http"; - }; - return Http; - })(); + /** + * 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; - api.HttpRule = (function() { + /** + * 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); + }; - /** - * 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 - */ + /** + * 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; + }; - /** - * 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]]; - } + /** + * 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(); + }; - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + /** + * 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; + }; - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; + /** + * 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()); + }; - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; + /** + * 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; + }; - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = 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; + }; - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; + /** + * 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; + }; - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + /** + * 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"; + }; - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + return ReservedRange; + })(); - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption */ - HttpRule.prototype.responseBody = ""; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + 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]]; + } /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ExtensionRangeOptions.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); + 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 HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.api.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.api.HttpRule(); + 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 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())); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -16045,255 +21613,149 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies an ExtensionRangeOptions message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + ExtensionRangeOptions.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 (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 "additionalBindings." + error; + return "uninterpretedOption." + error; } } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) 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]); + 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 a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ExtensionRangeOptions.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); + 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); } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ExtensionRangeOptions to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HttpRule + * Gets the default type url for ExtensionRangeOptions * @function getTypeUrl - * @memberof google.api.HttpRule + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.HttpRule"; + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; }; - return HttpRule; + return ExtensionRangeOptions; })(); - api.CustomHttpPattern = (function() { + protobuf.FieldDescriptorProto = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * 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 CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function FieldDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16301,89 +21763,215 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - CustomHttpPattern.prototype.kind = ""; + FieldDescriptorProto.prototype.name = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - CustomHttpPattern.prototype.path = ""; + FieldDescriptorProto.prototype.number = 0; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * 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.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + FieldDescriptorProto.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.api.CustomHttpPattern(); + 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.kind = reader.string(); + 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.path = reader.string(); + 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: @@ -16395,144 +21983,394 @@ }; /** - * 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. + * 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.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + 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 CustomHttpPattern to JSON. + * Converts this FieldDescriptorProto to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CustomHttpPattern + * Gets the default type url for FieldDescriptorProto * @function getTypeUrl - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; }; - return CustomHttpPattern; - })(); - - return api; - })(); + /** + * 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; + })(); - google.protobuf = (function() { + /** + * 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; + })(); - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + return FieldDescriptorProto; + })(); - protobuf.FileDescriptorSet = (function() { + protobuf.OneofDescriptorProto = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of an OneofDescriptorProto. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** - * Constructs a new FileDescriptorSet. + * Constructs a new OneofDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16540,78 +22378,89 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + OneofDescriptorProto.prototype.name = ""; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * 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.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + OneofDescriptorProto.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(); + 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 FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @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.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decode = function decode(reader, length) { + 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.FileDescriptorSet(); + 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: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; } default: @@ -16623,433 +22472,284 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies an OneofDescriptorProto message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @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 */ - FileDescriptorSet.verify = function verify(message) { + OneofDescriptorProto.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; - } + 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 a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) 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]); - } + 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 a FileDescriptorSet message. Also converts values to other types if specified. + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + OneofDescriptorProto.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); + 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 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 + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto * @instance + * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ - FileDescriptorProto.prototype.service = $util.emptyArray; + 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]]; + } /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + EnumDescriptorProto.prototype.name = ""; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - FileDescriptorProto.prototype.options = null; + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + EnumDescriptorProto.prototype.options = null; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - FileDescriptorProto.prototype.syntax = ""; + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** - * FileDescriptorProto edition. - * @member {string} edition - * @memberof google.protobuf.FileDescriptorProto + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - FileDescriptorProto.prototype.edition = ""; + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, 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["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.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.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); + $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 FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @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.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())); + * @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 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; } - case 12: { - message.syntax = reader.string(); + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; } - case 13: { - message.edition = reader.string(); + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); break; } default: @@ -17061,352 +22761,437 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies an EnumDescriptorProto message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @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 */ - FileDescriptorProto.verify = function verify(message) { + 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["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 (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 "extension." + error; + return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); + var error = $root.google.protobuf.EnumOptions.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.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"; } - 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. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; - var message = new $root.google.protobuf.FileDescriptorProto(); + var message = new $root.google.protobuf.EnumDescriptorProto(); 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.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.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.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.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]); } - 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. + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + EnumDescriptorProto.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 = []; + object.value = []; + object.reservedRange = []; + object.reservedName = []; } 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.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.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]; + 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.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return FileDescriptorProto; + /** + * 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.DescriptorProto = (function() { + protobuf.EnumValueDescriptorProto = (function() { /** - * Properties of a DescriptorProto. + * Properties of an EnumValueDescriptorProto. * @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 + * @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 DescriptorProto. + * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17414,168 +23199,90 @@ } /** - * DescriptorProto name. + * EnumValueDescriptorProto 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 + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - DescriptorProto.prototype.options = null; + EnumValueDescriptorProto.prototype.name = ""; /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + EnumValueDescriptorProto.prototype.number = 0; /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + EnumValueDescriptorProto.prototype.options = null; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, 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.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.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.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]); + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @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.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decode = function decode(reader, length) { + 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.DescriptorProto(); + 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) { @@ -17584,55 +23291,11 @@ 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())); + message.number = reader.int32(); 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()); + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; } default: @@ -17644,816 +23307,768 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. + * Verifies an EnumValueDescriptorProto message. * @function verify - * @memberof google.protobuf.DescriptorProto + * @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 */ - DescriptorProto.verify = function verify(message) { + 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.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.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.MessageOptions.verify(message.options); + var error = $root.google.protobuf.EnumValueOptions.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. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; - var message = new $root.google.protobuf.DescriptorProto(); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); 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.number != null) + message.number = object.number | 0; 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]); + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + EnumValueDescriptorProto.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.number = 0; 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.number != null && message.hasOwnProperty("number")) + object.number = message.number; 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]; - } + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** - * Converts this DescriptorProto to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DescriptorProto + * Gets the default type url for EnumValueDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; }; - 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 - */ + return EnumValueDescriptorProto; + })(); - /** - * 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]]; - } + protobuf.ServiceDescriptorProto = (function() { - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; + /** + * 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 + */ - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; + /** + * 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]]; + } - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * 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); - }; + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * 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; - }; + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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); + /** + * 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; - }; + } + 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()); - }; + /** + * 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 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); + /** + * 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 "options." + error; + return "method." + error; } - return null; - }; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.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); + /** + * 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]); } - return message; - }; + } + 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 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; - }; + /** + * 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); + }; - /** - * 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 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"; + }; - /** - * 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 ServiceDescriptorProto; + })(); - return ExtensionRange; - })(); + protobuf.MethodDescriptorProto = (function() { - DescriptorProto.ReservedRange = (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 + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; - /** - * 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); - }; + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; - /** - * 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; - }; + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; - /** - * 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(); - }; + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; - /** - * 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); + /** + * 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 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ReservedRange; - })(); + /** + * 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 DescriptorProto; + return MethodDescriptorProto; })(); - protobuf.ExtensionRangeOptions = (function() { + protobuf.FileOptions = (function() { /** - * Properties of an ExtensionRangeOptions. + * Properties of a FileOptions. * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @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 ExtensionRangeOptions. + * Constructs a new FileOptions. * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions + * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ - function ExtensionRangeOptions(properties) { + 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) @@ -18461,80 +24076,377 @@ } /** - * ExtensionRangeOptions uninterpretedOption. + * 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.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions * @instance */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, 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 ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ExtensionRangeOptions + * @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.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decode = function decode(reader, length) { + 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.ExtensionRangeOptions(); + 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; @@ -18544,365 +24456,522 @@ }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRangeOptions message. + * Verifies a FileOptions message. * @function verify - * @memberof google.protobuf.ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.verify = function verify(message) { + FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "uninterpretedOption." + error; + return "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 an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @returns {google.protobuf.FileOptions} FileOptions */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); + 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.ExtensionRangeOptions.uninterpretedOption: array expected"); + 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.ExtensionRangeOptions.uninterpretedOption: object expected"); + 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 an ExtensionRangeOptions message. Also converts values to other types if specified. + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + 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 ExtensionRangeOptions to JSON. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExtensionRangeOptions + * Gets the default type url for FileOptions * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.FileOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + return typeUrlPrefix + "/google.protobuf.FileOptions"; }; - 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 + * 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 */ - FieldDescriptorProto.prototype.name = ""; + 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; + })(); - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; + return FileOptions; + })(); - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; + protobuf.MessageOptions = (function() { /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ - FieldDescriptorProto.prototype.type = 1; /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - FieldDescriptorProto.prototype.typeName = ""; + 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]]; + } /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.extendee = ""; + MessageOptions.prototype.messageSetWireFormat = false; /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.defaultValue = ""; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.oneofIndex = 0; + MessageOptions.prototype.deprecated = false; /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.jsonName = ""; + MessageOptions.prototype.mapEntry = false; /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.options = null; + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions * @instance */ - FieldDescriptorProto.prototype.proto3Optional = false; + MessageOptions.prototype[".google.api.resource"] = null; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); }; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + MessageOptions.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); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldDescriptorProto + * @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.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decode = function decode(reader, length) { + 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.FieldDescriptorProto(); + 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.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(); + message.messageSetWireFormat = reader.bool(); break; } case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); + message.noStandardDescriptorAccessor = reader.bool(); break; } - case 9: { - message.oneofIndex = reader.int32(); + case 3: { + message.deprecated = reader.bool(); break; } - case 10: { - message.jsonName = reader.string(); + case 7: { + message.mapEntry = reader.bool(); break; } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 17: { - message.proto3Optional = reader.bool(); + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); break; } default: @@ -18914,394 +24983,197 @@ }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.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; + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; } - if (message.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 (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); if (error) - return "options." + error; + return ".google.api.resource." + 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. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @returns {google.protobuf.MessageOptions} MessageOptions */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) 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; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } - 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[".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"]); } - 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. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; 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; + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldDescriptorProto + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - /** - * 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; + return MessageOptions; })(); - protobuf.OneofDescriptorProto = (function() { + protobuf.FieldOptions = (function() { /** - * Properties of an OneofDescriptorProto. + * Properties of a FieldOptions. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** - * Constructs a new OneofDescriptorProto. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function OneofDescriptorProto(properties) { + 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) @@ -19309,820 +25181,807 @@ } /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - OneofDescriptorProto.prototype.name = ""; + FieldOptions.prototype.ctype = 0; /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions * @instance */ - OneofDescriptorProto.prototype.options = null; + FieldOptions.prototype.packed = false; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $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; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. * @function create - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + FieldOptions.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(); + 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.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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + 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.OneofDescriptorProto(); + 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.name = reader.string(); + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.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.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.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; + } + 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; + } + } + 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.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.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"]); + } + 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 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + 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; } - 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. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options) { + 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.name = ""; - object.options = null; + 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[".google.api.resourceReference"] = 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); + 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.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 OneofDescriptorProto to JSON. + * Converts this FieldOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.FieldOptions * @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); + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions * @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 + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - 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; + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; }; /** - * 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 + * 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 */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + 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; + })(); /** - * 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 + * 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 */ - 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; - }; + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { /** - * 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 + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ - 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 + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - 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; - }; + 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]]; + } /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * 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 {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - 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; + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * 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.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - 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; + 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; }; /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object + * 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 */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @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 */ - 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); + 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; } - } - 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; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; + } + 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return EnumReservedRange; - })(); + /** + * 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 EnumDescriptorProto; + return OneofOptions; })(); - protobuf.EnumValueDescriptorProto = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of an EnumValueDescriptorProto. + * Properties of an EnumOptions. * @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 + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + function EnumOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20130,103 +25989,106 @@ } /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.name = ""; + EnumOptions.prototype.allowAlias = false; /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.number = 0; + EnumOptions.prototype.deprecated = false; /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.options = null; + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer) { + EnumOptions.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(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto + * @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.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decode = function decode(reader, length) { + 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.EnumValueDescriptorProto(); + 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 1: { - message.name = reader.string(); - break; - } case 2: { - message.number = reader.int32(); + message.allowAlias = reader.bool(); break; } case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + 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: @@ -20238,147 +26100,159 @@ }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueDescriptorProto message. + * Verifies an EnumOptions message. * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.verify = function verify(message) { + EnumOptions.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; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } } return null; }; /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.EnumOptions} EnumOptions */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) 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); + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } } return message; }; /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - 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. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueDescriptorProto + * Gets the default type url for EnumOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumOptions"; }; - return EnumValueDescriptorProto; + return EnumOptions; })(); - protobuf.ServiceDescriptorProto = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of an EnumValueOptions. * @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 + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + function EnumValueOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20386,106 +26260,92 @@ } /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + EnumValueOptions.prototype.deprecated = false; /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions * @instance */ - ServiceDescriptorProto.prototype.options = null; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + EnumValueOptions.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(); + 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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + 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.ServiceDescriptorProto(); + 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.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())); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); break; } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -20497,167 +26357,152 @@ }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceDescriptorProto message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.verify = function verify(message) { + EnumValueOptions.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 (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 "method." + error; + return "uninterpretedOption." + 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. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) 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]); + 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]); } } - 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. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + EnumValueOptions.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); + 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); } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceDescriptorProto + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return ServiceDescriptorProto; + return EnumValueOptions; })(); - protobuf.MethodDescriptorProto = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of a MethodDescriptorProto. + * Properties of a ServiceOptions. * @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 + * @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 MethodDescriptorProto. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function MethodDescriptorProto(properties) { + function ServiceOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20665,145 +26510,120 @@ } /** - * 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 + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.outputType = ""; + ServiceOptions.prototype.deprecated = false; /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.options = null; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.clientStreaming = false; + ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.serverStreaming = false; + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + ServiceOptions.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); + 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 MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodDescriptorProto + * @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.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decode = function decode(reader, length) { + 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.MethodDescriptorProto(); + 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 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); + case 33: { + message.deprecated = reader.bool(); break; } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 5: { - message.clientStreaming = reader.bool(); + case 1049: { + message[".google.api.defaultHost"] = reader.string(); break; } - case 6: { - message.serverStreaming = reader.bool(); + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); break; } default: @@ -20815,191 +26635,172 @@ }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodDescriptorProto message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.MethodDescriptorProto + * @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 */ - MethodDescriptorProto.verify = function verify(message) { + ServiceOptions.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.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.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"; + 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) 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); + 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.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); + 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 MethodDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - 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; + 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 MethodDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodDescriptorProto + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - return MethodDescriptorProto; + return ServiceOptions; })(); - protobuf.FileOptions = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a FileOptions. + * Properties of a MethodOptions. * @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 + * @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 FileOptions. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function FileOptions(properties) { + function MethodOptions(properties) { this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; + this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21007,375 +26808,570 @@ } /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions + * 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 */ - FileOptions.prototype.javaPackage = ""; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions * @instance */ - FileOptions.prototype.javaOuterClassname = ""; + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaMultipleFiles = false; + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + 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; + }; /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaStringCheckUtf8 = false; + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.optimizeFor = 1; + 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; + }; /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.goPackage = ""; + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.ccGenericServices = false; + 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; + }; /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaGenericServices = false; + 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; + }; /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.pyGenericServices = false; + 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; + }; /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions * @instance + * @returns {Object.} JSON object */ - FileOptions.prototype.phpGenericServices = false; + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.deprecated = false; + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.ccEnableArenas = true; + 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; + })(); - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + return MethodOptions; + })(); - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + protobuf.UninterpretedOption = (function() { /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.swiftPrefix = ""; /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - FileOptions.prototype.phpClassPrefix = ""; + 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]]; + } /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.phpNamespace = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.phpMetadataNamespace = ""; + UninterpretedOption.prototype.identifierValue = ""; /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.rubyPackage = ""; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + UninterpretedOption.prototype.doubleValue = 0; /** - * 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 + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * 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(); + * 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 FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @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.FileOptions} FileOptions + * @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 */ - FileOptions.decode = function decode(reader, length) { + 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.FileOptions(); + 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 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(); + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; } - case 40: { - message.phpClassPrefix = reader.string(); + case 3: { + message.identifierValue = reader.string(); break; } - case 41: { - message.phpNamespace = reader.string(); + case 4: { + message.positiveIntValue = reader.uint64(); break; } - case 44: { - message.phpMetadataNamespace = reader.string(); + case 5: { + message.negativeIntValue = reader.int64(); break; } - case 45: { - message.rubyPackage = reader.string(); + case 6: { + message.doubleValue = reader.double(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 7: { + message.stringValue = reader.bytes(); 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())); + case 8: { + message.aggregateValue = reader.string(); break; } default: @@ -21387,373 +27383,454 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions + * @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 */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.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]); + + /** + * 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 ".google.api.resourceDefinition." + 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 a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) 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]); + 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 a FileOptions message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } + if (options.arrays || options.defaults) + object.name = []; 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); + 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[".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); + 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 FileOptions to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - FileOptions.prototype.toJSON = function toJSON() { + UninterpretedOption.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"; - }; + /** + * 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"; + }; - /** - * 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 NamePart; })(); - return FileOptions; + return UninterpretedOption; })(); - protobuf.MessageOptions = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of a MessageOptions. + * Properties of a SourceCodeInfo. * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new MessageOptions. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21761,350 +27838,585 @@ } /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - MessageOptions.prototype.messageSetWireFormat = false; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.deprecated = false; + 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; + }; /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.mapEntry = false; + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + 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; + }; /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance + * 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 */ - MessageOptions.prototype[".google.api.resource"] = null; + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + 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; }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo * @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 + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; + 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; }; /** - * 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 + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @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.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + 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; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + 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()); - }; + /** + * 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 MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; + /** + * 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[".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; - }; + 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 MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * 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[".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; - }; + 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 MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; + /** + * 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 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); - }; + /** + * 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 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"; - }; + /** + * 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 MessageOptions; + return Location; + })(); + + return SourceCodeInfo; })(); - protobuf.FieldOptions = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a FieldOptions. + * Properties of a GeneratedCodeInfo. * @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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new FieldOptions. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22112,215 +28424,78 @@ } /** - * 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 uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $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; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + GeneratedCodeInfo.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.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(); + 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 FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @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.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decode = function decode(reader, length) { + 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.FieldOptions(); + 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: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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()); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; } default: @@ -22332,587 +28507,501 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.FieldOptions + * @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 */ - FieldOptions.verify = function verify(message) { + GeneratedCodeInfo.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.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 (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 "uninterpretedOption." + error; + return "annotation." + error; } } - 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; - } - 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; - } - } return null; }; /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo 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.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.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"]); - } - 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; - } + * @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 FieldOptions message. Also converts values to other types if specified. + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + GeneratedCodeInfo.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[".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.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 (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); } - 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. + * Converts this GeneratedCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ - FieldOptions.prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldOptions + * Gets the default type url for GeneratedCodeInfo * @function getTypeUrl - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; }; - /** - * 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; - })(); + GeneratedCodeInfo.Annotation = (function() { - /** - * 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; - })(); + /** + * 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 + */ - return FieldOptions; - })(); + /** + * 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]]; + } - protobuf.OneofOptions = (function() { + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; - /** - * 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]]; - } + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; - /** - * 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); - }; + /** + * 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 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 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(); + }; - /** - * 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 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 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())); + /** + * 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: - reader.skipType(tag & 7); + 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; - }; - - /** - * 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()); - }; + return message; + }; - /** - * 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; + /** + * 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; } - } - 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]); + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; } - } - return message; - }; + 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; + }; - /** - * 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 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); + }; - /** - * 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 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"; + }; - /** - * 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"; - }; + /** + * 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 OneofOptions; + return Annotation; + })(); + + return GeneratedCodeInfo; })(); - protobuf.EnumOptions = (function() { + protobuf.Duration = (function() { /** - * Properties of an EnumOptions. + * Properties of a Duration. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new EnumOptions. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function EnumOptions(properties) { - this.uninterpretedOption = []; + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22920,106 +29009,89 @@ } /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - EnumOptions.prototype.deprecated = false; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + Duration.prototype.nanos = 0; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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 EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @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.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decode = function decode(reader, length) { + 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.EnumOptions(); + 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 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); + case 1: { + message.seconds = reader.int64(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + message.nanos = reader.int32(); break; } default: @@ -23031,159 +29103,146 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.EnumOptions + * @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 */ - EnumOptions.verify = function verify(message) { + Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } + 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 an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.Duration} Duration */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } + 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 an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + 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 EnumOptions to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - return EnumOptions; + return Duration; })(); - protobuf.EnumValueOptions = (function() { + protobuf.Struct = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a Struct. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IStruct + * @property {Object.|null} [fields] Struct fields */ /** - * Constructs a new EnumValueOptions. + * Constructs a new Struct. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a Struct. + * @implements IStruct * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IStruct=} [properties] Properties to set */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; + function Struct(properties) { + this.fields = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23191,92 +29250,97 @@ } /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + Struct.prototype.fields = $util.emptyObject; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + Struct.create = function create(properties) { + return new Struct(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + Struct.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(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + Struct.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decode = function decode(reader, length) { + Struct.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - 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())); + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; break; } default: @@ -23288,152 +29352,146 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + Struct.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a Struct message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnumValueOptions.verify = function verify(message) { + Struct.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 (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); if (error) - return "uninterpretedOption." + error; + return "fields." + error; } } return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Struct} Struct */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) 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]); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); } } return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a Struct message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.Struct} message Struct * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + Struct.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); + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); } return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Struct to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + Struct.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for Struct * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Struct * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.Struct"; }; - return EnumValueOptions; + return Struct; })(); - protobuf.ServiceOptions = (function() { + protobuf.Value = (function() { /** - * Properties of a ServiceOptions. + * Properties of a Value. * @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 + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue */ /** - * Constructs a new ServiceOptions. + * Constructs a new Value. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a Value. + * @implements IValue * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IValue=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23441,120 +29499,159 @@ } /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype.deprecated = false; + Value.prototype.nullValue = null; /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + Value.prototype.numberValue = null; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + Value.prototype.stringValue = null; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + Value.prototype.boolValue = null; /** - * Creates a new ServiceOptions instance using the specified properties. + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + Value.create = function create(properties) { + return new Value(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + Value.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"]); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decode = function decode(reader, length) { + Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); + case 1: { + message.nullValue = reader.int32(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + message.numberValue = reader.double(); break; } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); + case 3: { + message.stringValue = reader.string(); break; } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); break; } default: @@ -23566,309 +29663,314 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a Value message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServiceOptions.verify = function verify(message) { + Value.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]); + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); if (error) - return "uninterpretedOption." + error; + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; } } - 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. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Value} Value */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) 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]); + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); } - 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. + * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.Value} message Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + Value.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.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; } - if (message.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.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; } - 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. + * Converts this Value to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for Value * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + return typeUrlPrefix + "/google.protobuf.Value"; }; - return ServiceOptions; + return Value; })(); - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set */ - MethodOptions.prototype[".google.api.http"] = null; + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + ListValue.prototype.values = $util.emptyArray; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + ListValue.create = function create(properties) { + return new ListValue(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + ListValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + ListValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decode = function decode(reader, length) { + ListValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 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()); + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; } default: @@ -23880,238 +29982,140 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + ListValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies a ListValue message. * @function verify - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MethodOptions.verify = function verify(message) { + ListValue.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 (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); if (error) - return "uninterpretedOption." + error; + return "values." + error; } } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } return null; }; /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.ListValue} ListValue */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) 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]); + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); } } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } return message; }; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from a ListValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.ListValue} message ListValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + ListValue.toObject = function toObject(message, options) { if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === 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.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]; + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); } - 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. + * Converts this ListValue to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + ListValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for ListValue * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.ListValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.ListValue"; }; - /** - * 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; + return ListValue; })(); - protobuf.UninterpretedOption = (function() { + protobuf.Any = (function() { /** - * Properties of an UninterpretedOption. + * Properties of an Any. * @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 + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new UninterpretedOption. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24119,164 +30123,297 @@ } /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - UninterpretedOption.prototype.name = $util.emptyArray; + Any.prototype.type_url = ""; /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - UninterpretedOption.prototype.identifierValue = ""; + Any.prototype.value = $util.newBuffer([]); /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Any.create = function create(properties) { + return new Any(properties); + }; /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + 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; + }; /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.doubleValue = 0; + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * 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 */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + 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; + }; /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * 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 */ - UninterpretedOption.prototype.aggregateValue = ""; + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; }; + return Any; + })(); + + protobuf.Empty = (function() { + /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption + * 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.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - 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); + 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 UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @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.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decode = function decode(reader, length) { + 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.UninterpretedOption(); + 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) { - 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; @@ -24286,454 +30423,329 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @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 */ - UninterpretedOption.verify = function verify(message) { + Empty.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. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.Empty} Empty */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) 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; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.Empty} message Empty * @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); + 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"; } - 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; + return typeUrlPrefix + "/google.protobuf.Empty"; }; + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask * @instance - * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + FieldMask.prototype.paths = $util.emptyArray; /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; - 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 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 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(); - }; + /** + * 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 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); + /** + * 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; } - 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return NamePart; - })(); + /** + * 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 UninterpretedOption; + return FieldMask; })(); - protobuf.SourceCodeInfo = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a SourceCodeInfo. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new SourceCodeInfo. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24741,78 +30753,89 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * 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.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + Timestamp.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(); + 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 SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @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.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decode = function decode(reader, length) { + 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.SourceCodeInfo(); + 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: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); break; } default: @@ -24824,502 +30847,695 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @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 */ - SourceCodeInfo.verify = function verify(message) { + Timestamp.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; - } - } + 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.Timestamp} Timestamp */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) 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]); - } - } + 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 SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + Timestamp.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); + 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 SourceCodeInfo to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - SourceCodeInfo.Location = (function() { + return Timestamp; + })(); - /** - * 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 - */ + return protobuf; + })(); - /** - * 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]]; - } + google.longrunning = (function() { - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; + longrunning.Operations = (function() { - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; + /** + * 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); + } - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + /** + * 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); + }; - /** - * 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); - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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" }); - /** - * 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(); - }; + /** + * 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; - /** - * 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; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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()); - }; + /** + * 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) + }); - /** - * 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 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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]; + /** + * 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; } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; + } + 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.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]; + } + 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return Location; - })(); + /** + * 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 SourceCodeInfo; + return Operation; })(); - protobuf.GeneratedCodeInfo = (function() { + longrunning.GetOperationRequest = (function() { /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name */ /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + function GetOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25327,78 +31543,75 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + GetOperationRequest.prototype.name = ""; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new GetOperationRequest instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + GetOperationRequest.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(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a GetOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decode = function decode(reader, length) { + 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.protobuf.GeneratedCodeInfo(); + 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: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -25410,501 +31623,397 @@ }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a GetOperationRequest message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.verify = function verify(message) { + GetOperationRequest.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; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) 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]); - } - } + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + GetOperationRequest.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); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this GetOperationRequest to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.GetOperationRequest * @instance * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { + GetOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for GetOperationRequest * @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]]; + * @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"; + }; - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; + return GetOperationRequest; + })(); - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; + longrunning.ListOperationsRequest = (function() { - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + /** + * 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 + */ - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + /** + * 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]]; + } - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; - /** - * 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); - }; + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; - /** - * 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; - }; + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; - /** - * 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(); - }; + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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()); - }; + /** + * 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; + }; - /** - * 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: + /** + * 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; } - 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; + case 1: { + message.filter = reader.string(); 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; + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + 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; - }; + /** + * 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()); + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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; + }; - /** - * 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; - })(); + /** + * 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; + }; - return Annotation; - })(); + /** + * 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); + }; - return GeneratedCodeInfo; + /** + * 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; })(); - protobuf.Duration = (function() { + longrunning.ListOperationsResponse = (function() { /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken */ /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set */ - function Duration(properties) { + function ListOperationsResponse(properties) { + this.operations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25912,89 +32021,92 @@ } /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListOperationsResponse.prototype.operations = $util.emptyArray; /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse * @instance */ - Duration.prototype.nanos = 0; + ListOperationsResponse.prototype.nextPageToken = ""; /** - * Creates a new Duration instance using the specified properties. + * Creates a new ListOperationsResponse instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance */ - Duration.create = function create(properties) { - return new Duration(properties); + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + ListOperationsResponse.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); + 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 Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a ListOperationsResponse message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @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.protobuf.Duration} Duration + * @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 */ - Duration.decode = function decode(reader, length) { + 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.protobuf.Duration(); + 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: { - message.seconds = reader.int64(); + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); break; } case 2: { - message.nanos = reader.int32(); + message.nextPageToken = reader.string(); break; } default: @@ -26006,146 +32118,148 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @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 */ - Duration.decodeDelimited = function decodeDelimited(reader) { + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies a ListOperationsResponse message. * @function verify - * @memberof google.protobuf.Duration + * @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 */ - Duration.verify = function verify(message) { + ListOperationsResponse.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"; + 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) 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; + 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 Duration message. Also converts values to other types if specified. + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + ListOperationsResponse.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; + 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 Duration to JSON. + * Converts this ListOperationsResponse to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + ListOperationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for ListOperationsResponse * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.longrunning.ListOperationsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; }; - return Duration; + return ListOperationsResponse; })(); - protobuf.Struct = (function() { + longrunning.CancelOperationRequest = (function() { /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name */ /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set */ - function Struct(properties) { - this.fields = {}; + function CancelOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26153,97 +32267,75 @@ } /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest * @instance */ - Struct.prototype.fields = $util.emptyObject; + CancelOperationRequest.prototype.name = ""; /** - * Creates a new Struct instance using the specified properties. + * Creates a new CancelOperationRequest instance using the specified properties. * @function create - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance */ - Struct.create = function create(properties) { - return new Struct(properties); + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); }; /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Struct.encode = function encode(message, writer) { + CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Struct message from the specified reader or buffer. + * Decodes a CancelOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Struct + * @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.protobuf.Struct} Struct + * @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 */ - Struct.decode = function decode(reader, length) { + 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.protobuf.Struct(), key, value; + 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: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; + message.name = reader.string(); break; } default: @@ -26255,306 +32347,198 @@ }; /** - * Decodes a Struct message from the specified reader or buffer, length delimited. + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct + * @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 */ - Struct.decodeDelimited = function decodeDelimited(reader) { + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Struct message. + * Verifies a CancelOperationRequest message. * @function verify - * @memberof google.protobuf.Struct + * @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 */ - Struct.verify = function verify(message) { + CancelOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.Struct} message Struct + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Struct.toObject = function toObject(message, options) { + CancelOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this Struct to JSON. + * Converts this CancelOperationRequest to JSON. * @function toJSON - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @instance * @returns {Object.} JSON object */ - Struct.prototype.toJSON = function toJSON() { + CancelOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Struct + * Gets the default type url for CancelOperationRequest * @function getTypeUrl - * @memberof google.protobuf.Struct + * @memberof google.longrunning.CancelOperationRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Struct"; + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; }; - return Struct; + return CancelOperationRequest; })(); - protobuf.Value = (function() { + longrunning.DeleteOperationRequest = (function() { /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name */ /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set */ - function Value(properties) { + 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]]; } - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest * @instance */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteOperationRequest.prototype.name = ""; /** - * Creates a new Value instance using the specified properties. + * Creates a new DeleteOperationRequest instance using the specified properties. * @function create - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance */ - Value.create = function create(properties) { - return new Value(properties); + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); }; /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encode = function encode(message, writer) { + DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encodeDelimited = function encodeDelimited(message, writer) { + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Value message from the specified reader or buffer. + * Decodes a DeleteOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Value + * @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.protobuf.Value} Value + * @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 */ - Value.decode = function decode(reader, length) { + 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.protobuf.Value(); + 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.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -26566,235 +32550,123 @@ }; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value + * @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 */ - Value.decodeDelimited = function decodeDelimited(reader) { + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Value message. + * Verifies a DeleteOperationRequest message. * @function verify - * @memberof google.protobuf.Value + * @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 */ - Value.verify = function verify(message) { + DeleteOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.protobuf.Value} message Value + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { + DeleteOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this Value to JSON. + * Converts this DeleteOperationRequest to JSON. * @function toJSON - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @instance * @returns {Object.} JSON object */ - Value.prototype.toJSON = function toJSON() { + DeleteOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Value + * Gets the default type url for DeleteOperationRequest * @function getTypeUrl - * @memberof google.protobuf.Value + * @memberof google.longrunning.DeleteOperationRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Value"; + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; }; - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; + return DeleteOperationRequest; })(); - protobuf.ListValue = (function() { + longrunning.WaitOperationRequest = (function() { /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values + * 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 ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set */ - function ListValue(properties) { - this.values = []; + function WaitOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26802,78 +32674,89 @@ } /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest * @instance */ - ListValue.prototype.values = $util.emptyArray; + WaitOperationRequest.prototype.name = ""; /** - * Creates a new ListValue instance using the specified properties. + * 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.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance */ - ListValue.create = function create(properties) { - return new ListValue(properties); + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); }; /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListValue.encode = function encode(message, writer) { + WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListValue message from the specified reader or buffer. + * Decodes a WaitOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ListValue + * @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.protobuf.ListValue} ListValue + * @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 */ - ListValue.decode = function decode(reader, length) { + 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.protobuf.ListValue(); + 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: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -26885,138 +32768,137 @@ }; /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue + * @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 */ - ListValue.decodeDelimited = function decodeDelimited(reader) { + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListValue message. + * Verifies a WaitOperationRequest message. * @function verify - * @memberof google.protobuf.ListValue + * @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 */ - ListValue.verify = function verify(message) { + WaitOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } + 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 ListValue message from a plain object. Also converts values to their respective internal types. + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } + 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 ListValue message. Also converts values to other types if specified. + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static - * @param {google.protobuf.ListValue} message ListValue + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListValue.toObject = function toObject(message, options) { + WaitOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + 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 ListValue to JSON. + * Converts this WaitOperationRequest to JSON. * @function toJSON - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @instance * @returns {Object.} JSON object */ - ListValue.prototype.toJSON = function toJSON() { + WaitOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListValue + * Gets the default type url for WaitOperationRequest * @function getTypeUrl - * @memberof google.protobuf.ListValue + * @memberof google.longrunning.WaitOperationRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ListValue"; + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; }; - return ListValue; + return WaitOperationRequest; })(); - protobuf.Empty = (function() { + longrunning.OperationInfo = (function() { /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType */ /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set */ - function Empty(properties) { + function OperationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27024,63 +32906,91 @@ } /** - * Creates a new Empty instance using the specified properties. + * 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.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance */ - Empty.create = function create(properties) { - return new Empty(properties); + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, 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 Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes an OperationInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @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.protobuf.Empty} Empty + * @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 */ - Empty.decode = function decode(reader, length) { + 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.protobuf.Empty(); + 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; @@ -27090,110 +33000,146 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @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 */ - Empty.decodeDelimited = function decodeDelimited(reader) { + OperationInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies an OperationInfo message. * @function verify - * @memberof google.protobuf.Empty + * @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 */ - Empty.verify = function verify(message) { + 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 Empty message from a plain object. Also converts values to their respective internal types. + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.longrunning.OperationInfo} OperationInfo */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) return object; - return new $root.google.protobuf.Empty(); + 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 Empty message. Also converts values to other types if specified. + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.longrunning.OperationInfo} message OperationInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + 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 Empty to JSON. + * Converts this OperationInfo to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + OperationInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for OperationInfo * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.longrunning.OperationInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.longrunning.OperationInfo"; }; - return Empty; + return OperationInfo; })(); - protobuf.FieldMask = (function() { + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths + * 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 FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @param {google.rpc.IStatus=} [properties] Properties to set */ - function FieldMask(properties) { - this.paths = []; + function Status(properties) { + this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27201,78 +33147,106 @@ } /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask + * Status code. + * @member {number} code + * @memberof google.rpc.Status * @instance */ - FieldMask.prototype.paths = $util.emptyArray; + Status.prototype.code = 0; /** - * Creates a new FieldMask instance using the specified properties. + * 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.protobuf.FieldMask + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); + Status.create = function create(properties) { + return new Status(properties); }; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer) { + Status.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]); + 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 FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + Status.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes a Status message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldMask + * @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.protobuf.FieldMask} FieldMask + * @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 */ - FieldMask.decode = function decode(reader, length) { + 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.protobuf.FieldMask(); + 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: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); + 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: @@ -27284,117 +33258,140 @@ }; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask + * @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 */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { + Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldMask message. + * Verifies a Status message. * @function verify - * @memberof google.protobuf.FieldMask + * @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 */ - FieldMask.verify = function verify(message) { + Status.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"; + 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.rpc.Status} Status */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) 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]); + 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 FieldMask message. Also converts values to other types if specified. + * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static - * @param {google.protobuf.FieldMask} message FieldMask + * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { + Status.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]; + 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 FieldMask to JSON. + * Converts this Status to JSON. * @function toJSON - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ - FieldMask.prototype.toJSON = function toJSON() { + Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Status * @function getTypeUrl - * @memberof google.protobuf.FieldMask + * @memberof google.rpc.Status * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldMask"; + return typeUrlPrefix + "/google.rpc.Status"; }; - return FieldMask; + return Status; })(); - return protobuf; + return rpc; })(); return google; diff --git a/packages/google-cloud-video-stitcher/protos/protos.json b/packages/google-cloud-video-stitcher/protos/protos.json index a2c87448fcb4..a578129b8a20 100644 --- a/packages/google-cloud-video-stitcher/protos/protos.json +++ b/packages/google-cloud-video-stitcher/protos/protos.json @@ -357,6 +357,129 @@ } } }, + "AdTracking": { + "values": { + "AD_TRACKING_UNSPECIFIED": 0, + "CLIENT": 1, + "SERVER": 2 + } + }, + "LiveConfig": { + "options": { + "(google.api.resource).type": "videostitcher.googleapis.com/LiveConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/liveConfigs/{live_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "adTagUri": { + "type": "string", + "id": 3 + }, + "gamLiveConfig": { + "type": "GamLiveConfig", + "id": 4 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "adTracking": { + "type": "AdTracking", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultSlate": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "videostitcher.googleapis.com/Slate" + } + }, + "stitchingPolicy": { + "type": "StitchingPolicy", + "id": 8 + }, + "prefetchConfig": { + "type": "PrefetchConfig", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 3 + } + }, + "StitchingPolicy": { + "values": { + "STITCHING_POLICY_UNSPECIFIED": 0, + "CUT_CURRENT": 1, + "COMPLETE_AD": 2 + } + } + } + }, + "PrefetchConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "initialAdRequestDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "GamLiveConfig": { + "fields": { + "networkCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customAssetKey": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "VodSession": { "options": { "(google.api.resource).type": "videostitcher.googleapis.com/VodSession", @@ -403,10 +526,6 @@ "type": "string", "id": 7 }, - "clientAdTracking": { - "type": "bool", - "id": 8 - }, "manifestOptions": { "type": "ManifestOptions", "id": 9 @@ -417,6 +536,37 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "adTracking": { + "type": "AdTracking", + "id": 11, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gamSettings": { + "type": "GamSettings", + "id": 13 + } + }, + "nested": { + "GamSettings": { + "fields": { + "networkCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "streamId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } } } }, @@ -500,66 +650,42 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "sourceUri": { - "type": "string", - "id": 3 - }, - "defaultAdTagId": { - "type": "string", - "id": 4 - }, - "adTagMap": { - "keyType": "string", - "type": "AdTag", - "id": 5 - }, "adTagMacros": { "keyType": "string", "type": "string", "id": 6 }, - "clientAdTracking": { - "type": "bool", - "id": 7 - }, - "defaultSlateId": { - "type": "string", - "id": 8 - }, - "stitchingPolicy": { - "type": "StitchingPolicy", - "id": 9 - }, "manifestOptions": { "type": "ManifestOptions", "id": 10 }, - "streamId": { + "gamSettings": { + "type": "GamSettings", + "id": 15 + }, + "liveConfig": { "type": "string", - "id": 11, + "id": 16, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "videostitcher.googleapis.com/LiveConfig" } } }, "nested": { - "StitchingPolicy": { - "values": { - "STITCHING_POLICY_UNSPECIFIED": 0, - "COMPLETE_AD": 1, - "CUT_CURRENT": 3 + "GamSettings": { + "fields": { + "streamId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } } } }, - "AdTag": { - "fields": { - "uri": { - "type": "string", - "id": 1 - } - } - }, "ManifestOptions": { "fields": { "includeRenditions": { @@ -610,6 +736,30 @@ "uri": { "type": "string", "id": 2 + }, + "gamSlate": { + "type": "GamSlate", + "id": 3 + } + }, + "nested": { + "GamSlate": { + "fields": { + "networkCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gamSlateId": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } } } }, @@ -678,11 +828,13 @@ "methods": { "CreateCdnKey": { "requestType": "CreateCdnKeyRequest", - "responseType": "CdnKey", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/cdnKeys", "(google.api.http).body": "cdn_key", - "(google.api.method_signature)": "parent,cdn_key,cdn_key_id" + "(google.api.method_signature)": "parent,cdn_key,cdn_key_id", + "(google.longrunning.operation_info).response_type": "google.cloud.video.stitcher.v1.CdnKey", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -693,6 +845,12 @@ }, { "(google.api.method_signature)": "parent,cdn_key,cdn_key_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.video.stitcher.v1.CdnKey", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, @@ -734,10 +892,12 @@ }, "DeleteCdnKey": { "requestType": "DeleteCdnKeyRequest", - "responseType": "google.protobuf.Empty", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).delete": "/v1/{name=projects/*/locations/*/cdnKeys/*}", - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -747,16 +907,24 @@ }, { "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, "UpdateCdnKey": { "requestType": "UpdateCdnKeyRequest", - "responseType": "CdnKey", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).patch": "/v1/{cdn_key.name=projects/*/locations/*/cdnKeys/*}", "(google.api.http).body": "cdn_key", - "(google.api.method_signature)": "cdn_key,update_mask" + "(google.api.method_signature)": "cdn_key,update_mask", + "(google.longrunning.operation_info).response_type": "google.cloud.video.stitcher.v1.CdnKey", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -767,6 +935,12 @@ }, { "(google.api.method_signature)": "cdn_key,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.video.stitcher.v1.CdnKey", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, @@ -918,11 +1092,13 @@ }, "CreateSlate": { "requestType": "CreateSlateRequest", - "responseType": "Slate", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/slates", "(google.api.http).body": "slate", - "(google.api.method_signature)": "parent,slate,slate_id" + "(google.api.method_signature)": "parent,slate,slate_id", + "(google.longrunning.operation_info).response_type": "google.cloud.video.stitcher.v1.Slate", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -933,6 +1109,12 @@ }, { "(google.api.method_signature)": "parent,slate,slate_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.video.stitcher.v1.Slate", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, @@ -974,11 +1156,13 @@ }, "UpdateSlate": { "requestType": "UpdateSlateRequest", - "responseType": "Slate", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).patch": "/v1/{slate.name=projects/*/locations/*/slates/*}", "(google.api.http).body": "slate", - "(google.api.method_signature)": "slate,update_mask" + "(google.api.method_signature)": "slate,update_mask", + "(google.longrunning.operation_info).response_type": "google.cloud.video.stitcher.v1.Slate", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -989,15 +1173,23 @@ }, { "(google.api.method_signature)": "slate,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.video.stitcher.v1.Slate", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, "DeleteSlate": { "requestType": "DeleteSlateRequest", - "responseType": "google.protobuf.Empty", + "responseType": "google.longrunning.Operation", "options": { "(google.api.http).delete": "/v1/{name=projects/*/locations/*/slates/*}", - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" }, "parsedOptions": [ { @@ -1007,6 +1199,12 @@ }, { "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } } ] }, @@ -1047,6 +1245,96 @@ "(google.api.method_signature)": "name" } ] + }, + "CreateLiveConfig": { + "requestType": "CreateLiveConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/liveConfigs", + "(google.api.http).body": "live_config", + "(google.api.method_signature)": "parent,live_config,live_config_id", + "(google.longrunning.operation_info).response_type": "google.cloud.video.stitcher.v1.LiveConfig", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/liveConfigs", + "body": "live_config" + } + }, + { + "(google.api.method_signature)": "parent,live_config,live_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.video.stitcher.v1.LiveConfig", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } + } + ] + }, + "ListLiveConfigs": { + "requestType": "ListLiveConfigsRequest", + "responseType": "ListLiveConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/liveConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/liveConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetLiveConfig": { + "requestType": "GetLiveConfigRequest", + "responseType": "LiveConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/liveConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/liveConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteLiveConfig": { + "requestType": "DeleteLiveConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/liveConfigs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/liveConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.video.stitcher.v1.OperationMetadata" + } + } + ] } } }, @@ -1353,6 +1641,10 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "requestId": { + "type": "string", + "id": 4 } } }, @@ -1474,6 +1766,132 @@ } } } + }, + "CreateLiveConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "videostitcher.googleapis.com/LiveConfig" + } + }, + "liveConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "liveConfig": { + "type": "LiveConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "ListLiveConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "videostitcher.googleapis.com/LiveConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLiveConfigsResponse": { + "fields": { + "liveConfigs": { + "rule": "repeated", + "type": "LiveConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetLiveConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "videostitcher.googleapis.com/LiveConfig" + } + } + } + }, + "DeleteLiveConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "videostitcher.googleapis.com/LiveConfig" + } + } + } + }, + "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 + } + } } } } @@ -2699,6 +3117,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Empty": { "fields": {} }, @@ -2710,6 +3140,263 @@ "id": 1 } } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "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 + } + } } } } diff --git a/packages/google-cloud-video-stitcher/samples/README.md b/packages/google-cloud-video-stitcher/samples/README.md index 23ba8a8cde15..4fcfc45c9838 100644 --- a/packages/google-cloud-video-stitcher/samples/README.md +++ b/packages/google-cloud-video-stitcher/samples/README.md @@ -13,13 +13,16 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Video_stitcher_service.create_cdn_key](#video_stitcher_service.create_cdn_key) + * [Video_stitcher_service.create_live_config](#video_stitcher_service.create_live_config) * [Video_stitcher_service.create_live_session](#video_stitcher_service.create_live_session) * [Video_stitcher_service.create_slate](#video_stitcher_service.create_slate) * [Video_stitcher_service.create_vod_session](#video_stitcher_service.create_vod_session) * [Video_stitcher_service.delete_cdn_key](#video_stitcher_service.delete_cdn_key) + * [Video_stitcher_service.delete_live_config](#video_stitcher_service.delete_live_config) * [Video_stitcher_service.delete_slate](#video_stitcher_service.delete_slate) * [Video_stitcher_service.get_cdn_key](#video_stitcher_service.get_cdn_key) * [Video_stitcher_service.get_live_ad_tag_detail](#video_stitcher_service.get_live_ad_tag_detail) + * [Video_stitcher_service.get_live_config](#video_stitcher_service.get_live_config) * [Video_stitcher_service.get_live_session](#video_stitcher_service.get_live_session) * [Video_stitcher_service.get_slate](#video_stitcher_service.get_slate) * [Video_stitcher_service.get_vod_ad_tag_detail](#video_stitcher_service.get_vod_ad_tag_detail) @@ -27,13 +30,13 @@ * [Video_stitcher_service.get_vod_stitch_detail](#video_stitcher_service.get_vod_stitch_detail) * [Video_stitcher_service.list_cdn_keys](#video_stitcher_service.list_cdn_keys) * [Video_stitcher_service.list_live_ad_tag_details](#video_stitcher_service.list_live_ad_tag_details) + * [Video_stitcher_service.list_live_configs](#video_stitcher_service.list_live_configs) * [Video_stitcher_service.list_slates](#video_stitcher_service.list_slates) * [Video_stitcher_service.list_vod_ad_tag_details](#video_stitcher_service.list_vod_ad_tag_details) * [Video_stitcher_service.list_vod_stitch_details](#video_stitcher_service.list_vod_stitch_details) * [Video_stitcher_service.update_cdn_key](#video_stitcher_service.update_cdn_key) * [Video_stitcher_service.update_slate](#video_stitcher_service.update_slate) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -67,6 +70,23 @@ __Usage:__ +### Video_stitcher_service.create_live_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js` + + +----- + + + + ### Video_stitcher_service.create_live_session View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js). @@ -135,6 +155,23 @@ __Usage:__ +### Video_stitcher_service.delete_live_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js` + + +----- + + + + ### Video_stitcher_service.delete_slate View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js). @@ -186,6 +223,23 @@ __Usage:__ +### Video_stitcher_service.get_live_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js` + + +----- + + + + ### Video_stitcher_service.get_live_session View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_session.js). @@ -305,6 +359,23 @@ __Usage:__ +### Video_stitcher_service.list_live_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js). + +[![Open in Cloud 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-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js` + + +----- + + + + ### Video_stitcher_service.list_slates View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js). @@ -402,23 +473,6 @@ __Usage:__ `node packages/google-cloud-video-stitcher/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-stitcher/samples/test/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-video-stitcher/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-video-stitcher/samples/test/quickstart.js` - - diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json b/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json index 574e878a2619..db58fb876d59 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-stitcher", - "version": "0.3.1", + "version": "0.3.2", "language": "TYPESCRIPT", "apis": [ { @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -44,7 +44,7 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.video.stitcher.v1.CdnKey", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -180,7 +180,7 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.protobuf.Empty", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -206,7 +206,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 61, "type": "FULL" } ], @@ -224,7 +224,7 @@ "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.cloud.video.stitcher.v1.CdnKey", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -382,7 +382,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -598,7 +598,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 82, "type": "FULL" } ], @@ -618,9 +618,13 @@ { "name": "slate", "type": ".google.cloud.video.stitcher.v1.Slate" + }, + { + "name": "request_id", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.video.stitcher.v1.Slate", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -646,7 +650,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 73, "type": "FULL" } ], @@ -742,7 +746,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], @@ -760,7 +764,7 @@ "type": ".google.protobuf.FieldMask" } ], - "resultType": ".google.cloud.video.stitcher.v1.Slate", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -786,7 +790,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -800,7 +804,7 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.protobuf.Empty", + "resultType": ".google.longrunning.Operation", "client": { "shortName": "VideoStitcherServiceClient", "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" @@ -898,6 +902,194 @@ } } } + }, + { + "regionTag": "videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_async", + "title": "VideoStitcherService createLiveConfig Sample", + "origin": "API_DEFINITION", + "description": " Registers the live config with the provided unique ID in the specified region.", + "canonical": true, + "file": "video_stitcher_service.create_live_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "live_config_id", + "type": "TYPE_STRING" + }, + { + "name": "live_config", + "type": ".google.cloud.video.stitcher.v1.LiveConfig" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoStitcherServiceClient", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" + }, + "method": { + "shortName": "CreateLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.CreateLiveConfig", + "service": { + "shortName": "VideoStitcherService", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService" + } + } + } + }, + { + "regionTag": "videostitcher_v1_generated_VideoStitcherService_ListLiveConfigs_async", + "title": "VideoStitcherService listLiveConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists all live configs managed by the Video Stitcher that belong to the specified project and region.", + "canonical": true, + "file": "video_stitcher_service.list_live_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLiveConfigs", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.stitcher.v1.ListLiveConfigsResponse", + "client": { + "shortName": "VideoStitcherServiceClient", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" + }, + "method": { + "shortName": "ListLiveConfigs", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.ListLiveConfigs", + "service": { + "shortName": "VideoStitcherService", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService" + } + } + } + }, + { + "regionTag": "videostitcher_v1_generated_VideoStitcherService_GetLiveConfig_async", + "title": "VideoStitcherService getLiveConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified live config managed by the Video Stitcher service.", + "canonical": true, + "file": "video_stitcher_service.get_live_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.stitcher.v1.LiveConfig", + "client": { + "shortName": "VideoStitcherServiceClient", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" + }, + "method": { + "shortName": "GetLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.GetLiveConfig", + "service": { + "shortName": "VideoStitcherService", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService" + } + } + } + }, + { + "regionTag": "videostitcher_v1_generated_VideoStitcherService_DeleteLiveConfig_async", + "title": "VideoStitcherService deleteLiveConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified live config.", + "canonical": true, + "file": "video_stitcher_service.delete_live_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.DeleteLiveConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoStitcherServiceClient", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherServiceClient" + }, + "method": { + "shortName": "DeleteLiveConfig", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService.DeleteLiveConfig", + "service": { + "shortName": "VideoStitcherService", + "fullName": "google.cloud.video.stitcher.v1.VideoStitcherService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js index 30f51875b6b9..84ef728cf9d8 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_cdn_key.js @@ -29,8 +29,8 @@ function main(parent, cdnKey, cdnKeyId) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project in which the CDN key should be created, in the form of - * `projects/{project_number}/locations/{location}`. + * Required. The project in which the CDN key should be created, in the form + * of `projects/{project_number}/locations/{location}`. */ // const parent = 'abc123' /** @@ -38,8 +38,8 @@ function main(parent, cdnKey, cdnKeyId) { */ // const cdnKey = {} /** - * Required. The ID to use for the CDN key, which will become the final component of - * the CDN key's resource name. + * Required. The ID to use for the CDN key, which will become the final + * component of the CDN key's resource name. * This value should conform to RFC-1034, which restricts to * lower-case letters, numbers, and hyphen, with the first character a * letter, the last a letter or a number, and a 63 character maximum. @@ -61,7 +61,8 @@ function main(parent, cdnKey, cdnKeyId) { }; // Run request - const response = await stitcherClient.createCdnKey(request); + const [operation] = await stitcherClient.createCdnKey(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js new file mode 100644 index 000000000000..f45225f5dde2 --- /dev/null +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_config.js @@ -0,0 +1,87 @@ +// 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, liveConfigId, liveConfig) { + // [START videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_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 project in which the live config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The unique identifier ID to use for the live config. + */ + // const liveConfigId = 'abc123' + /** + * Required. The live config resource to create. + */ + // const liveConfig = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Stitcher library + const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher').v1; + + // Instantiates a client + const stitcherClient = new VideoStitcherServiceClient(); + + async function callCreateLiveConfig() { + // Construct request + const request = { + parent, + liveConfigId, + liveConfig, + }; + + // Run request + const [operation] = await stitcherClient.createLiveConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateLiveConfig(); + // [END videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js index 8dec8bf88fab..3fd5e8d40170 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_live_session.js @@ -29,8 +29,8 @@ function main(parent, liveSession) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the live session should be created, - * in the form of `projects/{project_number}/locations/{location}`. + * Required. The project and location in which the live session should be + * created, in the form of `projects/{project_number}/locations/{location}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js index 0484fdb3ab96..c89dfd53a460 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_slate.js @@ -30,7 +30,7 @@ function main(parent, slateId, slate) { */ /** * Required. The project in which the slate should be created, in the form of - * `projects/{project_number}`. + * `projects/{project_number}/locations/{location}`. */ // const parent = 'abc123' /** @@ -44,6 +44,20 @@ function main(parent, slateId, slate) { * Required. The slate to create. */ // const slate = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' // Imports the Stitcher library const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher').v1; @@ -60,7 +74,8 @@ function main(parent, slateId, slate) { }; // Run request - const response = await stitcherClient.createSlate(request); + const [operation] = await stitcherClient.createSlate(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js index ed288958583b..9dcfada31052 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.create_vod_session.js @@ -29,8 +29,8 @@ function main(parent, vodSession) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the VOD session should be created, in the - * form of `projects/{project_number}/locations/{location}`. + * Required. The project and location in which the VOD session should be + * created, in the form of `projects/{project_number}/locations/{location}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js index 2a4d6748d020..12416f62ad65 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_cdn_key.js @@ -47,7 +47,8 @@ function main(name) { }; // Run request - const response = await stitcherClient.deleteCdnKey(request); + const [operation] = await stitcherClient.deleteCdnKey(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.js new file mode 100644 index 000000000000..d0aeb6c930f9 --- /dev/null +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_live_config.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 videostitcher_v1_generated_VideoStitcherService_DeleteLiveConfig_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 live config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/liveConfigs/{id}`. + */ + // const name = 'abc123' + + // Imports the Stitcher library + const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher').v1; + + // Instantiates a client + const stitcherClient = new VideoStitcherServiceClient(); + + async function callDeleteLiveConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await stitcherClient.deleteLiveConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteLiveConfig(); + // [END videostitcher_v1_generated_VideoStitcherService_DeleteLiveConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js index fa60f843ac16..e0be2b579dfb 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.delete_slate.js @@ -47,7 +47,8 @@ function main(name) { }; // Run request - const response = await stitcherClient.deleteSlate(request); + const [operation] = await stitcherClient.deleteSlate(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.js new file mode 100644 index 000000000000..848c25d52c24 --- /dev/null +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_live_config.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 videostitcher_v1_generated_VideoStitcherService_GetLiveConfig_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 live config to be retrieved, in the form + * of + * `projects/{project_number}/locations/{location}/liveConfigs/{id}`. + */ + // const name = 'abc123' + + // Imports the Stitcher library + const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher').v1; + + // Instantiates a client + const stitcherClient = new VideoStitcherServiceClient(); + + async function callGetLiveConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await stitcherClient.getLiveConfig(request); + console.log(response); + } + + callGetLiveConfig(); + // [END videostitcher_v1_generated_VideoStitcherService_GetLiveConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js index 317c437c5f85..f919af3b3bed 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_slate.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the slate to be retrieved, of the slate, in the form of - * `projects/{project_number}/locations/{location}/slates/{id}`. + * Required. The name of the slate to be retrieved, of the slate, in the form + * of `projects/{project_number}/locations/{location}/slates/{id}`. */ // const name = 'abc123' diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js index 0cdd81d1f3e1..ec56be2b9039 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the ad tag detail for the specified VOD session, in the form of + * Required. The name of the ad tag detail for the specified VOD session, in + * the form of * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodAdTagDetails/{vod_ad_tag_detail}`. */ // const name = 'abc123' diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js index b649c83fe925..e163438554bc 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the stitch detail in the specified VOD session, in the form of + * Required. The name of the stitch detail in the specified VOD session, in + * the form of * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodStitchDetails/{id}`. */ // const name = 'abc123' diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.js new file mode 100644 index 000000000000..ef90b9102fb3 --- /dev/null +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_live_configs.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 videostitcher_v1_generated_VideoStitcherService_ListLiveConfigs_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 project that contains the list of live configs, in the + * form of `projects/{project_number}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results (see + * Filtering (https://google.aip.dev/160)). + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following + * Cloud API + * syntax (https://cloud.google.com/apis/design/design_patterns#sorting_order). + */ + // const orderBy = 'abc123' + + // Imports the Stitcher library + const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher').v1; + + // Instantiates a client + const stitcherClient = new VideoStitcherServiceClient(); + + async function callListLiveConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await stitcherClient.listLiveConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLiveConfigs(); + // [END videostitcher_v1_generated_VideoStitcherService_ListLiveConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js index 220229e7af6c..7ab122123680 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_slates.js @@ -29,7 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project to list slates, in the form of `projects/{project_number}`. + * Required. The project to list slates, in the form of + * `projects/{project_number}/locations/{location}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js index 2ab97b3696e4..ae6251dae4fb 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_ad_tag_details.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The VOD session which the ad tag details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. + * Required. The VOD session which the ad tag details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js index 06f85ea44a87..0d3b33b3e947 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.list_vod_stitch_details.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The VOD session where the stitch details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{id}`. + * Required. The VOD session where the stitch details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{id}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js index 250553b50ebb..e448efed6ba2 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_cdn_key.js @@ -53,7 +53,8 @@ function main(cdnKey, updateMask) { }; // Run request - const response = await stitcherClient.updateCdnKey(request); + const [operation] = await stitcherClient.updateCdnKey(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js index b018e5a6860e..8c53d30787d8 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/video_stitcher_service.update_slate.js @@ -51,7 +51,8 @@ function main(slate, updateMask) { }; // Run request - const response = await stitcherClient.updateSlate(request); + const [operation] = await stitcherClient.updateSlate(request); + const [response] = await operation.promise(); console.log(response); } diff --git a/packages/google-cloud-video-stitcher/src/v1/gapic_metadata.json b/packages/google-cloud-video-stitcher/src/v1/gapic_metadata.json index 6af8b6979561..4326d81a9181 100644 --- a/packages/google-cloud-video-stitcher/src/v1/gapic_metadata.json +++ b/packages/google-cloud-video-stitcher/src/v1/gapic_metadata.json @@ -10,26 +10,11 @@ "grpc": { "libraryClient": "VideoStitcherServiceClient", "rpcs": { - "CreateCdnKey": { - "methods": [ - "createCdnKey" - ] - }, "GetCdnKey": { "methods": [ "getCdnKey" ] }, - "DeleteCdnKey": { - "methods": [ - "deleteCdnKey" - ] - }, - "UpdateCdnKey": { - "methods": [ - "updateCdnKey" - ] - }, "CreateVodSession": { "methods": [ "createVodSession" @@ -55,14 +40,44 @@ "getLiveAdTagDetail" ] }, - "CreateSlate": { + "GetSlate": { "methods": [ - "createSlate" + "getSlate" ] }, - "GetSlate": { + "CreateLiveSession": { "methods": [ - "getSlate" + "createLiveSession" + ] + }, + "GetLiveSession": { + "methods": [ + "getLiveSession" + ] + }, + "GetLiveConfig": { + "methods": [ + "getLiveConfig" + ] + }, + "CreateCdnKey": { + "methods": [ + "createCdnKey" + ] + }, + "DeleteCdnKey": { + "methods": [ + "deleteCdnKey" + ] + }, + "UpdateCdnKey": { + "methods": [ + "updateCdnKey" + ] + }, + "CreateSlate": { + "methods": [ + "createSlate" ] }, "UpdateSlate": { @@ -75,14 +90,14 @@ "deleteSlate" ] }, - "CreateLiveSession": { + "CreateLiveConfig": { "methods": [ - "createLiveSession" + "createLiveConfig" ] }, - "GetLiveSession": { + "DeleteLiveConfig": { "methods": [ - "getLiveSession" + "deleteLiveConfig" ] }, "ListCdnKeys": { @@ -119,32 +134,24 @@ "listSlatesStream", "listSlatesAsync" ] + }, + "ListLiveConfigs": { + "methods": [ + "listLiveConfigs", + "listLiveConfigsStream", + "listLiveConfigsAsync" + ] } } }, "grpc-fallback": { "libraryClient": "VideoStitcherServiceClient", "rpcs": { - "CreateCdnKey": { - "methods": [ - "createCdnKey" - ] - }, "GetCdnKey": { "methods": [ "getCdnKey" ] }, - "DeleteCdnKey": { - "methods": [ - "deleteCdnKey" - ] - }, - "UpdateCdnKey": { - "methods": [ - "updateCdnKey" - ] - }, "CreateVodSession": { "methods": [ "createVodSession" @@ -170,14 +177,44 @@ "getLiveAdTagDetail" ] }, - "CreateSlate": { + "GetSlate": { "methods": [ - "createSlate" + "getSlate" ] }, - "GetSlate": { + "CreateLiveSession": { "methods": [ - "getSlate" + "createLiveSession" + ] + }, + "GetLiveSession": { + "methods": [ + "getLiveSession" + ] + }, + "GetLiveConfig": { + "methods": [ + "getLiveConfig" + ] + }, + "CreateCdnKey": { + "methods": [ + "createCdnKey" + ] + }, + "DeleteCdnKey": { + "methods": [ + "deleteCdnKey" + ] + }, + "UpdateCdnKey": { + "methods": [ + "updateCdnKey" + ] + }, + "CreateSlate": { + "methods": [ + "createSlate" ] }, "UpdateSlate": { @@ -190,14 +227,14 @@ "deleteSlate" ] }, - "CreateLiveSession": { + "CreateLiveConfig": { "methods": [ - "createLiveSession" + "createLiveConfig" ] }, - "GetLiveSession": { + "DeleteLiveConfig": { "methods": [ - "getLiveSession" + "deleteLiveConfig" ] }, "ListCdnKeys": { @@ -234,6 +271,13 @@ "listSlatesStream", "listSlatesAsync" ] + }, + "ListLiveConfigs": { + "methods": [ + "listLiveConfigs", + "listLiveConfigsStream", + "listLiveConfigsAsync" + ] } } } diff --git a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts index 47c836ba4bb3..b97fd2c2e04e 100644 --- a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts +++ b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts @@ -23,6 +23,8 @@ import type { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, + LROperation, PaginationCallback, GaxCall, } from 'google-gax'; @@ -64,6 +66,7 @@ export class VideoStitcherServiceClient { warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; videoStitcherServiceStub?: Promise<{[name: string]: Function}>; /** @@ -188,6 +191,9 @@ export class VideoStitcherServiceClient { liveAdTagDetailPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/liveSessions/{live_session}/liveAdTagDetails/{live_ad_tag_detail}' ), + liveConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/liveConfigs/{live_config}' + ), liveSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/liveSessions/{live_session}' ), @@ -240,6 +246,136 @@ export class VideoStitcherServiceClient { 'nextPageToken', 'slates' ), + listLiveConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'liveConfigs' + ), + }; + + 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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + 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 createCdnKeyResponse = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.CdnKey' + ) as gax.protobuf.Type; + const createCdnKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCdnKeyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteCdnKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateCdnKeyResponse = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.CdnKey' + ) as gax.protobuf.Type; + const updateCdnKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createSlateResponse = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.Slate' + ) as gax.protobuf.Type; + const createSlateMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateSlateResponse = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.Slate' + ) as gax.protobuf.Type; + const updateSlateMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteSlateResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteSlateMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createLiveConfigResponse = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.LiveConfig' + ) as gax.protobuf.Type; + const createLiveConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteLiveConfigResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteLiveConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.video.stitcher.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCdnKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCdnKeyResponse.decode.bind(createCdnKeyResponse), + createCdnKeyMetadata.decode.bind(createCdnKeyMetadata) + ), + deleteCdnKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCdnKeyResponse.decode.bind(deleteCdnKeyResponse), + deleteCdnKeyMetadata.decode.bind(deleteCdnKeyMetadata) + ), + updateCdnKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCdnKeyResponse.decode.bind(updateCdnKeyResponse), + updateCdnKeyMetadata.decode.bind(updateCdnKeyMetadata) + ), + createSlate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSlateResponse.decode.bind(createSlateResponse), + createSlateMetadata.decode.bind(createSlateMetadata) + ), + updateSlate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSlateResponse.decode.bind(updateSlateResponse), + updateSlateMetadata.decode.bind(updateSlateMetadata) + ), + deleteSlate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSlateResponse.decode.bind(deleteSlateResponse), + deleteSlateMetadata.decode.bind(deleteSlateMetadata) + ), + createLiveConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createLiveConfigResponse.decode.bind(createLiveConfigResponse), + createLiveConfigMetadata.decode.bind(createLiveConfigMetadata) + ), + deleteLiveConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteLiveConfigResponse.decode.bind(deleteLiveConfigResponse), + deleteLiveConfigMetadata.decode.bind(deleteLiveConfigMetadata) + ), }; // Put together the default options sent with requests. @@ -313,6 +449,10 @@ export class VideoStitcherServiceClient { 'deleteSlate', 'createLiveSession', 'getLiveSession', + 'createLiveConfig', + 'listLiveConfigs', + 'getLiveConfig', + 'deleteLiveConfig', ]; for (const methodName of videoStitcherServiceStubMethods) { const callPromise = this.videoStitcherServiceStub.then( @@ -329,7 +469,10 @@ export class VideoStitcherServiceClient { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -397,22 +540,13 @@ export class VideoStitcherServiceClient { // -- Service calls -- // ------------------- /** - * Creates a new CDN key. + * Returns the specified CDN key. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project in which the CDN key should be created, in the form of - * `projects/{project_number}/locations/{location}`. - * @param {google.cloud.video.stitcher.v1.CdnKey} request.cdnKey - * Required. The CDN key resource to create. - * @param {string} request.cdnKeyId - * Required. The ID to use for the CDN key, which will become the final component of - * the CDN key's resource name. - * - * This value should conform to RFC-1034, which restricts to - * lower-case letters, numbers, and hyphen, with the first character a - * letter, the last a letter or a number, and a 63 character maximum. + * @param {string} request.name + * Required. The name of the CDN key to be retrieved, in the form of + * `projects/{project}/locations/{location}/cdnKeys/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -420,54 +554,54 @@ export class VideoStitcherServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.create_cdn_key.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateCdnKey_async + * @example include:samples/generated/v1/video_stitcher_service.get_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetCdnKey_async */ - createCdnKey( - request?: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + getCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, options?: CallOptions ): Promise< [ protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | undefined, {} | undefined ] >; - createCdnKey( - request: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + getCdnKey( + request: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, options: CallOptions, callback: Callback< protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest + | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | null | undefined, {} | null | undefined > ): void; - createCdnKey( - request: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + getCdnKey( + request: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, callback: Callback< protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest + | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | null | undefined, {} | null | undefined > ): void; - createCdnKey( - request?: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + getCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, optionsOrCallback?: | CallOptions | Callback< protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest + | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | null | undefined, {} | null | undefined >, callback?: Callback< protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest + | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | null | undefined, {} | null | undefined @@ -475,7 +609,7 @@ export class VideoStitcherServiceClient { ): Promise< [ protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | undefined, {} | undefined ] > | void { @@ -492,82 +626,91 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createCdnKey(request, options, callback); + return this.innerApiCalls.getCdnKey(request, options, callback); } /** - * Returns the specified CDN key. + * Creates a client side playback VOD session and returns the full + * tracking and playback metadata of the session. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CDN key to be retrieved, in the form of - * `projects/{project}/locations/{location}/cdnKeys/{id}`. + * @param {string} request.parent + * Required. The project and location in which the VOD session should be + * created, in the form of `projects/{project_number}/locations/{location}`. + * @param {google.cloud.video.stitcher.v1.VodSession} request.vodSession + * Required. Parameters for creating a session. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.CdnKey | CdnKey}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodSession | VodSession}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_cdn_key.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetCdnKey_async + * @example include:samples/generated/v1/video_stitcher_service.create_vod_session.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateVodSession_async */ - getCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, + createVodSession( + request?: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodSession, + ( + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + | undefined + ), {} | undefined ] >; - getCdnKey( - request: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, + createVodSession( + request: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest | null | undefined, {} | null | undefined > ): void; - getCdnKey( - request: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, + createVodSession( + request: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest | null | undefined, {} | null | undefined > ): void; - getCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest, + createVodSession( + request?: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.IGetCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodSession, + ( + | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + | undefined + ), {} | undefined ] > | void { @@ -584,82 +727,83 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getCdnKey(request, options, callback); + return this.innerApiCalls.createVodSession(request, options, callback); } /** - * Deletes the specified CDN key. + * Returns the full tracking, playback metadata, and relevant ad-ops + * logs for the specified VOD session. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the CDN key to be deleted, in the form of - * `projects/{project_number}/locations/{location}/cdnKeys/{id}`. + * Required. The name of the VOD session to be retrieved, in the form of + * `projects/{project_number}/locations/{location}/vodSessions/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodSession | VodSession}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.delete_cdn_key.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteCdnKey_async + * @example include:samples/generated/v1/video_stitcher_service.get_vod_session.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodSession_async */ - deleteCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + getVodSession( + request?: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, options?: CallOptions ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodSession, + protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | undefined, {} | undefined ] >; - deleteCdnKey( - request: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + getVodSession( + request: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, options: CallOptions, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | null | undefined, {} | null | undefined > ): void; - deleteCdnKey( - request: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + getVodSession( + request: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | null | undefined, {} | null | undefined > ): void; - deleteCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + getVodSession( + request?: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodSession, + | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodSession, + protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | undefined, {} | undefined ] > | void { @@ -679,83 +823,86 @@ export class VideoStitcherServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCdnKey(request, options, callback); + return this.innerApiCalls.getVodSession(request, options, callback); } /** - * Updates the specified CDN key. Only update fields specified - * in the call method body. + * Returns the specified stitching information for the specified VOD session. * * @param {Object} request * The request object that will be sent. - * @param {google.cloud.video.stitcher.v1.CdnKey} request.cdnKey - * Required. The CDN key resource which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * For the `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {string} request.name + * Required. The name of the stitch detail in the specified VOD session, in + * the form of + * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodStitchDetails/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.CdnKey | CdnKey}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodStitchDetail | VodStitchDetail}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.update_cdn_key.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_UpdateCdnKey_async + * @example include:samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_async */ - updateCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, + getVodStitchDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + ( + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + | undefined + ), {} | undefined ] >; - updateCdnKey( - request: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, + getVodStitchDetail( + request: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest | null | undefined, {} | null | undefined > ): void; - updateCdnKey( - request: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, + getVodStitchDetail( + request: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest | null | undefined, {} | null | undefined > ): void; - updateCdnKey( - request?: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, + getVodStitchDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ICdnKey, - | protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ICdnKey, - protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest | undefined, + protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + ( + | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + | undefined + ), {} | undefined ] > | void { @@ -772,89 +919,87 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'cdn_key.name': request.cdnKey!.name ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCdnKey(request, options, callback); + return this.innerApiCalls.getVodStitchDetail(request, options, callback); } /** - * Creates a client side playback VOD session and returns the full - * tracking and playback metadata of the session. + * Returns the specified ad tag detail for the specified VOD session. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location in which the VOD session should be created, in the - * form of `projects/{project_number}/locations/{location}`. - * @param {google.cloud.video.stitcher.v1.VodSession} request.vodSession - * Required. Parameters for creating a session. + * @param {string} request.name + * Required. The name of the ad tag detail for the specified VOD session, in + * the form of + * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodAdTagDetails/{vod_ad_tag_detail}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.VodSession | VodSession}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodAdTagDetail | VodAdTagDetail}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.create_vod_session.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateVodSession_async + * @example include:samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodAdTagDetail_async */ - createVodSession( - request?: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, + getVodAdTagDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodSession, + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, ( - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | undefined ), {} | undefined ] >; - createVodSession( - request: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, + getVodAdTagDetail( + request: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | null | undefined, {} | null | undefined > ): void; - createVodSession( - request: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, + getVodAdTagDetail( + request: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | null | undefined, {} | null | undefined > ): void; - createVodSession( - request?: protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest, + getVodAdTagDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodSession, + protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, ( - | protos.google.cloud.video.stitcher.v1.ICreateVodSessionRequest + | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest | undefined ), {} | undefined @@ -873,83 +1018,88 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createVodSession(request, options, callback); + return this.innerApiCalls.getVodAdTagDetail(request, options, callback); } /** - * Returns the full tracking, playback metadata, and relevant ad-ops - * logs for the specified VOD session. + * Returns the specified ad tag detail for the specified live session. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the VOD session to be retrieved, in the form of - * `projects/{project_number}/locations/{location}/vodSessions/{id}`. + * Required. The resource name in the form of + * `projects/{project}/locations/{location}/liveSessions/{live_session}/liveAdTagDetails/{live_ad_tag_detail}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.VodSession | VodSession}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.LiveAdTagDetail | LiveAdTagDetail}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_vod_session.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodSession_async + * @example include:samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetLiveAdTagDetail_async */ - getVodSession( - request?: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, + getLiveAdTagDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodSession, - protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | undefined, + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + ( + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + | undefined + ), {} | undefined ] >; - getVodSession( - request: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, + getLiveAdTagDetail( + request: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest | null | undefined, {} | null | undefined > ): void; - getVodSession( - request: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, + getLiveAdTagDetail( + request: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest | null | undefined, {} | null | undefined > ): void; - getVodSession( - request?: protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest, + getLiveAdTagDetail( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.IVodSession, - | protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodSession, - protos.google.cloud.video.stitcher.v1.IGetVodSessionRequest | undefined, + protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, + ( + | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + | undefined + ), {} | undefined ] > | void { @@ -969,83 +1119,171 @@ export class VideoStitcherServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVodSession(request, options, callback); + return this.innerApiCalls.getLiveAdTagDetail(request, options, callback); } /** - * Returns the specified stitching information for the specified VOD session. + * Returns the specified slate. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the stitch detail in the specified VOD session, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodStitchDetails/{id}`. + * Required. The name of the slate to be retrieved, of the slate, in the form + * of `projects/{project_number}/locations/{location}/slates/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodStitchDetail | VodStitchDetail}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.Slate | Slate}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_vod_stitch_detail.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_async + * @example include:samples/generated/v1/video_stitcher_service.get_slate.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetSlate_async */ - getVodStitchDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, + getSlate( + request?: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IGetSlateRequest | undefined, + {} | undefined + ] + >; + getSlate( + request: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + {} | null | undefined + > + ): void; + getSlate( + request: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + callback: Callback< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + {} | null | undefined + > + ): void; + getSlate( + request?: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.stitcher.v1.ISlate, + | protos.google.cloud.video.stitcher.v1.IGetSlateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IGetSlateRequest | 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.getSlate(request, options, callback); + } + /** + * Creates a new live session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location in which the live session should be + * created, in the form of `projects/{project_number}/locations/{location}`. + * @param {google.cloud.video.stitcher.v1.LiveSession} request.liveSession + * Required. Parameters for creating a live session. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.LiveSession | LiveSession}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.create_live_session.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateLiveSession_async + */ + createLiveSession( + request?: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.stitcher.v1.ILiveSession, ( - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | undefined ), {} | undefined ] >; - getVodStitchDetail( - request: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, + createLiveSession( + request: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | null | undefined, {} | null | undefined > ): void; - getVodStitchDetail( - request: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, + createLiveSession( + request: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | null | undefined, {} | null | undefined > ): void; - getVodStitchDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest, + createLiveSession( + request?: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodStitchDetail, + protos.google.cloud.video.stitcher.v1.ILiveSession, ( - | protos.google.cloud.video.stitcher.v1.IGetVodStitchDetailRequest + | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest | undefined ), {} | undefined @@ -1064,88 +1302,82 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getVodStitchDetail(request, options, callback); + return this.innerApiCalls.createLiveSession(request, options, callback); } /** - * Returns the specified ad tag detail for the specified VOD session. + * Returns the details for the specified live session. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the ad tag detail for the specified VOD session, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodAdTagDetails/{vod_ad_tag_detail}`. + * Required. The name of the live session, in the form of + * `projects/{project_number}/locations/{location}/liveSessions/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.VodAdTagDetail | VodAdTagDetail}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.LiveSession | LiveSession}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_vod_ad_tag_detail.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetVodAdTagDetail_async + * @example include:samples/generated/v1/video_stitcher_service.get_live_session.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetLiveSession_async */ - getVodAdTagDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, + getLiveSession( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - ( - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest - | undefined - ), + protos.google.cloud.video.stitcher.v1.ILiveSession, + protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | undefined, {} | undefined ] >; - getVodAdTagDetail( - request: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, + getLiveSession( + request: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | null | undefined, {} | null | undefined > ): void; - getVodAdTagDetail( - request: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, + getLiveSession( + request: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | null | undefined, {} | null | undefined > ): void; - getVodAdTagDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest, + getLiveSession( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveSession, + | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.IVodAdTagDetail, - ( - | protos.google.cloud.video.stitcher.v1.IGetVodAdTagDetailRequest - | undefined - ), + protos.google.cloud.video.stitcher.v1.ILiveSession, + protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | undefined, {} | undefined ] > | void { @@ -1165,85 +1397,334 @@ export class VideoStitcherServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVodAdTagDetail(request, options, callback); + return this.innerApiCalls.getLiveSession(request, options, callback); } /** - * Returns the specified ad tag detail for the specified live session. + * Returns the specified live config managed by the Video + * Stitcher service. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name in the form of - * `projects/{project}/locations/{location}/liveSessions/{live_session}/liveAdTagDetails/{live_ad_tag_detail}`. + * Required. The name of the live config to be retrieved, in the form + * of + * `projects/{project_number}/locations/{location}/liveConfigs/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.LiveAdTagDetail | LiveAdTagDetail}. + * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.LiveConfig | LiveConfig}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_live_ad_tag_detail.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetLiveAdTagDetail_async + * @example include:samples/generated/v1/video_stitcher_service.get_live_config.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_GetLiveConfig_async */ - getLiveAdTagDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, + getLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - ( - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest - | undefined - ), + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | undefined, {} | undefined ] >; - getLiveAdTagDetail( - request: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, + getLiveConfig( + request: protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveConfig, + | protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | null | undefined, {} | null | undefined > ): void; - getLiveAdTagDetail( - request: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, + getLiveConfig( + request: protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveConfig, + | protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | null | undefined, {} | null | undefined > ): void; - getLiveAdTagDetail( - request?: protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest, + getLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveConfig, + | protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest + protos.google.cloud.video.stitcher.v1.ILiveConfig, + | protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail, - ( - | protos.google.cloud.video.stitcher.v1.IGetLiveAdTagDetailRequest - | undefined - ), + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IGetLiveConfigRequest | 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.getLiveConfig(request, options, callback); + } + + /** + * Creates a new CDN key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project in which the CDN key should be created, in the form + * of `projects/{project_number}/locations/{location}`. + * @param {google.cloud.video.stitcher.v1.CdnKey} request.cdnKey + * Required. The CDN key resource to create. + * @param {string} request.cdnKeyId + * Required. The ID to use for the CDN key, which will become the final + * component of the CDN key's resource name. + * + * This value should conform to RFC-1034, which restricts to + * lower-case letters, numbers, and hyphen, with the first character a + * letter, the last a letter or a number, and a 63 character maximum. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.create_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateCdnKey_async + */ + createCdnKey( + request?: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCdnKey( + request: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCdnKey( + request: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCdnKey( + request?: protos.google.cloud.video.stitcher.v1.ICreateCdnKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.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.createCdnKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCdnKey()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.create_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateCdnKey_async + */ + async checkCreateCdnKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.stitcher.v1.CdnKey, + protos.google.cloud.video.stitcher.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.createCdnKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.stitcher.v1.CdnKey, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } + /** + * Deletes the specified CDN key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CDN key to be deleted, in the form of + * `projects/{project_number}/locations/{location}/cdnKeys/{id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.delete_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteCdnKey_async + */ + deleteCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCdnKey( + request: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCdnKey( + request: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IDeleteCdnKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1263,86 +1744,130 @@ export class VideoStitcherServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getLiveAdTagDetail(request, options, callback); + return this.innerApiCalls.deleteCdnKey(request, options, callback); } /** - * Creates a slate. + * Check the status of the long running operation returned by `deleteCdnKey()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.delete_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteCdnKey_async + */ + async checkDeleteCdnKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.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.deleteCdnKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } + /** + * Updates the specified CDN key. Only update fields specified + * in the call method body. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project in which the slate should be created, in the form of - * `projects/{project_number}`. - * @param {string} request.slateId - * Required. The unique identifier for the slate. - * This value should conform to RFC-1034, which restricts to - * lower-case letters, numbers, and hyphen, with the first character a - * letter, the last a letter or a number, and a 63 character maximum. - * @param {google.cloud.video.stitcher.v1.Slate} request.slate - * Required. The slate to create. + * @param {google.cloud.video.stitcher.v1.CdnKey} request.cdnKey + * Required. The CDN key resource which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.Slate | Slate}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.create_slate.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateSlate_async + * @example include:samples/generated/v1/video_stitcher_service.update_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_UpdateCdnKey_async */ - createSlate( - request?: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, + updateCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.ICreateSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - createSlate( - request: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, + updateCdnKey( + request: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.ICreateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createSlate( - request: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, + updateCdnKey( + request: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.ICreateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createSlate( - request?: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, + updateCdnKey( + request?: protos.google.cloud.video.stitcher.v1.IUpdateCdnKeyRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.ICreateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.ICreateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.ICreateSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1359,76 +1884,150 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + 'cdn_key.name': request.cdnKey!.name ?? '', }); this.initialize(); - return this.innerApiCalls.createSlate(request, options, callback); + return this.innerApiCalls.updateCdnKey(request, options, callback); } /** - * Returns the specified slate. + * Check the status of the long running operation returned by `updateCdnKey()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.update_cdn_key.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_UpdateCdnKey_async + */ + async checkUpdateCdnKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.stitcher.v1.CdnKey, + protos.google.cloud.video.stitcher.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.updateCdnKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.stitcher.v1.CdnKey, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } + /** + * Creates a slate. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. The name of the slate to be retrieved, of the slate, in the form of - * `projects/{project_number}/locations/{location}/slates/{id}`. + * @param {string} request.parent + * Required. The project in which the slate should be created, in the form of + * `projects/{project_number}/locations/{location}`. + * @param {string} request.slateId + * Required. The unique identifier for the slate. + * This value should conform to RFC-1034, which restricts to + * lower-case letters, numbers, and hyphen, with the first character a + * letter, the last a letter or a number, and a 63 character maximum. + * @param {google.cloud.video.stitcher.v1.Slate} request.slate + * Required. The slate to create. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.Slate | Slate}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_slate.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetSlate_async + * @example include:samples/generated/v1/video_stitcher_service.create_slate.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateSlate_async */ - getSlate( - request?: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + createSlate( + request?: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IGetSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - getSlate( - request: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + createSlate( + request: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - getSlate( - request: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + createSlate( + request: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - getSlate( - request?: protos.google.cloud.video.stitcher.v1.IGetSlateRequest, + createSlate( + request?: protos.google.cloud.video.stitcher.v1.ICreateSlateRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.IGetSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IGetSlateRequest | null | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IGetSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1445,10 +2044,45 @@ export class VideoStitcherServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getSlate(request, options, callback); + return this.innerApiCalls.createSlate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createSlate()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.create_slate.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateSlate_async + */ + async checkCreateSlateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.stitcher.v1.Slate, + protos.google.cloud.video.stitcher.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.createSlate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.stitcher.v1.Slate, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; } /** * Updates the specified slate. @@ -1462,9 +2096,11 @@ export class VideoStitcherServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.Slate | Slate}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example include:samples/generated/v1/video_stitcher_service.update_slate.js * region_tag:videostitcher_v1_generated_VideoStitcherService_UpdateSlate_async @@ -1474,8 +2110,11 @@ export class VideoStitcherServiceClient { options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; @@ -1483,20 +2122,22 @@ export class VideoStitcherServiceClient { request: protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; updateSlate( request: protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; @@ -1505,23 +2146,28 @@ export class VideoStitcherServiceClient { optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ISlate, - | protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ISlate, - protos.google.cloud.video.stitcher.v1.IUpdateSlateRequest | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1543,6 +2189,41 @@ export class VideoStitcherServiceClient { this.initialize(); return this.innerApiCalls.updateSlate(request, options, callback); } + /** + * Check the status of the long running operation returned by `updateSlate()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.update_slate.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_UpdateSlate_async + */ + async checkUpdateSlateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.stitcher.v1.Slate, + protos.google.cloud.video.stitcher.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.updateSlate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.stitcher.v1.Slate, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } /** * Deletes the specified slate. * @@ -1554,9 +2235,11 @@ export class VideoStitcherServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.protobuf.Empty | Empty}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example include:samples/generated/v1/video_stitcher_service.delete_slate.js * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteSlate_async @@ -1566,8 +2249,11 @@ export class VideoStitcherServiceClient { options?: CallOptions ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; @@ -1575,20 +2261,22 @@ export class VideoStitcherServiceClient { request: protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest, options: CallOptions, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; deleteSlate( request: protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; @@ -1597,23 +2285,28 @@ export class VideoStitcherServiceClient { optionsOrCallback?: | CallOptions | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.cloud.video.stitcher.v1.IDeleteSlateRequest | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1636,84 +2329,142 @@ export class VideoStitcherServiceClient { return this.innerApiCalls.deleteSlate(request, options, callback); } /** - * Creates a new live session. + * Check the status of the long running operation returned by `deleteSlate()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.delete_slate.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteSlate_async + */ + async checkDeleteSlateProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.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.deleteSlate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } + /** + * Registers the live config with the provided unique ID in + * the specified region. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location in which the live session should be created, - * in the form of `projects/{project_number}/locations/{location}`. - * @param {google.cloud.video.stitcher.v1.LiveSession} request.liveSession - * Required. Parameters for creating a live session. + * Required. The project in which the live config should be created, in + * the form of `projects/{project_number}/locations/{location}`. + * @param {string} request.liveConfigId + * Required. The unique identifier ID to use for the live config. + * @param {google.cloud.video.stitcher.v1.LiveConfig} request.liveConfig + * Required. The live config resource to create. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.video.stitcher.v1.LiveSession | LiveSession}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.create_live_session.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateLiveSession_async + * @example include:samples/generated/v1/video_stitcher_service.create_live_config.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_async */ - createLiveSession( - request?: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, + createLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveSession, - ( - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | undefined - ), + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - createLiveSession( - request: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, + createLiveConfig( + request: protos.google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createLiveSession( - request: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, + createLiveConfig( + request: protos.google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createLiveSession( - request?: protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest, + createLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.ICreateLiveConfigRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveSession, - ( - | protos.google.cloud.video.stitcher.v1.ICreateLiveSessionRequest - | undefined - ), + LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1733,79 +2484,126 @@ export class VideoStitcherServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createLiveSession(request, options, callback); + return this.innerApiCalls.createLiveConfig(request, options, callback); } /** - * Returns the details for the specified live session. + * Check the status of the long running operation returned by `createLiveConfig()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.create_live_config.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_async + */ + async checkCreateLiveConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.stitcher.v1.LiveConfig, + protos.google.cloud.video.stitcher.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.createLiveConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.stitcher.v1.LiveConfig, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; + } + /** + * Deletes the specified live config. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the live session, in the form of - * `projects/{project_number}/locations/{location}/liveSessions/{id}`. + * Required. The name of the live config to be deleted, in the form of + * `projects/{project_number}/locations/{location}/liveConfigs/{id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.video.stitcher.v1.LiveSession | LiveSession}. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/video_stitcher_service.get_live_session.js - * region_tag:videostitcher_v1_generated_VideoStitcherService_GetLiveSession_async + * @example include:samples/generated/v1/video_stitcher_service.delete_live_config.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteLiveConfig_async */ - getLiveSession( - request?: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, + deleteLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveSession, - protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - getLiveSession( - request: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, + deleteLiveConfig( + request: protos.google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, options: CallOptions, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - getLiveSession( - request: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, + deleteLiveConfig( + request: protos.google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, callback: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - getLiveSession( - request?: protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest, + deleteLiveConfig( + request?: protos.google.cloud.video.stitcher.v1.IDeleteLiveConfigRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.video.stitcher.v1.ILiveSession, - | protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest - | null - | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.video.stitcher.v1.ILiveSession, - protos.google.cloud.video.stitcher.v1.IGetLiveSessionRequest | undefined, + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1825,9 +2623,43 @@ export class VideoStitcherServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getLiveSession(request, options, callback); + return this.innerApiCalls.deleteLiveConfig(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteLiveConfig()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.delete_live_config.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_DeleteLiveConfig_async + */ + async checkDeleteLiveConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.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.deleteLiveConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.stitcher.v1.OperationMetadata + >; } - /** * Lists all CDN keys in the specified project and location. * @@ -2042,8 +2874,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session where the stitch details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{id}`. + * Required. The VOD session where the stitch details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2141,8 +2973,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session where the stitch details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{id}`. + * Required. The VOD session where the stitch details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2188,8 +3020,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session where the stitch details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{id}`. + * Required. The VOD session where the stitch details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2234,8 +3066,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session which the ad tag details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. + * Required. The VOD session which the ad tag details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2333,8 +3165,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session which the ad tag details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. + * Required. The VOD session which the ad tag details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2380,8 +3212,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The VOD session which the ad tag details belong to, in the form of - * `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. + * Required. The VOD session which the ad tag details belong to, in the form + * of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2618,7 +3450,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project to list slates, in the form of `projects/{project_number}`. + * Required. The project to list slates, in the form of + * `projects/{project_number}/locations/{location}`. * @param {number} request.pageSize * Requested page size. Server may return fewer items than requested. * If unspecified, server will pick an appropriate default. @@ -2721,7 +3554,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project to list slates, in the form of `projects/{project_number}`. + * Required. The project to list slates, in the form of + * `projects/{project_number}/locations/{location}`. * @param {number} request.pageSize * Requested page size. Server may return fewer items than requested. * If unspecified, server will pick an appropriate default. @@ -2772,7 +3606,8 @@ export class VideoStitcherServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project to list slates, in the form of `projects/{project_number}`. + * Required. The project to list slates, in the form of + * `projects/{project_number}/locations/{location}`. * @param {number} request.pageSize * Requested page size. Server may return fewer items than requested. * If unspecified, server will pick an appropriate default. @@ -2816,6 +3651,395 @@ export class VideoStitcherServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists all live configs managed by the Video Stitcher that + * belong to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that contains the list of live configs, in the + * form of `projects/{project_number}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.video.stitcher.v1.LiveConfig | LiveConfig}. + * 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 `listLiveConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLiveConfigs( + request?: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.stitcher.v1.ILiveConfig[], + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest | null, + protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + ] + >; + listLiveConfigs( + request: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + | protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + | null + | undefined, + protos.google.cloud.video.stitcher.v1.ILiveConfig + > + ): void; + listLiveConfigs( + request: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + | protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + | null + | undefined, + protos.google.cloud.video.stitcher.v1.ILiveConfig + > + ): void; + listLiveConfigs( + request?: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + | protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + | null + | undefined, + protos.google.cloud.video.stitcher.v1.ILiveConfig + >, + callback?: PaginationCallback< + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + | protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + | null + | undefined, + protos.google.cloud.video.stitcher.v1.ILiveConfig + > + ): Promise< + [ + protos.google.cloud.video.stitcher.v1.ILiveConfig[], + protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest | null, + protos.google.cloud.video.stitcher.v1.IListLiveConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listLiveConfigs(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 project that contains the list of live configs, in the + * form of `projects/{project_number}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @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 google.cloud.video.stitcher.v1.LiveConfig | LiveConfig} 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 `listLiveConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLiveConfigsStream( + request?: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + 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['listLiveConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLiveConfigs.createStream( + this.innerApiCalls.listLiveConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listLiveConfigs`, 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 project that contains the list of live configs, in the + * form of `projects/{project_number}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results (see + * [Filtering](https://google.aip.dev/160)). + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following + * [Cloud API + * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.video.stitcher.v1.LiveConfig | LiveConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/video_stitcher_service.list_live_configs.js + * region_tag:videostitcher_v1_generated_VideoStitcherService_ListLiveConfigs_async + */ + listLiveConfigsAsync( + request?: protos.google.cloud.video.stitcher.v1.IListLiveConfigsRequest, + 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['listLiveConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLiveConfigs.asyncIterate( + this.innerApiCalls['listLiveConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 -- // -------------------- @@ -2944,6 +4168,58 @@ export class VideoStitcherServiceClient { ).live_ad_tag_detail; } + /** + * Return a fully-qualified liveConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} live_config + * @returns {string} Resource name string. + */ + liveConfigPath(project: string, location: string, liveConfig: string) { + return this.pathTemplates.liveConfigPathTemplate.render({ + project: project, + location: location, + live_config: liveConfig, + }); + } + + /** + * Parse the project from LiveConfig resource. + * + * @param {string} liveConfigName + * A fully-qualified path representing LiveConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLiveConfigName(liveConfigName: string) { + return this.pathTemplates.liveConfigPathTemplate.match(liveConfigName) + .project; + } + + /** + * Parse the location from LiveConfig resource. + * + * @param {string} liveConfigName + * A fully-qualified path representing LiveConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLiveConfigName(liveConfigName: string) { + return this.pathTemplates.liveConfigPathTemplate.match(liveConfigName) + .location; + } + + /** + * Parse the live_config from LiveConfig resource. + * + * @param {string} liveConfigName + * A fully-qualified path representing LiveConfig resource. + * @returns {string} A string representing the live_config. + */ + matchLiveConfigFromLiveConfigName(liveConfigName: string) { + return this.pathTemplates.liveConfigPathTemplate.match(liveConfigName) + .live_config; + } + /** * Return a fully-qualified liveSession resource name string. * @@ -3317,6 +4593,7 @@ export class VideoStitcherServiceClient { return this.videoStitcherServiceStub.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client_config.json b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client_config.json index 691ca37cb935..b9fe3e0a69b7 100644 --- a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client_config.json +++ b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,6 +20,15 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { @@ -119,6 +131,26 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateLiveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListLiveConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetLiveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteLiveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_proto_list.json b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_proto_list.json index c3a399051314..0c5c1421b3b4 100644 --- a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_proto_list.json +++ b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_proto_list.json @@ -3,6 +3,7 @@ "../../protos/google/cloud/video/stitcher/v1/cdn_keys.proto", "../../protos/google/cloud/video/stitcher/v1/companions.proto", "../../protos/google/cloud/video/stitcher/v1/events.proto", + "../../protos/google/cloud/video/stitcher/v1/live_configs.proto", "../../protos/google/cloud/video/stitcher/v1/sessions.proto", "../../protos/google/cloud/video/stitcher/v1/slates.proto", "../../protos/google/cloud/video/stitcher/v1/stitch_details.proto", diff --git a/packages/google-cloud-video-stitcher/test/gapic_video_stitcher_service_v1.ts b/packages/google-cloud-video-stitcher/test/gapic_video_stitcher_service_v1.ts index 354d13c00172..4481e86bd2cd 100644 --- a/packages/google-cloud-video-stitcher/test/gapic_video_stitcher_service_v1.ts +++ b/packages/google-cloud-video-stitcher/test/gapic_video_stitcher_service_v1.ts @@ -25,7 +25,7 @@ import * as videostitcherserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -66,6 +66,38 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + function stubPageStreamingCall( responses?: ResponseType[], error?: Error @@ -235,8 +267,8 @@ describe('v1.VideoStitcherServiceClient', () => { }); }); - describe('createCdnKey', () => { - it('invokes createCdnKey without error', async () => { + describe('getCdnKey', () => { + it('invokes getCdnKey without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -244,31 +276,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.video.stitcher.v1.CdnKey() ); - client.innerApiCalls.createCdnKey = stubSimpleCall(expectedResponse); - const [response] = await client.createCdnKey(request); + client.innerApiCalls.getCdnKey = stubSimpleCall(expectedResponse); + const [response] = await client.getCdnKey(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCdnKey without error using callback', async () => { + it('invokes getCdnKey without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -276,21 +308,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.video.stitcher.v1.CdnKey() ); - client.innerApiCalls.createCdnKey = + client.innerApiCalls.getCdnKey = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createCdnKey( + client.getCdnKey( request, ( err?: Error | null, @@ -307,16 +339,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCdnKey with error', async () => { + it('invokes getCdnKey with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -324,31 +356,28 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createCdnKey = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createCdnKey(request), expectedError); + client.innerApiCalls.getCdnKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCdnKey(request), expectedError); const actualRequest = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCdnKey as SinonStub + client.innerApiCalls.getCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCdnKey with closed client', async () => { + it('invokes getCdnKey with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -356,21 +385,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', + ['name'] ); - request.parent = defaultValue1; + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.createCdnKey(request), expectedError); + await assert.rejects(client.getCdnKey(request), expectedError); }); }); - describe('getCdnKey', () => { - it('invokes getCdnKey without error', async () => { + describe('createVodSession', () => { + it('invokes createVodSession without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -378,31 +407,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodSession() ); - client.innerApiCalls.getCdnKey = stubSimpleCall(expectedResponse); - const [response] = await client.getCdnKey(request); + client.innerApiCalls.createVodSession = stubSimpleCall(expectedResponse); + const [response] = await client.createVodSession(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getCdnKey without error using callback', async () => { + it('invokes createVodSession without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -410,25 +439,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodSession() ); - client.innerApiCalls.getCdnKey = + client.innerApiCalls.createVodSession = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getCdnKey( + client.createVodSession( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ICdnKey | null + result?: protos.google.cloud.video.stitcher.v1.IVodSession | null ) => { if (err) { reject(err); @@ -441,16 +470,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getCdnKey with error', async () => { + it('invokes createVodSession with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -458,28 +487,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getCdnKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCdnKey(request), expectedError); + client.innerApiCalls.createVodSession = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createVodSession(request), expectedError); const actualRequest = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getCdnKey as SinonStub + client.innerApiCalls.createVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getCdnKey with closed client', async () => { + it('invokes createVodSession with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -487,21 +519,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetCdnKeyRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', + ['parent'] ); - request.name = defaultValue1; + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getCdnKey(request), expectedError); + await assert.rejects(client.createVodSession(request), expectedError); }); }); - describe('deleteCdnKey', () => { - it('invokes deleteCdnKey without error', async () => { + describe('getVodSession', () => { + it('invokes getVodSession without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -509,31 +541,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', + '.google.cloud.video.stitcher.v1.GetVodSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.video.stitcher.v1.VodSession() ); - client.innerApiCalls.deleteCdnKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCdnKey(request); + client.innerApiCalls.getVodSession = stubSimpleCall(expectedResponse); + const [response] = await client.getVodSession(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCdnKey without error using callback', async () => { + it('invokes getVodSession without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -541,25 +573,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', + '.google.cloud.video.stitcher.v1.GetVodSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.video.stitcher.v1.VodSession() ); - client.innerApiCalls.deleteCdnKey = + client.innerApiCalls.getVodSession = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteCdnKey( + client.getVodSession( request, ( err?: Error | null, - result?: protos.google.protobuf.IEmpty | null + result?: protos.google.cloud.video.stitcher.v1.IVodSession | null ) => { if (err) { reject(err); @@ -572,16 +604,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCdnKey with error', async () => { + it('invokes getVodSession with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -589,31 +621,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', + '.google.cloud.video.stitcher.v1.GetVodSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCdnKey = stubSimpleCall( + client.innerApiCalls.getVodSession = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.deleteCdnKey(request), expectedError); + await assert.rejects(client.getVodSession(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCdnKey as SinonStub + client.innerApiCalls.getVodSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCdnKey with closed client', async () => { + it('invokes getVodSession with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -621,21 +653,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', + '.google.cloud.video.stitcher.v1.GetVodSessionRequest', ['name'] ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.deleteCdnKey(request), expectedError); + await assert.rejects(client.getVodSession(request), expectedError); }); }); - describe('updateCdnKey', () => { - it('invokes updateCdnKey without error', async () => { + describe('getVodStitchDetail', () => { + it('invokes getVodStitchDetail without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -643,32 +675,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() ); - request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', - ['cdnKey', 'name'] + '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + ['name'] ); - request.cdnKey.name = defaultValue1; - const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() ); - client.innerApiCalls.updateCdnKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateCdnKey(request); + client.innerApiCalls.getVodStitchDetail = + stubSimpleCall(expectedResponse); + const [response] = await client.getVodStitchDetail(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCdnKey without error using callback', async () => { + it('invokes getVodStitchDetail without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -676,26 +708,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() ); - request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', - ['cdnKey', 'name'] + '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + ['name'] ); - request.cdnKey.name = defaultValue1; - const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() ); - client.innerApiCalls.updateCdnKey = + client.innerApiCalls.getVodStitchDetail = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateCdnKey( + client.getVodStitchDetail( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ICdnKey | null + result?: protos.google.cloud.video.stitcher.v1.IVodStitchDetail | null ) => { if (err) { reject(err); @@ -708,16 +739,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCdnKey with error', async () => { + it('invokes getVodStitchDetail with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -725,32 +756,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() ); - request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', - ['cdnKey', 'name'] + '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + ['name'] ); - request.cdnKey.name = defaultValue1; - const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateCdnKey = stubSimpleCall( + client.innerApiCalls.getVodStitchDetail = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateCdnKey(request), expectedError); + await assert.rejects(client.getVodStitchDetail(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCdnKey as SinonStub + client.innerApiCalls.getVodStitchDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCdnKey with closed client', async () => { + it('invokes getVodStitchDetail with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -758,22 +788,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() + new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() ); - request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', - ['cdnKey', 'name'] + '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + ['name'] ); - request.cdnKey.name = defaultValue1; + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.updateCdnKey(request), expectedError); + await assert.rejects(client.getVodStitchDetail(request), expectedError); }); }); - describe('createVodSession', () => { - it('invokes createVodSession without error', async () => { + describe('getVodAdTagDetail', () => { + it('invokes getVodAdTagDetail without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -781,31 +810,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodSession() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ); - client.innerApiCalls.createVodSession = stubSimpleCall(expectedResponse); - const [response] = await client.createVodSession(request); + client.innerApiCalls.getVodAdTagDetail = stubSimpleCall(expectedResponse); + const [response] = await client.getVodAdTagDetail(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createVodSession without error using callback', async () => { + it('invokes getVodAdTagDetail without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -813,25 +842,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodSession() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ); - client.innerApiCalls.createVodSession = + client.innerApiCalls.getVodAdTagDetail = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createVodSession( + client.getVodAdTagDetail( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.IVodSession | null + result?: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail | null ) => { if (err) { reject(err); @@ -844,16 +873,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createVodSession with error', async () => { + it('invokes getVodAdTagDetail with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -861,31 +890,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createVodSession = stubSimpleCall( + client.innerApiCalls.getVodAdTagDetail = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createVodSession(request), expectedError); + await assert.rejects(client.getVodAdTagDetail(request), expectedError); const actualRequest = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createVodSession as SinonStub + client.innerApiCalls.getVodAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createVodSession with closed client', async () => { + it('invokes getVodAdTagDetail with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -893,21 +922,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateVodSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', + ['name'] ); - request.parent = defaultValue1; + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.createVodSession(request), expectedError); + await assert.rejects(client.getVodAdTagDetail(request), expectedError); }); }); - describe('getVodSession', () => { - it('invokes getVodSession without error', async () => { + describe('getLiveAdTagDetail', () => { + it('invokes getLiveAdTagDetail without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -915,31 +944,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodSessionRequest', + '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodSession() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ); - client.innerApiCalls.getVodSession = stubSimpleCall(expectedResponse); - const [response] = await client.getVodSession(request); + client.innerApiCalls.getLiveAdTagDetail = + stubSimpleCall(expectedResponse); + const [response] = await client.getLiveAdTagDetail(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodSession without error using callback', async () => { + it('invokes getLiveAdTagDetail without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -947,25 +977,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodSessionRequest', + '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodSession() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ); - client.innerApiCalls.getVodSession = + client.innerApiCalls.getLiveAdTagDetail = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getVodSession( + client.getLiveAdTagDetail( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.IVodSession | null + result?: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail | null ) => { if (err) { reject(err); @@ -978,16 +1008,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodSession with error', async () => { + it('invokes getLiveAdTagDetail with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -995,31 +1025,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodSessionRequest', + '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getVodSession = stubSimpleCall( + client.innerApiCalls.getLiveAdTagDetail = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getVodSession(request), expectedError); + await assert.rejects(client.getLiveAdTagDetail(request), expectedError); const actualRequest = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodSession as SinonStub + client.innerApiCalls.getLiveAdTagDetail as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodSession with closed client', async () => { + it('invokes getLiveAdTagDetail with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1027,21 +1057,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodSessionRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodSessionRequest', + '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', ['name'] ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getVodSession(request), expectedError); + await assert.rejects(client.getLiveAdTagDetail(request), expectedError); }); }); - describe('getVodStitchDetail', () => { - it('invokes getVodStitchDetail without error', async () => { + describe('getSlate', () => { + it('invokes getSlate without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1049,32 +1079,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + '.google.cloud.video.stitcher.v1.GetSlateRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ); - client.innerApiCalls.getVodStitchDetail = - stubSimpleCall(expectedResponse); - const [response] = await client.getVodStitchDetail(request); + client.innerApiCalls.getSlate = stubSimpleCall(expectedResponse); + const [response] = await client.getSlate(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodStitchDetail without error using callback', async () => { + it('invokes getSlate without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1082,25 +1111,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + '.google.cloud.video.stitcher.v1.GetSlateRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ); - client.innerApiCalls.getVodStitchDetail = + client.innerApiCalls.getSlate = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getVodStitchDetail( + client.getSlate( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.IVodStitchDetail | null + result?: protos.google.cloud.video.stitcher.v1.ISlate | null ) => { if (err) { reject(err); @@ -1113,16 +1142,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodStitchDetail with error', async () => { + it('invokes getSlate with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1130,31 +1159,28 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + '.google.cloud.video.stitcher.v1.GetSlateRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getVodStitchDetail = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.getVodStitchDetail(request), expectedError); + client.innerApiCalls.getSlate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSlate(request), expectedError); const actualRequest = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodStitchDetail as SinonStub + client.innerApiCalls.getSlate as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodStitchDetail with closed client', async () => { + it('invokes getSlate with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1162,21 +1188,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodStitchDetailRequest', + '.google.cloud.video.stitcher.v1.GetSlateRequest', ['name'] ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getVodStitchDetail(request), expectedError); + await assert.rejects(client.getSlate(request), expectedError); }); }); - describe('getVodAdTagDetail', () => { - it('invokes getVodAdTagDetail without error', async () => { + describe('createLiveSession', () => { + it('invokes createLiveSession without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1184,31 +1210,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveSession() ); - client.innerApiCalls.getVodAdTagDetail = stubSimpleCall(expectedResponse); - const [response] = await client.getVodAdTagDetail(request); + client.innerApiCalls.createLiveSession = stubSimpleCall(expectedResponse); + const [response] = await client.createLiveSession(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodAdTagDetail without error using callback', async () => { + it('invokes createLiveSession without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1216,25 +1242,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveSession() ); - client.innerApiCalls.getVodAdTagDetail = + client.innerApiCalls.createLiveSession = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getVodAdTagDetail( + client.createLiveSession( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail | null + result?: protos.google.cloud.video.stitcher.v1.ILiveSession | null ) => { if (err) { reject(err); @@ -1247,16 +1273,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodAdTagDetail with error', async () => { + it('invokes createLiveSession with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1264,31 +1290,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getVodAdTagDetail = stubSimpleCall( + client.innerApiCalls.createLiveSession = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getVodAdTagDetail(request), expectedError); + await assert.rejects(client.createLiveSession(request), expectedError); const actualRequest = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getVodAdTagDetail as SinonStub + client.innerApiCalls.createLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getVodAdTagDetail with closed client', async () => { + it('invokes createLiveSession with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1296,21 +1322,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetVodAdTagDetailRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', + ['parent'] ); - request.name = defaultValue1; + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getVodAdTagDetail(request), expectedError); + await assert.rejects(client.createLiveSession(request), expectedError); }); }); - describe('getLiveAdTagDetail', () => { - it('invokes getLiveAdTagDetail without error', async () => { + describe('getLiveSession', () => { + it('invokes getLiveSession without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1318,32 +1344,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', + '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveSession() ); - client.innerApiCalls.getLiveAdTagDetail = - stubSimpleCall(expectedResponse); - const [response] = await client.getLiveAdTagDetail(request); + client.innerApiCalls.getLiveSession = stubSimpleCall(expectedResponse); + const [response] = await client.getLiveSession(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveAdTagDetail without error using callback', async () => { + it('invokes getLiveSession without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1351,25 +1376,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', + '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveSession() ); - client.innerApiCalls.getLiveAdTagDetail = + client.innerApiCalls.getLiveSession = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getLiveAdTagDetail( + client.getLiveSession( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail | null + result?: protos.google.cloud.video.stitcher.v1.ILiveSession | null ) => { if (err) { reject(err); @@ -1382,16 +1407,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveAdTagDetail with error', async () => { + it('invokes getLiveSession with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1399,31 +1424,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', + '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getLiveAdTagDetail = stubSimpleCall( + client.innerApiCalls.getLiveSession = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getLiveAdTagDetail(request), expectedError); + await assert.rejects(client.getLiveSession(request), expectedError); const actualRequest = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveAdTagDetail as SinonStub + client.innerApiCalls.getLiveSession as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveAdTagDetail with closed client', async () => { + it('invokes getLiveSession with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1431,21 +1456,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveAdTagDetailRequest', + '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', ['name'] ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getLiveAdTagDetail(request), expectedError); + await assert.rejects(client.getLiveSession(request), expectedError); }); }); - describe('createSlate', () => { - it('invokes createSlate without error', async () => { + describe('getLiveConfig', () => { + it('invokes getLiveConfig without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1453,31 +1478,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateSlateRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetLiveConfigRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ); - client.innerApiCalls.createSlate = stubSimpleCall(expectedResponse); - const [response] = await client.createSlate(request); + client.innerApiCalls.getLiveConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getLiveConfig(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSlate without error using callback', async () => { + it('invokes getLiveConfig without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1485,25 +1510,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateSlateRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetLiveConfigRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ); - client.innerApiCalls.createSlate = + client.innerApiCalls.getLiveConfig = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSlate( + client.getLiveConfig( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ISlate | null + result?: protos.google.cloud.video.stitcher.v1.ILiveConfig | null ) => { if (err) { reject(err); @@ -1516,16 +1541,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSlate with error', async () => { + it('invokes getLiveConfig with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1533,31 +1558,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateSlateRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetLiveConfigRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSlate = stubSimpleCall( + client.innerApiCalls.getLiveConfig = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createSlate(request), expectedError); + await assert.rejects(client.getLiveConfig(request), expectedError); const actualRequest = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSlate as SinonStub + client.innerApiCalls.getLiveConfig as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSlate with closed client', async () => { + it('invokes getLiveConfig with closed client', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1565,21 +1590,21 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + new protos.google.cloud.video.stitcher.v1.GetLiveConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateSlateRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.GetLiveConfigRequest', + ['name'] ); - request.parent = defaultValue1; + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.createSlate(request), expectedError); + await assert.rejects(client.getLiveConfig(request), expectedError); }); }); - describe('getSlate', () => { - it('invokes getSlate without error', async () => { + describe('createCdnKey', () => { + it('invokes createCdnKey without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1587,31 +1612,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetSlateRequest() + new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetSlateRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getSlate = stubSimpleCall(expectedResponse); - const [response] = await client.getSlate(request); + client.innerApiCalls.createCdnKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCdnKey(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getSlate without error using callback', async () => { + it('invokes createCdnKey without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1619,25 +1645,28 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetSlateRequest() + new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetSlateRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getSlate = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.createCdnKey = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getSlate( + client.createCdnKey( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ISlate | null + result?: LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -1647,19 +1676,23 @@ describe('v1.VideoStitcherServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getSlate with error', async () => { + it('invokes createCdnKey with call error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1667,28 +1700,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetSlateRequest() + new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetSlateRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.getSlate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSlate(request), expectedError); + client.innerApiCalls.createCdnKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCdnKey(request), expectedError); const actualRequest = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getSlate with closed client', async () => { + it('invokes createCdnKey with LRO error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1696,159 +1732,75 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetSlateRequest() + new protos.google.cloud.video.stitcher.v1.CreateCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetSlateRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateCdnKeyRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSlate(request), expectedError); - }); - }); - - describe('updateSlate', () => { - it('invokes updateSlate without error', async () => { - const client = - new videostitcherserviceModule.v1.VideoStitcherServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() - ); - request.slate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateSlateRequest', - ['slate', 'name'] - ); - request.slate.name = defaultValue1; - const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCdnKey = stubLongRunningCall( + undefined, + undefined, + expectedError ); - client.innerApiCalls.updateSlate = stubSimpleCall(expectedResponse); - const [response] = await client.updateSlate(request); - assert.deepStrictEqual(response, expectedResponse); + const [operation] = await client.createCdnKey(request); + await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateSlate as SinonStub + client.innerApiCalls.createCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateSlate without error using callback', async () => { + it('invokes checkCreateCdnKeyProgress without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() - ); - request.slate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateSlateRequest', - ['slate', 'name'] - ); - request.slate.name = defaultValue1; - const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new operationsProtos.google.longrunning.Operation() ); - client.innerApiCalls.updateSlate = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSlate( - request, - ( - err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ISlate | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateSlate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateSlate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + 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.checkCreateCdnKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes updateSlate with error', async () => { + it('invokes checkCreateCdnKeyProgress with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() - ); - request.slate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateSlateRequest', - ['slate', 'name'] - ); - request.slate.name = defaultValue1; - const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateSlate = stubSimpleCall( + + client.operationsClient.getOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateSlate(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateSlate as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateSlate as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSlate with closed client', async () => { - const client = - new videostitcherserviceModule.v1.VideoStitcherServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() - ); - request.slate ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.UpdateSlateRequest', - ['slate', 'name'] - ); - request.slate.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSlate(request), expectedError); + await assert.rejects(client.checkCreateCdnKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteSlate', () => { - it('invokes deleteSlate without error', async () => { + describe('deleteCdnKey', () => { + it('invokes deleteCdnKey without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1856,31 +1808,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteSlate = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSlate(request); + client.innerApiCalls.deleteCdnKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCdnKey(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSlate without error using callback', async () => { + it('invokes deleteCdnKey without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1888,25 +1841,28 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteSlate = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.deleteCdnKey = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteSlate( + client.deleteCdnKey( request, ( err?: Error | null, - result?: protos.google.protobuf.IEmpty | null + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -1916,19 +1872,23 @@ describe('v1.VideoStitcherServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSlate with error', async () => { + it('invokes deleteCdnKey with call error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1936,31 +1896,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteSlate = stubSimpleCall( + client.innerApiCalls.deleteCdnKey = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteSlate(request), expectedError); + await assert.rejects(client.deleteCdnKey(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSlate as SinonStub + client.innerApiCalls.deleteCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSlate with closed client', async () => { + it('invokes deleteCdnKey with LRO error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1968,21 +1928,75 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + new protos.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + '.google.cloud.video.stitcher.v1.DeleteCdnKeyRequest', ['name'] ); request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSlate(request), expectedError); + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCdnKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCdnKey(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCdnKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCdnKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCdnKeyProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteCdnKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCdnKeyProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteCdnKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createLiveSession', () => { - it('invokes createLiveSession without error', async () => { + describe('updateCdnKey', () => { + it('invokes updateCdnKey without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1990,31 +2004,33 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() ); + request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', + ['cdnKey', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cdnKey.name = defaultValue1; + const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveSession() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.createLiveSession = stubSimpleCall(expectedResponse); - const [response] = await client.createLiveSession(request); + client.innerApiCalls.updateCdnKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCdnKey(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createLiveSession without error using callback', async () => { + it('invokes updateCdnKey without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2022,25 +2038,29 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() ); + request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', + ['cdnKey', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cdnKey.name = defaultValue1; + const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveSession() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.createLiveSession = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.updateCdnKey = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createLiveSession( + client.updateCdnKey( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ILiveSession | null + result?: LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -2050,19 +2070,23 @@ describe('v1.VideoStitcherServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.video.stitcher.v1.ICdnKey, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createLiveSession with error', async () => { + it('invokes updateCdnKey with call error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2070,31 +2094,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() ); + request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', + ['cdnKey', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cdnKey.name = defaultValue1; + const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createLiveSession = stubSimpleCall( + client.innerApiCalls.updateCdnKey = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createLiveSession(request), expectedError); + await assert.rejects(client.updateCdnKey(request), expectedError); const actualRequest = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createLiveSession as SinonStub + client.innerApiCalls.updateCdnKey as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createLiveSession with closed client', async () => { + it('invokes updateCdnKey with LRO error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2102,21 +2127,76 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CreateLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest() ); + request.cdnKey ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.CreateLiveSessionRequest', - ['parent'] + '.google.cloud.video.stitcher.v1.UpdateCdnKeyRequest', + ['cdnKey', 'name'] ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createLiveSession(request), expectedError); + request.cdnKey.name = defaultValue1; + const expectedHeaderRequestParams = `cdn_key.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCdnKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCdnKey(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCdnKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCdnKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCdnKeyProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkUpdateCdnKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCdnKeyProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkUpdateCdnKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('getLiveSession', () => { - it('invokes getLiveSession without error', async () => { + describe('createSlate', () => { + it('invokes createSlate without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2124,31 +2204,32 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateSlateRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveSession() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getLiveSession = stubSimpleCall(expectedResponse); - const [response] = await client.getLiveSession(request); + client.innerApiCalls.createSlate = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSlate(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getLiveSession as SinonStub + client.innerApiCalls.createSlate as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveSession as SinonStub + client.innerApiCalls.createSlate as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveSession without error using callback', async () => { + it('invokes createSlate without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2156,25 +2237,28 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', - ['name'] + '.google.cloud.video.stitcher.v1.CreateSlateRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveSession() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getLiveSession = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.createSlate = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getLiveSession( + client.createSlate( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ILiveSession | null + result?: LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -2184,19 +2268,1507 @@ describe('v1.VideoStitcherServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.getLiveSession as SinonStub + client.innerApiCalls.createSlate as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveSession as SinonStub + client.innerApiCalls.createSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSlate with call error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateSlateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSlate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createSlate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSlate with LRO error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateSlateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSlate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createSlate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSlateProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkCreateSlateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSlateProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkCreateSlateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSlate', () => { + it('invokes updateSlate without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() + ); + request.slate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.UpdateSlateRequest', + ['slate', 'name'] + ); + request.slate.name = defaultValue1; + const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSlate = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSlate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSlate as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveSession with error', async () => { + it('invokes updateSlate without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() + ); + request.slate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.UpdateSlateRequest', + ['slate', 'name'] + ); + request.slate.name = defaultValue1; + const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSlate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSlate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.stitcher.v1.ISlate, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSlate with call error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() + ); + request.slate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.UpdateSlateRequest', + ['slate', 'name'] + ); + request.slate.name = defaultValue1; + const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSlate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSlate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSlate with LRO error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.UpdateSlateRequest() + ); + request.slate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.UpdateSlateRequest', + ['slate', 'name'] + ); + request.slate.name = defaultValue1; + const expectedHeaderRequestParams = `slate.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSlate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateSlate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSlateProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkUpdateSlateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSlateProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkUpdateSlateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSlate', () => { + it('invokes deleteSlate without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSlate = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSlate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSlate without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSlate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSlate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSlate with call error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSlate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSlate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSlate with LRO error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteSlateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteSlateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSlate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteSlate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSlate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSlateProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteSlateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSlateProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteSlateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createLiveConfig', () => { + it('invokes createLiveConfig without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateLiveConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createLiveConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createLiveConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLiveConfig without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateLiveConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createLiveConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createLiveConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.stitcher.v1.ILiveConfig, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLiveConfig with call error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateLiveConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLiveConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createLiveConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLiveConfig with LRO error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CreateLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.CreateLiveConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLiveConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createLiveConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateLiveConfigProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkCreateLiveConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateLiveConfigProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkCreateLiveConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteLiveConfig', () => { + it('invokes deleteLiveConfig without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteLiveConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteLiveConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLiveConfig without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteLiveConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLiveConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.stitcher.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLiveConfig with call error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLiveConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteLiveConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLiveConfig with LRO error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.DeleteLiveConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLiveConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteLiveConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLiveConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteLiveConfigProgress without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteLiveConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteLiveConfigProgress with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.checkDeleteLiveConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCdnKeys', () => { + it('invokes listCdnKeys without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + ]; + client.innerApiCalls.listCdnKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listCdnKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCdnKeys without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + ]; + client.innerApiCalls.listCdnKeys = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCdnKeys( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.stitcher.v1.ICdnKey[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCdnKeys with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCdnKeys = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCdnKeys(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCdnKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCdnKeysStream without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + ]; + client.descriptors.page.listCdnKeys.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCdnKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.stitcher.v1.CdnKey[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.stitcher.v1.CdnKey) => { + 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.listCdnKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCdnKeys, request) + ); + assert( + (client.descriptors.page.listCdnKeys.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCdnKeysStream with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCdnKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCdnKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.stitcher.v1.CdnKey[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.stitcher.v1.CdnKey) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCdnKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCdnKeys, request) + ); + assert( + (client.descriptors.page.listCdnKeys.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCdnKeys without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.CdnKey() + ), + ]; + client.descriptors.page.listCdnKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.stitcher.v1.ICdnKey[] = []; + const iterable = client.listCdnKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCdnKeys with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCdnKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCdnKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.stitcher.v1.ICdnKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVodStitchDetails', () => { + it('invokes listVodStitchDetails without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + ]; + client.innerApiCalls.listVodStitchDetails = + stubSimpleCall(expectedResponse); + const [response] = await client.listVodStitchDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVodStitchDetails without error using callback', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + ]; + client.innerApiCalls.listVodStitchDetails = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVodStitchDetails( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVodStitchDetails with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVodStitchDetails = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVodStitchDetails(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVodStitchDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVodStitchDetailsStream without error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + ]; + client.descriptors.page.listVodStitchDetails.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVodStitchDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.stitcher.v1.VodStitchDetail[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.video.stitcher.v1.VodStitchDetail) => { + 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.listVodStitchDetails.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVodStitchDetails, request) + ); + assert( + (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVodStitchDetailsStream with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVodStitchDetails.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVodStitchDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.stitcher.v1.VodStitchDetail[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.video.stitcher.v1.VodStitchDetail) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVodStitchDetails, request) + ); + assert( + (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVodStitchDetails without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2204,31 +3776,50 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', - ['name'] + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getLiveSession = stubSimpleCall( - undefined, - expectedError + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + generateSampleMessage( + new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + ), + ]; + client.descriptors.page.listVodStitchDetails.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] = + []; + const iterable = client.listVodStitchDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); - await assert.rejects(client.getLiveSession(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getLiveSession as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getLiveSession as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLiveSession with closed client', async () => { + it('uses async iteration with listVodStitchDetails with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2236,21 +3827,43 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.GetLiveSessionRequest() + new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.GetLiveSessionRequest', - ['name'] + '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVodStitchDetails.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVodStitchDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getLiveSession(request), expectedError); }); }); - describe('listCdnKeys', () => { - it('invokes listCdnKeys without error', async () => { + describe('listVodAdTagDetails', () => { + it('invokes listVodAdTagDetails without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2258,39 +3871,40 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), ]; - client.innerApiCalls.listCdnKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listCdnKeys(request); + client.innerApiCalls.listVodAdTagDetails = + stubSimpleCall(expectedResponse); + const [response] = await client.listVodAdTagDetails(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCdnKeys without error using callback', async () => { + it('invokes listVodAdTagDetails without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2298,33 +3912,35 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), ]; - client.innerApiCalls.listCdnKeys = + client.innerApiCalls.listVodAdTagDetails = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listCdnKeys( + client.listVodAdTagDetails( request, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ICdnKey[] | null + result?: + | protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] + | null ) => { if (err) { reject(err); @@ -2337,16 +3953,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCdnKeys with error', async () => { + it('invokes listVodAdTagDetails with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2354,31 +3970,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listCdnKeys = stubSimpleCall( + client.innerApiCalls.listVodAdTagDetails = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listCdnKeys(request), expectedError); + await assert.rejects(client.listVodAdTagDetails(request), expectedError); const actualRequest = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listCdnKeys as SinonStub + client.innerApiCalls.listVodAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listCdnKeysStream without error', async () => { + it('invokes listVodAdTagDetailsStream without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2386,33 +4002,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), ]; - client.descriptors.page.listCdnKeys.createStream = + client.descriptors.page.listVodAdTagDetails.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCdnKeysStream(request); + const stream = client.listVodAdTagDetailsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.CdnKey[] = []; + const responses: protos.google.cloud.video.stitcher.v1.VodAdTagDetail[] = + []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.CdnKey) => { + (response: protos.google.cloud.video.stitcher.v1.VodAdTagDetail) => { responses.push(response); } ); @@ -2426,12 +4043,12 @@ describe('v1.VideoStitcherServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listCdnKeys.createStream as SinonStub) + (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listCdnKeys, request) + .calledWith(client.innerApiCalls.listVodAdTagDetails, request) ); assert( - (client.descriptors.page.listCdnKeys.createStream as SinonStub) + (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2439,7 +4056,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('invokes listCdnKeysStream with error', async () => { + it('invokes listVodAdTagDetailsStream with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2447,25 +4064,24 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listCdnKeys.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listCdnKeysStream(request); + client.descriptors.page.listVodAdTagDetails.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVodAdTagDetailsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.CdnKey[] = []; + const responses: protos.google.cloud.video.stitcher.v1.VodAdTagDetail[] = + []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.CdnKey) => { + (response: protos.google.cloud.video.stitcher.v1.VodAdTagDetail) => { responses.push(response); } ); @@ -2478,12 +4094,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listCdnKeys.createStream as SinonStub) + (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listCdnKeys, request) + .calledWith(client.innerApiCalls.listVodAdTagDetails, request) ); assert( - (client.descriptors.page.listCdnKeys.createStream as SinonStub) + (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2491,7 +4107,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listCdnKeys without error', async () => { + it('uses async iteration with listVodAdTagDetails without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2499,41 +4115,42 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.CdnKey() + new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() ), ]; - client.descriptors.page.listCdnKeys.asyncIterate = + client.descriptors.page.listVodAdTagDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.stitcher.v1.ICdnKey[] = []; - const iterable = client.listCdnKeysAsync(request); + const responses: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] = + []; + const iterable = client.listVodAdTagDetailsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub) + (client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2541,7 +4158,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listCdnKeys with error', async () => { + it('uses async iteration with listVodAdTagDetails with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2549,34 +4166,33 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListCdnKeysRequest() + new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListCdnKeysRequest', + '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listCdnKeys.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listCdnKeysAsync(request); + client.descriptors.page.listVodAdTagDetails.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVodAdTagDetailsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.video.stitcher.v1.ICdnKey[] = []; + const responses: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listCdnKeys.asyncIterate as SinonStub) + (client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2585,8 +4201,8 @@ describe('v1.VideoStitcherServiceClient', () => { }); }); - describe('listVodStitchDetails', () => { - it('invokes listVodStitchDetails without error', async () => { + describe('listLiveAdTagDetails', () => { + it('invokes listLiveAdTagDetails without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2594,40 +4210,40 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), ]; - client.innerApiCalls.listVodStitchDetails = + client.innerApiCalls.listLiveAdTagDetails = stubSimpleCall(expectedResponse); - const [response] = await client.listVodStitchDetails(request); + const [response] = await client.listLiveAdTagDetails(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodStitchDetails without error using callback', async () => { + it('invokes listLiveAdTagDetails without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2635,34 +4251,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), ]; - client.innerApiCalls.listVodStitchDetails = + client.innerApiCalls.listLiveAdTagDetails = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listVodStitchDetails( + client.listLiveAdTagDetails( request, ( err?: Error | null, result?: - | protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] + | protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] | null ) => { if (err) { @@ -2676,16 +4292,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodStitchDetails with error', async () => { + it('invokes listLiveAdTagDetails with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2693,31 +4309,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listVodStitchDetails = stubSimpleCall( + client.innerApiCalls.listLiveAdTagDetails = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listVodStitchDetails(request), expectedError); + await assert.rejects(client.listLiveAdTagDetails(request), expectedError); const actualRequest = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodStitchDetails as SinonStub + client.innerApiCalls.listLiveAdTagDetails as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodStitchDetailsStream without error', async () => { + it('invokes listLiveAdTagDetailsStream without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2725,34 +4341,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), ]; - client.descriptors.page.listVodStitchDetails.createStream = + client.descriptors.page.listLiveAdTagDetails.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listVodStitchDetailsStream(request); + const stream = client.listLiveAdTagDetailsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.VodStitchDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.VodStitchDetail) => { + (response: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail) => { responses.push(response); } ); @@ -2766,12 +4382,12 @@ describe('v1.VideoStitcherServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listVodStitchDetails, request) + .calledWith(client.innerApiCalls.listLiveAdTagDetails, request) ); assert( - (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2779,7 +4395,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('invokes listVodStitchDetailsStream with error', async () => { + it('invokes listLiveAdTagDetailsStream with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2787,24 +4403,24 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listVodStitchDetails.createStream = + client.descriptors.page.listLiveAdTagDetails.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listVodStitchDetailsStream(request); + const stream = client.listLiveAdTagDetailsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.VodStitchDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.VodStitchDetail) => { + (response: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail) => { responses.push(response); } ); @@ -2817,12 +4433,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listVodStitchDetails, request) + .calledWith(client.innerApiCalls.listLiveAdTagDetails, request) ); assert( - (client.descriptors.page.listVodStitchDetails.createStream as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2830,7 +4446,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listVodStitchDetails without error', async () => { + it('uses async iteration with listLiveAdTagDetails without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2838,42 +4454,42 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodStitchDetail() + new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() ), ]; - client.descriptors.page.listVodStitchDetails.asyncIterate = + client.descriptors.page.listLiveAdTagDetails.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] = []; - const iterable = client.listVodStitchDetailsAsync(request); + const iterable = client.listLiveAdTagDetailsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub + client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2881,7 +4497,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listVodStitchDetails with error', async () => { + it('uses async iteration with listLiveAdTagDetails with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2889,20 +4505,20 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodStitchDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listVodStitchDetails.asyncIterate = + client.descriptors.page.listLiveAdTagDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listVodStitchDetailsAsync(request); + const iterable = client.listLiveAdTagDetailsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.video.stitcher.v1.IVodStitchDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2910,12 +4526,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub + client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listVodStitchDetails.asyncIterate as SinonStub) + (client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2924,8 +4540,8 @@ describe('v1.VideoStitcherServiceClient', () => { }); }); - describe('listVodAdTagDetails', () => { - it('invokes listVodAdTagDetails without error', async () => { + describe('listSlates', () => { + it('invokes listSlates without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2933,40 +4549,39 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), ]; - client.innerApiCalls.listVodAdTagDetails = - stubSimpleCall(expectedResponse); - const [response] = await client.listVodAdTagDetails(request); + client.innerApiCalls.listSlates = stubSimpleCall(expectedResponse); + const [response] = await client.listSlates(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodAdTagDetails without error using callback', async () => { + it('invokes listSlates without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2974,35 +4589,33 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), ]; - client.innerApiCalls.listVodAdTagDetails = + client.innerApiCalls.listSlates = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listVodAdTagDetails( + client.listSlates( request, ( err?: Error | null, - result?: - | protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] - | null + result?: protos.google.cloud.video.stitcher.v1.ISlate[] | null ) => { if (err) { reject(err); @@ -3015,16 +4628,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodAdTagDetails with error', async () => { + it('invokes listSlates with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3032,31 +4645,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listVodAdTagDetails = stubSimpleCall( + client.innerApiCalls.listSlates = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listVodAdTagDetails(request), expectedError); + await assert.rejects(client.listSlates(request), expectedError); const actualRequest = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVodAdTagDetails as SinonStub + client.innerApiCalls.listSlates as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVodAdTagDetailsStream without error', async () => { + it('invokes listSlatesStream without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3064,34 +4677,33 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), ]; - client.descriptors.page.listVodAdTagDetails.createStream = + client.descriptors.page.listSlates.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listVodAdTagDetailsStream(request); + const stream = client.listSlatesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.VodAdTagDetail[] = - []; + const responses: protos.google.cloud.video.stitcher.v1.Slate[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.VodAdTagDetail) => { + (response: protos.google.cloud.video.stitcher.v1.Slate) => { responses.push(response); } ); @@ -3105,12 +4717,12 @@ describe('v1.VideoStitcherServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listSlates.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listVodAdTagDetails, request) + .calledWith(client.innerApiCalls.listSlates, request) ); assert( - (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listSlates.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3118,7 +4730,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('invokes listVodAdTagDetailsStream with error', async () => { + it('invokes listSlatesStream with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3126,24 +4738,25 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listVodAdTagDetails.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listVodAdTagDetailsStream(request); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSlates.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSlatesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.VodAdTagDetail[] = - []; + const responses: protos.google.cloud.video.stitcher.v1.Slate[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.VodAdTagDetail) => { + (response: protos.google.cloud.video.stitcher.v1.Slate) => { responses.push(response); } ); @@ -3156,12 +4769,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listSlates.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listVodAdTagDetails, request) + .calledWith(client.innerApiCalls.listSlates, request) ); assert( - (client.descriptors.page.listVodAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listSlates.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3169,7 +4782,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listVodAdTagDetails without error', async () => { + it('uses async iteration with listSlates without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3177,42 +4790,41 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.VodAdTagDetail() + new protos.google.cloud.video.stitcher.v1.Slate() ), ]; - client.descriptors.page.listVodAdTagDetails.asyncIterate = + client.descriptors.page.listSlates.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] = - []; - const iterable = client.listVodAdTagDetailsAsync(request); + const responses: protos.google.cloud.video.stitcher.v1.ISlate[] = []; + const iterable = client.listSlatesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listSlates.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub) + (client.descriptors.page.listSlates.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3220,7 +4832,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listVodAdTagDetails with error', async () => { + it('uses async iteration with listSlates with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3228,33 +4840,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListVodAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListSlatesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listVodAdTagDetails.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listVodAdTagDetailsAsync(request); + client.descriptors.page.listSlates.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSlatesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.video.stitcher.v1.IVodAdTagDetail[] = - []; + const responses: protos.google.cloud.video.stitcher.v1.ISlate[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listSlates.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listVodAdTagDetails.asyncIterate as SinonStub) + (client.descriptors.page.listSlates.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3263,8 +4876,8 @@ describe('v1.VideoStitcherServiceClient', () => { }); }); - describe('listLiveAdTagDetails', () => { - it('invokes listLiveAdTagDetails without error', async () => { + describe('listLiveConfigs', () => { + it('invokes listLiveConfigs without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3272,40 +4885,39 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), ]; - client.innerApiCalls.listLiveAdTagDetails = - stubSimpleCall(expectedResponse); - const [response] = await client.listLiveAdTagDetails(request); + client.innerApiCalls.listLiveConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listLiveConfigs(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listLiveAdTagDetails without error using callback', async () => { + it('invokes listLiveConfigs without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3313,35 +4925,33 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), ]; - client.innerApiCalls.listLiveAdTagDetails = + client.innerApiCalls.listLiveConfigs = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listLiveAdTagDetails( + client.listLiveConfigs( request, ( err?: Error | null, - result?: - | protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] - | null + result?: protos.google.cloud.video.stitcher.v1.ILiveConfig[] | null ) => { if (err) { reject(err); @@ -3354,16 +4964,16 @@ describe('v1.VideoStitcherServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listLiveAdTagDetails with error', async () => { + it('invokes listLiveConfigs with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3371,31 +4981,31 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listLiveAdTagDetails = stubSimpleCall( + client.innerApiCalls.listLiveConfigs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listLiveAdTagDetails(request), expectedError); + await assert.rejects(client.listLiveConfigs(request), expectedError); const actualRequest = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listLiveAdTagDetails as SinonStub + client.innerApiCalls.listLiveConfigs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listLiveAdTagDetailsStream without error', async () => { + it('invokes listLiveConfigsStream without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3403,34 +5013,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), ]; - client.descriptors.page.listLiveAdTagDetails.createStream = + client.descriptors.page.listLiveConfigs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listLiveAdTagDetailsStream(request); + const stream = client.listLiveConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.LiveConfig[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail) => { + (response: protos.google.cloud.video.stitcher.v1.LiveConfig) => { responses.push(response); } ); @@ -3444,12 +5054,12 @@ describe('v1.VideoStitcherServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listLiveConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listLiveAdTagDetails, request) + .calledWith(client.innerApiCalls.listLiveConfigs, request) ); assert( - (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listLiveConfigs.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3457,7 +5067,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('invokes listLiveAdTagDetailsStream with error', async () => { + it('invokes listLiveConfigsStream with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3465,24 +5075,24 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listLiveAdTagDetails.createStream = + client.descriptors.page.listLiveConfigs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listLiveAdTagDetailsStream(request); + const stream = client.listLiveConfigsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.LiveConfig[] = []; stream.on( 'data', - (response: protos.google.cloud.video.stitcher.v1.LiveAdTagDetail) => { + (response: protos.google.cloud.video.stitcher.v1.LiveConfig) => { responses.push(response); } ); @@ -3495,12 +5105,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listLiveConfigs.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listLiveAdTagDetails, request) + .calledWith(client.innerApiCalls.listLiveConfigs, request) ); assert( - (client.descriptors.page.listLiveAdTagDetails.createStream as SinonStub) + (client.descriptors.page.listLiveConfigs.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3508,7 +5118,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listLiveAdTagDetails without error', async () => { + it('uses async iteration with listLiveConfigs without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3516,42 +5126,41 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.LiveAdTagDetail() + new protos.google.cloud.video.stitcher.v1.LiveConfig() ), ]; - client.descriptors.page.listLiveAdTagDetails.asyncIterate = + client.descriptors.page.listLiveConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] = - []; - const iterable = client.listLiveAdTagDetailsAsync(request); + const responses: protos.google.cloud.video.stitcher.v1.ILiveConfig[] = []; + const iterable = client.listLiveConfigsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub + client.descriptors.page.listLiveConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub) + (client.descriptors.page.listLiveConfigs.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3559,7 +5168,7 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); - it('uses async iteration with listLiveAdTagDetails with error', async () => { + it('uses async iteration with listLiveConfigs with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3567,20 +5176,20 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest() + new protos.google.cloud.video.stitcher.v1.ListLiveConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListLiveAdTagDetailsRequest', + '.google.cloud.video.stitcher.v1.ListLiveConfigsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listLiveAdTagDetails.asyncIterate = + client.descriptors.page.listLiveConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLiveAdTagDetailsAsync(request); + const iterable = client.listLiveConfigsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.video.stitcher.v1.ILiveAdTagDetail[] = + const responses: protos.google.cloud.video.stitcher.v1.ILiveConfig[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3588,12 +5197,12 @@ describe('v1.VideoStitcherServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub + client.descriptors.page.listLiveConfigs.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listLiveAdTagDetails.asyncIterate as SinonStub) + (client.descriptors.page.listLiveConfigs.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3601,9 +5210,8 @@ describe('v1.VideoStitcherServiceClient', () => { ); }); }); - - describe('listSlates', () => { - it('invokes listSlates without error', async () => { + describe('getOperation', () => { + it('invokes getOperation without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3611,39 +5219,81 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - ]; - client.innerApiCalls.listSlates = stubSimpleCall(expectedResponse); - const [response] = await client.listSlates(request); + 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 videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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); - const actualRequest = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - - it('invokes listSlates without error using callback', async () => { + it('invokes getOperation with error', async () => { + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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 videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3651,33 +5301,43 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - ]; - client.innerApiCalls.listSlates = - stubSimpleCallWithCallback(expectedResponse); + 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 videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.listSlates( + client.operationsClient.cancelOperation( request, + undefined, ( err?: Error | null, - result?: protos.google.cloud.video.stitcher.v1.ISlate[] | null + result?: protos.google.protobuf.Empty | null ) => { if (err) { reject(err); @@ -3689,49 +5349,34 @@ describe('v1.VideoStitcherServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); }); - - it('invokes listSlates with error', async () => { + it('invokes cancelOperation with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSlates = stubSimpleCall( + client.operationsClient.cancelOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listSlates(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listSlates as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); }); - - it('invokes listSlatesStream without error', async () => { + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3739,162 +5384,119 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() - ), - ]; - client.descriptors.page.listSlates.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listSlatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.Slate[] = []; - stream.on( - 'data', - (response: protos.google.cloud.video.stitcher.v1.Slate) => { - 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.listSlates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listSlates, request) + 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.descriptors.page.listSlates.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('invokes listSlatesStream with error', async () => { + it('invokes deleteOperation without error using callback', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSlates.createStream = stubPageStreamingCall( - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - const stream = client.listSlatesStream(request); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.video.stitcher.v1.Slate[] = []; - stream.on( - 'data', - (response: protos.google.cloud.video.stitcher.v1.Slate) => { - responses.push(response); + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listSlates.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listSlates, request) + 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 videostitcherserviceModule.v1.VideoStitcherServiceClient({ + 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.descriptors.page.listSlates.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('uses async iteration with listSlates without error', async () => { + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.Slate() + new operationsProtos.google.longrunning.ListOperationsResponse() ), ]; - client.descriptors.page.listSlates.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.video.stitcher.v1.ISlate[] = []; - const iterable = client.listSlatesAsync(request); + 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.descriptors.page.listSlates.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); - assert( - (client.descriptors.page.listSlates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); - - it('uses async iteration with listSlates with error', async () => { + it('uses async iteration with listOperations with error', async () => { const client = new videostitcherserviceModule.v1.VideoStitcherServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3902,39 +5504,26 @@ describe('v1.VideoStitcherServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.video.stitcher.v1.ListSlatesRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.video.stitcher.v1.ListSlatesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSlates.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listSlatesAsync(request); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.video.stitcher.v1.ISlate[] = []; + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listSlates.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); - assert( - (client.descriptors.page.listSlates.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); }); @@ -4082,6 +5671,71 @@ describe('v1.VideoStitcherServiceClient', () => { }); }); + describe('liveConfig', () => { + const fakePath = '/rendered/path/liveConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + live_config: 'liveConfigValue', + }; + const client = + new videostitcherserviceModule.v1.VideoStitcherServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.liveConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.liveConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('liveConfigPath', () => { + const result = client.liveConfigPath( + 'projectValue', + 'locationValue', + 'liveConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.liveConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLiveConfigName', () => { + const result = client.matchProjectFromLiveConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.liveConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLiveConfigName', () => { + const result = client.matchLocationFromLiveConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.liveConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLiveConfigFromLiveConfigName', () => { + const result = client.matchLiveConfigFromLiveConfigName(fakePath); + assert.strictEqual(result, 'liveConfigValue'); + assert( + (client.pathTemplates.liveConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('liveSession', () => { const fakePath = '/rendered/path/liveSession'; const expectedParameters = { From b6d8778f06458c3f701c8c0099de71dfb3b0b59d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:15:25 -0700 Subject: [PATCH 20/46] feat: [functions] ListFunctions now include metadata which indicates whether a function is a GEN_1 or GEN_2 function (#4262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added helper methods for long running operations, IAM, and locations docs: clarified that vpcConnector shortname is only returned if the connector is in the same project as the function docs: applied general style guide updates to descriptions PiperOrigin-RevId: 530688922 Source-Link: https://github.com/googleapis/googleapis/commit/a540c8aef871694f9489aecb594023817e713d54 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dca7c4dd03c0db64c5626c84c7309ce4eee4b967 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWZ1bmN0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiZGNhN2M0ZGQwM2MwZGI2NGM1NjI2Yzg0YzczMDljZTRlZWU0Yjk2NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: ListFunctions now include metadata which indicates whether a function is a `GEN_1` or `GEN_2` function feat: KMS crypto keys can now be specified when uploading function source code, enabling source code to be encrypted at rest with a user-managed encryption key feat: You can now specify concurrency and cpu of a gen 2 function through the Function API, without needing to modify the underlying Cloud Run service PiperOrigin-RevId: 534929457 Source-Link: https://github.com/googleapis/googleapis/commit/1c8b678e8b8336bd80fc5f0cd91fcf2e014dc1dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/c1050ce97535113557a0c132a62910794bc66227 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWZ1bmN0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiYzEwNTBjZTk3NTM1MTEzNTU3YTBjMTMyYTYyOTEwNzk0YmM2NjIyNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: ListFunctions now include metadata which indicates whether a function is a `GEN_1` or `GEN_2` function PiperOrigin-RevId: 535193873 Source-Link: https://github.com/googleapis/googleapis/commit/d6b7eb591353e5fb41fa58c0d3127a18b278cefd Source-Link: https://github.com/googleapis/googleapis-gen/commit/822ccd09cc1e9f8a4ab0125cc93effe26ab882c1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWZ1bmN0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiODIyY2NkMDljYzFlOWY4YTRhYjAxMjVjYzkzZWZmZTI2YWI4ODJjMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: ListFunctions now include metadata which indicates whether a function is a `GEN_1` or `GEN_2` function feat: KMS crypto keys can now be specified when uploading function source code, enabling source code to be encrypted at rest with a user-managed encryption key feat: You can now specify concurrency and cpu of a gen 2 function through the Function API, without needing to modify the underlying Cloud Run service PiperOrigin-RevId: 536826096 Source-Link: https://github.com/googleapis/googleapis/commit/b9f248ecac08f7a8e478846a61f5de80453c2438 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6c880ea5a39beab05c9fb5cf200c2f4d01f6d437 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWZ1bmN0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiNmM4ODBlYTVhMzliZWFiMDVjOWZiNWNmMjAwYzJmNGQwMWY2ZDQzNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: override IAM mixin for functions PiperOrigin-RevId: 537982107 Source-Link: https://github.com/googleapis/googleapis/commit/a924ecc5e22aa55855aaaaed8ca1462abe7ac12b Source-Link: https://github.com/googleapis/googleapis-gen/commit/0981ddc52cb29668ec65cc31a81c541aad48ee65 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWZ1bmN0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiMDk4MWRkYzUyY2IyOTY2OGVjNjVjYzMxYTgxYzU0MWFhZDQ4ZWU2NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com> Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Co-authored-by: Daniel Bankhead --- packages/google-cloud-functions/README.md | 77 +- .../google/cloud/functions/v1/functions.proto | 205 +- .../cloud/functions/v1/operations.proto | 2 +- .../google/cloud/functions/v2/functions.proto | 45 +- .../cloud/functions/v2alpha/functions.proto | 224 +- .../cloud/functions/v2beta/functions.proto | 224 +- .../google-cloud-functions/protos/protos.d.ts | 807 ++++-- .../google-cloud-functions/protos/protos.js | 2299 +++++++++++++---- .../google-cloud-functions/protos/protos.json | 210 +- .../google-cloud-functions/samples/README.md | 18 - ...cloud_functions_service.create_function.js | 4 +- ...et_metadata.google.cloud.functions.v1.json | 12 +- .../function_service.generate_upload_url.js | 2 +- ...et_metadata.google.cloud.functions.v2.json | 2 +- .../function_service.create_function.js | 4 +- .../function_service.generate_download_url.js | 4 +- .../function_service.generate_upload_url.js | 20 +- .../function_service.list_functions.js | 17 +- .../v2alpha/function_service.list_runtimes.js | 4 +- ...tadata.google.cloud.functions.v2alpha.json | 10 +- .../function_service.create_function.js | 4 +- .../function_service.generate_download_url.js | 4 +- .../function_service.generate_upload_url.js | 20 +- .../v2beta/function_service.list_functions.js | 17 +- .../v2beta/function_service.list_runtimes.js | 4 +- ...etadata.google.cloud.functions.v2beta.json | 10 +- .../src/v1/cloud_functions_service_client.ts | 281 +- .../src/v2/function_service_client.ts | 2 +- .../src/v2alpha/function_service_client.ts | 157 +- .../src/v2beta/function_service_client.ts | 157 +- .../test/gapic_cloud_functions_service_v1.ts | 526 +++- .../test/gapic_function_service_v2alpha.ts | 76 + .../test/gapic_function_service_v2beta.ts | 76 + 33 files changed, 4353 insertions(+), 1171 deletions(-) diff --git a/packages/google-cloud-functions/README.md b/packages/google-cloud-functions/README.md index 5a56f0391b95..e2be01d5c9d8 100644 --- a/packages/google-cloud-functions/README.md +++ b/packages/google-cloud-functions/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Functions: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Google Cloud Functions: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/functions.svg)](https://www.npmjs.org/package/@google-cloud/functions) @@ -83,47 +83,46 @@ listFunctions(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Cloud_functions_service.call_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.call_function.js,samples/README.md) | -| Cloud_functions_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.create_function.js,samples/README.md) | -| Cloud_functions_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.delete_function.js,samples/README.md) | -| Cloud_functions_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js,samples/README.md) | -| Cloud_functions_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js,samples/README.md) | -| Cloud_functions_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.get_function.js,samples/README.md) | -| Cloud_functions_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js,samples/README.md) | -| Cloud_functions_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.list_functions.js,samples/README.md) | -| Cloud_functions_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js,samples/README.md) | -| Cloud_functions_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js,samples/README.md) | -| Cloud_functions_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.update_function.js,samples/README.md) | -| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.create_function.js,samples/README.md) | -| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.delete_function.js,samples/README.md) | -| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.generate_download_url.js,samples/README.md) | -| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.generate_upload_url.js,samples/README.md) | -| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.get_function.js,samples/README.md) | -| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.list_functions.js,samples/README.md) | -| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.list_runtimes.js,samples/README.md) | -| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.update_function.js,samples/README.md) | -| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.create_function.js,samples/README.md) | -| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.delete_function.js,samples/README.md) | -| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.generate_download_url.js,samples/README.md) | -| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.generate_upload_url.js,samples/README.md) | -| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.get_function.js,samples/README.md) | -| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.list_functions.js,samples/README.md) | -| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.list_runtimes.js,samples/README.md) | -| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.update_function.js,samples/README.md) | -| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.create_function.js,samples/README.md) | -| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.delete_function.js,samples/README.md) | -| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.generate_download_url.js,samples/README.md) | -| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.generate_upload_url.js,samples/README.md) | -| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.get_function.js,samples/README.md) | -| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.list_functions.js,samples/README.md) | -| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.list_runtimes.js,samples/README.md) | -| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.update_function.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/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-functions/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/test/quickstart.test.js,samples/README.md) | +| Cloud_functions_service.call_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.call_function.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.create_function.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.delete_function.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.get_function.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.list_functions.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js,packages/google-cloud-functions/samples/README.md) | +| Cloud_functions_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v1/cloud_functions_service.update_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2alpha/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) | +| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js) | [![Open in Cloud 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-functions/samples/generated/v2beta/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/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-functions/samples/quickstart.js,packages/google-cloud-functions/samples/README.md) | diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto index 4b01c5b4f6ba..340338e5b234 100644 --- a/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto +++ b/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -20,10 +20,12 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/functions/v1/operations.proto"; import "google/iam/v1/iam_policy.proto"; import "google/iam/v1/policy.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -44,7 +46,8 @@ option (google.api.resource_definition) = { // A service that application uses to manipulate triggers and functions. service CloudFunctionsService { option (google.api.default_host) = "cloudfunctions.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Returns a list of functions that belong to the requested project. rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) { @@ -62,9 +65,10 @@ service CloudFunctionsService { } // Creates a new function. If a function with the given name already exists in - // the specified project, the long running operation will return + // the specified project, the long running operation returns an // `ALREADY_EXISTS` error. - rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + rpc CreateFunction(CreateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{location=projects/*/locations/*}/functions" body: "function" @@ -77,7 +81,8 @@ service CloudFunctionsService { } // Updates existing function. - rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + rpc UpdateFunction(UpdateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{function.name=projects/*/locations/*/functions/*}" body: "function" @@ -90,9 +95,10 @@ service CloudFunctionsService { } // Deletes a function with the given name from the specified project. If the - // given function is used by some trigger, the trigger will be updated to + // given function is used by some trigger, the trigger is updated to // remove this function. - rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + rpc DeleteFunction(DeleteFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/functions/*}" }; @@ -132,15 +138,16 @@ service CloudFunctionsService { // attached, the identity from the credentials would be used, but that // identity does not have permissions to upload files to the URL. // - // When making a HTTP PUT request, these two headers need to be specified: + // When making an HTTP PUT request, these two headers must be specified: // // * `content-type: application/zip` // * `x-goog-content-length-range: 0,104857600` // - // And this header SHOULD NOT be specified: + // And this header must NOT be specified: // // * `Authorization: Bearer YOUR_TOKEN` - rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + rpc GenerateUploadUrl(GenerateUploadUrlRequest) + returns (GenerateUploadUrlResponse) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/functions:generateUploadUrl" body: "*" @@ -148,11 +155,12 @@ service CloudFunctionsService { } // Returns a signed URL for downloading deployed function source code. - // The URL is only valid for a limited period and should be used within + // The URL is only valid for a limited period and must be used within // minutes after generation. - // For more information about the signed URL usage see: + // For more information about the signed URL usage, see: // https://cloud.google.com/storage/docs/access-control/signed-urls - rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) + returns (GenerateDownloadUrlResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" body: "*" @@ -161,7 +169,8 @@ service CloudFunctionsService { // Sets the IAM access control policy on the specified function. // Replaces any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=projects/*/locations/*/functions/*}:setIamPolicy" body: "*" @@ -171,7 +180,8 @@ service CloudFunctionsService { // Gets the IAM access control policy for a function. // Returns an empty policy if the function exists and does not have a policy // set. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { get: "/v1/{resource=projects/*/locations/*/functions/*}:getIamPolicy" }; @@ -179,9 +189,10 @@ service CloudFunctionsService { // Tests the specified permissions against the IAM access control policy // for a function. - // If the function does not exist, this will return an empty set of + // If the function does not exist, this returns an empty set of // permissions, not a NOT_FOUND error. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=projects/*/locations/*/functions/*}:testIamPermissions" body: "*" @@ -190,7 +201,7 @@ service CloudFunctionsService { } // Describes a Cloud Function that contains user computation executed in -// response to an event. It encapsulate function and triggers configurations. +// response to an event. It encapsulates function and triggers configurations. message CloudFunction { option (google.api.resource) = { type: "cloudfunctions.googleapis.com/CloudFunction" @@ -199,17 +210,18 @@ message CloudFunction { // Available egress settings. // - // This controls what traffic is diverted through the VPC Access Connector - // resource. By default PRIVATE_RANGES_ONLY will be used. + // This controls what traffic is diverted through the Serverless VPC Access + // connector resource. By default, PRIVATE_RANGES_ONLY is used. enum VpcConnectorEgressSettings { // Unspecified. VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; - // Use the VPC Access Connector only for private IP space from RFC1918. + // Use the Serverless VPC Access connector only for private IP space from + // RFC1918. PRIVATE_RANGES_ONLY = 1; - // Force the use of VPC Access Connector for all egress traffic from the - // function. + // Force the use of Serverless VPC Access connector for all egress traffic + // from the function. ALL_TRAFFIC = 2; } @@ -217,7 +229,7 @@ message CloudFunction { // // This controls what traffic can reach the function. // - // If unspecified, ALLOW_ALL will be used. + // If unspecified, ALLOW_ALL is used. enum IngressSettings { // Unspecified. INGRESS_SETTINGS_UNSPECIFIED = 0; @@ -237,15 +249,15 @@ message CloudFunction { // Unspecified. DOCKER_REGISTRY_UNSPECIFIED = 0; - // Docker images will be stored in multi-regional Container Registry + // Docker images are stored in multi-regional Container Registry // repositories named `gcf`. CONTAINER_REGISTRY = 1; - // Docker images will be stored in regional Artifact Registry repositories. - // By default, GCF will create and use repositories named `gcf-artifacts` - // in every region in which a function is deployed. But the repository to - // use can also be specified by the user using the `docker_repository` - // field. + // Docker images are stored in regional Artifact Registry repositories. + // By default, Cloud Functions creates and uses repositories named + // `gcf-artifacts` in every region in which a function is deployed. But the + // repository to use can also be specified by the user by using the + // `docker_repository` field. ARTIFACT_REGISTRY = 2; } @@ -267,7 +279,7 @@ message CloudFunction { // The source repository where a function is hosted. SourceRepository source_repository = 4; - // The Google Cloud Storage signed URL used for source uploading, generated + // The Google Cloud Storage-signed URL used for source uploading, generated // by calling [google.cloud.functions.v1.GenerateUploadUrl]. // // The signature is validated on write methods (Create, Update) @@ -288,12 +300,12 @@ message CloudFunction { // Output only. Status of the function deployment. CloudFunctionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The name of the function (as defined in source code) that will be - // executed. Defaults to the resource name suffix, if not specified. For - // backward compatibility, if function with given name is not found, then the - // system will try to use function named "function". - // For Node.js this is name of a function exported by the module specified - // in `source_location`. + // The name of the function (as defined in source code) that is executed. + // Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, the + // system tries to use the function named "function". + // For Node.js, this is the name of a function exported by the module + // as specified in `source_location`. string entry_point = 8; // The runtime in which to run the function. Required when deploying a new @@ -317,10 +329,11 @@ message CloudFunction { string service_account_email = 11; // Output only. The last update timestamp of a Cloud Function. - google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The version identifier of the Cloud Function. Each deployment attempt - // results in a new version of a function being created. + // Output only. The version identifier of the Cloud Function. Each deployment + // attempt results in a new version of a function being created. int64 version_id = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; // Labels associated with this Cloud Function. @@ -332,11 +345,11 @@ message CloudFunction { // Build environment variables that shall be available during build time. map build_environment_variables = 28; - // The VPC Network that this cloud function can connect to. It can be - // either the fully-qualified URI, or the short name of the network resource. - // If the short network name is used, the network must belong to the same - // project. Otherwise, it must belong to a project within the same - // organization. The format of this field is either + // The Serverless VPC Access connector that this cloud function can connect + // to. It can be either the fully qualified URI, or the short name of the + // connector resource. If the connector name is used, the connector must + // belong to the same project as the function. Otherwise, it must belong to a + // project within the same organization. The format of this field is either // `projects/{project}/global/networks/{network}` or `{network}`, where // `{project}` is a project id where the network is defined, and `{network}` // is the short name of the network. @@ -348,13 +361,13 @@ message CloudFunction { // more information on connecting Cloud projects. string network = 18; - // The limit on the maximum number of function instances that may coexist at a + // The limit on the maximum number of function instances that can coexist at a // given time. // - // In some cases, such as rapid traffic surges, Cloud Functions may, for a - // short period of time, create more instances than the specified max + // In some cases, such as rapid traffic surges, Cloud Functions can for a + // short period of time create more instances than the specified max // instances limit. If your function cannot tolerate this temporary behavior, - // you may want to factor in a safety margin and set a lower max instances + // you might want to factor in a safety margin and set a lower max instances // value than your function can tolerate. // // See the [Max @@ -362,12 +375,12 @@ message CloudFunction { // more details. int32 max_instances = 20; - // A lower bound for the number function instances that may coexist at a + // A lower bound for the number function instances that can coexist at a // given time. int32 min_instances = 32; // The VPC Network Connector that this cloud function can connect to. It can - // be either the fully-qualified URI, or the short name of the network + // be either the fully qualified URI, or the short name of the network // connector resource. The format of this field is // `projects/*/locations/*/connectors/*` // @@ -416,8 +429,8 @@ message CloudFunction { // function resources in internal projects that are not accessible by the // end user. string kms_key_name = 25 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; + type: "cloudkms.googleapis.com/CryptoKey" + }]; // Name of the Cloud Build Custom Worker Pool that should be used to build the // function. The format of this field is @@ -447,8 +460,8 @@ message CloudFunction { // Secret volumes configuration. repeated SecretVolume secret_volumes = 30; - // Input only. An identifier for Firebase function sources. Disclaimer: This field is only - // supported for Firebase function deployments. + // Input only. An identifier for Firebase function sources. Disclaimer: This + // field is only supported for Firebase function deployments. string source_token = 31 [(google.api.field_behavior) = INPUT_ONLY]; // User managed repository created in Artifact Registry optionally with a @@ -456,7 +469,7 @@ message CloudFunction { // Artifact Registry. If unspecified and the deployment is eligible to use // Artifact Registry, GCF will create and use a repository named // 'gcf-artifacts' for every deployed region. This is the repository to which - // the function docker image will be pushed after it is built by Cloud Build. + // the function docker image is pushed after it is built by Cloud Build. // // It must match the pattern // `projects/{project}/locations/{location}/repositories/{repository}`. @@ -465,12 +478,12 @@ message CloudFunction { // Cross-location repositories are not supported. // Repository format must be 'DOCKER'. string docker_repository = 34 [(google.api.resource_reference) = { - type: "artifactregistry.googleapis.com/Repository" - }]; + type: "artifactregistry.googleapis.com/Repository" + }]; // Docker Registry to use for this deployment. // - // If `docker_repository` field is specified, this field will be automatically + // If `docker_repository` field is specified, this field is automatically // set as `ARTIFACT_REGISTRY`. // If unspecified, it currently defaults to `CONTAINER_REGISTRY`. // This field may be overridden by the backend for eligible deployments. @@ -492,7 +505,7 @@ message SourceRepository { // To refer to a specific fixed alias (tag): // `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*` // - // You may omit `paths/*` if you want to use the main directory. + // You can omit `paths/*` if you want to use the main directory. string url = 1; // Output only. The URL pointing to the hosted repository where the function @@ -503,11 +516,11 @@ message SourceRepository { // Describes HttpsTrigger, could be used to connect web hooks to function. message HttpsTrigger { - // Available security level settings. + // Available security-level settings. // // This controls the methods to enforce security (HTTPS) on a URL. // - // If unspecified, SECURE_OPTIONAL will be used. + // If unspecified, SECURE_OPTIONAL is used. enum SecurityLevel { // Unspecified. SECURITY_LEVEL_UNSPECIFIED = 0; @@ -523,14 +536,14 @@ message HttpsTrigger { SECURE_OPTIONAL = 2; } - // Output only. The deployed url for the function. + // Output only. The deployed URL for the function. string url = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The security level for the function. SecurityLevel security_level = 2; } -// Describes EventTrigger, used to request events be sent from another +// Describes EventTrigger, used to request that events be sent from another // service. message EventTrigger { // Required. The type of event to observe. For example: @@ -546,7 +559,7 @@ message EventTrigger { // example, the Google Cloud Storage API includes the type `object`. // 3. action: The action that generates the event. For example, action for // a Google Cloud Storage Object is 'change'. - // These parts are lower case. + // These parts are lowercase. string event_type = 1; // Required. The resource(s) from which to observe events, for example, @@ -564,7 +577,7 @@ message EventTrigger { // that matches Google Cloud Pub/Sub topics. // // Additionally, some services may support short names when creating an - // `EventTrigger`. These will always be returned in the normalized "long" + // `EventTrigger`. These are always returned in the normalized "long" // format. // // See each *service's* documentation for supported formats. @@ -582,20 +595,18 @@ message EventTrigger { } // Describes the policy in case of function's execution failure. -// If empty, then defaults to ignoring failures (i.e. not retrying them). +// If empty, then defaults to ignoring failures (i.e., not retrying them). message FailurePolicy { // Describes the retry policy in case of function's execution failure. - // A function execution will be retried on any failure. - // A failed execution will be retried up to 7 days with an exponential backoff + // A function execution is retried on any failure. + // A failed execution is retried up to 7 days with an exponential backoff // (capped at 10 seconds). // Retried execution is charged as any other execution. - message Retry { - - } + message Retry {} // Defines the action taken in case of a function execution failure. oneof action { - // If specified, then the function will be retried in case of a failure. + // If specified, the function is retried in case of a failure. Retry retry = 1; } } @@ -623,19 +634,19 @@ enum CloudFunctionStatus { } // Configuration for a secret environment variable. It has the information -// necessary to fetch the secret value from secret manager and expose it as an +// necessary to fetch the secret value from Secret Manager and expose it as an // environment variable. message SecretEnvVar { // Name of the environment variable. string key = 1; // Project identifier (preferrably project number but can also be the project - // ID) of the project that contains the secret. If not set, it will be - // populated with the function's project assuming that the secret exists in - // the same project as of the function. + // ID) of the project that contains the secret. If not set, it is + // populated with the function's project, assuming that the secret exists in + // the same project as the function. string project_id = 2; - // Name of the secret in secret manager (not the full resource name). + // Name of the secret in Secret Manager (not the full resource name). string secret = 3; // Version of the secret (version number or the string 'latest'). It is @@ -645,28 +656,28 @@ message SecretEnvVar { } // Configuration for a secret volume. It has the information necessary to fetch -// the secret value from secret manager and make it available as files mounted +// the secret value from Secret Manager and make it available as files mounted // at the requested paths within the application container. Secret value is not -// a part of the configuration. Every filesystem read operation performs a -// lookup in secret manager to retrieve the secret value. +// a part of the configuration. Every file system read operation performs a +// lookup in Secret Manager to retrieve the secret value. message SecretVolume { // Configuration for a single version. message SecretVersion { // Version of the secret (version number or the string 'latest'). It is - // preferrable to use `latest` version with secret volumes as secret value + // preferable to use `latest` version with secret volumes as secret value // changes are reflected immediately. string version = 1; // Relative path of the file under the mount path where the secret value for - // this version will be fetched and made available. For example, setting the - // mount_path as '/etc/secrets' and path as `/secret_foo` would mount the + // this version is fetched and made available. For example, setting the + // mount_path as '/etc/secrets' and path as `/secret_foo` mounts the // secret value file at `/etc/secrets/secret_foo`. string path = 2; } // The path within the container to mount the secret volume. For example, - // setting the mount_path as `/etc/secrets` would mount the secret value files - // under the `/etc/secrets` directory. This directory will also be completely + // setting the mount_path as `/etc/secrets` mounts the secret value files + // under the `/etc/secrets` directory. This directory is also completely // shadowed and unavailable to mount any other secrets. // // Recommended mount paths: /etc/secrets @@ -674,24 +685,24 @@ message SecretVolume { string mount_path = 1; // Project identifier (preferrably project number but can also be the project - // ID) of the project that contains the secret. If not set, it will be - // populated with the function's project assuming that the secret exists in - // the same project as of the function. + // ID) of the project that contains the secret. If not set, it is + // populated with the function's project, assuming that the secret exists in + // the same project as the function. string project_id = 2; - // Name of the secret in secret manager (not the full resource name). + // Name of the secret in Secret Manager (not the full resource name). string secret = 3; // List of secret versions to mount for this secret. If empty, the `latest` - // version of the secret will be made available in a file named after the + // version of the secret is made available in a file named after the // secret under the mount point. repeated SecretVersion versions = 4; } // Request for the `CreateFunction` method. message CreateFunctionRequest { - // Required. The project and location in which the function should be created, specified - // in the format `projects/*/locations/*` + // Required. The project and location in which the function should be created, + // specified in the format `projects/*/locations/*` string location = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -732,8 +743,8 @@ message ListFunctionsRequest { // location(s) are unreachable, the response will contain functions from all // reachable locations along with the names of any unreachable locations. string parent = 1 [(google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - }]; + type: "locations.googleapis.com/Location" + }]; // Maximum number of functions to return per call. int32 page_size = 2; @@ -824,8 +835,8 @@ message GenerateUploadUrlRequest { // delegate access to the Google Storage service account in the internal // project. string kms_key_name = 2 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Response of `GenerateSourceUploadUrl` method. diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto index 880774c96c0d..1a9ba18890b0 100644 --- a/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto +++ b/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto index 8b29cd4976be..ae0cdc1ef22f 100644 --- a/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto +++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -241,9 +241,6 @@ message Function { // globally and match pattern `projects/*/locations/*/functions/*` string name = 1; - // Describe whether the function is 1st Gen or 2nd Gen. - Environment environment = 10; - // User-provided description of a function. string description = 2; @@ -273,7 +270,13 @@ message Function { repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Resource name of a KMS crypto key (managed by the user) used to + // Describe whether the function is 1st Gen or 2nd Gen. + Environment environment = 10; + + // Output only. The deployed url for the function. + string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // [Preview] Resource name of a KMS crypto key (managed by the user) used to // encrypt/decrypt function resources. // // It must match the pattern @@ -281,9 +284,6 @@ message Function { string kms_key_name = 25 [(google.api.resource_reference) = { type: "cloudkms.googleapis.com/CryptoKey" }]; - - // Output only. The deployed url for the function. - string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Informational messages about the state of the Cloud Function or Operation. @@ -467,18 +467,18 @@ message BuildConfig { // User-provided build-time environment variables for the function map environment_variables = 6; - // Optional. Docker Registry to use for this deployment. This configuration is - // only applicable to 1st Gen functions, 2nd Gen functions can only use - // Artifact Registry. + // Docker Registry to use for this deployment. This configuration is only + // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact + // Registry. // // If `docker_repository` field is specified, this field will be automatically // set as `ARTIFACT_REGISTRY`. // If unspecified, it currently defaults to `CONTAINER_REGISTRY`. // This field may be overridden by the backend for eligible deployments. - DockerRegistry docker_registry = 10 [(google.api.field_behavior) = OPTIONAL]; + DockerRegistry docker_registry = 10; - // User managed repository created in Artifact Registry optionally with a - // customer managed encryption key. This is the repository to which the + // User managed repository created in Artifact Registry optionally + // with a customer managed encryption key. This is the repository to which the // function docker image will be pushed after it is built by Cloud Build. // If unspecified, GCF will create and use a repository named 'gcf-artifacts' // for every deployed region. @@ -496,7 +496,6 @@ message BuildConfig { // Describes the Service being deployed. // Currently Supported : Cloud Run (fully managed). -// Next tag: 23 message ServiceConfig { // Available egress settings. // @@ -537,7 +536,7 @@ message ServiceConfig { // // This enforces security protocol on function URL. // - // Security level is only ocnfigurable for 1st Gen functions, If unspecified, + // Security level is only configurable for 1st Gen functions, If unspecified, // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY. enum SecurityLevel { // Unspecified. @@ -575,7 +574,7 @@ message ServiceConfig { // a full description. string available_memory = 13; - // The number of CPUs used in a single container instance. + // [Preview] The number of CPUs used in a single container instance. // Default value is calculated from available memory. // Supports the same values as Cloud Run, see // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements @@ -647,8 +646,8 @@ message ServiceConfig { // Output only. The name of service revision. string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Sets the maximum number of concurrent requests that each instance can - // receive. Defaults to 1. + // [Preview] Sets the maximum number of concurrent requests that each instance + // can receive. Defaults to 1. int32 max_instance_request_concurrency = 20; // Security level configure whether the function only accepts https. @@ -925,7 +924,7 @@ message GenerateUploadUrlRequest { } ]; - // Resource name of a KMS crypto key (managed by the user) used to + // [Preview] Resource name of a KMS crypto key (managed by the user) used to // encrypt/decrypt function source code objects in intermediate Cloud Storage // buckets. When you generate an upload url and upload your source code, it // gets copied to an intermediate Cloud Storage bucket. The source code is @@ -1081,6 +1080,12 @@ message OperationMetadata { repeated Stage stages = 9; } +// Extra GCF specific location information. +message LocationMetadata { + // The Cloud Function environments this location supports. + repeated Environment environments = 1; +} + // Each Stage of the deployment process message Stage { // Possible names for a Stage diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto index 0861c4b668ff..3c96518d728d 100644 --- a/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto +++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -62,6 +63,10 @@ option (google.api.resource_definition) = { type: "pubsub.googleapis.com/Topic" pattern: "projects/{project}/topics/{topic}" }; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; // Google Cloud Functions is used to deploy functions that are executed by // Google in response to various events. Data connected with that event is @@ -71,7 +76,8 @@ option (google.api.resource_definition) = { // executed and how it is triggered. service FunctionService { option (google.api.default_host) = "cloudfunctions.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Returns a function with the given name from the requested project. rpc GetFunction(GetFunctionRequest) returns (Function) { @@ -92,7 +98,8 @@ service FunctionService { // Creates a new function. If a function with the given name already exists in // the specified project, the long running operation will return // `ALREADY_EXISTS` error. - rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + rpc CreateFunction(CreateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2alpha/{parent=projects/*/locations/*}/functions" body: "function" @@ -105,7 +112,8 @@ service FunctionService { } // Updates existing function. - rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + rpc UpdateFunction(UpdateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2alpha/{function.name=projects/*/locations/*/functions/*}" body: "function" @@ -120,7 +128,8 @@ service FunctionService { // Deletes a function with the given name from the specified project. If the // given function is used by some trigger, the trigger will be updated to // remove this function. - rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + rpc DeleteFunction(DeleteFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v2alpha/{name=projects/*/locations/*/functions/*}" }; @@ -154,7 +163,8 @@ service FunctionService { // And this header SHOULD NOT be specified: // // * `Authorization: Bearer YOUR_TOKEN` - rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + rpc GenerateUploadUrl(GenerateUploadUrlRequest) + returns (GenerateUploadUrlResponse) { option (google.api.http) = { post: "/v2alpha/{parent=projects/*/locations/*}/functions:generateUploadUrl" body: "*" @@ -166,7 +176,8 @@ service FunctionService { // 30 minutes of generation. // For more information about the signed URL usage see: // https://cloud.google.com/storage/docs/access-control/signed-urls - rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) + returns (GenerateDownloadUrlResponse) { option (google.api.http) = { post: "/v2alpha/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" body: "*" @@ -230,9 +241,6 @@ message Function { // globally and match pattern `projects/*/locations/*/functions/*` string name = 1; - // Describe whether the function is gen1 or gen2. - Environment environment = 10; - // User-provided description of a function. string description = 2; @@ -252,13 +260,30 @@ message Function { State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of a Cloud Function. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Labels associated with this Cloud Function. map labels = 8; // Output only. State Messages for this Cloud Function. - repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated StateMessage state_messages = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Describe whether the function is 1st Gen or 2nd Gen. + Environment environment = 10; + + // Output only. The deployed url for the function. + string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // [Preview] Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function resources. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 25 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Informational messages about the state of the Cloud Function or Operation. @@ -375,8 +400,25 @@ message SourceProvenance { // Describes the Build step of the function that builds a container from the // given source. message BuildConfig { - // Output only. The Cloud Build name of the latest successful deployment of the - // function. + // Docker Registry to use for storing function Docker images. + enum DockerRegistry { + // Unspecified. + DOCKER_REGISTRY_UNSPECIFIED = 0; + + // Docker images will be stored in multi-regional Container Registry + // repositories named `gcf`. + CONTAINER_REGISTRY = 1; + + // Docker images will be stored in regional Artifact Registry repositories. + // By default, GCF will create and use repositories named `gcf-artifacts` + // in every region in which a function is deployed. But the repository to + // use can also be specified by the user using the `docker_repository` + // field. + ARTIFACT_REGISTRY = 2; + } + + // Output only. The Cloud Build name of the latest successful deployment of + // the function. string build = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -403,7 +445,8 @@ message BuildConfig { Source source = 4; // Output only. A permanent fixed identifier for source. - SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + SourceProvenance source_provenance = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Name of the Cloud Build Custom Worker Pool that should be used to build the // function. The format of this field is @@ -418,14 +461,24 @@ message BuildConfig { // granted the role Cloud Build Custom Workers Builder // (roles/cloudbuild.customworkers.builder) in the project. string worker_pool = 5 [(google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/WorkerPool" - }]; + type: "cloudbuild.googleapis.com/WorkerPool" + }]; // User-provided build-time environment variables for the function map environment_variables = 6; - // Optional. User managed repository created in Artifact Registry optionally with a - // customer managed encryption key. This is the repository to which the + // Docker Registry to use for this deployment. This configuration is only + // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact + // Registry. + // + // If `docker_repository` field is specified, this field will be automatically + // set as `ARTIFACT_REGISTRY`. + // If unspecified, it currently defaults to `CONTAINER_REGISTRY`. + // This field may be overridden by the backend for eligible deployments. + DockerRegistry docker_registry = 10; + + // User managed repository created in Artifact Registry optionally + // with a customer managed encryption key. This is the repository to which the // function docker image will be pushed after it is built by Cloud Build. // If unspecified, GCF will create and use a repository named 'gcf-artifacts' // for every deployed region. @@ -436,12 +489,9 @@ message BuildConfig { // Cross-project repositories are not supported. // Cross-location repositories are not supported. // Repository format must be 'DOCKER'. - string docker_repository = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "artifactregistry.googleapis.com/Repository" - } - ]; + string docker_repository = 7 [(google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + }]; } // Describes the Service being deployed. @@ -482,14 +532,33 @@ message ServiceConfig { ALLOW_INTERNAL_AND_GCLB = 3; } + // Available security level settings. + // + // This enforces security protocol on function URL. + // + // Security level is only configurable for 1st Gen functions, If unspecified, + // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY. + enum SecurityLevel { + // Unspecified. + SECURITY_LEVEL_UNSPECIFIED = 0; + + // Requests for a URL that match this handler that do not use HTTPS are + // automatically redirected to the HTTPS URL with the same path. Query + // parameters are reserved for the redirect. + SECURE_ALWAYS = 1; + + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used and respond accordingly. + SECURE_OPTIONAL = 2; + } + // Output only. Name of the service associated with a Function. // The format of this field is // `projects/{project}/locations/{region}/services/{service}` string service = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "run.googleapis.com/Service" - } + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } ]; // The function execution timeout. Execution is considered failed and @@ -505,6 +574,13 @@ message ServiceConfig { // a full description. string available_memory = 13; + // [Preview] The number of CPUs used in a single container instance. + // Default value is calculated from available memory. + // Supports the same values as Cloud Run, see + // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements + // Example: "1" indicates 1 vCPU + string available_cpu = 22; + // Environment variables that shall be available during function execution. map environment_variables = 4; @@ -536,8 +612,8 @@ message ServiceConfig { // The Serverless VPC Access connector that this cloud function can connect // to. The format of this field is `projects/*/locations/*/connectors/*`. string vpc_connector = 6 [(google.api.resource_reference) = { - type: "vpcaccess.googleapis.com/Connector" - }]; + type: "vpcaccess.googleapis.com/Connector" + }]; // The egress settings for the connector, controlling what traffic is diverted // through it. @@ -569,6 +645,16 @@ message ServiceConfig { // Output only. The name of service revision. string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // [Preview] Sets the maximum number of concurrent requests that each instance + // can receive. Defaults to 1. + int32 max_instance_request_concurrency = 20; + + // Security level configure whether the function only accepts https. + // This configuration is only applicable to 1st Gen functions with Http + // trigger. By default https is optional for 1st Gen functions; 2nd Gen + // functions are https ONLY. + SecurityLevel security_level = 21; } // Configuration for a secret environment variable. It has the information @@ -649,8 +735,8 @@ message EventTrigger { RETRY_POLICY_RETRY = 2; } - // Output only. The resource name of the Eventarc trigger. The format of this field is - // `projects/{project}/locations/{region}/triggers/{trigger}`. + // Output only. The resource name of the Eventarc trigger. The format of this + // field is `projects/{project}/locations/{region}/triggers/{trigger}`. string trigger = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -681,19 +767,18 @@ message EventTrigger { // will not be deleted at function deletion. string pubsub_topic = 5 [ (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Topic" - } + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // Optional. The email of the trigger's service account. The service account must have - // permission to invoke Cloud Run services, the permission is + // Optional. The email of the trigger's service account. The service account + // must have permission to invoke Cloud Run services, the permission is // `run.routes.invoke`. // If empty, defaults to the Compute Engine default service account: // `{project_number}-compute@developer.gserviceaccount.com`. string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). + // Optional. If unset, then defaults to ignoring failures (i.e. not retrying + // them). RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. The name of the channel associated with the trigger in @@ -735,12 +820,12 @@ message GetFunctionRequest { // Request for the `ListFunctions` method. message ListFunctionsRequest { - // Required. The project and location from which the function should be listed, - // specified in the format `projects/*/locations/*` - // If you want to list functions in all locations, use "-" in place of a - // location. When listing functions in all locations, if one or more - // location(s) are unreachable, the response will contain functions from all - // reachable locations along with the names of any unreachable locations. + // Required. The project and location from which the function should be + // listed, specified in the format `projects/*/locations/*` If you want to + // list functions in all locations, use "-" in place of a location. When + // listing functions in all locations, if one or more location(s) are + // unreachable, the response will contain functions from all reachable + // locations along with the names of any unreachable locations. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -748,7 +833,10 @@ message ListFunctionsRequest { } ]; - // Maximum number of functions to return per call. + // Maximum number of functions to return per call. The largest allowed + // page_size is 1,000, if the page_size is omitted or specified as greater + // than 1,000 then it will be replaced as 1,000. The size of the list + // response can be less than specified when used with filters. int32 page_size = 2; // The value returned by the last @@ -783,8 +871,8 @@ message ListFunctionsResponse { // Request for the `CreateFunction` method. message CreateFunctionRequest { - // Required. The project and location in which the function should be created, specified - // in the format `projects/*/locations/*` + // Required. The project and location in which the function should be created, + // specified in the format `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -827,14 +915,33 @@ message DeleteFunctionRequest { // Request of `GenerateSourceUploadUrl` method. message GenerateUploadUrlRequest { - // Required. The project and location in which the Google Cloud Storage signed URL - // should be generated, specified in the format `projects/*/locations/*`. + // Required. The project and location in which the Google Cloud Storage signed + // URL should be generated, specified in the format `projects/*/locations/*`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "locations.googleapis.com/Location" } ]; + + // [Preview] Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function source code objects in intermediate Cloud Storage + // buckets. When you generate an upload url and upload your source code, it + // gets copied to an intermediate Cloud Storage bucket. The source code is + // then copied to a versioned directory in the sources bucket in the consumer + // project during the function deployment. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + // + // The Google Cloud Functions service account + // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + // Key/KeyRing/Project/Organization (least access preferred). + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Response of `GenerateSourceUploadUrl` method. @@ -857,8 +964,8 @@ message GenerateUploadUrlResponse { // Request of `GenerateDownloadUrl` method. message GenerateDownloadUrlRequest { - // Required. The name of function for which source code Google Cloud Storage signed - // URL should be generated. + // Required. The name of function for which source code Google Cloud Storage + // signed URL should be generated. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -876,8 +983,8 @@ message GenerateDownloadUrlResponse { // Request for the `ListRuntimes` method. message ListRuntimesRequest { - // Required. The project and location from which the runtimes should be listed, - // specified in the format `projects/*/locations/*` + // Required. The project and location from which the runtimes should be + // listed, specified in the format `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -958,8 +1065,9 @@ message OperationMetadata { // 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`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool cancel_requested = 6; // API version used to start the operation. @@ -972,6 +1080,12 @@ message OperationMetadata { repeated Stage stages = 9; } +// Extra GCF specific location information. +message LocationMetadata { + // The Cloud Function environments this location supports. + repeated Environment environments = 1; +} + // Each Stage of the deployment process message Stage { // Possible names for a Stage diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto index 4d2284f31de8..a8f89d5a4f4e 100644 --- a/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto +++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -62,6 +63,10 @@ option (google.api.resource_definition) = { type: "pubsub.googleapis.com/Topic" pattern: "projects/{project}/topics/{topic}" }; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; // Google Cloud Functions is used to deploy functions that are executed by // Google in response to various events. Data connected with that event is @@ -71,7 +76,8 @@ option (google.api.resource_definition) = { // executed and how it is triggered. service FunctionService { option (google.api.default_host) = "cloudfunctions.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Returns a function with the given name from the requested project. rpc GetFunction(GetFunctionRequest) returns (Function) { @@ -92,7 +98,8 @@ service FunctionService { // Creates a new function. If a function with the given name already exists in // the specified project, the long running operation will return // `ALREADY_EXISTS` error. - rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + rpc CreateFunction(CreateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2beta/{parent=projects/*/locations/*}/functions" body: "function" @@ -105,7 +112,8 @@ service FunctionService { } // Updates existing function. - rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + rpc UpdateFunction(UpdateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2beta/{function.name=projects/*/locations/*/functions/*}" body: "function" @@ -120,7 +128,8 @@ service FunctionService { // Deletes a function with the given name from the specified project. If the // given function is used by some trigger, the trigger will be updated to // remove this function. - rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + rpc DeleteFunction(DeleteFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v2beta/{name=projects/*/locations/*/functions/*}" }; @@ -154,7 +163,8 @@ service FunctionService { // And this header SHOULD NOT be specified: // // * `Authorization: Bearer YOUR_TOKEN` - rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + rpc GenerateUploadUrl(GenerateUploadUrlRequest) + returns (GenerateUploadUrlResponse) { option (google.api.http) = { post: "/v2beta/{parent=projects/*/locations/*}/functions:generateUploadUrl" body: "*" @@ -166,7 +176,8 @@ service FunctionService { // 30 minutes of generation. // For more information about the signed URL usage see: // https://cloud.google.com/storage/docs/access-control/signed-urls - rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) + returns (GenerateDownloadUrlResponse) { option (google.api.http) = { post: "/v2beta/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" body: "*" @@ -230,9 +241,6 @@ message Function { // globally and match pattern `projects/*/locations/*/functions/*` string name = 1; - // Describe whether the function is gen1 or gen2. - Environment environment = 10; - // User-provided description of a function. string description = 2; @@ -252,13 +260,30 @@ message Function { State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of a Cloud Function. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Labels associated with this Cloud Function. map labels = 8; // Output only. State Messages for this Cloud Function. - repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated StateMessage state_messages = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Describe whether the function is 1st Gen or 2nd Gen. + Environment environment = 10; + + // Output only. The deployed url for the function. + string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // [Preview] Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function resources. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 25 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Informational messages about the state of the Cloud Function or Operation. @@ -375,8 +400,25 @@ message SourceProvenance { // Describes the Build step of the function that builds a container from the // given source. message BuildConfig { - // Output only. The Cloud Build name of the latest successful deployment of the - // function. + // Docker Registry to use for storing function Docker images. + enum DockerRegistry { + // Unspecified. + DOCKER_REGISTRY_UNSPECIFIED = 0; + + // Docker images will be stored in multi-regional Container Registry + // repositories named `gcf`. + CONTAINER_REGISTRY = 1; + + // Docker images will be stored in regional Artifact Registry repositories. + // By default, GCF will create and use repositories named `gcf-artifacts` + // in every region in which a function is deployed. But the repository to + // use can also be specified by the user using the `docker_repository` + // field. + ARTIFACT_REGISTRY = 2; + } + + // Output only. The Cloud Build name of the latest successful deployment of + // the function. string build = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -403,7 +445,8 @@ message BuildConfig { Source source = 4; // Output only. A permanent fixed identifier for source. - SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + SourceProvenance source_provenance = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Name of the Cloud Build Custom Worker Pool that should be used to build the // function. The format of this field is @@ -418,14 +461,24 @@ message BuildConfig { // granted the role Cloud Build Custom Workers Builder // (roles/cloudbuild.customworkers.builder) in the project. string worker_pool = 5 [(google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/WorkerPool" - }]; + type: "cloudbuild.googleapis.com/WorkerPool" + }]; // User-provided build-time environment variables for the function map environment_variables = 6; - // Optional. User managed repository created in Artifact Registry optionally with a - // customer managed encryption key. This is the repository to which the + // Docker Registry to use for this deployment. This configuration is only + // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact + // Registry. + // + // If `docker_repository` field is specified, this field will be automatically + // set as `ARTIFACT_REGISTRY`. + // If unspecified, it currently defaults to `CONTAINER_REGISTRY`. + // This field may be overridden by the backend for eligible deployments. + DockerRegistry docker_registry = 10; + + // User managed repository created in Artifact Registry optionally + // with a customer managed encryption key. This is the repository to which the // function docker image will be pushed after it is built by Cloud Build. // If unspecified, GCF will create and use a repository named 'gcf-artifacts' // for every deployed region. @@ -436,12 +489,9 @@ message BuildConfig { // Cross-project repositories are not supported. // Cross-location repositories are not supported. // Repository format must be 'DOCKER'. - string docker_repository = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "artifactregistry.googleapis.com/Repository" - } - ]; + string docker_repository = 7 [(google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + }]; } // Describes the Service being deployed. @@ -482,14 +532,33 @@ message ServiceConfig { ALLOW_INTERNAL_AND_GCLB = 3; } + // Available security level settings. + // + // This enforces security protocol on function URL. + // + // Security level is only configurable for 1st Gen functions, If unspecified, + // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY. + enum SecurityLevel { + // Unspecified. + SECURITY_LEVEL_UNSPECIFIED = 0; + + // Requests for a URL that match this handler that do not use HTTPS are + // automatically redirected to the HTTPS URL with the same path. Query + // parameters are reserved for the redirect. + SECURE_ALWAYS = 1; + + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used and respond accordingly. + SECURE_OPTIONAL = 2; + } + // Output only. Name of the service associated with a Function. // The format of this field is // `projects/{project}/locations/{region}/services/{service}` string service = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "run.googleapis.com/Service" - } + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } ]; // The function execution timeout. Execution is considered failed and @@ -505,6 +574,13 @@ message ServiceConfig { // a full description. string available_memory = 13; + // [Preview] The number of CPUs used in a single container instance. + // Default value is calculated from available memory. + // Supports the same values as Cloud Run, see + // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements + // Example: "1" indicates 1 vCPU + string available_cpu = 22; + // Environment variables that shall be available during function execution. map environment_variables = 4; @@ -536,8 +612,8 @@ message ServiceConfig { // The Serverless VPC Access connector that this cloud function can connect // to. The format of this field is `projects/*/locations/*/connectors/*`. string vpc_connector = 6 [(google.api.resource_reference) = { - type: "vpcaccess.googleapis.com/Connector" - }]; + type: "vpcaccess.googleapis.com/Connector" + }]; // The egress settings for the connector, controlling what traffic is diverted // through it. @@ -569,6 +645,16 @@ message ServiceConfig { // Output only. The name of service revision. string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // [Preview] Sets the maximum number of concurrent requests that each instance + // can receive. Defaults to 1. + int32 max_instance_request_concurrency = 20; + + // Security level configure whether the function only accepts https. + // This configuration is only applicable to 1st Gen functions with Http + // trigger. By default https is optional for 1st Gen functions; 2nd Gen + // functions are https ONLY. + SecurityLevel security_level = 21; } // Configuration for a secret environment variable. It has the information @@ -649,8 +735,8 @@ message EventTrigger { RETRY_POLICY_RETRY = 2; } - // Output only. The resource name of the Eventarc trigger. The format of this field is - // `projects/{project}/locations/{region}/triggers/{trigger}`. + // Output only. The resource name of the Eventarc trigger. The format of this + // field is `projects/{project}/locations/{region}/triggers/{trigger}`. string trigger = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -681,19 +767,18 @@ message EventTrigger { // will not be deleted at function deletion. string pubsub_topic = 5 [ (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Topic" - } + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // Optional. The email of the trigger's service account. The service account must have - // permission to invoke Cloud Run services, the permission is + // Optional. The email of the trigger's service account. The service account + // must have permission to invoke Cloud Run services, the permission is // `run.routes.invoke`. // If empty, defaults to the Compute Engine default service account: // `{project_number}-compute@developer.gserviceaccount.com`. string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). + // Optional. If unset, then defaults to ignoring failures (i.e. not retrying + // them). RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. The name of the channel associated with the trigger in @@ -735,12 +820,12 @@ message GetFunctionRequest { // Request for the `ListFunctions` method. message ListFunctionsRequest { - // Required. The project and location from which the function should be listed, - // specified in the format `projects/*/locations/*` - // If you want to list functions in all locations, use "-" in place of a - // location. When listing functions in all locations, if one or more - // location(s) are unreachable, the response will contain functions from all - // reachable locations along with the names of any unreachable locations. + // Required. The project and location from which the function should be + // listed, specified in the format `projects/*/locations/*` If you want to + // list functions in all locations, use "-" in place of a location. When + // listing functions in all locations, if one or more location(s) are + // unreachable, the response will contain functions from all reachable + // locations along with the names of any unreachable locations. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -748,7 +833,10 @@ message ListFunctionsRequest { } ]; - // Maximum number of functions to return per call. + // Maximum number of functions to return per call. The largest allowed + // page_size is 1,000, if the page_size is omitted or specified as greater + // than 1,000 then it will be replaced as 1,000. The size of the list + // response can be less than specified when used with filters. int32 page_size = 2; // The value returned by the last @@ -783,8 +871,8 @@ message ListFunctionsResponse { // Request for the `CreateFunction` method. message CreateFunctionRequest { - // Required. The project and location in which the function should be created, specified - // in the format `projects/*/locations/*` + // Required. The project and location in which the function should be created, + // specified in the format `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -827,14 +915,33 @@ message DeleteFunctionRequest { // Request of `GenerateSourceUploadUrl` method. message GenerateUploadUrlRequest { - // Required. The project and location in which the Google Cloud Storage signed URL - // should be generated, specified in the format `projects/*/locations/*`. + // Required. The project and location in which the Google Cloud Storage signed + // URL should be generated, specified in the format `projects/*/locations/*`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "locations.googleapis.com/Location" } ]; + + // [Preview] Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function source code objects in intermediate Cloud Storage + // buckets. When you generate an upload url and upload your source code, it + // gets copied to an intermediate Cloud Storage bucket. The source code is + // then copied to a versioned directory in the sources bucket in the consumer + // project during the function deployment. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + // + // The Google Cloud Functions service account + // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + // Key/KeyRing/Project/Organization (least access preferred). + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Response of `GenerateSourceUploadUrl` method. @@ -857,8 +964,8 @@ message GenerateUploadUrlResponse { // Request of `GenerateDownloadUrl` method. message GenerateDownloadUrlRequest { - // Required. The name of function for which source code Google Cloud Storage signed - // URL should be generated. + // Required. The name of function for which source code Google Cloud Storage + // signed URL should be generated. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -876,8 +983,8 @@ message GenerateDownloadUrlResponse { // Request for the `ListRuntimes` method. message ListRuntimesRequest { - // Required. The project and location from which the runtimes should be listed, - // specified in the format `projects/*/locations/*` + // Required. The project and location from which the runtimes should be + // listed, specified in the format `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -958,8 +1065,9 @@ message OperationMetadata { // 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`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool cancel_requested = 6; // API version used to start the operation. @@ -972,6 +1080,12 @@ message OperationMetadata { repeated Stage stages = 9; } +// Extra GCF specific location information. +message LocationMetadata { + // The Cloud Function environments this location supports. + repeated Environment environments = 1; +} + // Each Stage of the deployment process message Stage { // Possible names for a Stage diff --git a/packages/google-cloud-functions/protos/protos.d.ts b/packages/google-cloud-functions/protos/protos.d.ts index dc6a0c168cac..c871c7b9450e 100644 --- a/packages/google-cloud-functions/protos/protos.d.ts +++ b/packages/google-cloud-functions/protos/protos.d.ts @@ -3058,9 +3058,6 @@ export namespace google { /** Function name */ name?: (string|null); - /** Function environment */ - environment?: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment|null); - /** Function description */ description?: (string|null); @@ -3085,11 +3082,14 @@ export namespace google { /** Function stateMessages */ stateMessages?: (google.cloud.functions.v2.IStateMessage[]|null); - /** Function kmsKeyName */ - kmsKeyName?: (string|null); + /** Function environment */ + environment?: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment|null); /** Function url */ url?: (string|null); + + /** Function kmsKeyName */ + kmsKeyName?: (string|null); } /** Represents a Function. */ @@ -3104,9 +3104,6 @@ export namespace google { /** Function name. */ public name: string; - /** Function environment. */ - public environment: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment); - /** Function description. */ public description: string; @@ -3131,12 +3128,15 @@ export namespace google { /** Function stateMessages. */ public stateMessages: google.cloud.functions.v2.IStateMessage[]; - /** Function kmsKeyName. */ - public kmsKeyName: string; + /** Function environment. */ + public environment: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment); /** Function url. */ public url: string; + /** Function kmsKeyName. */ + public kmsKeyName: string; + /** * Creates a new Function instance using the specified properties. * @param [properties] Properties to set @@ -6291,6 +6291,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata environments */ + environments?: (google.cloud.functions.v2.Environment[]|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.functions.v2.ILocationMetadata); + + /** LocationMetadata environments. */ + public environments: google.cloud.functions.v2.Environment[]; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.functions.v2.ILocationMetadata): google.cloud.functions.v2.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.functions.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.functions.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.functions.v2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Stage. */ interface IStage { @@ -6649,9 +6746,6 @@ export namespace google { /** Function name */ name?: (string|null); - /** Function environment */ - environment?: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment|null); - /** Function description */ description?: (string|null); @@ -6675,6 +6769,15 @@ export namespace google { /** Function stateMessages */ stateMessages?: (google.cloud.functions.v2alpha.IStateMessage[]|null); + + /** Function environment */ + environment?: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment|null); + + /** Function url */ + url?: (string|null); + + /** Function kmsKeyName */ + kmsKeyName?: (string|null); } /** Represents a Function. */ @@ -6689,9 +6792,6 @@ export namespace google { /** Function name. */ public name: string; - /** Function environment. */ - public environment: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment); - /** Function description. */ public description: string; @@ -6716,6 +6816,15 @@ export namespace google { /** Function stateMessages. */ public stateMessages: google.cloud.functions.v2alpha.IStateMessage[]; + /** Function environment. */ + public environment: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment); + + /** Function url. */ + public url: string; + + /** Function kmsKeyName. */ + public kmsKeyName: string; + /** * Creates a new Function instance using the specified properties. * @param [properties] Properties to set @@ -7405,6 +7514,9 @@ export namespace google { /** BuildConfig environmentVariables */ environmentVariables?: ({ [k: string]: string }|null); + /** BuildConfig dockerRegistry */ + dockerRegistry?: (google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|null); + /** BuildConfig dockerRepository */ dockerRepository?: (string|null); } @@ -7439,6 +7551,9 @@ export namespace google { /** BuildConfig environmentVariables. */ public environmentVariables: { [k: string]: string }; + /** BuildConfig dockerRegistry. */ + public dockerRegistry: (google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2alpha.BuildConfig.DockerRegistry); + /** BuildConfig dockerRepository. */ public dockerRepository: string; @@ -7520,6 +7635,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace BuildConfig { + + /** DockerRegistry enum. */ + enum DockerRegistry { + DOCKER_REGISTRY_UNSPECIFIED = 0, + CONTAINER_REGISTRY = 1, + ARTIFACT_REGISTRY = 2 + } + } + /** Properties of a ServiceConfig. */ interface IServiceConfig { @@ -7532,6 +7657,9 @@ export namespace google { /** ServiceConfig availableMemory */ availableMemory?: (string|null); + /** ServiceConfig availableCpu */ + availableCpu?: (string|null); + /** ServiceConfig environmentVariables */ environmentVariables?: ({ [k: string]: string }|null); @@ -7567,6 +7695,12 @@ export namespace google { /** ServiceConfig revision */ revision?: (string|null); + + /** ServiceConfig maxInstanceRequestConcurrency */ + maxInstanceRequestConcurrency?: (number|null); + + /** ServiceConfig securityLevel */ + securityLevel?: (google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|null); } /** Represents a ServiceConfig. */ @@ -7587,6 +7721,9 @@ export namespace google { /** ServiceConfig availableMemory. */ public availableMemory: string; + /** ServiceConfig availableCpu. */ + public availableCpu: string; + /** ServiceConfig environmentVariables. */ public environmentVariables: { [k: string]: string }; @@ -7623,6 +7760,12 @@ export namespace google { /** ServiceConfig revision. */ public revision: string; + /** ServiceConfig maxInstanceRequestConcurrency. */ + public maxInstanceRequestConcurrency: number; + + /** ServiceConfig securityLevel. */ + public securityLevel: (google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel); + /** * Creates a new ServiceConfig instance using the specified properties. * @param [properties] Properties to set @@ -7717,6 +7860,13 @@ export namespace google { ALLOW_INTERNAL_ONLY = 2, ALLOW_INTERNAL_AND_GCLB = 3 } + + /** SecurityLevel enum. */ + enum SecurityLevel { + SECURITY_LEVEL_UNSPECIFIED = 0, + SECURE_ALWAYS = 1, + SECURE_OPTIONAL = 2 + } } /** Properties of a SecretEnvVar. */ @@ -8954,6 +9104,9 @@ export namespace google { /** GenerateUploadUrlRequest parent */ parent?: (string|null); + + /** GenerateUploadUrlRequest kmsKeyName */ + kmsKeyName?: (string|null); } /** Represents a GenerateUploadUrlRequest. */ @@ -8968,6 +9121,9 @@ export namespace google { /** GenerateUploadUrlRequest parent. */ public parent: string; + /** GenerateUploadUrlRequest kmsKeyName. */ + public kmsKeyName: string; + /** * Creates a new GenerateUploadUrlRequest instance using the specified properties. * @param [properties] Properties to set @@ -9823,6 +9979,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata environments */ + environments?: (google.cloud.functions.v2alpha.Environment[]|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.functions.v2alpha.ILocationMetadata); + + /** LocationMetadata environments. */ + public environments: google.cloud.functions.v2alpha.Environment[]; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.functions.v2alpha.ILocationMetadata): google.cloud.functions.v2alpha.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.functions.v2alpha.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.functions.v2alpha.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2alpha.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2alpha.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2alpha.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.functions.v2alpha.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Stage. */ interface IStage { @@ -10181,9 +10434,6 @@ export namespace google { /** Function name */ name?: (string|null); - /** Function environment */ - environment?: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment|null); - /** Function description */ description?: (string|null); @@ -10207,6 +10457,15 @@ export namespace google { /** Function stateMessages */ stateMessages?: (google.cloud.functions.v2beta.IStateMessage[]|null); + + /** Function environment */ + environment?: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment|null); + + /** Function url */ + url?: (string|null); + + /** Function kmsKeyName */ + kmsKeyName?: (string|null); } /** Represents a Function. */ @@ -10221,9 +10480,6 @@ export namespace google { /** Function name. */ public name: string; - /** Function environment. */ - public environment: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment); - /** Function description. */ public description: string; @@ -10248,6 +10504,15 @@ export namespace google { /** Function stateMessages. */ public stateMessages: google.cloud.functions.v2beta.IStateMessage[]; + /** Function environment. */ + public environment: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment); + + /** Function url. */ + public url: string; + + /** Function kmsKeyName. */ + public kmsKeyName: string; + /** * Creates a new Function instance using the specified properties. * @param [properties] Properties to set @@ -10937,6 +11202,9 @@ export namespace google { /** BuildConfig environmentVariables */ environmentVariables?: ({ [k: string]: string }|null); + /** BuildConfig dockerRegistry */ + dockerRegistry?: (google.cloud.functions.v2beta.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2beta.BuildConfig.DockerRegistry|null); + /** BuildConfig dockerRepository */ dockerRepository?: (string|null); } @@ -10971,6 +11239,9 @@ export namespace google { /** BuildConfig environmentVariables. */ public environmentVariables: { [k: string]: string }; + /** BuildConfig dockerRegistry. */ + public dockerRegistry: (google.cloud.functions.v2beta.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2beta.BuildConfig.DockerRegistry); + /** BuildConfig dockerRepository. */ public dockerRepository: string; @@ -11052,6 +11323,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace BuildConfig { + + /** DockerRegistry enum. */ + enum DockerRegistry { + DOCKER_REGISTRY_UNSPECIFIED = 0, + CONTAINER_REGISTRY = 1, + ARTIFACT_REGISTRY = 2 + } + } + /** Properties of a ServiceConfig. */ interface IServiceConfig { @@ -11064,6 +11345,9 @@ export namespace google { /** ServiceConfig availableMemory */ availableMemory?: (string|null); + /** ServiceConfig availableCpu */ + availableCpu?: (string|null); + /** ServiceConfig environmentVariables */ environmentVariables?: ({ [k: string]: string }|null); @@ -11099,9 +11383,15 @@ export namespace google { /** ServiceConfig revision */ revision?: (string|null); - } - /** Represents a ServiceConfig. */ + /** ServiceConfig maxInstanceRequestConcurrency */ + maxInstanceRequestConcurrency?: (number|null); + + /** ServiceConfig securityLevel */ + securityLevel?: (google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|null); + } + + /** Represents a ServiceConfig. */ class ServiceConfig implements IServiceConfig { /** @@ -11119,6 +11409,9 @@ export namespace google { /** ServiceConfig availableMemory. */ public availableMemory: string; + /** ServiceConfig availableCpu. */ + public availableCpu: string; + /** ServiceConfig environmentVariables. */ public environmentVariables: { [k: string]: string }; @@ -11155,6 +11448,12 @@ export namespace google { /** ServiceConfig revision. */ public revision: string; + /** ServiceConfig maxInstanceRequestConcurrency. */ + public maxInstanceRequestConcurrency: number; + + /** ServiceConfig securityLevel. */ + public securityLevel: (google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2beta.ServiceConfig.SecurityLevel); + /** * Creates a new ServiceConfig instance using the specified properties. * @param [properties] Properties to set @@ -11249,6 +11548,13 @@ export namespace google { ALLOW_INTERNAL_ONLY = 2, ALLOW_INTERNAL_AND_GCLB = 3 } + + /** SecurityLevel enum. */ + enum SecurityLevel { + SECURITY_LEVEL_UNSPECIFIED = 0, + SECURE_ALWAYS = 1, + SECURE_OPTIONAL = 2 + } } /** Properties of a SecretEnvVar. */ @@ -12486,6 +12792,9 @@ export namespace google { /** GenerateUploadUrlRequest parent */ parent?: (string|null); + + /** GenerateUploadUrlRequest kmsKeyName */ + kmsKeyName?: (string|null); } /** Represents a GenerateUploadUrlRequest. */ @@ -12500,6 +12809,9 @@ export namespace google { /** GenerateUploadUrlRequest parent. */ public parent: string; + /** GenerateUploadUrlRequest kmsKeyName. */ + public kmsKeyName: string; + /** * Creates a new GenerateUploadUrlRequest instance using the specified properties. * @param [properties] Properties to set @@ -13355,6 +13667,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata environments */ + environments?: (google.cloud.functions.v2beta.Environment[]|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.functions.v2beta.ILocationMetadata); + + /** LocationMetadata environments. */ + public environments: google.cloud.functions.v2beta.Environment[]; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.functions.v2beta.ILocationMetadata): google.cloud.functions.v2beta.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.functions.v2beta.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.functions.v2beta.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2beta.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2beta.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2beta.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.functions.v2beta.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Stage. */ interface IStage { @@ -17484,200 +17893,303 @@ export namespace google { } } - /** Properties of a FieldMask. */ - interface IFieldMask { + /** Properties of an Any. */ + interface IAny { - /** FieldMask paths */ - paths?: (string[]|null); + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new FieldMask. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); + constructor(properties?: google.protobuf.IAny); - /** FieldMask paths. */ - public paths: string[]; + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Any instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns Any instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * 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.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IAny, 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 + * 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.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * 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 FieldMask + * @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.FieldMask; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @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.FieldMask; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; /** - * Verifies a FieldMask message. + * 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 a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * 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.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Any to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldMask + * 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 Any. */ - interface IAny { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** Any type_url */ - type_url?: (string|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** Any value */ - value?: (Uint8Array|string|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents an Any. */ - class Any implements IAny { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new Any. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IAny); + constructor(properties?: google.protobuf.ITimestamp); - /** Any type_url. */ - public type_url: string; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** Any value. */ - public value: (Uint8Array|string); + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new Any instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns Any instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, 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 + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Any message from the specified reader or buffer. + * 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 Any + * @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.Any; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Any + * @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.Any; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies an Any message. + * 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 an Any message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Any + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any + * 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.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Any to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for 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 */ @@ -17877,109 +18389,6 @@ export namespace google { */ 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; - } } /** Namespace iam. */ diff --git a/packages/google-cloud-functions/protos/protos.js b/packages/google-cloud-functions/protos/protos.js index 49abe9fc5ba2..e5a4b8fbf5b8 100644 --- a/packages/google-cloud-functions/protos/protos.js +++ b/packages/google-cloud-functions/protos/protos.js @@ -7338,7 +7338,6 @@ * @memberof google.cloud.functions.v2 * @interface IFunction * @property {string|null} [name] Function name - * @property {google.cloud.functions.v2.Environment|null} [environment] Function environment * @property {string|null} [description] Function description * @property {google.cloud.functions.v2.IBuildConfig|null} [buildConfig] Function buildConfig * @property {google.cloud.functions.v2.IServiceConfig|null} [serviceConfig] Function serviceConfig @@ -7347,8 +7346,9 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime * @property {Object.|null} [labels] Function labels * @property {Array.|null} [stateMessages] Function stateMessages - * @property {string|null} [kmsKeyName] Function kmsKeyName + * @property {google.cloud.functions.v2.Environment|null} [environment] Function environment * @property {string|null} [url] Function url + * @property {string|null} [kmsKeyName] Function kmsKeyName */ /** @@ -7376,14 +7376,6 @@ */ Function.prototype.name = ""; - /** - * Function environment. - * @member {google.cloud.functions.v2.Environment} environment - * @memberof google.cloud.functions.v2.Function - * @instance - */ - Function.prototype.environment = 0; - /** * Function description. * @member {string} description @@ -7449,12 +7441,12 @@ Function.prototype.stateMessages = $util.emptyArray; /** - * Function kmsKeyName. - * @member {string} kmsKeyName + * Function environment. + * @member {google.cloud.functions.v2.Environment} environment * @memberof google.cloud.functions.v2.Function * @instance */ - Function.prototype.kmsKeyName = ""; + Function.prototype.environment = 0; /** * Function url. @@ -7464,6 +7456,14 @@ */ Function.prototype.url = ""; + /** + * Function kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.functions.v2.Function + * @instance + */ + Function.prototype.kmsKeyName = ""; + /** * Creates a new Function instance using the specified properties. * @function create @@ -7552,10 +7552,6 @@ message.name = reader.string(); break; } - case 10: { - message.environment = reader.int32(); - break; - } case 2: { message.description = reader.string(); break; @@ -7609,14 +7605,18 @@ message.stateMessages.push($root.google.cloud.functions.v2.StateMessage.decode(reader, reader.uint32())); break; } - case 25: { - message.kmsKeyName = reader.string(); + case 10: { + message.environment = reader.int32(); break; } case 14: { message.url = reader.string(); break; } + case 25: { + message.kmsKeyName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7655,15 +7655,6 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.environment != null && message.hasOwnProperty("environment")) - switch (message.environment) { - default: - return "environment: enum value expected"; - case 0: - case 1: - case 2: - break; - } if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; @@ -7716,12 +7707,21 @@ return "stateMessages." + error; } } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + switch (message.environment) { + default: + return "environment: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.url != null && message.hasOwnProperty("url")) if (!$util.isString(message.url)) return "url: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; @@ -7739,26 +7739,6 @@ var message = new $root.google.cloud.functions.v2.Function(); if (object.name != null) message.name = String(object.name); - switch (object.environment) { - default: - if (typeof object.environment === "number") { - message.environment = object.environment; - break; - } - break; - case "ENVIRONMENT_UNSPECIFIED": - case 0: - message.environment = 0; - break; - case "GEN_1": - case 1: - message.environment = 1; - break; - case "GEN_2": - case 2: - message.environment = 2; - break; - } if (object.description != null) message.description = String(object.description); if (object.buildConfig != null) { @@ -7830,10 +7810,30 @@ message.stateMessages[i] = $root.google.cloud.functions.v2.StateMessage.fromObject(object.stateMessages[i]); } } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + switch (object.environment) { + default: + if (typeof object.environment === "number") { + message.environment = object.environment; + break; + } + break; + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environment = 0; + break; + case "GEN_1": + case 1: + message.environment = 1; + break; + case "GEN_2": + case 2: + message.environment = 2; + break; + } if (object.url != null) message.url = String(object.url); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; @@ -15760,6 +15760,257 @@ return OperationMetadata; })(); + v2.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.functions.v2 + * @interface ILocationMetadata + * @property {Array.|null} [environments] LocationMetadata environments + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.functions.v2 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.functions.v2.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata environments. + * @member {Array.} environments + * @memberof google.cloud.functions.v2.LocationMetadata + * @instance + */ + LocationMetadata.prototype.environments = $util.emptyArray; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {google.cloud.functions.v2.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {google.cloud.functions.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.environments.length; ++i) + writer.int32(message.environments[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {google.cloud.functions.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.environments.push(reader.int32()); + } else + message.environments.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) + switch (message.environments[i]) { + default: + return "environments: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.functions.v2.LocationMetadata) + return object; + var message = new $root.google.cloud.functions.v2.LocationMetadata(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.functions.v2.LocationMetadata.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) + switch (object.environments[i]) { + default: + if (typeof object.environments[i] === "number") { + message.environments[i] = object.environments[i]; + break; + } + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environments[i] = 0; + break; + case "GEN_1": + case 1: + message.environments[i] = 1; + break; + case "GEN_2": + case 2: + message.environments[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {google.cloud.functions.v2.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2.Environment[message.environments[j]] : message.environments[j]; + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.functions.v2.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.functions.v2.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.functions.v2.LocationMetadata"; + }; + + return LocationMetadata; + })(); + v2.Stage = (function() { /** @@ -16550,7 +16801,6 @@ * @memberof google.cloud.functions.v2alpha * @interface IFunction * @property {string|null} [name] Function name - * @property {google.cloud.functions.v2alpha.Environment|null} [environment] Function environment * @property {string|null} [description] Function description * @property {google.cloud.functions.v2alpha.IBuildConfig|null} [buildConfig] Function buildConfig * @property {google.cloud.functions.v2alpha.IServiceConfig|null} [serviceConfig] Function serviceConfig @@ -16559,6 +16809,9 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime * @property {Object.|null} [labels] Function labels * @property {Array.|null} [stateMessages] Function stateMessages + * @property {google.cloud.functions.v2alpha.Environment|null} [environment] Function environment + * @property {string|null} [url] Function url + * @property {string|null} [kmsKeyName] Function kmsKeyName */ /** @@ -16586,14 +16839,6 @@ */ Function.prototype.name = ""; - /** - * Function environment. - * @member {google.cloud.functions.v2alpha.Environment} environment - * @memberof google.cloud.functions.v2alpha.Function - * @instance - */ - Function.prototype.environment = 0; - /** * Function description. * @member {string} description @@ -16658,6 +16903,30 @@ */ Function.prototype.stateMessages = $util.emptyArray; + /** + * Function environment. + * @member {google.cloud.functions.v2alpha.Environment} environment + * @memberof google.cloud.functions.v2alpha.Function + * @instance + */ + Function.prototype.environment = 0; + + /** + * Function url. + * @member {string} url + * @memberof google.cloud.functions.v2alpha.Function + * @instance + */ + Function.prototype.url = ""; + + /** + * Function kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.functions.v2alpha.Function + * @instance + */ + Function.prototype.kmsKeyName = ""; + /** * Creates a new Function instance using the specified properties. * @function create @@ -16704,6 +16973,10 @@ $root.google.cloud.functions.v2alpha.StateMessage.encode(message.stateMessages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.environment); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.url); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.kmsKeyName); return writer; }; @@ -16742,10 +17015,6 @@ message.name = reader.string(); break; } - case 10: { - message.environment = reader.int32(); - break; - } case 2: { message.description = reader.string(); break; @@ -16799,6 +17068,18 @@ message.stateMessages.push($root.google.cloud.functions.v2alpha.StateMessage.decode(reader, reader.uint32())); break; } + case 10: { + message.environment = reader.int32(); + break; + } + case 14: { + message.url = reader.string(); + break; + } + case 25: { + message.kmsKeyName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -16837,15 +17118,6 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.environment != null && message.hasOwnProperty("environment")) - switch (message.environment) { - default: - return "environment: enum value expected"; - case 0: - case 1: - case 2: - break; - } if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; @@ -16898,6 +17170,21 @@ return "stateMessages." + error; } } + if (message.environment != null && message.hasOwnProperty("environment")) + switch (message.environment) { + default: + return "environment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; @@ -16915,26 +17202,6 @@ var message = new $root.google.cloud.functions.v2alpha.Function(); if (object.name != null) message.name = String(object.name); - switch (object.environment) { - default: - if (typeof object.environment === "number") { - message.environment = object.environment; - break; - } - break; - case "ENVIRONMENT_UNSPECIFIED": - case 0: - message.environment = 0; - break; - case "GEN_1": - case 1: - message.environment = 1; - break; - case "GEN_2": - case 2: - message.environment = 2; - break; - } if (object.description != null) message.description = String(object.description); if (object.buildConfig != null) { @@ -17006,6 +17273,30 @@ message.stateMessages[i] = $root.google.cloud.functions.v2alpha.StateMessage.fromObject(object.stateMessages[i]); } } + switch (object.environment) { + default: + if (typeof object.environment === "number") { + message.environment = object.environment; + break; + } + break; + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environment = 0; + break; + case "GEN_1": + case 1: + message.environment = 1; + break; + case "GEN_2": + case 2: + message.environment = 2; + break; + } + if (object.url != null) + message.url = String(object.url); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; @@ -17035,6 +17326,8 @@ object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.updateTime = null; object.environment = options.enums === String ? "ENVIRONMENT_UNSPECIFIED" : 0; + object.url = ""; + object.kmsKeyName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -17063,6 +17356,10 @@ } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = options.enums === String ? $root.google.cloud.functions.v2alpha.Environment[message.environment] === undefined ? message.environment : $root.google.cloud.functions.v2alpha.Environment[message.environment] : message.environment; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; @@ -18563,6 +18860,7 @@ * @property {google.cloud.functions.v2alpha.ISourceProvenance|null} [sourceProvenance] BuildConfig sourceProvenance * @property {string|null} [workerPool] BuildConfig workerPool * @property {Object.|null} [environmentVariables] BuildConfig environmentVariables + * @property {google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|null} [dockerRegistry] BuildConfig dockerRegistry * @property {string|null} [dockerRepository] BuildConfig dockerRepository */ @@ -18638,6 +18936,14 @@ */ BuildConfig.prototype.environmentVariables = $util.emptyObject; + /** + * BuildConfig dockerRegistry. + * @member {google.cloud.functions.v2alpha.BuildConfig.DockerRegistry} dockerRegistry + * @memberof google.cloud.functions.v2alpha.BuildConfig + * @instance + */ + BuildConfig.prototype.dockerRegistry = 0; + /** * BuildConfig dockerRepository. * @member {string} dockerRepository @@ -18687,6 +18993,8 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.dockerRepository); if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance")) $root.google.cloud.functions.v2alpha.SourceProvenance.encode(message.sourceProvenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dockerRegistry != null && Object.hasOwnProperty.call(message, "dockerRegistry")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.dockerRegistry); return writer; }; @@ -18768,6 +19076,10 @@ message.environmentVariables[key] = value; break; } + case 10: { + message.dockerRegistry = reader.int32(); + break; + } case 7: { message.dockerRepository = reader.string(); break; @@ -18837,6 +19149,15 @@ if (!$util.isString(message.environmentVariables[key[i]])) return "environmentVariables: string{k:string} expected"; } + if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry")) + switch (message.dockerRegistry) { + default: + return "dockerRegistry: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.dockerRepository != null && message.hasOwnProperty("dockerRepository")) if (!$util.isString(message.dockerRepository)) return "dockerRepository: string expected"; @@ -18880,6 +19201,26 @@ for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); } + switch (object.dockerRegistry) { + default: + if (typeof object.dockerRegistry === "number") { + message.dockerRegistry = object.dockerRegistry; + break; + } + break; + case "DOCKER_REGISTRY_UNSPECIFIED": + case 0: + message.dockerRegistry = 0; + break; + case "CONTAINER_REGISTRY": + case 1: + message.dockerRegistry = 1; + break; + case "ARTIFACT_REGISTRY": + case 2: + message.dockerRegistry = 2; + break; + } if (object.dockerRepository != null) message.dockerRepository = String(object.dockerRepository); return message; @@ -18908,6 +19249,7 @@ object.workerPool = ""; object.dockerRepository = ""; object.sourceProvenance = null; + object.dockerRegistry = options.enums === String ? "DOCKER_REGISTRY_UNSPECIFIED" : 0; } if (message.build != null && message.hasOwnProperty("build")) object.build = message.build; @@ -18929,6 +19271,8 @@ object.dockerRepository = message.dockerRepository; if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) object.sourceProvenance = $root.google.cloud.functions.v2alpha.SourceProvenance.toObject(message.sourceProvenance, options); + if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry")) + object.dockerRegistry = options.enums === String ? $root.google.cloud.functions.v2alpha.BuildConfig.DockerRegistry[message.dockerRegistry] === undefined ? message.dockerRegistry : $root.google.cloud.functions.v2alpha.BuildConfig.DockerRegistry[message.dockerRegistry] : message.dockerRegistry; return object; }; @@ -18958,6 +19302,22 @@ return typeUrlPrefix + "/google.cloud.functions.v2alpha.BuildConfig"; }; + /** + * DockerRegistry enum. + * @name google.cloud.functions.v2alpha.BuildConfig.DockerRegistry + * @enum {number} + * @property {number} DOCKER_REGISTRY_UNSPECIFIED=0 DOCKER_REGISTRY_UNSPECIFIED value + * @property {number} CONTAINER_REGISTRY=1 CONTAINER_REGISTRY value + * @property {number} ARTIFACT_REGISTRY=2 ARTIFACT_REGISTRY value + */ + BuildConfig.DockerRegistry = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCKER_REGISTRY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTAINER_REGISTRY"] = 1; + values[valuesById[2] = "ARTIFACT_REGISTRY"] = 2; + return values; + })(); + return BuildConfig; })(); @@ -18970,6 +19330,7 @@ * @property {string|null} [service] ServiceConfig service * @property {number|null} [timeoutSeconds] ServiceConfig timeoutSeconds * @property {string|null} [availableMemory] ServiceConfig availableMemory + * @property {string|null} [availableCpu] ServiceConfig availableCpu * @property {Object.|null} [environmentVariables] ServiceConfig environmentVariables * @property {number|null} [maxInstanceCount] ServiceConfig maxInstanceCount * @property {number|null} [minInstanceCount] ServiceConfig minInstanceCount @@ -18982,6 +19343,8 @@ * @property {Array.|null} [secretEnvironmentVariables] ServiceConfig secretEnvironmentVariables * @property {Array.|null} [secretVolumes] ServiceConfig secretVolumes * @property {string|null} [revision] ServiceConfig revision + * @property {number|null} [maxInstanceRequestConcurrency] ServiceConfig maxInstanceRequestConcurrency + * @property {google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|null} [securityLevel] ServiceConfig securityLevel */ /** @@ -19026,6 +19389,14 @@ */ ServiceConfig.prototype.availableMemory = ""; + /** + * ServiceConfig availableCpu. + * @member {string} availableCpu + * @memberof google.cloud.functions.v2alpha.ServiceConfig + * @instance + */ + ServiceConfig.prototype.availableCpu = ""; + /** * ServiceConfig environmentVariables. * @member {Object.} environmentVariables @@ -19122,6 +19493,22 @@ */ ServiceConfig.prototype.revision = ""; + /** + * ServiceConfig maxInstanceRequestConcurrency. + * @member {number} maxInstanceRequestConcurrency + * @memberof google.cloud.functions.v2alpha.ServiceConfig + * @instance + */ + ServiceConfig.prototype.maxInstanceRequestConcurrency = 0; + + /** + * ServiceConfig securityLevel. + * @member {google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel} securityLevel + * @memberof google.cloud.functions.v2alpha.ServiceConfig + * @instance + */ + ServiceConfig.prototype.securityLevel = 0; + /** * Creates a new ServiceConfig instance using the specified properties. * @function create @@ -19179,6 +19566,12 @@ if (message.secretVolumes != null && message.secretVolumes.length) for (var i = 0; i < message.secretVolumes.length; ++i) $root.google.cloud.functions.v2alpha.SecretVolume.encode(message.secretVolumes[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.maxInstanceRequestConcurrency); + if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.securityLevel); + if (message.availableCpu != null && Object.hasOwnProperty.call(message, "availableCpu")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.availableCpu); return writer; }; @@ -19225,6 +19618,10 @@ message.availableMemory = reader.string(); break; } + case 22: { + message.availableCpu = reader.string(); + break; + } case 4: { if (message.environmentVariables === $util.emptyObject) message.environmentVariables = {}; @@ -19296,6 +19693,14 @@ message.revision = reader.string(); break; } + case 20: { + message.maxInstanceRequestConcurrency = reader.int32(); + break; + } + case 21: { + message.securityLevel = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -19340,6 +19745,9 @@ if (message.availableMemory != null && message.hasOwnProperty("availableMemory")) if (!$util.isString(message.availableMemory)) return "availableMemory: string expected"; + if (message.availableCpu != null && message.hasOwnProperty("availableCpu")) + if (!$util.isString(message.availableCpu)) + return "availableCpu: string expected"; if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { if (!$util.isObject(message.environmentVariables)) return "environmentVariables: object expected"; @@ -19406,6 +19814,18 @@ if (message.revision != null && message.hasOwnProperty("revision")) if (!$util.isString(message.revision)) return "revision: string expected"; + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + if (!$util.isInteger(message.maxInstanceRequestConcurrency)) + return "maxInstanceRequestConcurrency: integer expected"; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + switch (message.securityLevel) { + default: + return "securityLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -19427,6 +19847,8 @@ message.timeoutSeconds = object.timeoutSeconds | 0; if (object.availableMemory != null) message.availableMemory = String(object.availableMemory); + if (object.availableCpu != null) + message.availableCpu = String(object.availableCpu); if (object.environmentVariables) { if (typeof object.environmentVariables !== "object") throw TypeError(".google.cloud.functions.v2alpha.ServiceConfig.environmentVariables: object expected"); @@ -19512,6 +19934,28 @@ } if (object.revision != null) message.revision = String(object.revision); + if (object.maxInstanceRequestConcurrency != null) + message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; + switch (object.securityLevel) { + default: + if (typeof object.securityLevel === "number") { + message.securityLevel = object.securityLevel; + break; + } + break; + case "SECURITY_LEVEL_UNSPECIFIED": + case 0: + message.securityLevel = 0; + break; + case "SECURE_ALWAYS": + case 1: + message.securityLevel = 1; + break; + case "SECURE_OPTIONAL": + case 2: + message.securityLevel = 2; + break; + } return message; }; @@ -19547,6 +19991,9 @@ object.availableMemory = ""; object.allTrafficOnLatestRevision = false; object.revision = ""; + object.maxInstanceRequestConcurrency = 0; + object.securityLevel = options.enums === String ? "SECURITY_LEVEL_UNSPECIFIED" : 0; + object.availableCpu = ""; } if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; @@ -19588,6 +20035,12 @@ for (var j = 0; j < message.secretVolumes.length; ++j) object.secretVolumes[j] = $root.google.cloud.functions.v2alpha.SecretVolume.toObject(message.secretVolumes[j], options); } + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + object.securityLevel = options.enums === String ? $root.google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel[message.securityLevel] : message.securityLevel; + if (message.availableCpu != null && message.hasOwnProperty("availableCpu")) + object.availableCpu = message.availableCpu; return object; }; @@ -19651,6 +20104,22 @@ return values; })(); + /** + * SecurityLevel enum. + * @name google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel + * @enum {number} + * @property {number} SECURITY_LEVEL_UNSPECIFIED=0 SECURITY_LEVEL_UNSPECIFIED value + * @property {number} SECURE_ALWAYS=1 SECURE_ALWAYS value + * @property {number} SECURE_OPTIONAL=2 SECURE_OPTIONAL value + */ + ServiceConfig.SecurityLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SECURITY_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SECURE_ALWAYS"] = 1; + values[valuesById[2] = "SECURE_OPTIONAL"] = 2; + return values; + })(); + return ServiceConfig; })(); @@ -22615,6 +23084,7 @@ * @memberof google.cloud.functions.v2alpha * @interface IGenerateUploadUrlRequest * @property {string|null} [parent] GenerateUploadUrlRequest parent + * @property {string|null} [kmsKeyName] GenerateUploadUrlRequest kmsKeyName */ /** @@ -22640,6 +23110,14 @@ */ GenerateUploadUrlRequest.prototype.parent = ""; + /** + * GenerateUploadUrlRequest kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.functions.v2alpha.GenerateUploadUrlRequest + * @instance + */ + GenerateUploadUrlRequest.prototype.kmsKeyName = ""; + /** * Creates a new GenerateUploadUrlRequest instance using the specified properties. * @function create @@ -22666,6 +23144,8 @@ writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); return writer; }; @@ -22704,6 +23184,10 @@ message.parent = reader.string(); break; } + case 2: { + message.kmsKeyName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22742,6 +23226,9 @@ if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; @@ -22759,6 +23246,8 @@ var message = new $root.google.cloud.functions.v2alpha.GenerateUploadUrlRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; @@ -22775,10 +23264,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.kmsKeyName = ""; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; @@ -24730,6 +25223,257 @@ return OperationMetadata; })(); + v2alpha.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.functions.v2alpha + * @interface ILocationMetadata + * @property {Array.|null} [environments] LocationMetadata environments + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.functions.v2alpha + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.functions.v2alpha.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata environments. + * @member {Array.} environments + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @instance + */ + LocationMetadata.prototype.environments = $util.emptyArray; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {google.cloud.functions.v2alpha.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {google.cloud.functions.v2alpha.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.environments.length; ++i) + writer.int32(message.environments[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {google.cloud.functions.v2alpha.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2alpha.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.environments.push(reader.int32()); + } else + message.environments.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) + switch (message.environments[i]) { + default: + return "environments: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.functions.v2alpha.LocationMetadata) + return object; + var message = new $root.google.cloud.functions.v2alpha.LocationMetadata(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.functions.v2alpha.LocationMetadata.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) + switch (object.environments[i]) { + default: + if (typeof object.environments[i] === "number") { + message.environments[i] = object.environments[i]; + break; + } + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environments[i] = 0; + break; + case "GEN_1": + case 1: + message.environments[i] = 1; + break; + case "GEN_2": + case 2: + message.environments[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {google.cloud.functions.v2alpha.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2alpha.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2alpha.Environment[message.environments[j]] : message.environments[j]; + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.functions.v2alpha.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.functions.v2alpha.LocationMetadata"; + }; + + return LocationMetadata; + })(); + v2alpha.Stage = (function() { /** @@ -25520,7 +26264,6 @@ * @memberof google.cloud.functions.v2beta * @interface IFunction * @property {string|null} [name] Function name - * @property {google.cloud.functions.v2beta.Environment|null} [environment] Function environment * @property {string|null} [description] Function description * @property {google.cloud.functions.v2beta.IBuildConfig|null} [buildConfig] Function buildConfig * @property {google.cloud.functions.v2beta.IServiceConfig|null} [serviceConfig] Function serviceConfig @@ -25529,6 +26272,9 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime * @property {Object.|null} [labels] Function labels * @property {Array.|null} [stateMessages] Function stateMessages + * @property {google.cloud.functions.v2beta.Environment|null} [environment] Function environment + * @property {string|null} [url] Function url + * @property {string|null} [kmsKeyName] Function kmsKeyName */ /** @@ -25556,14 +26302,6 @@ */ Function.prototype.name = ""; - /** - * Function environment. - * @member {google.cloud.functions.v2beta.Environment} environment - * @memberof google.cloud.functions.v2beta.Function - * @instance - */ - Function.prototype.environment = 0; - /** * Function description. * @member {string} description @@ -25628,6 +26366,30 @@ */ Function.prototype.stateMessages = $util.emptyArray; + /** + * Function environment. + * @member {google.cloud.functions.v2beta.Environment} environment + * @memberof google.cloud.functions.v2beta.Function + * @instance + */ + Function.prototype.environment = 0; + + /** + * Function url. + * @member {string} url + * @memberof google.cloud.functions.v2beta.Function + * @instance + */ + Function.prototype.url = ""; + + /** + * Function kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.functions.v2beta.Function + * @instance + */ + Function.prototype.kmsKeyName = ""; + /** * Creates a new Function instance using the specified properties. * @function create @@ -25674,6 +26436,10 @@ $root.google.cloud.functions.v2beta.StateMessage.encode(message.stateMessages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.environment); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.url); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.kmsKeyName); return writer; }; @@ -25712,10 +26478,6 @@ message.name = reader.string(); break; } - case 10: { - message.environment = reader.int32(); - break; - } case 2: { message.description = reader.string(); break; @@ -25769,6 +26531,18 @@ message.stateMessages.push($root.google.cloud.functions.v2beta.StateMessage.decode(reader, reader.uint32())); break; } + case 10: { + message.environment = reader.int32(); + break; + } + case 14: { + message.url = reader.string(); + break; + } + case 25: { + message.kmsKeyName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25807,15 +26581,6 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.environment != null && message.hasOwnProperty("environment")) - switch (message.environment) { - default: - return "environment: enum value expected"; - case 0: - case 1: - case 2: - break; - } if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; @@ -25868,6 +26633,21 @@ return "stateMessages." + error; } } + if (message.environment != null && message.hasOwnProperty("environment")) + switch (message.environment) { + default: + return "environment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; @@ -25885,26 +26665,6 @@ var message = new $root.google.cloud.functions.v2beta.Function(); if (object.name != null) message.name = String(object.name); - switch (object.environment) { - default: - if (typeof object.environment === "number") { - message.environment = object.environment; - break; - } - break; - case "ENVIRONMENT_UNSPECIFIED": - case 0: - message.environment = 0; - break; - case "GEN_1": - case 1: - message.environment = 1; - break; - case "GEN_2": - case 2: - message.environment = 2; - break; - } if (object.description != null) message.description = String(object.description); if (object.buildConfig != null) { @@ -25976,6 +26736,30 @@ message.stateMessages[i] = $root.google.cloud.functions.v2beta.StateMessage.fromObject(object.stateMessages[i]); } } + switch (object.environment) { + default: + if (typeof object.environment === "number") { + message.environment = object.environment; + break; + } + break; + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environment = 0; + break; + case "GEN_1": + case 1: + message.environment = 1; + break; + case "GEN_2": + case 2: + message.environment = 2; + break; + } + if (object.url != null) + message.url = String(object.url); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; @@ -26005,6 +26789,8 @@ object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.updateTime = null; object.environment = options.enums === String ? "ENVIRONMENT_UNSPECIFIED" : 0; + object.url = ""; + object.kmsKeyName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -26033,6 +26819,10 @@ } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = options.enums === String ? $root.google.cloud.functions.v2beta.Environment[message.environment] === undefined ? message.environment : $root.google.cloud.functions.v2beta.Environment[message.environment] : message.environment; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; @@ -27533,6 +28323,7 @@ * @property {google.cloud.functions.v2beta.ISourceProvenance|null} [sourceProvenance] BuildConfig sourceProvenance * @property {string|null} [workerPool] BuildConfig workerPool * @property {Object.|null} [environmentVariables] BuildConfig environmentVariables + * @property {google.cloud.functions.v2beta.BuildConfig.DockerRegistry|null} [dockerRegistry] BuildConfig dockerRegistry * @property {string|null} [dockerRepository] BuildConfig dockerRepository */ @@ -27608,6 +28399,14 @@ */ BuildConfig.prototype.environmentVariables = $util.emptyObject; + /** + * BuildConfig dockerRegistry. + * @member {google.cloud.functions.v2beta.BuildConfig.DockerRegistry} dockerRegistry + * @memberof google.cloud.functions.v2beta.BuildConfig + * @instance + */ + BuildConfig.prototype.dockerRegistry = 0; + /** * BuildConfig dockerRepository. * @member {string} dockerRepository @@ -27657,6 +28456,8 @@ writer.uint32(/* id 7, wireType 2 =*/58).string(message.dockerRepository); if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance")) $root.google.cloud.functions.v2beta.SourceProvenance.encode(message.sourceProvenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dockerRegistry != null && Object.hasOwnProperty.call(message, "dockerRegistry")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.dockerRegistry); return writer; }; @@ -27738,6 +28539,10 @@ message.environmentVariables[key] = value; break; } + case 10: { + message.dockerRegistry = reader.int32(); + break; + } case 7: { message.dockerRepository = reader.string(); break; @@ -27807,6 +28612,15 @@ if (!$util.isString(message.environmentVariables[key[i]])) return "environmentVariables: string{k:string} expected"; } + if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry")) + switch (message.dockerRegistry) { + default: + return "dockerRegistry: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.dockerRepository != null && message.hasOwnProperty("dockerRepository")) if (!$util.isString(message.dockerRepository)) return "dockerRepository: string expected"; @@ -27850,6 +28664,26 @@ for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); } + switch (object.dockerRegistry) { + default: + if (typeof object.dockerRegistry === "number") { + message.dockerRegistry = object.dockerRegistry; + break; + } + break; + case "DOCKER_REGISTRY_UNSPECIFIED": + case 0: + message.dockerRegistry = 0; + break; + case "CONTAINER_REGISTRY": + case 1: + message.dockerRegistry = 1; + break; + case "ARTIFACT_REGISTRY": + case 2: + message.dockerRegistry = 2; + break; + } if (object.dockerRepository != null) message.dockerRepository = String(object.dockerRepository); return message; @@ -27878,6 +28712,7 @@ object.workerPool = ""; object.dockerRepository = ""; object.sourceProvenance = null; + object.dockerRegistry = options.enums === String ? "DOCKER_REGISTRY_UNSPECIFIED" : 0; } if (message.build != null && message.hasOwnProperty("build")) object.build = message.build; @@ -27899,6 +28734,8 @@ object.dockerRepository = message.dockerRepository; if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) object.sourceProvenance = $root.google.cloud.functions.v2beta.SourceProvenance.toObject(message.sourceProvenance, options); + if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry")) + object.dockerRegistry = options.enums === String ? $root.google.cloud.functions.v2beta.BuildConfig.DockerRegistry[message.dockerRegistry] === undefined ? message.dockerRegistry : $root.google.cloud.functions.v2beta.BuildConfig.DockerRegistry[message.dockerRegistry] : message.dockerRegistry; return object; }; @@ -27928,6 +28765,22 @@ return typeUrlPrefix + "/google.cloud.functions.v2beta.BuildConfig"; }; + /** + * DockerRegistry enum. + * @name google.cloud.functions.v2beta.BuildConfig.DockerRegistry + * @enum {number} + * @property {number} DOCKER_REGISTRY_UNSPECIFIED=0 DOCKER_REGISTRY_UNSPECIFIED value + * @property {number} CONTAINER_REGISTRY=1 CONTAINER_REGISTRY value + * @property {number} ARTIFACT_REGISTRY=2 ARTIFACT_REGISTRY value + */ + BuildConfig.DockerRegistry = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCKER_REGISTRY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTAINER_REGISTRY"] = 1; + values[valuesById[2] = "ARTIFACT_REGISTRY"] = 2; + return values; + })(); + return BuildConfig; })(); @@ -27940,6 +28793,7 @@ * @property {string|null} [service] ServiceConfig service * @property {number|null} [timeoutSeconds] ServiceConfig timeoutSeconds * @property {string|null} [availableMemory] ServiceConfig availableMemory + * @property {string|null} [availableCpu] ServiceConfig availableCpu * @property {Object.|null} [environmentVariables] ServiceConfig environmentVariables * @property {number|null} [maxInstanceCount] ServiceConfig maxInstanceCount * @property {number|null} [minInstanceCount] ServiceConfig minInstanceCount @@ -27952,6 +28806,8 @@ * @property {Array.|null} [secretEnvironmentVariables] ServiceConfig secretEnvironmentVariables * @property {Array.|null} [secretVolumes] ServiceConfig secretVolumes * @property {string|null} [revision] ServiceConfig revision + * @property {number|null} [maxInstanceRequestConcurrency] ServiceConfig maxInstanceRequestConcurrency + * @property {google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|null} [securityLevel] ServiceConfig securityLevel */ /** @@ -27996,6 +28852,14 @@ */ ServiceConfig.prototype.availableMemory = ""; + /** + * ServiceConfig availableCpu. + * @member {string} availableCpu + * @memberof google.cloud.functions.v2beta.ServiceConfig + * @instance + */ + ServiceConfig.prototype.availableCpu = ""; + /** * ServiceConfig environmentVariables. * @member {Object.} environmentVariables @@ -28092,6 +28956,22 @@ */ ServiceConfig.prototype.revision = ""; + /** + * ServiceConfig maxInstanceRequestConcurrency. + * @member {number} maxInstanceRequestConcurrency + * @memberof google.cloud.functions.v2beta.ServiceConfig + * @instance + */ + ServiceConfig.prototype.maxInstanceRequestConcurrency = 0; + + /** + * ServiceConfig securityLevel. + * @member {google.cloud.functions.v2beta.ServiceConfig.SecurityLevel} securityLevel + * @memberof google.cloud.functions.v2beta.ServiceConfig + * @instance + */ + ServiceConfig.prototype.securityLevel = 0; + /** * Creates a new ServiceConfig instance using the specified properties. * @function create @@ -28149,6 +29029,12 @@ if (message.secretVolumes != null && message.secretVolumes.length) for (var i = 0; i < message.secretVolumes.length; ++i) $root.google.cloud.functions.v2beta.SecretVolume.encode(message.secretVolumes[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.maxInstanceRequestConcurrency); + if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.securityLevel); + if (message.availableCpu != null && Object.hasOwnProperty.call(message, "availableCpu")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.availableCpu); return writer; }; @@ -28195,6 +29081,10 @@ message.availableMemory = reader.string(); break; } + case 22: { + message.availableCpu = reader.string(); + break; + } case 4: { if (message.environmentVariables === $util.emptyObject) message.environmentVariables = {}; @@ -28266,6 +29156,14 @@ message.revision = reader.string(); break; } + case 20: { + message.maxInstanceRequestConcurrency = reader.int32(); + break; + } + case 21: { + message.securityLevel = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -28310,6 +29208,9 @@ if (message.availableMemory != null && message.hasOwnProperty("availableMemory")) if (!$util.isString(message.availableMemory)) return "availableMemory: string expected"; + if (message.availableCpu != null && message.hasOwnProperty("availableCpu")) + if (!$util.isString(message.availableCpu)) + return "availableCpu: string expected"; if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { if (!$util.isObject(message.environmentVariables)) return "environmentVariables: object expected"; @@ -28376,6 +29277,18 @@ if (message.revision != null && message.hasOwnProperty("revision")) if (!$util.isString(message.revision)) return "revision: string expected"; + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + if (!$util.isInteger(message.maxInstanceRequestConcurrency)) + return "maxInstanceRequestConcurrency: integer expected"; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + switch (message.securityLevel) { + default: + return "securityLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -28397,6 +29310,8 @@ message.timeoutSeconds = object.timeoutSeconds | 0; if (object.availableMemory != null) message.availableMemory = String(object.availableMemory); + if (object.availableCpu != null) + message.availableCpu = String(object.availableCpu); if (object.environmentVariables) { if (typeof object.environmentVariables !== "object") throw TypeError(".google.cloud.functions.v2beta.ServiceConfig.environmentVariables: object expected"); @@ -28482,6 +29397,28 @@ } if (object.revision != null) message.revision = String(object.revision); + if (object.maxInstanceRequestConcurrency != null) + message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; + switch (object.securityLevel) { + default: + if (typeof object.securityLevel === "number") { + message.securityLevel = object.securityLevel; + break; + } + break; + case "SECURITY_LEVEL_UNSPECIFIED": + case 0: + message.securityLevel = 0; + break; + case "SECURE_ALWAYS": + case 1: + message.securityLevel = 1; + break; + case "SECURE_OPTIONAL": + case 2: + message.securityLevel = 2; + break; + } return message; }; @@ -28517,6 +29454,9 @@ object.availableMemory = ""; object.allTrafficOnLatestRevision = false; object.revision = ""; + object.maxInstanceRequestConcurrency = 0; + object.securityLevel = options.enums === String ? "SECURITY_LEVEL_UNSPECIFIED" : 0; + object.availableCpu = ""; } if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; @@ -28558,6 +29498,12 @@ for (var j = 0; j < message.secretVolumes.length; ++j) object.secretVolumes[j] = $root.google.cloud.functions.v2beta.SecretVolume.toObject(message.secretVolumes[j], options); } + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; + if (message.securityLevel != null && message.hasOwnProperty("securityLevel")) + object.securityLevel = options.enums === String ? $root.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel[message.securityLevel] : message.securityLevel; + if (message.availableCpu != null && message.hasOwnProperty("availableCpu")) + object.availableCpu = message.availableCpu; return object; }; @@ -28621,6 +29567,22 @@ return values; })(); + /** + * SecurityLevel enum. + * @name google.cloud.functions.v2beta.ServiceConfig.SecurityLevel + * @enum {number} + * @property {number} SECURITY_LEVEL_UNSPECIFIED=0 SECURITY_LEVEL_UNSPECIFIED value + * @property {number} SECURE_ALWAYS=1 SECURE_ALWAYS value + * @property {number} SECURE_OPTIONAL=2 SECURE_OPTIONAL value + */ + ServiceConfig.SecurityLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SECURITY_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SECURE_ALWAYS"] = 1; + values[valuesById[2] = "SECURE_OPTIONAL"] = 2; + return values; + })(); + return ServiceConfig; })(); @@ -31585,6 +32547,7 @@ * @memberof google.cloud.functions.v2beta * @interface IGenerateUploadUrlRequest * @property {string|null} [parent] GenerateUploadUrlRequest parent + * @property {string|null} [kmsKeyName] GenerateUploadUrlRequest kmsKeyName */ /** @@ -31610,6 +32573,14 @@ */ GenerateUploadUrlRequest.prototype.parent = ""; + /** + * GenerateUploadUrlRequest kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.functions.v2beta.GenerateUploadUrlRequest + * @instance + */ + GenerateUploadUrlRequest.prototype.kmsKeyName = ""; + /** * Creates a new GenerateUploadUrlRequest instance using the specified properties. * @function create @@ -31636,6 +32607,8 @@ writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); return writer; }; @@ -31674,6 +32647,10 @@ message.parent = reader.string(); break; } + case 2: { + message.kmsKeyName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31712,6 +32689,9 @@ if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; @@ -31729,6 +32709,8 @@ var message = new $root.google.cloud.functions.v2beta.GenerateUploadUrlRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; @@ -31745,10 +32727,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.kmsKeyName = ""; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; @@ -33700,6 +34686,257 @@ return OperationMetadata; })(); + v2beta.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.functions.v2beta + * @interface ILocationMetadata + * @property {Array.|null} [environments] LocationMetadata environments + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.functions.v2beta + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.functions.v2beta.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata environments. + * @member {Array.} environments + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @instance + */ + LocationMetadata.prototype.environments = $util.emptyArray; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {google.cloud.functions.v2beta.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {google.cloud.functions.v2beta.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.environments.length; ++i) + writer.int32(message.environments[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {google.cloud.functions.v2beta.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2beta.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.environments.push(reader.int32()); + } else + message.environments.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) + switch (message.environments[i]) { + default: + return "environments: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.functions.v2beta.LocationMetadata) + return object; + var message = new $root.google.cloud.functions.v2beta.LocationMetadata(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.functions.v2beta.LocationMetadata.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) + switch (object.environments[i]) { + default: + if (typeof object.environments[i] === "number") { + message.environments[i] = object.environments[i]; + break; + } + case "ENVIRONMENT_UNSPECIFIED": + case 0: + message.environments[i] = 0; + break; + case "GEN_1": + case 1: + message.environments[i] = 1; + break; + case "GEN_2": + case 2: + message.environments[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {google.cloud.functions.v2beta.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2beta.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2beta.Environment[message.environments[j]] : message.environments[j]; + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.functions.v2beta.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.functions.v2beta.LocationMetadata"; + }; + + return LocationMetadata; + })(); + v2beta.Stage = (function() { /** @@ -45259,225 +46496,6 @@ return GeneratedCodeInfo; })(); - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - protobuf.Any = (function() { /** @@ -45714,25 +46732,25 @@ return Any; })(); - protobuf.Duration = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a Duration. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new Duration. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function Duration(properties) { + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45740,43 +46758,43 @@ } /** - * Duration seconds. + * Timestamp seconds. * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Duration nanos. + * Timestamp nanos. * @member {number} nanos - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.nanos = 0; + Timestamp.prototype.nanos = 0; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - Duration.create = function create(properties) { - return new Duration(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) @@ -45787,33 +46805,33 @@ }; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @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.Duration} Duration + * @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 */ - Duration.decode = function decode(reader, length) { + 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.Duration(); + 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) { @@ -45834,30 +46852,30 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @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 */ - Duration.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.Duration + * @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 */ - Duration.verify = function verify(message) { + Timestamp.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) @@ -45870,17 +46888,17 @@ }; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Timestamp} Timestamp */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.Duration(); + var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; @@ -45896,15 +46914,15 @@ }; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -45927,51 +46945,53 @@ }; /** - * Converts this Duration to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Duration; + return Timestamp; })(); - protobuf.Empty = (function() { + protobuf.FieldMask = (function() { /** - * Properties of an Empty. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IEmpty + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function Empty(properties) { + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45979,63 +46999,80 @@ } /** - * Creates a new Empty instance using the specified properties. + * 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.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - Empty.create = function create(properties) { - return new Empty(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, 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 Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @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.Empty} Empty + * @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 */ - Empty.decode = function decode(reader, length) { + 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.Empty(); + 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; @@ -46045,110 +47082,135 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @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 */ - Empty.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.Empty + * @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 */ - Empty.verify = function verify(message) { + 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 an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - return new $root.google.protobuf.Empty(); + 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 an Empty message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + 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 Empty to JSON. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.protobuf.FieldMask"; }; - return Empty; + return FieldMask; })(); - protobuf.Timestamp = (function() { + protobuf.Duration = (function() { /** - * Properties of a Timestamp. + * Properties of a Duration. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new Timestamp. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function Timestamp(properties) { + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46156,43 +47218,43 @@ } /** - * Timestamp seconds. + * Duration seconds. * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Timestamp nanos. + * Duration nanos. * @member {number} nanos - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance */ - Timestamp.prototype.nanos = 0; + Duration.prototype.nanos = 0; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) @@ -46203,33 +47265,33 @@ }; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @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.Timestamp} Timestamp + * @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 */ - Timestamp.decode = function decode(reader, length) { + 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.Timestamp(); + 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) { @@ -46250,30 +47312,30 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @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 */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.Timestamp + * @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 */ - Timestamp.verify = function verify(message) { + Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) @@ -46286,17 +47348,17 @@ }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Duration} Duration */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.Timestamp(); + var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; @@ -46312,15 +47374,15 @@ }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -46343,32 +47405,207 @@ }; /** - * Converts this Timestamp to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - return Timestamp; + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; })(); return protobuf; diff --git a/packages/google-cloud-functions/protos/protos.json b/packages/google-cloud-functions/protos/protos.json index b4479d70e731..b9497f521803 100644 --- a/packages/google-cloud-functions/protos/protos.json +++ b/packages/google-cloud-functions/protos/protos.json @@ -1014,10 +1014,6 @@ "type": "string", "id": 1 }, - "environment": { - "type": "Environment", - "id": 10 - }, "description": { "type": "string", "id": 2 @@ -1061,12 +1057,9 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "kmsKeyName": { - "type": "string", - "id": 25, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } + "environment": { + "type": "Environment", + "id": 10 }, "url": { "type": "string", @@ -1074,6 +1067,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "kmsKeyName": { + "type": "string", + "id": 25, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } }, "nested": { @@ -1247,10 +1247,7 @@ }, "dockerRegistry": { "type": "DockerRegistry", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 10 }, "dockerRepository": { "type": "string", @@ -1796,6 +1793,15 @@ } } }, + "LocationMetadata": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + } + } + }, "Stage": { "fields": { "name": { @@ -1855,8 +1861,8 @@ "java_outer_classname": "FunctionsProto", "java_package": "com.google.cloud.functions.v2alpha", "objc_class_prefix": "GCF", - "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", - "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" }, "nested": { "FunctionService": { @@ -2054,10 +2060,6 @@ "type": "string", "id": 1 }, - "environment": { - "type": "Environment", - "id": 10 - }, "description": { "type": "string", "id": 2 @@ -2100,6 +2102,24 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "environment": { + "type": "Environment", + "id": 10 + }, + "url": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 25, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } }, "nested": { @@ -2271,14 +2291,26 @@ "type": "string", "id": 6 }, + "dockerRegistry": { + "type": "DockerRegistry", + "id": 10 + }, "dockerRepository": { "type": "string", "id": 7, "options": { - "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "artifactregistry.googleapis.com/Repository" } } + }, + "nested": { + "DockerRegistry": { + "values": { + "DOCKER_REGISTRY_UNSPECIFIED": 0, + "CONTAINER_REGISTRY": 1, + "ARTIFACT_REGISTRY": 2 + } + } } }, "ServiceConfig": { @@ -2299,6 +2331,10 @@ "type": "string", "id": 13 }, + "availableCpu": { + "type": "string", + "id": 22 + }, "environmentVariables": { "keyType": "string", "type": "string", @@ -2358,6 +2394,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "maxInstanceRequestConcurrency": { + "type": "int32", + "id": 20 + }, + "securityLevel": { + "type": "SecurityLevel", + "id": 21 } }, "nested": { @@ -2375,6 +2419,13 @@ "ALLOW_INTERNAL_ONLY": 2, "ALLOW_INTERNAL_AND_GCLB": 3 } + }, + "SecurityLevel": { + "values": { + "SECURITY_LEVEL_UNSPECIFIED": 0, + "SECURE_ALWAYS": 1, + "SECURE_OPTIONAL": 2 + } } } }, @@ -2642,6 +2693,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } } }, @@ -2781,6 +2839,15 @@ } } }, + "LocationMetadata": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + } + } + }, "Stage": { "fields": { "name": { @@ -2840,8 +2907,8 @@ "java_outer_classname": "FunctionsProto", "java_package": "com.google.cloud.functions.v2beta", "objc_class_prefix": "GCF", - "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", - "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" }, "nested": { "FunctionService": { @@ -3039,10 +3106,6 @@ "type": "string", "id": 1 }, - "environment": { - "type": "Environment", - "id": 10 - }, "description": { "type": "string", "id": 2 @@ -3085,6 +3148,24 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "environment": { + "type": "Environment", + "id": 10 + }, + "url": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 25, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } }, "nested": { @@ -3256,14 +3337,26 @@ "type": "string", "id": 6 }, + "dockerRegistry": { + "type": "DockerRegistry", + "id": 10 + }, "dockerRepository": { "type": "string", "id": 7, "options": { - "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "artifactregistry.googleapis.com/Repository" } } + }, + "nested": { + "DockerRegistry": { + "values": { + "DOCKER_REGISTRY_UNSPECIFIED": 0, + "CONTAINER_REGISTRY": 1, + "ARTIFACT_REGISTRY": 2 + } + } } }, "ServiceConfig": { @@ -3284,6 +3377,10 @@ "type": "string", "id": 13 }, + "availableCpu": { + "type": "string", + "id": 22 + }, "environmentVariables": { "keyType": "string", "type": "string", @@ -3343,6 +3440,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "maxInstanceRequestConcurrency": { + "type": "int32", + "id": 20 + }, + "securityLevel": { + "type": "SecurityLevel", + "id": 21 } }, "nested": { @@ -3360,6 +3465,13 @@ "ALLOW_INTERNAL_ONLY": 2, "ALLOW_INTERNAL_AND_GCLB": 3 } + }, + "SecurityLevel": { + "values": { + "SECURITY_LEVEL_UNSPECIFIED": 0, + "SECURE_ALWAYS": 1, + "SECURE_OPTIONAL": 2 + } } } }, @@ -3627,6 +3739,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } } }, @@ -3766,6 +3885,15 @@ } } }, + "LocationMetadata": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + } + } + }, "Stage": { "fields": { "name": { @@ -4963,15 +5091,6 @@ } } }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, "Any": { "fields": { "type_url": { @@ -4984,7 +5103,7 @@ } } }, - "Duration": { + "Timestamp": { "fields": { "seconds": { "type": "int64", @@ -4996,10 +5115,16 @@ } } }, - "Empty": { - "fields": {} + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } }, - "Timestamp": { + "Duration": { "fields": { "seconds": { "type": "int64", @@ -5010,6 +5135,9 @@ "id": 2 } } + }, + "Empty": { + "fields": {} } } }, diff --git a/packages/google-cloud-functions/samples/README.md b/packages/google-cloud-functions/samples/README.md index d893421d77fd..6bbc06056d4c 100644 --- a/packages/google-cloud-functions/samples/README.md +++ b/packages/google-cloud-functions/samples/README.md @@ -48,7 +48,6 @@ * [Function_service.list_runtimes](#function_service.list_runtimes) * [Function_service.update_function](#function_service.update_function) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -672,23 +671,6 @@ __Usage:__ `node packages/google-cloud-functions/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-functions/samples/test/quickstart.test.js` - - diff --git a/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js b/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js index 8123cdbc6ff7..dbb4c91641e8 100644 --- a/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js +++ b/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js @@ -29,8 +29,8 @@ function main(location, function1) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` */ // const location = 'abc123' /** diff --git a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json index 3fe3030b6b98..41cafa9ca8ef 100644 --- a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json +++ b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.0", + "version": "2.4.1", "language": "TYPESCRIPT", "apis": [ { @@ -103,7 +103,7 @@ "regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_CreateFunction_async", "title": "CloudFunctionsService createFunction Sample", "origin": "API_DEFINITION", - "description": " Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return `ALREADY_EXISTS` error.", + "description": " Creates a new function. If a function with the given name already exists in the specified project, the long running operation returns an `ALREADY_EXISTS` error.", "canonical": true, "file": "cloud_functions_service.create_function.js", "language": "JAVASCRIPT", @@ -191,7 +191,7 @@ "regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_DeleteFunction_async", "title": "CloudFunctionsService deleteFunction Sample", "origin": "API_DEFINITION", - "description": " Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function.", + "description": " Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger is updated to remove this function.", "canonical": true, "file": "cloud_functions_service.delete_function.js", "language": "JAVASCRIPT", @@ -275,7 +275,7 @@ "regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_GenerateUploadUrl_async", "title": "CloudFunctionsService generateUploadUrl Sample", "origin": "API_DEFINITION", - "description": " Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * Source file size should not exceed 100MB limit. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, these two headers need to be specified: * `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN`", + "description": " Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * Source file size should not exceed 100MB limit. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making an HTTP PUT request, these two headers must be specified: * `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` And this header must NOT be specified: * `Authorization: Bearer YOUR_TOKEN`", "canonical": true, "file": "cloud_functions_service.generate_upload_url.js", "language": "JAVASCRIPT", @@ -319,7 +319,7 @@ "regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_GenerateDownloadUrl_async", "title": "CloudFunctionsService generateDownloadUrl Sample", "origin": "API_DEFINITION", - "description": " Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls", + "description": " Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and must be used within minutes after generation. For more information about the signed URL usage, see: https://cloud.google.com/storage/docs/access-control/signed-urls", "canonical": true, "file": "cloud_functions_service.generate_download_url.js", "language": "JAVASCRIPT", @@ -455,7 +455,7 @@ "regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_TestIamPermissions_async", "title": "CloudFunctionsService testIamPermissions Sample", "origin": "API_DEFINITION", - "description": " Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.", + "description": " Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this returns an empty set of permissions, not a NOT_FOUND error.", "canonical": true, "file": "cloud_functions_service.test_iam_permissions.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js index a38d4bf7647b..e5ad4b903cbc 100644 --- a/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js +++ b/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js @@ -34,7 +34,7 @@ function main(parent) { */ // const parent = 'abc123' /** - * Resource name of a KMS crypto key (managed by the user) used to + * Preview Resource name of a KMS crypto key (managed by the user) used to * encrypt/decrypt function source code objects in intermediate Cloud Storage * buckets. When you generate an upload url and upload your source code, it * gets copied to an intermediate Cloud Storage bucket. The source code is diff --git a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json index d4e5aa304a68..2a095dc4e6df 100644 --- a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json +++ b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.0", + "version": "2.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js index ff03605baf79..0f5680a4aa39 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js +++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js @@ -29,8 +29,8 @@ function main(parent, function1) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js index 31bc30fa7e33..aef6c59f5186 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js +++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of function for which source code Google Cloud Storage signed - * URL should be generated. + * Required. The name of function for which source code Google Cloud Storage + * signed URL should be generated. */ // const name = 'abc123' diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js index df16519d7134..06ed9cd30856 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js +++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js @@ -29,10 +29,26 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the Google Cloud Storage signed URL - * should be generated, specified in the format `projects/* /locations/*`. + * Required. The project and location in which the Google Cloud Storage signed + * URL should be generated, specified in the format `projects/* /locations/*`. */ // const parent = 'abc123' + /** + * Preview Resource name of a KMS crypto key (managed by the user) used to + * encrypt/decrypt function source code objects in intermediate Cloud Storage + * buckets. When you generate an upload url and upload your source code, it + * gets copied to an intermediate Cloud Storage bucket. The source code is + * then copied to a versioned directory in the sources bucket in the consumer + * project during the function deployment. + * It must match the pattern + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * The Google Cloud Functions service account + * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + * Key/KeyRing/Project/Organization (least access preferred). + */ + // const kmsKeyName = 'abc123' // Imports the Functions library const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha; diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js index d57906c8de3e..9e131b181773 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js +++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js @@ -29,16 +29,19 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. */ // const parent = 'abc123' /** - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js index 9445b4dbb54b..9a5754e50d31 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js +++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location from which the runtimes should be listed, - * specified in the format `projects/* /locations/*` + * Required. The project and location from which the runtimes should be + * listed, specified in the format `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json index 3654494c3052..7ecda0aa5929 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json +++ b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.0", + "version": "2.4.1", "language": "TYPESCRIPT", "apis": [ { @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 82, + "end": 85, "type": "FULL" } ], @@ -250,7 +250,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 70, "type": "FULL" } ], @@ -262,6 +262,10 @@ { "name": "parent", "type": "TYPE_STRING" + }, + { + "name": "kms_key_name", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.functions.v2alpha.GenerateUploadUrlResponse", diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js index 8a66e94ed05b..aed5e22444d7 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js +++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js @@ -29,8 +29,8 @@ function main(parent, function1) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js index 0031d52029bd..cc28d6330474 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js +++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of function for which source code Google Cloud Storage signed - * URL should be generated. + * Required. The name of function for which source code Google Cloud Storage + * signed URL should be generated. */ // const name = 'abc123' diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js index ad28b36f9968..a148b14523d9 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js +++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js @@ -29,10 +29,26 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location in which the Google Cloud Storage signed URL - * should be generated, specified in the format `projects/* /locations/*`. + * Required. The project and location in which the Google Cloud Storage signed + * URL should be generated, specified in the format `projects/* /locations/*`. */ // const parent = 'abc123' + /** + * Preview Resource name of a KMS crypto key (managed by the user) used to + * encrypt/decrypt function source code objects in intermediate Cloud Storage + * buckets. When you generate an upload url and upload your source code, it + * gets copied to an intermediate Cloud Storage bucket. The source code is + * then copied to a versioned directory in the sources bucket in the consumer + * project during the function deployment. + * It must match the pattern + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * The Google Cloud Functions service account + * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + * Key/KeyRing/Project/Organization (least access preferred). + */ + // const kmsKeyName = 'abc123' // Imports the Functions library const {FunctionServiceClient} = require('@google-cloud/functions').v2beta; diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js index 31ce53abc212..c1eaa32538e3 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js +++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js @@ -29,16 +29,19 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. */ // const parent = 'abc123' /** - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js index 534741537f75..7e10600b474e 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js +++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location from which the runtimes should be listed, - * specified in the format `projects/* /locations/*` + * Required. The project and location from which the runtimes should be + * listed, specified in the format `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json index 451cd271188e..a487e445633d 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json +++ b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.0", + "version": "2.4.1", "language": "TYPESCRIPT", "apis": [ { @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 82, + "end": 85, "type": "FULL" } ], @@ -250,7 +250,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 70, "type": "FULL" } ], @@ -262,6 +262,10 @@ { "name": "parent", "type": "TYPE_STRING" + }, + { + "name": "kms_key_name", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.functions.v2beta.GenerateUploadUrlResponse", diff --git a/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts b/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts index 75b56ce389df..1a0d6feb4b30 100644 --- a/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts +++ b/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -61,6 +63,7 @@ export class CloudFunctionsServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; cloudFunctionsServiceStub?: Promise<{[name: string]: Function}>; @@ -159,6 +162,10 @@ export class CloudFunctionsServiceClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -612,12 +619,12 @@ export class CloudFunctionsServiceClient { * attached, the identity from the credentials would be used, but that * identity does not have permissions to upload files to the URL. * - * When making a HTTP PUT request, these two headers need to be specified: + * When making an HTTP PUT request, these two headers must be specified: * * * `content-type: application/zip` * * `x-goog-content-length-range: 0,104857600` * - * And this header SHOULD NOT be specified: + * And this header must NOT be specified: * * * `Authorization: Bearer YOUR_TOKEN` * @@ -730,9 +737,9 @@ export class CloudFunctionsServiceClient { } /** * Returns a signed URL for downloading deployed function source code. - * The URL is only valid for a limited period and should be used within + * The URL is only valid for a limited period and must be used within * minutes after generation. - * For more information about the signed URL usage see: + * For more information about the signed URL usage, see: * https://cloud.google.com/storage/docs/access-control/signed-urls * * @param {Object} request @@ -1015,7 +1022,7 @@ export class CloudFunctionsServiceClient { /** * Tests the specified permissions against the IAM access control policy * for a function. - * If the function does not exist, this will return an empty set of + * If the function does not exist, this returns an empty set of * permissions, not a NOT_FOUND error. * * @param {Object} request @@ -1107,14 +1114,14 @@ export class CloudFunctionsServiceClient { /** * Creates a new function. If a function with the given name already exists in - * the specified project, the long running operation will return + * the specified project, the long running operation returns an * `ALREADY_EXISTS` error. * * @param {Object} request * The request object that will be sent. * @param {string} request.location - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` * @param {google.cloud.functions.v1.CloudFunction} request.function * Required. Function to be created. * @param {object} [options] @@ -1390,7 +1397,7 @@ export class CloudFunctionsServiceClient { } /** * Deletes a function with the given name from the specified project. If the - * given function is used by some trigger, the trigger will be updated to + * given function is used by some trigger, the trigger is updated to * remove this function. * * @param {Object} request @@ -1741,6 +1748,261 @@ export class CloudFunctionsServiceClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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 -- // -------------------- @@ -1967,6 +2229,7 @@ export class CloudFunctionsServiceClient { return this.cloudFunctionsServiceStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-functions/src/v2/function_service_client.ts b/packages/google-cloud-functions/src/v2/function_service_client.ts index 8146297f6e48..2a2877757a33 100644 --- a/packages/google-cloud-functions/src/v2/function_service_client.ts +++ b/packages/google-cloud-functions/src/v2/function_service_client.ts @@ -586,7 +586,7 @@ export class FunctionServiceClient { * Required. The project and location in which the Google Cloud Storage signed * URL should be generated, specified in the format `projects/* /locations/*`. * @param {string} request.kmsKeyName - * Resource name of a KMS crypto key (managed by the user) used to + * [Preview] Resource name of a KMS crypto key (managed by the user) used to * encrypt/decrypt function source code objects in intermediate Cloud Storage * buckets. When you generate an upload url and upload your source code, it * gets copied to an intermediate Cloud Storage bucket. The source code is diff --git a/packages/google-cloud-functions/src/v2alpha/function_service_client.ts b/packages/google-cloud-functions/src/v2alpha/function_service_client.ts index dfefec58c0b3..45f7d9e4f421 100644 --- a/packages/google-cloud-functions/src/v2alpha/function_service_client.ts +++ b/packages/google-cloud-functions/src/v2alpha/function_service_client.ts @@ -207,6 +207,9 @@ export class FunctionServiceClient { connectorPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/connectors/{connector}' ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), functionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/functions/{function}' ), @@ -586,8 +589,24 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location in which the Google Cloud Storage signed URL - * should be generated, specified in the format `projects/* /locations/*`. + * Required. The project and location in which the Google Cloud Storage signed + * URL should be generated, specified in the format `projects/* /locations/*`. + * @param {string} request.kmsKeyName + * [Preview] Resource name of a KMS crypto key (managed by the user) used to + * encrypt/decrypt function source code objects in intermediate Cloud Storage + * buckets. When you generate an upload url and upload your source code, it + * gets copied to an intermediate Cloud Storage bucket. The source code is + * then copied to a versioned directory in the sources bucket in the consumer + * project during the function deployment. + * + * It must match the pattern + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * + * The Google Cloud Functions service account + * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + * Key/KeyRing/Project/Organization (least access preferred). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -688,8 +707,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of function for which source code Google Cloud Storage signed - * URL should be generated. + * Required. The name of function for which source code Google Cloud Storage + * signed URL should be generated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -786,8 +805,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the runtimes should be listed, - * specified in the format `projects/* /locations/*` + * Required. The project and location from which the runtimes should be + * listed, specified in the format `projects/* /locations/*` * @param {string} request.filter * The filter for Runtimes that match the filter expression, * following the syntax outlined in https://google.aip.dev/160. @@ -884,8 +903,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` * @param {google.cloud.functions.v2alpha.Function} request.function * Required. Function to be created. * @param {string} request.functionId @@ -1313,14 +1332,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -1426,14 +1448,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -1487,14 +1512,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -2090,6 +2118,77 @@ export class FunctionServiceClient { .connector; } + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .crypto_key; + } + /** * Return a fully-qualified function resource name string. * diff --git a/packages/google-cloud-functions/src/v2beta/function_service_client.ts b/packages/google-cloud-functions/src/v2beta/function_service_client.ts index e36cde632c97..09df44ecd6e6 100644 --- a/packages/google-cloud-functions/src/v2beta/function_service_client.ts +++ b/packages/google-cloud-functions/src/v2beta/function_service_client.ts @@ -207,6 +207,9 @@ export class FunctionServiceClient { connectorPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/connectors/{connector}' ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), functionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/functions/{function}' ), @@ -586,8 +589,24 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location in which the Google Cloud Storage signed URL - * should be generated, specified in the format `projects/* /locations/*`. + * Required. The project and location in which the Google Cloud Storage signed + * URL should be generated, specified in the format `projects/* /locations/*`. + * @param {string} request.kmsKeyName + * [Preview] Resource name of a KMS crypto key (managed by the user) used to + * encrypt/decrypt function source code objects in intermediate Cloud Storage + * buckets. When you generate an upload url and upload your source code, it + * gets copied to an intermediate Cloud Storage bucket. The source code is + * then copied to a versioned directory in the sources bucket in the consumer + * project during the function deployment. + * + * It must match the pattern + * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + * + * The Google Cloud Functions service account + * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + * Key/KeyRing/Project/Organization (least access preferred). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -688,8 +707,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of function for which source code Google Cloud Storage signed - * URL should be generated. + * Required. The name of function for which source code Google Cloud Storage + * signed URL should be generated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -786,8 +805,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the runtimes should be listed, - * specified in the format `projects/* /locations/*` + * Required. The project and location from which the runtimes should be + * listed, specified in the format `projects/* /locations/*` * @param {string} request.filter * The filter for Runtimes that match the filter expression, * following the syntax outlined in https://google.aip.dev/160. @@ -884,8 +903,8 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location in which the function should be created, specified - * in the format `projects/* /locations/*` + * Required. The project and location in which the function should be created, + * specified in the format `projects/* /locations/*` * @param {google.cloud.functions.v2beta.Function} request.function * Required. Function to be created. * @param {string} request.functionId @@ -1313,14 +1332,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -1426,14 +1448,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -1487,14 +1512,17 @@ export class FunctionServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the function should be listed, - * specified in the format `projects/* /locations/*` - * If you want to list functions in all locations, use "-" in place of a - * location. When listing functions in all locations, if one or more - * location(s) are unreachable, the response will contain functions from all - * reachable locations along with the names of any unreachable locations. + * Required. The project and location from which the function should be + * listed, specified in the format `projects/* /locations/*` If you want to + * list functions in all locations, use "-" in place of a location. When + * listing functions in all locations, if one or more location(s) are + * unreachable, the response will contain functions from all reachable + * locations along with the names of any unreachable locations. * @param {number} request.pageSize - * Maximum number of functions to return per call. + * Maximum number of functions to return per call. The largest allowed + * page_size is 1,000, if the page_size is omitted or specified as greater + * than 1,000 then it will be replaced as 1,000. The size of the list + * response can be less than specified when used with filters. * @param {string} request.pageToken * The value returned by the last * `ListFunctionsResponse`; indicates that @@ -2090,6 +2118,77 @@ export class FunctionServiceClient { .connector; } + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .crypto_key; + } + /** * Return a fully-qualified function resource name string. * diff --git a/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts b/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts index c5fb1e0d3429..154f507e9e35 100644 --- a/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts +++ b/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts @@ -25,7 +25,12 @@ import * as cloudfunctionsserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -2142,6 +2147,525 @@ describe('v1.CloudFunctionsServiceClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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 cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({ + 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('cloudFunction', () => { diff --git a/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts b/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts index 28bc8e754e85..8712ec21e152 100644 --- a/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts +++ b/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts @@ -2717,6 +2717,82 @@ describe('v2alpha.FunctionServiceClient', () => { }); }); + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + key_ring: 'keyRingValue', + crypto_key: 'cryptoKeyValue', + }; + const client = new functionserviceModule.v2alpha.FunctionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyRingValue', + 'cryptoKeyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyRingValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'cryptoKeyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('function', () => { const fakePath = '/rendered/path/function'; const expectedParameters = { diff --git a/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts b/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts index 47baf117fa3e..b09c085b301b 100644 --- a/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts +++ b/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts @@ -2717,6 +2717,82 @@ describe('v2beta.FunctionServiceClient', () => { }); }); + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + key_ring: 'keyRingValue', + crypto_key: 'cryptoKeyValue', + }; + const client = new functionserviceModule.v2beta.FunctionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyRingValue', + 'cryptoKeyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyRingValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'cryptoKeyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('function', () => { const fakePath = '/rendered/path/function'; const expectedParameters = { From 99736a9b9ac01b9673280eddc2f57a8722646ecd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:46:04 -0700 Subject: [PATCH 21/46] feat: [ai-platform] add blocking_operation_ids to ImportFeatureValuesOperationMetadata (#4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add match service in aiplatform v1 PiperOrigin-RevId: 533008702 Source-Link: https://github.com/googleapis/googleapis/commit/2f00988bfd99bbb3e268d1d6f3fec37514538020 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3ccb5f69dee03f37c58d0f4c0f87b40936457e5c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjNjY2I1ZjY5ZGVlMDNmMzdjNThkMGY0YzBmODdiNDA5MzY0NTdlNWMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support for Model Garden -- A single place to search, discover, and interact with a wide variety of foundation models from Google and Google partners, available on Vertex AI PiperOrigin-RevId: 536794833 Source-Link: https://github.com/googleapis/googleapis/commit/df070601d4695d29ba096b72b579d8145e8b2fbd Source-Link: https://github.com/googleapis/googleapis-gen/commit/d9492ce901fc8bc2987280f16a466da1b441bc75 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImQ5NDkyY2U5MDFmYzhiYzI5ODcyODBmMTZhNDY2ZGExYjQ0MWJjNzUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add NVIDIA_A100_80GB to AcceleratorType feat: add blocking_operation_ids to ImportFeatureValuesOperationMetadata PiperOrigin-RevId: 537124229 Source-Link: https://github.com/googleapis/googleapis/commit/064f6cd1d12bafb17faa6ed5d77540fd5bc14c2c Source-Link: https://github.com/googleapis/googleapis-gen/commit/b5a4a981256b863f6960aaa6f1a03a65521d002c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImI1YTRhOTgxMjU2Yjg2M2Y2OTYwYWFhNmYxYTAzYTY1NTIxZDAwMmMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add blocking_operation_ids to ImportFeatureValuesOperationMetadata feat: add launch_stage to PublisherModel PiperOrigin-RevId: 537154438 Source-Link: https://github.com/googleapis/googleapis/commit/d2d95e5107bda1d7f51f8878faaaa193553ee972 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2688bd01fc821ef022543955309e9c056cec8d56 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjI2ODhiZDAxZmM4MjFlZjAyMjU0Mzk1NTMwOWU5YzA1NmNlYzhkNTYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: export new clients * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com> Co-authored-by: danieljbruce Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Co-authored-by: Daniel Bankhead Co-authored-by: Sofia Leon --- packages/google-cloud-aiplatform/README.md | 3 + .../aiplatform/v1/accelerator_type.proto | 3 + .../aiplatform/v1/featurestore_service.proto | 8 +- .../cloud/aiplatform/v1/index_endpoint.proto | 15 +- .../cloud/aiplatform/v1/match_service.proto | 176 + .../aiplatform/v1/metadata_service.proto | 15 +- .../google/cloud/aiplatform/v1/model.proto | 13 + .../aiplatform/v1/model_evaluation.proto | 5 +- .../aiplatform/v1/model_garden_service.proto | 83 + .../aiplatform/v1/prediction_service.proto | 3 +- .../cloud/aiplatform/v1/publisher_model.proto | 239 + .../v1/tensorboard_experiment.proto | 3 +- .../cloud/aiplatform/v1/vizier_service.proto | 3 +- .../v1beta1/featurestore_service.proto | 8 +- .../aiplatform/v1beta1/index_endpoint.proto | 15 +- .../aiplatform/v1beta1/metadata_service.proto | 15 +- .../cloud/aiplatform/v1beta1/model.proto | 4 +- .../aiplatform/v1beta1/model_evaluation.proto | 5 +- .../v1beta1/prediction_service.proto | 3 +- .../aiplatform/v1beta1/publisher_model.proto | 27 +- .../v1beta1/tensorboard_experiment.proto | 3 +- .../aiplatform/v1beta1/vizier_service.proto | 3 +- .../protos/protos.d.ts | 1982 ++ .../google-cloud-aiplatform/protos/protos.js | 17055 ++++++++++------ .../protos/protos.json | 563 + .../google-cloud-aiplatform/samples/README.md | 54 + ...turestore_service.import_feature_values.js | 2 +- .../v1/match_service.find_neighbors.js | 83 + .../v1/match_service.read_index_datapoints.js | 71 + .../v1/metadata_service.list_artifacts.js | 3 + .../v1/metadata_service.list_contexts.js | 3 + .../v1/metadata_service.list_executions.js | 3 + ...service.query_artifact_lineage_subgraph.js | 3 + .../v1/metadata_service.update_artifact.js | 1 - .../v1/metadata_service.update_context.js | 1 - .../v1/metadata_service.update_execution.js | 1 - ...odel_garden_service.get_publisher_model.js | 72 + ...t_metadata.google.cloud.aiplatform.v1.json | 166 +- ...turestore_service.import_feature_values.js | 2 +- .../metadata_service.list_artifacts.js | 3 + .../v1beta1/metadata_service.list_contexts.js | 3 + .../metadata_service.list_executions.js | 3 + ...service.query_artifact_lineage_subgraph.js | 3 + .../metadata_service.update_artifact.js | 1 - .../metadata_service.update_context.js | 1 - .../metadata_service.update_execution.js | 1 - ...adata.google.cloud.aiplatform.v1beta1.json | 18 +- packages/google-cloud-aiplatform/src/index.ts | 8 + .../src/v1/dataset_service_client.ts | 43 + .../src/v1/dataset_service_proto_list.json | 3 + .../src/v1/endpoint_service_client.ts | 43 + .../src/v1/endpoint_service_proto_list.json | 3 + ...turestore_online_serving_service_client.ts | 43 + ...ore_online_serving_service_proto_list.json | 3 + .../src/v1/featurestore_service_client.ts | 45 +- .../v1/featurestore_service_proto_list.json | 3 + .../src/v1/gapic_metadata.json | 58 + .../google-cloud-aiplatform/src/v1/index.ts | 2 + .../src/v1/index_endpoint_service_client.ts | 43 + .../v1/index_endpoint_service_proto_list.json | 3 + .../src/v1/index_service_client.ts | 43 + .../src/v1/index_service_proto_list.json | 3 + .../src/v1/job_service_client.ts | 43 + .../src/v1/job_service_proto_list.json | 3 + .../src/v1/match_service_client.ts | 3324 +++ .../src/v1/match_service_client_config.json | 34 + .../src/v1/match_service_proto_list.json | 118 + .../src/v1/metadata_service_client.ts | 76 +- .../src/v1/metadata_service_proto_list.json | 3 + .../src/v1/migration_service_client.ts | 43 + .../src/v1/migration_service_proto_list.json | 3 + .../src/v1/model_garden_service_client.ts | 3216 +++ .../model_garden_service_client_config.json | 30 + .../v1/model_garden_service_proto_list.json | 118 + .../src/v1/model_service_client.ts | 43 + .../src/v1/model_service_proto_list.json | 3 + .../src/v1/pipeline_service_client.ts | 43 + .../src/v1/pipeline_service_proto_list.json | 3 + .../src/v1/prediction_service_client.ts | 46 +- .../src/v1/prediction_service_proto_list.json | 3 + .../src/v1/specialist_pool_service_client.ts | 43 + .../specialist_pool_service_proto_list.json | 3 + .../src/v1/tensorboard_service_client.ts | 43 + .../v1/tensorboard_service_proto_list.json | 3 + .../src/v1/vizier_service_client.ts | 46 +- .../src/v1/vizier_service_proto_list.json | 3 + .../src/v1beta1/dataset_service_client.ts | 10 + ...deployment_resource_pool_service_client.ts | 10 + .../src/v1beta1/endpoint_service_client.ts | 10 + .../v1beta1/featurestore_service_client.ts | 12 +- .../v1beta1/index_endpoint_service_client.ts | 10 + .../src/v1beta1/index_service_client.ts | 10 + .../src/v1beta1/job_service_client.ts | 10 + .../src/v1beta1/metadata_service_client.ts | 43 +- .../src/v1beta1/migration_service_client.ts | 10 + .../src/v1beta1/model_service_client.ts | 10 + .../src/v1beta1/pipeline_service_client.ts | 10 + .../src/v1beta1/prediction_service_client.ts | 3 +- .../src/v1beta1/schedule_service_client.ts | 10 + .../v1beta1/specialist_pool_service_client.ts | 10 + .../src/v1beta1/tensorboard_service_client.ts | 10 + .../src/v1beta1/vizier_service_client.ts | 13 +- .../system-test/fixtures/sample/src/index.js | 2 + .../system-test/fixtures/sample/src/index.ts | 14 + .../test/gapic_dataset_service_v1.ts | 52 + .../test/gapic_endpoint_service_v1.ts | 52 + ..._featurestore_online_serving_service_v1.ts | 55 + .../test/gapic_featurestore_service_v1.ts | 54 + .../test/gapic_index_endpoint_service_v1.ts | 53 + .../test/gapic_index_service_v1.ts | 52 + .../test/gapic_job_service_v1.ts | 52 + .../test/gapic_match_service_v1.ts | 3769 ++++ .../test/gapic_metadata_service_v1.ts | 52 + .../test/gapic_migration_service_v1.ts | 52 + .../test/gapic_model_garden_service_v1.ts | 3640 ++++ .../test/gapic_model_service_v1.ts | 52 + .../test/gapic_pipeline_service_v1.ts | 52 + .../test/gapic_prediction_service_v1.ts | 52 + .../test/gapic_specialist_pool_service_v1.ts | 53 + .../test/gapic_tensorboard_service_v1.ts | 52 + .../test/gapic_vizier_service_v1.ts | 52 + 121 files changed, 30715 insertions(+), 6077 deletions(-) create mode 100644 packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/match_service.proto create mode 100644 packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_garden_service.proto create mode 100644 packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js create mode 100644 packages/google-cloud-aiplatform/src/v1/match_service_client.ts create mode 100644 packages/google-cloud-aiplatform/src/v1/match_service_client_config.json create mode 100644 packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json create mode 100644 packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts create mode 100644 packages/google-cloud-aiplatform/src/v1/model_garden_service_client_config.json create mode 100644 packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json create mode 100644 packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts create mode 100644 packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index dcea0873e740..c7d91d374e9d 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -196,6 +196,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Job_service.resume_model_deployment_monitoring_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Job_service.search_model_deployment_monitoring_stats_anomalies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js,packages/google-cloud-aiplatform/samples/README.md) | | Job_service.update_model_deployment_monitoring_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js,packages/google-cloud-aiplatform/samples/README.md) | +| Match_service.find_neighbors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/match_service.find_neighbors.js,packages/google-cloud-aiplatform/samples/README.md) | +| Match_service.read_index_datapoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js,packages/google-cloud-aiplatform/samples/README.md) | | Metadata_service.add_context_artifacts_and_executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js,packages/google-cloud-aiplatform/samples/README.md) | | Metadata_service.add_context_children | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_children.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/metadata_service.add_context_children.js,packages/google-cloud-aiplatform/samples/README.md) | | Metadata_service.add_execution_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -230,6 +232,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Metadata_service.update_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/metadata_service.update_execution.js,packages/google-cloud-aiplatform/samples/README.md) | | Migration_service.batch_migrate_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js,packages/google-cloud-aiplatform/samples/README.md) | | Migration_service.search_migratable_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_garden_service.get_publisher_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.batch_import_evaluated_annotations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.batch_import_model_evaluation_slices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.copy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.copy_model.js) | [![Open in Cloud 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-aiplatform/samples/generated/v1/model_service.copy_model.js,packages/google-cloud-aiplatform/samples/README.md) | diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto index f06cfb9df9ec..de62b281e3a7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto @@ -47,6 +47,9 @@ enum AcceleratorType { // Nvidia Tesla A100 GPU. NVIDIA_TESLA_A100 = 8; + // Nvidia A100 80GB GPU. + NVIDIA_A100_80GB = 9; + // Nvidia L4 GPU. NVIDIA_L4 = 11; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto index 9249e3874acc..6c413631e432 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/featurestore_service.proto @@ -534,7 +534,7 @@ message ImportFeatureValuesRequest { ]; // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. + // extracted from the column named entity_id. string entity_id_field = 5; // Required. Specifications defining which Feature values to import from the @@ -1288,6 +1288,10 @@ message ImportFeatureValuesOperationMetadata { // The number rows that weren't ingested due to having timestamps outside the // retention boundary. int64 timestamp_outside_retention_rows_count = 7; + + // List of ImportFeatureValues operations running under a single EntityType + // that are blocking this operation. + repeated int64 blocking_operation_ids = 8; } // Details of operations that exports Features values. @@ -1439,6 +1443,6 @@ message EntityIdSelector { } // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. + // extracted from the column named entity_id. string entity_id_field = 5; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto index 9b4dd453297c..49a30b966aab 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto @@ -159,17 +159,16 @@ message DeployedIndex { // Output only. The DeployedIndex may depend on various data on its original // Index. Additionally when certain changes to the original Index are being // done (e.g. when what the Index contains is being changed) the DeployedIndex - // may be asynchronously updated in the background to reflect this changes. If - // this timestamp's value is at least the + // may be asynchronously updated in the background to reflect these changes. + // If this timestamp's value is at least the // [Index.update_time][google.cloud.aiplatform.v1.Index.update_time] of the // original Index, it means that this DeployedIndex and the original Index are // in sync. If this timestamp is older, then to see which updates this - // DeployedIndex already contains (and which not), one must - // [list][Operations.ListOperations] [Operations][Operation] - // [working][Operation.name] on the original Index. Only - // the successfully completed Operations with - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] + // DeployedIndex already contains (and which it does not), one must + // [list][google.longrunning.Operations.ListOperations] the operations that + // are running on the original Index. Only the successfully completed + // Operations with + // [update_time][google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] // equal or before this sync time are contained in this DeployedIndex. google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/match_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/match_service.proto new file mode 100644 index 000000000000..5b56a08b5a92 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/match_service.proto @@ -0,0 +1,176 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/index.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "MatchServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// MatchService is a Google managed service for efficient vector similarity +// search at scale. +service MatchService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Finds the nearest neighbors of each vector within the request. + rpc FindNeighbors(FindNeighborsRequest) returns (FindNeighborsResponse) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors" + body: "*" + }; + } + + // Reads the datapoints/vectors of the given IDs. + // A maximum of 1000 datapoints can be retrieved in a batch. + rpc ReadIndexDatapoints(ReadIndexDatapointsRequest) + returns (ReadIndexDatapointsResponse) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints" + body: "*" + }; + } +} + +// The request message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors]. +message FindNeighborsRequest { + // A query to find a number of the nearest neighbors (most similar vectors) + // of a vector. + message Query { + // Required. The datapoint/vector whose nearest neighbors should be searched + // for. + IndexDatapoint datapoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of nearest neighbors to be retrieved from database for each + // query. If not set, will use the default from the service configuration + // (https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor-search-config). + int32 neighbor_count = 2; + + // Crowding is a constraint on a neighbor list produced by nearest neighbor + // search requiring that no more than some value k' of the k neighbors + // returned have the same value of crowding_attribute. + // It's used for improving result diversity. + // This field is the maximum number of matches with the same crowding tag. + int32 per_crowding_attribute_neighbor_count = 3; + + // The number of neighbors to find via approximate search before + // exact reordering is performed. If not set, the default value from scam + // config is used; if set, this value must be > 0. + int32 approximate_neighbor_count = 4; + + // The fraction of the number of leaves to search, set at query time allows + // user to tune search performance. This value increase result in both + // search accuracy and latency increase. The value should be between 0.0 + // and 1.0. If not set or set to 0.0, query uses the default value specified + // in + // NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. + double fraction_leaf_nodes_to_search_override = 5; + } + + // Required. The name of the index endpoint. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // The ID of the DeployedIndex that will serve the request. This request is + // sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + // IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + // has a DeployedIndex.id field. + // The value of the field below must equal one of the DeployedIndex.id + // fields of the IndexEndpoint that is being called for this request. + string deployed_index_id = 2; + + // The list of queries. + repeated Query queries = 3; + + // If set to true, the full datapoints (including all vector values and + // restricts) of the nearest neighbors are returned. + // Note that returning full datapoint will significantly increase the + // latency and cost of the query. + bool return_full_datapoint = 4; +} + +// The response message for +// [MatchService.FindNeighbors][google.cloud.aiplatform.v1.MatchService.FindNeighbors]. +message FindNeighborsResponse { + // A neighbor of the query vector. + message Neighbor { + // The datapoint of the neighbor. + // Note that full datapoints are returned only when "return_full_datapoint" + // is set to true. Otherwise, only the "datapoint_id" and "crowding_tag" + // fields are populated. + IndexDatapoint datapoint = 1; + + // The distance between the neighbor and the query vector. + double distance = 2; + } + + // Nearest neighbors for one query. + message NearestNeighbors { + // The ID of the query datapoint. + string id = 1; + + // All its neighbors. + repeated Neighbor neighbors = 2; + } + + // The nearest neighbors of the query datapoints. + repeated NearestNeighbors nearest_neighbors = 1; +} + +// The request message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsRequest { + // Required. The name of the index endpoint. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // The ID of the DeployedIndex that will serve the request. + string deployed_index_id = 2; + + // IDs of the datapoints to be searched for. + repeated string ids = 3; +} + +// The response message for +// [MatchService.ReadIndexDatapoints][google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints]. +message ReadIndexDatapointsResponse { + // The result list of datapoints. + repeated IndexDatapoint datapoints = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/metadata_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/metadata_service.proto index 9c1bcb09a6b5..017b0df2eda3 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/metadata_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/metadata_service.proto @@ -582,6 +582,9 @@ message ListArtifactsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Context based filtering**: // To filter Artifacts based on the contexts to which they belong, use the // function operator with the full resource name @@ -628,7 +631,6 @@ message UpdateArtifactRequest { Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -784,6 +786,9 @@ message ListContextsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0`. + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Parent Child filtering**: // To filter Contexts based on parent-child relationship use the HAS // operator as follows: @@ -834,7 +839,6 @@ message UpdateContextRequest { Context context = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -1097,6 +1101,9 @@ message ListExecutionsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..` // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Context based filtering**: // To filter Executions based on the contexts to which they belong use // the function operator with the full resource name: @@ -1143,7 +1150,6 @@ message UpdateExecutionRequest { Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -1379,6 +1385,9 @@ message QueryArtifactLineageSubgraphRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // // Each of the above supported filter types can be combined together using // logical operators (`AND` & `OR`). Maximum nested expression depth allowed diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto index 4872249c54a1..3a6d6fb1c9aa 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto @@ -204,6 +204,11 @@ message Model { } ]; + // This field is populated if the model is produced by a pipeline job. + string pipeline_job = 47 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + }]; + // Input only. The specification of the container that is to be used when // deploying this Model. The specification is ingested upon // [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], @@ -406,6 +411,14 @@ message Model { string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Contains information about the Large Model. +message LargeModelReference { + // Required. The unique name of the large Foundation or pre-built model. Like + // "chat-bison", "text-bison". Or model name with version ID, like + // "chat-bison@001", "text-bison@005", etc. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Contains the schemata used in Model's predictions and explanations via // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict], // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain] diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_evaluation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_evaluation.proto index 6114518bf041..8fcd5184912c 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_evaluation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_evaluation.proto @@ -71,8 +71,9 @@ message ModelEvaluation { google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of - // ModelEvaluationSlices. The dimensions can be used as the filter of the + // All possible + // [dimensions][google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.dimension] + // of ModelEvaluationSlices. The dimensions can be used as the filter of the // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] // request, in the form of `slice.dimension = `. repeated string slice_dimensions = 5; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_garden_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_garden_service.proto new file mode 100644 index 000000000000..3a5802378fbb --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_garden_service.proto @@ -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 +// +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/publisher_model.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ModelGardenServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The interface of Model Garden Service. +service ModelGardenService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a Model Garden publisher model. + rpc GetPublisherModel(GetPublisherModelRequest) returns (PublisherModel) { + option (google.api.http) = { + get: "/v1/{name=publishers/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// View enumeration of PublisherModel. +enum PublisherModelView { + // The default / unset value. The API will default to the BASIC view. + PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0; + + // Include basic metadata about the publisher model, but not the full + // contents. + PUBLISHER_MODEL_VIEW_BASIC = 1; + + // Include everything. + PUBLISHER_MODEL_VIEW_FULL = 2; + + // Include: VersionId, ModelVersionExternalName, and SupportedActions. + PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3; +} + +// Request message for +// [ModelGardenService.GetPublisherModel][google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel] +message GetPublisherModelRequest { + // Required. The name of the PublisherModel resource. + // Format: + // `publishers/{publisher}/models/{publisher_model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + } + ]; + + // Optional. The IETF BCP-47 language code representing the language in which + // the publisher model's text information should be written in (see go/bcp47). + string language_code = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. PublisherModel view specifying which fields to read. + PublisherModelView view = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto index 16463dd48c53..16dadb28af81 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto @@ -84,8 +84,7 @@ service PredictionService { // [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] // is not specified, all DeployedModels must have // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - // populated. Only deployed AutoML tabular Models have - // explanation_spec. + // populated. rpc Explain(ExplainRequest) returns (ExplainResponse) { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain" diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto new file mode 100644 index 000000000000..a854fce73e7e --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto @@ -0,0 +1,239 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/cloud/aiplatform/v1/model.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "PublisherModelProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A Model Garden Publisher Model. +message PublisherModel { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/PublisherModel" + pattern: "publishers/{publisher}/models/{model}" + }; + + // Reference to a resource. + message ResourceReference { + oneof reference { + // The URI of the resource. + string uri = 1; + + // The resource name of the Google Cloud resource. + string resource_name = 2; + } + } + + // A named piece of documentation. + message Documentation { + // Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA, + // NODE.JS, etc.. + string title = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Content of this piece of document (in Markdown format). + string content = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Actions could take on this Publisher Model. + message CallToAction { + // The regional resource name or the URI. Key is region, e.g., + // us-central1, europe-west2, global, etc.. + message RegionalResourceReferences { + // Required. + map references = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The title of the regional resource reference. + string title = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Rest API docs. + message ViewRestApi { + // Required. + repeated Documentation documentations = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The title of the view rest API. + string title = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Model metadata that is needed for UploadModel or + // DeployModel/CreateEndpoint requests. + message Deploy { + // The prediction (for example, the machine) resources that the + // DeployedModel uses. + oneof prediction_resources { + // A description of resources that are dedicated to the DeployedModel, + // and that need a higher degree of manual configuration. + DedicatedResources dedicated_resources = 5; + + // A description of resources that to large degree are decided by Vertex + // AI, and require only a modest additional configuration. + AutomaticResources automatic_resources = 6; + + // The resource name of the shared DeploymentResourcePool to deploy on. + // Format: + // `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + string shared_resources = 7; + } + + // Optional. Default model display name. + string model_display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Large model reference. When this is set, model_artifact_spec + // is not needed. + LargeModelReference large_model_reference = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The specification of the container that is to be used when + // deploying this Model in Vertex AI. Not present for Large Models. + ModelContainerSpec container_spec = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The path to the directory containing the Model artifact and + // any of its supporting files. + string artifact_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The title of the regional resource reference. + string title = 8 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. To view Rest API docs. + ViewRestApi view_rest_api = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Open notebook of the PublisherModel. + RegionalResourceReferences open_notebook = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Create application using the PublisherModel. + RegionalResourceReferences create_application = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Open fine-tuning pipeline of the PublisherModel. + RegionalResourceReferences open_fine_tuning_pipeline = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Open prompt-tuning pipeline of the PublisherModel. + RegionalResourceReferences open_prompt_tuning_pipeline = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Open Genie / Playground. + RegionalResourceReferences open_genie = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploy the PublisherModel to Vertex Endpoint. + Deploy deploy = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Open in Generation AI Studio. + RegionalResourceReferences open_generation_ai_studio = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Request for access. + RegionalResourceReferences request_access = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // An enum representing the open source category of a PublisherModel. + enum OpenSourceCategory { + // The open source category is unspecified, which should not be used. + OPEN_SOURCE_CATEGORY_UNSPECIFIED = 0; + + // Used to indicate the PublisherModel is not open sourced. + PROPRIETARY = 1; + + // Used to indicate the PublisherModel is a Google-owned open source model + // w/ Google checkpoint. + GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 2; + + // Used to indicate the PublisherModel is a 3p-owned open source model w/ + // Google checkpoint. + THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 3; + + // Used to indicate the PublisherModel is a Google-owned pure open source + // model. + GOOGLE_OWNED_OSS = 4; + + // Used to indicate the PublisherModel is a 3p-owned pure open source model. + THIRD_PARTY_OWNED_OSS = 5; + } + + // An enum representing the launch stage of a PublisherModel. + enum LaunchStage { + // The model launch stage is unspecified. + LAUNCH_STAGE_UNSPECIFIED = 0; + + // Used to indicate the PublisherModel is at Experimental launch stage. + EXPERIMENTAL = 1; + + // Used to indicate the PublisherModel is at Private Preview launch stage. + PRIVATE_PREVIEW = 2; + + // Used to indicate the PublisherModel is at Public Preview launch stage. + PUBLIC_PREVIEW = 3; + + // Used to indicate the PublisherModel is at GA launch stage. + GA = 4; + } + + // Output only. The resource name of the PublisherModel. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. The version ID of the PublisherModel. + // A new version is committed when a new model version is uploaded under an + // existing model id. It is an auto-incrementing decimal number in string + // representation. + string version_id = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Required. Indicates the open source category of the publisher model. + OpenSourceCategory open_source_category = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Supported call-to-action options. + CallToAction supported_actions = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information about the model's Frameworks. + repeated string frameworks = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates the launch stage of the model. + LaunchStage launch_stage = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. Immutable. Used to indicate this model has a + // publisher model and provide the template of the publisher model resource + // name. + string publisher_model_template = 30 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The schemata that describes formats of the PublisherModel's + // predictions and explanations as given and returned via + // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict]. + PredictSchemata predict_schemata = 31 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto index 6ae26d3efad4..e6bfa6f8e479 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto @@ -55,7 +55,8 @@ message TensorboardExperiment { google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The labels with user-defined metadata to organize your Datasets. + // The labels with user-defined metadata to organize your + // TensorboardExperiment. // // Label keys and values cannot be longer than 64 characters // (Unicode codepoints), can only contain lowercase letters, numeric diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto index 1158f58dc91f..e45b733f0aec 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto @@ -92,7 +92,8 @@ service VizierService { // suggested by Vertex AI Vizier. Returns a long-running // operation associated with the generation of Trial suggestions. // When this long-running operation succeeds, it will contain - // a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse]. + // a + // [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse]. rpc SuggestTrials(SuggestTrialsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto index f4ec90768c21..50fa54e16bf3 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -534,7 +534,7 @@ message ImportFeatureValuesRequest { ]; // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. + // extracted from the column named entity_id. string entity_id_field = 5; // Required. Specifications defining which Feature values to import from the @@ -1288,6 +1288,10 @@ message ImportFeatureValuesOperationMetadata { // The number rows that weren't ingested due to having timestamps outside the // retention boundary. int64 timestamp_outside_retention_rows_count = 7; + + // List of ImportFeatureValues operations running under a single EntityType + // that are blocking this operation. + repeated int64 blocking_operation_ids = 8; } // Details of operations that exports Features values. @@ -1439,6 +1443,6 @@ message EntityIdSelector { } // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. + // extracted from the column named entity_id. string entity_id_field = 5; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto index ef2efb41c65c..14af3b80940b 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -160,17 +160,16 @@ message DeployedIndex { // Output only. The DeployedIndex may depend on various data on its original // Index. Additionally when certain changes to the original Index are being // done (e.g. when what the Index contains is being changed) the DeployedIndex - // may be asynchronously updated in the background to reflect this changes. If - // this timestamp's value is at least the + // may be asynchronously updated in the background to reflect these changes. + // If this timestamp's value is at least the // [Index.update_time][google.cloud.aiplatform.v1beta1.Index.update_time] of // the original Index, it means that this DeployedIndex and the original Index // are in sync. If this timestamp is older, then to see which updates this - // DeployedIndex already contains (and which not), one must - // [list][Operations.ListOperations] [Operations][Operation] - // [working][Operation.name] on the original Index. Only - // the successfully completed Operations with - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] + // DeployedIndex already contains (and which it does not), one must + // [list][google.longrunning.Operations.ListOperations] the operations that + // are running on the original Index. Only the successfully completed + // Operations with + // [update_time][google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] // equal or before this sync time are contained in this DeployedIndex. google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto index 74ecdb973180..dc000c727617 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto @@ -582,6 +582,9 @@ message ListArtifactsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Context based filtering**: // To filter Artifacts based on the contexts to which they belong, use the // function operator with the full resource name @@ -629,7 +632,6 @@ message UpdateArtifactRequest { Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -785,6 +787,9 @@ message ListContextsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0`. + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Parent Child filtering**: // To filter Contexts based on parent-child relationship use the HAS // operator as follows: @@ -835,7 +840,6 @@ message UpdateContextRequest { Context context = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -1099,6 +1103,9 @@ message ListExecutionsRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..` // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // * **Context based filtering**: // To filter Executions based on the contexts to which they belong use // the function operator with the full resource name: @@ -1146,7 +1153,6 @@ message UpdateExecutionRequest { Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -1382,6 +1388,9 @@ message QueryArtifactLineageSubgraphRequest { // To filter on metadata fields use traversal operation as follows: // `metadata..`. // For example: `metadata.field_1.number_value = 10.0` + // In case the field name contains special characters (such as colon), one + // can embed it inside double quote. + // For example: `metadata."field:1".number_value = 10.0` // // Each of the above supported filter types can be combined together using // logical operators (`AND` & `OR`). Maximum nested expression depth allowed diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto index 4751153abcf8..0edbee572d5e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -414,8 +414,8 @@ message Model { // Contains information about the Large Model. message LargeModelReference { // Required. The unique name of the large Foundation or pre-built model. Like - // "chat-panda", "text-panda". Or model name with version ID, like - // "chat-panda-001", "text-panda-005", etc. + // "chat-bison", "text-bison". Or model name with version ID, like + // "chat-bison@001", "text-bison@005", etc. string name = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto index 862679989fc1..f636c27ef83d 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto @@ -71,8 +71,9 @@ message ModelEvaluation { google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of - // ModelEvaluationSlices. The dimensions can be used as the filter of the + // All possible + // [dimensions][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.Slice.dimension] + // of ModelEvaluationSlices. The dimensions can be used as the filter of the // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] // request, in the form of `slice.dimension = `. repeated string slice_dimensions = 5; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto index b6d2c16ffb8a..c96f0f241124 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -84,8 +84,7 @@ service PredictionService { // [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] // is not specified, all DeployedModels must have // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] - // populated. Only deployed AutoML tabular Models have - // explanation_spec. + // populated. rpc Explain(ExplainRequest) returns (ExplainResponse) { option (google.api.http) = { post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:explain" diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto index 55e11ea1b511..dd45a764a876 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto @@ -42,7 +42,7 @@ message PublisherModel { // The URI of the resource. string uri = 1; - // The resource name of the GCP resource. + // The resource name of the Google Cloud resource. string resource_name = 2; } } @@ -150,6 +150,10 @@ message PublisherModel { // Optional. Open in Generation AI Studio. RegionalResourceReferences open_generation_ai_studio = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Request for access. + RegionalResourceReferences request_access = 9 + [(google.api.field_behavior) = OPTIONAL]; } // An enum representing the open source category of a PublisherModel. @@ -176,6 +180,24 @@ message PublisherModel { THIRD_PARTY_OWNED_OSS = 5; } + // An enum representing the launch stage of a PublisherModel. + enum LaunchStage { + // The model launch stage is unspecified. + LAUNCH_STAGE_UNSPECIFIED = 0; + + // Used to indicate the PublisherModel is at Experimental launch stage. + EXPERIMENTAL = 1; + + // Used to indicate the PublisherModel is at Private Preview launch stage. + PRIVATE_PREVIEW = 2; + + // Used to indicate the PublisherModel is at Public Preview launch stage. + PUBLIC_PREVIEW = 3; + + // Used to indicate the PublisherModel is at GA launch stage. + GA = 4; + } + // Output only. The resource name of the PublisherModel. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -198,6 +220,9 @@ message PublisherModel { // Optional. Additional information about the model's Frameworks. repeated string frameworks = 23 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Indicates the launch stage of the model. + LaunchStage launch_stage = 29 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Output only. Immutable. Used to indicate this model has a // publisher model and provide the template of the publisher model resource // name. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto index c29f2f17b6a8..30813202f709 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto @@ -55,7 +55,8 @@ message TensorboardExperiment { google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The labels with user-defined metadata to organize your Datasets. + // The labels with user-defined metadata to organize your + // TensorboardExperiment. // // Label keys and values cannot be longer than 64 characters // (Unicode codepoints), can only contain lowercase letters, numeric diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto index 60ca817b5960..7936b1af9e23 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto @@ -92,7 +92,8 @@ service VizierService { // suggested by Vertex AI Vizier. Returns a long-running // operation associated with the generation of Trial suggestions. // When this long-running operation succeeds, it will contain - // a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse]. + // a + // [SuggestTrialsResponse][google.cloud.aiplatform.v1beta1.SuggestTrialsResponse]. rpc SuggestTrials(SuggestTrialsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 9bb7bc4736d6..d12977413860 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -35,6 +35,7 @@ export namespace google { NVIDIA_TESLA_P4 = 4, NVIDIA_TESLA_T4 = 5, NVIDIA_TESLA_A100 = 8, + NVIDIA_A100_80GB = 9, NVIDIA_L4 = 11, TPU_V2 = 6, TPU_V3 = 7, @@ -6477,6 +6478,9 @@ export namespace google { /** Model trainingPipeline */ trainingPipeline?: (string|null); + /** Model pipelineJob */ + pipelineJob?: (string|null); + /** Model containerSpec */ containerSpec?: (google.cloud.aiplatform.v1.IModelContainerSpec|null); @@ -6571,6 +6575,9 @@ export namespace google { /** Model trainingPipeline. */ public trainingPipeline: string; + /** Model pipelineJob. */ + public pipelineJob: string; + /** Model containerSpec. */ public containerSpec?: (google.cloud.aiplatform.v1.IModelContainerSpec|null); @@ -6915,6 +6922,103 @@ export namespace google { } } + /** Properties of a LargeModelReference. */ + interface ILargeModelReference { + + /** LargeModelReference name */ + name?: (string|null); + } + + /** Represents a LargeModelReference. */ + class LargeModelReference implements ILargeModelReference { + + /** + * Constructs a new LargeModelReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ILargeModelReference); + + /** LargeModelReference name. */ + public name: string; + + /** + * Creates a new LargeModelReference instance using the specified properties. + * @param [properties] Properties to set + * @returns LargeModelReference instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ILargeModelReference): google.cloud.aiplatform.v1.LargeModelReference; + + /** + * Encodes the specified LargeModelReference message. Does not implicitly {@link google.cloud.aiplatform.v1.LargeModelReference.verify|verify} messages. + * @param message LargeModelReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ILargeModelReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LargeModelReference message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.LargeModelReference.verify|verify} messages. + * @param message LargeModelReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ILargeModelReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LargeModelReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LargeModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.LargeModelReference; + + /** + * Decodes a LargeModelReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LargeModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.LargeModelReference; + + /** + * Verifies a LargeModelReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LargeModelReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LargeModelReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.LargeModelReference; + + /** + * Creates a plain object from a LargeModelReference message. Also converts values to other types if specified. + * @param message LargeModelReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.LargeModelReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LargeModelReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LargeModelReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PredictSchemata. */ interface IPredictSchemata { @@ -24116,6 +24220,9 @@ export namespace google { /** ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount */ timestampOutsideRetentionRowsCount?: (number|Long|string|null); + + /** ImportFeatureValuesOperationMetadata blockingOperationIds */ + blockingOperationIds?: ((number|Long|string)[]|null); } /** Represents an ImportFeatureValuesOperationMetadata. */ @@ -24145,6 +24252,9 @@ export namespace google { /** ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount. */ public timestampOutsideRetentionRowsCount: (number|Long|string); + /** ImportFeatureValuesOperationMetadata blockingOperationIds. */ + public blockingOperationIds: (number|Long|string)[]; + /** * Creates a new ImportFeatureValuesOperationMetadata instance using the specified properties. * @param [properties] Properties to set @@ -41833,6 +41943,823 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Represents a MatchService */ + class MatchService extends $protobuf.rpc.Service { + + /** + * Constructs a new MatchService 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 MatchService 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): MatchService; + + /** + * Calls FindNeighbors. + * @param request FindNeighborsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FindNeighborsResponse + */ + public findNeighbors(request: google.cloud.aiplatform.v1.IFindNeighborsRequest, callback: google.cloud.aiplatform.v1.MatchService.FindNeighborsCallback): void; + + /** + * Calls FindNeighbors. + * @param request FindNeighborsRequest message or plain object + * @returns Promise + */ + public findNeighbors(request: google.cloud.aiplatform.v1.IFindNeighborsRequest): Promise; + + /** + * Calls ReadIndexDatapoints. + * @param request ReadIndexDatapointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadIndexDatapointsResponse + */ + public readIndexDatapoints(request: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, callback: google.cloud.aiplatform.v1.MatchService.ReadIndexDatapointsCallback): void; + + /** + * Calls ReadIndexDatapoints. + * @param request ReadIndexDatapointsRequest message or plain object + * @returns Promise + */ + public readIndexDatapoints(request: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest): Promise; + } + + namespace MatchService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MatchService|findNeighbors}. + * @param error Error, if any + * @param [response] FindNeighborsResponse + */ + type FindNeighborsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.FindNeighborsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MatchService|readIndexDatapoints}. + * @param error Error, if any + * @param [response] ReadIndexDatapointsResponse + */ + type ReadIndexDatapointsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) => void; + } + + /** Properties of a FindNeighborsRequest. */ + interface IFindNeighborsRequest { + + /** FindNeighborsRequest indexEndpoint */ + indexEndpoint?: (string|null); + + /** FindNeighborsRequest deployedIndexId */ + deployedIndexId?: (string|null); + + /** FindNeighborsRequest queries */ + queries?: (google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery[]|null); + + /** FindNeighborsRequest returnFullDatapoint */ + returnFullDatapoint?: (boolean|null); + } + + /** Represents a FindNeighborsRequest. */ + class FindNeighborsRequest implements IFindNeighborsRequest { + + /** + * Constructs a new FindNeighborsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IFindNeighborsRequest); + + /** FindNeighborsRequest indexEndpoint. */ + public indexEndpoint: string; + + /** FindNeighborsRequest deployedIndexId. */ + public deployedIndexId: string; + + /** FindNeighborsRequest queries. */ + public queries: google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery[]; + + /** FindNeighborsRequest returnFullDatapoint. */ + public returnFullDatapoint: boolean; + + /** + * Creates a new FindNeighborsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FindNeighborsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IFindNeighborsRequest): google.cloud.aiplatform.v1.FindNeighborsRequest; + + /** + * Encodes the specified FindNeighborsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.verify|verify} messages. + * @param message FindNeighborsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IFindNeighborsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindNeighborsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.verify|verify} messages. + * @param message FindNeighborsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IFindNeighborsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindNeighborsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindNeighborsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FindNeighborsRequest; + + /** + * Decodes a FindNeighborsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindNeighborsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FindNeighborsRequest; + + /** + * Verifies a FindNeighborsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindNeighborsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindNeighborsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FindNeighborsRequest; + + /** + * Creates a plain object from a FindNeighborsRequest message. Also converts values to other types if specified. + * @param message FindNeighborsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FindNeighborsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindNeighborsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindNeighborsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FindNeighborsRequest { + + /** Properties of a Query. */ + interface IQuery { + + /** Query datapoint */ + datapoint?: (google.cloud.aiplatform.v1.IIndexDatapoint|null); + + /** Query neighborCount */ + neighborCount?: (number|null); + + /** Query perCrowdingAttributeNeighborCount */ + perCrowdingAttributeNeighborCount?: (number|null); + + /** Query approximateNeighborCount */ + approximateNeighborCount?: (number|null); + + /** Query fractionLeafNodesToSearchOverride */ + fractionLeafNodesToSearchOverride?: (number|null); + } + + /** Represents a Query. */ + class Query implements IQuery { + + /** + * Constructs a new Query. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery); + + /** Query datapoint. */ + public datapoint?: (google.cloud.aiplatform.v1.IIndexDatapoint|null); + + /** Query neighborCount. */ + public neighborCount: number; + + /** Query perCrowdingAttributeNeighborCount. */ + public perCrowdingAttributeNeighborCount: number; + + /** Query approximateNeighborCount. */ + public approximateNeighborCount: number; + + /** Query fractionLeafNodesToSearchOverride. */ + public fractionLeafNodesToSearchOverride: number; + + /** + * Creates a new Query instance using the specified properties. + * @param [properties] Properties to set + * @returns Query instance + */ + public static create(properties?: google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery): google.cloud.aiplatform.v1.FindNeighborsRequest.Query; + + /** + * Encodes the specified Query message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.Query.verify|verify} messages. + * @param message Query message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Query message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.Query.verify|verify} messages. + * @param message Query message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Query message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FindNeighborsRequest.Query; + + /** + * Decodes a Query message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FindNeighborsRequest.Query; + + /** + * Verifies a Query message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Query message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Query + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FindNeighborsRequest.Query; + + /** + * Creates a plain object from a Query message. Also converts values to other types if specified. + * @param message Query + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FindNeighborsRequest.Query, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Query to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Query + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FindNeighborsResponse. */ + interface IFindNeighborsResponse { + + /** FindNeighborsResponse nearestNeighbors */ + nearestNeighbors?: (google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors[]|null); + } + + /** Represents a FindNeighborsResponse. */ + class FindNeighborsResponse implements IFindNeighborsResponse { + + /** + * Constructs a new FindNeighborsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IFindNeighborsResponse); + + /** FindNeighborsResponse nearestNeighbors. */ + public nearestNeighbors: google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors[]; + + /** + * Creates a new FindNeighborsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FindNeighborsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IFindNeighborsResponse): google.cloud.aiplatform.v1.FindNeighborsResponse; + + /** + * Encodes the specified FindNeighborsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.verify|verify} messages. + * @param message FindNeighborsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IFindNeighborsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindNeighborsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.verify|verify} messages. + * @param message FindNeighborsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IFindNeighborsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindNeighborsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindNeighborsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FindNeighborsResponse; + + /** + * Decodes a FindNeighborsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindNeighborsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FindNeighborsResponse; + + /** + * Verifies a FindNeighborsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindNeighborsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindNeighborsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FindNeighborsResponse; + + /** + * Creates a plain object from a FindNeighborsResponse message. Also converts values to other types if specified. + * @param message FindNeighborsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FindNeighborsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindNeighborsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindNeighborsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FindNeighborsResponse { + + /** Properties of a Neighbor. */ + interface INeighbor { + + /** Neighbor datapoint */ + datapoint?: (google.cloud.aiplatform.v1.IIndexDatapoint|null); + + /** Neighbor distance */ + distance?: (number|null); + } + + /** Represents a Neighbor. */ + class Neighbor implements INeighbor { + + /** + * Constructs a new Neighbor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor); + + /** Neighbor datapoint. */ + public datapoint?: (google.cloud.aiplatform.v1.IIndexDatapoint|null); + + /** Neighbor distance. */ + public distance: number; + + /** + * Creates a new Neighbor instance using the specified properties. + * @param [properties] Properties to set + * @returns Neighbor instance + */ + public static create(properties?: google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor): google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor; + + /** + * Encodes the specified Neighbor message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.verify|verify} messages. + * @param message Neighbor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Neighbor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.verify|verify} messages. + * @param message Neighbor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Neighbor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor; + + /** + * Decodes a Neighbor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor; + + /** + * Verifies a Neighbor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Neighbor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Neighbor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor; + + /** + * Creates a plain object from a Neighbor message. Also converts values to other types if specified. + * @param message Neighbor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Neighbor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Neighbor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NearestNeighbors. */ + interface INearestNeighbors { + + /** NearestNeighbors id */ + id?: (string|null); + + /** NearestNeighbors neighbors */ + neighbors?: (google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor[]|null); + } + + /** Represents a NearestNeighbors. */ + class NearestNeighbors implements INearestNeighbors { + + /** + * Constructs a new NearestNeighbors. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors); + + /** NearestNeighbors id. */ + public id: string; + + /** NearestNeighbors neighbors. */ + public neighbors: google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor[]; + + /** + * Creates a new NearestNeighbors instance using the specified properties. + * @param [properties] Properties to set + * @returns NearestNeighbors instance + */ + public static create(properties?: google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors): google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors; + + /** + * Encodes the specified NearestNeighbors message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.verify|verify} messages. + * @param message NearestNeighbors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NearestNeighbors message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.verify|verify} messages. + * @param message NearestNeighbors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NearestNeighbors message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NearestNeighbors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors; + + /** + * Decodes a NearestNeighbors message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NearestNeighbors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors; + + /** + * Verifies a NearestNeighbors message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NearestNeighbors message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NearestNeighbors + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors; + + /** + * Creates a plain object from a NearestNeighbors message. Also converts values to other types if specified. + * @param message NearestNeighbors + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NearestNeighbors to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NearestNeighbors + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadIndexDatapointsRequest. */ + interface IReadIndexDatapointsRequest { + + /** ReadIndexDatapointsRequest indexEndpoint */ + indexEndpoint?: (string|null); + + /** ReadIndexDatapointsRequest deployedIndexId */ + deployedIndexId?: (string|null); + + /** ReadIndexDatapointsRequest ids */ + ids?: (string[]|null); + } + + /** Represents a ReadIndexDatapointsRequest. */ + class ReadIndexDatapointsRequest implements IReadIndexDatapointsRequest { + + /** + * Constructs a new ReadIndexDatapointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest); + + /** ReadIndexDatapointsRequest indexEndpoint. */ + public indexEndpoint: string; + + /** ReadIndexDatapointsRequest deployedIndexId. */ + public deployedIndexId: string; + + /** ReadIndexDatapointsRequest ids. */ + public ids: string[]; + + /** + * Creates a new ReadIndexDatapointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadIndexDatapointsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest): google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; + + /** + * Encodes the specified ReadIndexDatapointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.verify|verify} messages. + * @param message ReadIndexDatapointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadIndexDatapointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.verify|verify} messages. + * @param message ReadIndexDatapointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadIndexDatapointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadIndexDatapointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; + + /** + * Decodes a ReadIndexDatapointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadIndexDatapointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; + + /** + * Verifies a ReadIndexDatapointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadIndexDatapointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadIndexDatapointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadIndexDatapointsRequest; + + /** + * Creates a plain object from a ReadIndexDatapointsRequest message. Also converts values to other types if specified. + * @param message ReadIndexDatapointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadIndexDatapointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadIndexDatapointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadIndexDatapointsResponse. */ + interface IReadIndexDatapointsResponse { + + /** ReadIndexDatapointsResponse datapoints */ + datapoints?: (google.cloud.aiplatform.v1.IIndexDatapoint[]|null); + } + + /** Represents a ReadIndexDatapointsResponse. */ + class ReadIndexDatapointsResponse implements IReadIndexDatapointsResponse { + + /** + * Constructs a new ReadIndexDatapointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadIndexDatapointsResponse); + + /** ReadIndexDatapointsResponse datapoints. */ + public datapoints: google.cloud.aiplatform.v1.IIndexDatapoint[]; + + /** + * Creates a new ReadIndexDatapointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadIndexDatapointsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadIndexDatapointsResponse): google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; + + /** + * Encodes the specified ReadIndexDatapointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.verify|verify} messages. + * @param message ReadIndexDatapointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadIndexDatapointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.verify|verify} messages. + * @param message ReadIndexDatapointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadIndexDatapointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadIndexDatapointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; + + /** + * Decodes a ReadIndexDatapointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadIndexDatapointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; + + /** + * Verifies a ReadIndexDatapointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadIndexDatapointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadIndexDatapointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadIndexDatapointsResponse; + + /** + * Creates a plain object from a ReadIndexDatapointsResponse message. Also converts values to other types if specified. + * @param message ReadIndexDatapointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadIndexDatapointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadIndexDatapointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadIndexDatapointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a MetadataSchema. */ interface IMetadataSchema { @@ -51025,6 +51952,1034 @@ export namespace google { } } + /** Represents a ModelGardenService */ + class ModelGardenService extends $protobuf.rpc.Service { + + /** + * Constructs a new ModelGardenService 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 ModelGardenService 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): ModelGardenService; + + /** + * Calls GetPublisherModel. + * @param request GetPublisherModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublisherModel + */ + public getPublisherModel(request: google.cloud.aiplatform.v1.IGetPublisherModelRequest, callback: google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModelCallback): void; + + /** + * Calls GetPublisherModel. + * @param request GetPublisherModelRequest message or plain object + * @returns Promise + */ + public getPublisherModel(request: google.cloud.aiplatform.v1.IGetPublisherModelRequest): Promise; + } + + namespace ModelGardenService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ModelGardenService|getPublisherModel}. + * @param error Error, if any + * @param [response] PublisherModel + */ + type GetPublisherModelCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.PublisherModel) => void; + } + + /** PublisherModelView enum. */ + enum PublisherModelView { + PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0, + PUBLISHER_MODEL_VIEW_BASIC = 1, + PUBLISHER_MODEL_VIEW_FULL = 2, + PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3 + } + + /** Properties of a GetPublisherModelRequest. */ + interface IGetPublisherModelRequest { + + /** GetPublisherModelRequest name */ + name?: (string|null); + + /** GetPublisherModelRequest languageCode */ + languageCode?: (string|null); + + /** GetPublisherModelRequest view */ + view?: (google.cloud.aiplatform.v1.PublisherModelView|keyof typeof google.cloud.aiplatform.v1.PublisherModelView|null); + } + + /** Represents a GetPublisherModelRequest. */ + class GetPublisherModelRequest implements IGetPublisherModelRequest { + + /** + * Constructs a new GetPublisherModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IGetPublisherModelRequest); + + /** GetPublisherModelRequest name. */ + public name: string; + + /** GetPublisherModelRequest languageCode. */ + public languageCode: string; + + /** GetPublisherModelRequest view. */ + public view: (google.cloud.aiplatform.v1.PublisherModelView|keyof typeof google.cloud.aiplatform.v1.PublisherModelView); + + /** + * Creates a new GetPublisherModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPublisherModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IGetPublisherModelRequest): google.cloud.aiplatform.v1.GetPublisherModelRequest; + + /** + * Encodes the specified GetPublisherModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetPublisherModelRequest.verify|verify} messages. + * @param message GetPublisherModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IGetPublisherModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPublisherModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetPublisherModelRequest.verify|verify} messages. + * @param message GetPublisherModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetPublisherModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPublisherModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPublisherModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetPublisherModelRequest; + + /** + * Decodes a GetPublisherModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPublisherModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetPublisherModelRequest; + + /** + * Verifies a GetPublisherModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPublisherModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPublisherModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetPublisherModelRequest; + + /** + * Creates a plain object from a GetPublisherModelRequest message. Also converts values to other types if specified. + * @param message GetPublisherModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GetPublisherModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPublisherModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPublisherModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublisherModel. */ + interface IPublisherModel { + + /** PublisherModel name */ + name?: (string|null); + + /** PublisherModel versionId */ + versionId?: (string|null); + + /** PublisherModel openSourceCategory */ + openSourceCategory?: (google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory|keyof typeof google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory|null); + + /** PublisherModel supportedActions */ + supportedActions?: (google.cloud.aiplatform.v1.PublisherModel.ICallToAction|null); + + /** PublisherModel frameworks */ + frameworks?: (string[]|null); + + /** PublisherModel launchStage */ + launchStage?: (google.cloud.aiplatform.v1.PublisherModel.LaunchStage|keyof typeof google.cloud.aiplatform.v1.PublisherModel.LaunchStage|null); + + /** PublisherModel publisherModelTemplate */ + publisherModelTemplate?: (string|null); + + /** PublisherModel predictSchemata */ + predictSchemata?: (google.cloud.aiplatform.v1.IPredictSchemata|null); + } + + /** Represents a PublisherModel. */ + class PublisherModel implements IPublisherModel { + + /** + * Constructs a new PublisherModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IPublisherModel); + + /** PublisherModel name. */ + public name: string; + + /** PublisherModel versionId. */ + public versionId: string; + + /** PublisherModel openSourceCategory. */ + public openSourceCategory: (google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory|keyof typeof google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory); + + /** PublisherModel supportedActions. */ + public supportedActions?: (google.cloud.aiplatform.v1.PublisherModel.ICallToAction|null); + + /** PublisherModel frameworks. */ + public frameworks: string[]; + + /** PublisherModel launchStage. */ + public launchStage: (google.cloud.aiplatform.v1.PublisherModel.LaunchStage|keyof typeof google.cloud.aiplatform.v1.PublisherModel.LaunchStage); + + /** PublisherModel publisherModelTemplate. */ + public publisherModelTemplate: string; + + /** PublisherModel predictSchemata. */ + public predictSchemata?: (google.cloud.aiplatform.v1.IPredictSchemata|null); + + /** + * Creates a new PublisherModel instance using the specified properties. + * @param [properties] Properties to set + * @returns PublisherModel instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IPublisherModel): google.cloud.aiplatform.v1.PublisherModel; + + /** + * Encodes the specified PublisherModel message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.verify|verify} messages. + * @param message PublisherModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IPublisherModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublisherModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.verify|verify} messages. + * @param message PublisherModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IPublisherModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublisherModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublisherModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel; + + /** + * Decodes a PublisherModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublisherModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel; + + /** + * Verifies a PublisherModel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublisherModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublisherModel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel; + + /** + * Creates a plain object from a PublisherModel message. Also converts values to other types if specified. + * @param message PublisherModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublisherModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublisherModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PublisherModel { + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference uri */ + uri?: (string|null); + + /** ResourceReference resourceName */ + resourceName?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.IResourceReference); + + /** ResourceReference uri. */ + public uri?: (string|null); + + /** ResourceReference resourceName. */ + public resourceName?: (string|null); + + /** ResourceReference reference. */ + public reference?: ("uri"|"resourceName"); + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.IResourceReference): google.cloud.aiplatform.v1.PublisherModel.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.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.cloud.aiplatform.v1.PublisherModel.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 Documentation. */ + interface IDocumentation { + + /** Documentation title */ + title?: (string|null); + + /** Documentation content */ + content?: (string|null); + } + + /** Represents a Documentation. */ + class Documentation implements IDocumentation { + + /** + * Constructs a new Documentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.IDocumentation); + + /** Documentation title. */ + public title: string; + + /** Documentation content. */ + public content: string; + + /** + * Creates a new Documentation instance using the specified properties. + * @param [properties] Properties to set + * @returns Documentation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.IDocumentation): google.cloud.aiplatform.v1.PublisherModel.Documentation; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.Documentation; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.Documentation; + + /** + * Verifies a Documentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documentation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.Documentation; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @param message Documentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CallToAction. */ + interface ICallToAction { + + /** CallToAction viewRestApi */ + viewRestApi?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi|null); + + /** CallToAction openNotebook */ + openNotebook?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction createApplication */ + createApplication?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openFineTuningPipeline */ + openFineTuningPipeline?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openPromptTuningPipeline */ + openPromptTuningPipeline?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openGenie */ + openGenie?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction deploy */ + deploy?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy|null); + + /** CallToAction openGenerationAiStudio */ + openGenerationAiStudio?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction requestAccess */ + requestAccess?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + } + + /** Represents a CallToAction. */ + class CallToAction implements ICallToAction { + + /** + * Constructs a new CallToAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.ICallToAction); + + /** CallToAction viewRestApi. */ + public viewRestApi?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi|null); + + /** CallToAction openNotebook. */ + public openNotebook?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction createApplication. */ + public createApplication?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openFineTuningPipeline. */ + public openFineTuningPipeline?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openPromptTuningPipeline. */ + public openPromptTuningPipeline?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction openGenie. */ + public openGenie?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction deploy. */ + public deploy?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy|null); + + /** CallToAction openGenerationAiStudio. */ + public openGenerationAiStudio?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction requestAccess. */ + public requestAccess?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** + * Creates a new CallToAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CallToAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.ICallToAction): google.cloud.aiplatform.v1.PublisherModel.CallToAction; + + /** + * Encodes the specified CallToAction message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.verify|verify} messages. + * @param message CallToAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.ICallToAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CallToAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.verify|verify} messages. + * @param message CallToAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.ICallToAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CallToAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CallToAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.CallToAction; + + /** + * Decodes a CallToAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CallToAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.CallToAction; + + /** + * Verifies a CallToAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CallToAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CallToAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.CallToAction; + + /** + * Creates a plain object from a CallToAction message. Also converts values to other types if specified. + * @param message CallToAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CallToAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CallToAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CallToAction { + + /** Properties of a RegionalResourceReferences. */ + interface IRegionalResourceReferences { + + /** RegionalResourceReferences references */ + references?: ({ [k: string]: google.cloud.aiplatform.v1.PublisherModel.IResourceReference }|null); + + /** RegionalResourceReferences title */ + title?: (string|null); + } + + /** Represents a RegionalResourceReferences. */ + class RegionalResourceReferences implements IRegionalResourceReferences { + + /** + * Constructs a new RegionalResourceReferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences); + + /** RegionalResourceReferences references. */ + public references: { [k: string]: google.cloud.aiplatform.v1.PublisherModel.IResourceReference }; + + /** RegionalResourceReferences title. */ + public title: string; + + /** + * Creates a new RegionalResourceReferences instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionalResourceReferences instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences): google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences; + + /** + * Encodes the specified RegionalResourceReferences message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify|verify} messages. + * @param message RegionalResourceReferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionalResourceReferences message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify|verify} messages. + * @param message RegionalResourceReferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionalResourceReferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionalResourceReferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences; + + /** + * Decodes a RegionalResourceReferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionalResourceReferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences; + + /** + * Verifies a RegionalResourceReferences message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionalResourceReferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionalResourceReferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences; + + /** + * Creates a plain object from a RegionalResourceReferences message. Also converts values to other types if specified. + * @param message RegionalResourceReferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionalResourceReferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegionalResourceReferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ViewRestApi. */ + interface IViewRestApi { + + /** ViewRestApi documentations */ + documentations?: (google.cloud.aiplatform.v1.PublisherModel.IDocumentation[]|null); + + /** ViewRestApi title */ + title?: (string|null); + } + + /** Represents a ViewRestApi. */ + class ViewRestApi implements IViewRestApi { + + /** + * Constructs a new ViewRestApi. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi); + + /** ViewRestApi documentations. */ + public documentations: google.cloud.aiplatform.v1.PublisherModel.IDocumentation[]; + + /** ViewRestApi title. */ + public title: string; + + /** + * Creates a new ViewRestApi instance using the specified properties. + * @param [properties] Properties to set + * @returns ViewRestApi instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi): google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi; + + /** + * Encodes the specified ViewRestApi message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.verify|verify} messages. + * @param message ViewRestApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViewRestApi message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.verify|verify} messages. + * @param message ViewRestApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViewRestApi message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViewRestApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi; + + /** + * Decodes a ViewRestApi message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViewRestApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi; + + /** + * Verifies a ViewRestApi message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ViewRestApi message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViewRestApi + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi; + + /** + * Creates a plain object from a ViewRestApi message. Also converts values to other types if specified. + * @param message ViewRestApi + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViewRestApi to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViewRestApi + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deploy. */ + interface IDeploy { + + /** Deploy dedicatedResources */ + dedicatedResources?: (google.cloud.aiplatform.v1.IDedicatedResources|null); + + /** Deploy automaticResources */ + automaticResources?: (google.cloud.aiplatform.v1.IAutomaticResources|null); + + /** Deploy sharedResources */ + sharedResources?: (string|null); + + /** Deploy modelDisplayName */ + modelDisplayName?: (string|null); + + /** Deploy largeModelReference */ + largeModelReference?: (google.cloud.aiplatform.v1.ILargeModelReference|null); + + /** Deploy containerSpec */ + containerSpec?: (google.cloud.aiplatform.v1.IModelContainerSpec|null); + + /** Deploy artifactUri */ + artifactUri?: (string|null); + + /** Deploy title */ + title?: (string|null); + } + + /** Represents a Deploy. */ + class Deploy implements IDeploy { + + /** + * Constructs a new Deploy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy); + + /** Deploy dedicatedResources. */ + public dedicatedResources?: (google.cloud.aiplatform.v1.IDedicatedResources|null); + + /** Deploy automaticResources. */ + public automaticResources?: (google.cloud.aiplatform.v1.IAutomaticResources|null); + + /** Deploy sharedResources. */ + public sharedResources?: (string|null); + + /** Deploy modelDisplayName. */ + public modelDisplayName: string; + + /** Deploy largeModelReference. */ + public largeModelReference?: (google.cloud.aiplatform.v1.ILargeModelReference|null); + + /** Deploy containerSpec. */ + public containerSpec?: (google.cloud.aiplatform.v1.IModelContainerSpec|null); + + /** Deploy artifactUri. */ + public artifactUri: string; + + /** Deploy title. */ + public title: string; + + /** Deploy predictionResources. */ + public predictionResources?: ("dedicatedResources"|"automaticResources"|"sharedResources"); + + /** + * Creates a new Deploy instance using the specified properties. + * @param [properties] Properties to set + * @returns Deploy instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy; + + /** + * Encodes the specified Deploy message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.verify|verify} messages. + * @param message Deploy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deploy message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.verify|verify} messages. + * @param message Deploy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deploy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deploy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy; + + /** + * Decodes a Deploy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deploy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy; + + /** + * Verifies a Deploy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deploy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deploy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy; + + /** + * Creates a plain object from a Deploy message. Also converts values to other types if specified. + * @param message Deploy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deploy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deploy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** OpenSourceCategory enum. */ + enum OpenSourceCategory { + OPEN_SOURCE_CATEGORY_UNSPECIFIED = 0, + PROPRIETARY = 1, + GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 2, + THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 3, + GOOGLE_OWNED_OSS = 4, + THIRD_PARTY_OWNED_OSS = 5 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + EXPERIMENTAL = 1, + PRIVATE_PREVIEW = 2, + PUBLIC_PREVIEW = 3, + GA = 4 + } + } + /** Represents a ModelService */ class ModelService extends $protobuf.rpc.Service { @@ -103746,6 +105701,9 @@ export namespace google { /** ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount */ timestampOutsideRetentionRowsCount?: (number|Long|string|null); + + /** ImportFeatureValuesOperationMetadata blockingOperationIds */ + blockingOperationIds?: ((number|Long|string)[]|null); } /** Represents an ImportFeatureValuesOperationMetadata. */ @@ -103775,6 +105733,9 @@ export namespace google { /** ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount. */ public timestampOutsideRetentionRowsCount: (number|Long|string); + /** ImportFeatureValuesOperationMetadata blockingOperationIds. */ + public blockingOperationIds: (number|Long|string)[]; + /** * Creates a new ImportFeatureValuesOperationMetadata instance using the specified properties. * @param [properties] Properties to set @@ -129762,6 +131723,9 @@ export namespace google { /** PublisherModel frameworks */ frameworks?: (string[]|null); + /** PublisherModel launchStage */ + launchStage?: (google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage|keyof typeof google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage|null); + /** PublisherModel publisherModelTemplate */ publisherModelTemplate?: (string|null); @@ -129793,6 +131757,9 @@ export namespace google { /** PublisherModel frameworks. */ public frameworks: string[]; + /** PublisherModel launchStage. */ + public launchStage: (google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage|keyof typeof google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage); + /** PublisherModel publisherModelTemplate. */ public publisherModelTemplate: string; @@ -130114,6 +132081,9 @@ export namespace google { /** CallToAction openGenerationAiStudio */ openGenerationAiStudio?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + + /** CallToAction requestAccess */ + requestAccess?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null); } /** Represents a CallToAction. */ @@ -130149,6 +132119,9 @@ export namespace google { /** CallToAction openGenerationAiStudio. */ public openGenerationAiStudio?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + /** CallToAction requestAccess. */ + public requestAccess?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null); + /** * Creates a new CallToAction instance using the specified properties. * @param [properties] Properties to set @@ -130587,6 +132560,15 @@ export namespace google { GOOGLE_OWNED_OSS = 4, THIRD_PARTY_OWNED_OSS = 5 } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + EXPERIMENTAL = 1, + PRIVATE_PREVIEW = 2, + PUBLIC_PREVIEW = 3, + GA = 4 + } } /** Represents a ModelService */ diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 513ea3afc0dc..1140760f22c0 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -77,6 +77,7 @@ * @property {number} NVIDIA_TESLA_P4=4 NVIDIA_TESLA_P4 value * @property {number} NVIDIA_TESLA_T4=5 NVIDIA_TESLA_T4 value * @property {number} NVIDIA_TESLA_A100=8 NVIDIA_TESLA_A100 value + * @property {number} NVIDIA_A100_80GB=9 NVIDIA_A100_80GB value * @property {number} NVIDIA_L4=11 NVIDIA_L4 value * @property {number} TPU_V2=6 TPU_V2 value * @property {number} TPU_V3=7 TPU_V3 value @@ -91,6 +92,7 @@ values[valuesById[4] = "NVIDIA_TESLA_P4"] = 4; values[valuesById[5] = "NVIDIA_TESLA_T4"] = 5; values[valuesById[8] = "NVIDIA_TESLA_A100"] = 8; + values[valuesById[9] = "NVIDIA_A100_80GB"] = 9; values[valuesById[11] = "NVIDIA_L4"] = 11; values[valuesById[6] = "TPU_V2"] = 6; values[valuesById[7] = "TPU_V3"] = 7; @@ -14111,6 +14113,7 @@ case 4: case 5: case 8: + case 9: case 11: case 6: case 7: @@ -14172,6 +14175,10 @@ case 8: message.acceleratorType = 8; break; + case "NVIDIA_A100_80GB": + case 9: + message.acceleratorType = 9; + break; case "NVIDIA_L4": case 11: message.acceleratorType = 11; @@ -16421,6 +16428,7 @@ * @property {google.protobuf.IValue|null} [metadata] Model metadata * @property {Array.|null} [supportedExportFormats] Model supportedExportFormats * @property {string|null} [trainingPipeline] Model trainingPipeline + * @property {string|null} [pipelineJob] Model pipelineJob * @property {google.cloud.aiplatform.v1.IModelContainerSpec|null} [containerSpec] Model containerSpec * @property {string|null} [artifactUri] Model artifactUri * @property {Array.|null} [supportedDeploymentResourcesTypes] Model supportedDeploymentResourcesTypes @@ -16564,6 +16572,14 @@ */ Model.prototype.trainingPipeline = ""; + /** + * Model pipelineJob. + * @member {string} pipelineJob + * @memberof google.cloud.aiplatform.v1.Model + * @instance + */ + Model.prototype.pipelineJob = ""; + /** * Model containerSpec. * @member {google.cloud.aiplatform.v1.IModelContainerSpec|null|undefined} containerSpec @@ -16774,6 +16790,8 @@ $root.google.cloud.aiplatform.v1.ModelSourceInfo.encode(message.modelSourceInfo, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); if (message.metadataArtifact != null && Object.hasOwnProperty.call(message, "metadataArtifact")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.metadataArtifact); + if (message.pipelineJob != null && Object.hasOwnProperty.call(message, "pipelineJob")) + writer.uint32(/* id 47, wireType 2 =*/378).string(message.pipelineJob); return writer; }; @@ -16864,6 +16882,10 @@ message.trainingPipeline = reader.string(); break; } + case 47: { + message.pipelineJob = reader.string(); + break; + } case 9: { message.containerSpec = $root.google.cloud.aiplatform.v1.ModelContainerSpec.decode(reader, reader.uint32()); break; @@ -17048,6 +17070,9 @@ if (message.trainingPipeline != null && message.hasOwnProperty("trainingPipeline")) if (!$util.isString(message.trainingPipeline)) return "trainingPipeline: string expected"; + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) + if (!$util.isString(message.pipelineJob)) + return "pipelineJob: string expected"; if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) { var error = $root.google.cloud.aiplatform.v1.ModelContainerSpec.verify(message.containerSpec); if (error) @@ -17203,6 +17228,8 @@ } if (object.trainingPipeline != null) message.trainingPipeline = String(object.trainingPipeline); + if (object.pipelineJob != null) + message.pipelineJob = String(object.pipelineJob); if (object.containerSpec != null) { if (typeof object.containerSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1.Model.containerSpec: object expected"); @@ -17352,6 +17379,7 @@ object.originalModelInfo = null; object.modelSourceInfo = null; object.metadataArtifact = ""; + object.pipelineJob = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -17431,6 +17459,8 @@ object.modelSourceInfo = $root.google.cloud.aiplatform.v1.ModelSourceInfo.toObject(message.modelSourceInfo, options); if (message.metadataArtifact != null && message.hasOwnProperty("metadataArtifact")) object.metadataArtifact = message.metadataArtifact; + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) + object.pipelineJob = message.pipelineJob; return object; }; @@ -17975,6 +18005,209 @@ return Model; })(); + v1.LargeModelReference = (function() { + + /** + * Properties of a LargeModelReference. + * @memberof google.cloud.aiplatform.v1 + * @interface ILargeModelReference + * @property {string|null} [name] LargeModelReference name + */ + + /** + * Constructs a new LargeModelReference. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a LargeModelReference. + * @implements ILargeModelReference + * @constructor + * @param {google.cloud.aiplatform.v1.ILargeModelReference=} [properties] Properties to set + */ + function LargeModelReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LargeModelReference name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @instance + */ + LargeModelReference.prototype.name = ""; + + /** + * Creates a new LargeModelReference instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {google.cloud.aiplatform.v1.ILargeModelReference=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.LargeModelReference} LargeModelReference instance + */ + LargeModelReference.create = function create(properties) { + return new LargeModelReference(properties); + }; + + /** + * Encodes the specified LargeModelReference message. Does not implicitly {@link google.cloud.aiplatform.v1.LargeModelReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {google.cloud.aiplatform.v1.ILargeModelReference} message LargeModelReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeModelReference.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 LargeModelReference message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.LargeModelReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {google.cloud.aiplatform.v1.ILargeModelReference} message LargeModelReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LargeModelReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LargeModelReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.LargeModelReference} LargeModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeModelReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.LargeModelReference(); + 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 LargeModelReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.LargeModelReference} LargeModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LargeModelReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LargeModelReference message. + * @function verify + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LargeModelReference.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 LargeModelReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.LargeModelReference} LargeModelReference + */ + LargeModelReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.LargeModelReference) + return object; + var message = new $root.google.cloud.aiplatform.v1.LargeModelReference(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LargeModelReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {google.cloud.aiplatform.v1.LargeModelReference} message LargeModelReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LargeModelReference.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 LargeModelReference to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @instance + * @returns {Object.} JSON object + */ + LargeModelReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LargeModelReference + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.LargeModelReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LargeModelReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.LargeModelReference"; + }; + + return LargeModelReference; + })(); + v1.PredictSchemata = (function() { /** @@ -60520,6 +60753,7 @@ * @property {Array.|null} [sourceUris] ImportFeatureValuesOperationMetadata sourceUris * @property {number|Long|null} [invalidRowCount] ImportFeatureValuesOperationMetadata invalidRowCount * @property {number|Long|null} [timestampOutsideRetentionRowsCount] ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount + * @property {Array.|null} [blockingOperationIds] ImportFeatureValuesOperationMetadata blockingOperationIds */ /** @@ -60532,6 +60766,7 @@ */ function ImportFeatureValuesOperationMetadata(properties) { this.sourceUris = []; + this.blockingOperationIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60586,6 +60821,14 @@ */ ImportFeatureValuesOperationMetadata.prototype.timestampOutsideRetentionRowsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ImportFeatureValuesOperationMetadata blockingOperationIds. + * @member {Array.} blockingOperationIds + * @memberof google.cloud.aiplatform.v1.ImportFeatureValuesOperationMetadata + * @instance + */ + ImportFeatureValuesOperationMetadata.prototype.blockingOperationIds = $util.emptyArray; + /** * Creates a new ImportFeatureValuesOperationMetadata instance using the specified properties. * @function create @@ -60623,6 +60866,12 @@ writer.uint32(/* id 6, wireType 0 =*/48).int64(message.invalidRowCount); if (message.timestampOutsideRetentionRowsCount != null && Object.hasOwnProperty.call(message, "timestampOutsideRetentionRowsCount")) writer.uint32(/* id 7, wireType 0 =*/56).int64(message.timestampOutsideRetentionRowsCount); + if (message.blockingOperationIds != null && message.blockingOperationIds.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.blockingOperationIds.length; ++i) + writer.int64(message.blockingOperationIds[i]); + writer.ldelim(); + } return writer; }; @@ -60683,6 +60932,17 @@ message.timestampOutsideRetentionRowsCount = reader.int64(); break; } + case 8: { + if (!(message.blockingOperationIds && message.blockingOperationIds.length)) + message.blockingOperationIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.blockingOperationIds.push(reader.int64()); + } else + message.blockingOperationIds.push(reader.int64()); + break; + } default: reader.skipType(tag & 7); break; @@ -60742,6 +61002,13 @@ if (message.timestampOutsideRetentionRowsCount != null && message.hasOwnProperty("timestampOutsideRetentionRowsCount")) if (!$util.isInteger(message.timestampOutsideRetentionRowsCount) && !(message.timestampOutsideRetentionRowsCount && $util.isInteger(message.timestampOutsideRetentionRowsCount.low) && $util.isInteger(message.timestampOutsideRetentionRowsCount.high))) return "timestampOutsideRetentionRowsCount: integer|Long expected"; + if (message.blockingOperationIds != null && message.hasOwnProperty("blockingOperationIds")) { + if (!Array.isArray(message.blockingOperationIds)) + return "blockingOperationIds: array expected"; + for (var i = 0; i < message.blockingOperationIds.length; ++i) + if (!$util.isInteger(message.blockingOperationIds[i]) && !(message.blockingOperationIds[i] && $util.isInteger(message.blockingOperationIds[i].low) && $util.isInteger(message.blockingOperationIds[i].high))) + return "blockingOperationIds: integer|Long[] expected"; + } return null; }; @@ -60805,6 +61072,20 @@ message.timestampOutsideRetentionRowsCount = object.timestampOutsideRetentionRowsCount; else if (typeof object.timestampOutsideRetentionRowsCount === "object") message.timestampOutsideRetentionRowsCount = new $util.LongBits(object.timestampOutsideRetentionRowsCount.low >>> 0, object.timestampOutsideRetentionRowsCount.high >>> 0).toNumber(); + if (object.blockingOperationIds) { + if (!Array.isArray(object.blockingOperationIds)) + throw TypeError(".google.cloud.aiplatform.v1.ImportFeatureValuesOperationMetadata.blockingOperationIds: array expected"); + message.blockingOperationIds = []; + for (var i = 0; i < object.blockingOperationIds.length; ++i) + if ($util.Long) + (message.blockingOperationIds[i] = $util.Long.fromValue(object.blockingOperationIds[i])).unsigned = false; + else if (typeof object.blockingOperationIds[i] === "string") + message.blockingOperationIds[i] = parseInt(object.blockingOperationIds[i], 10); + else if (typeof object.blockingOperationIds[i] === "number") + message.blockingOperationIds[i] = object.blockingOperationIds[i]; + else if (typeof object.blockingOperationIds[i] === "object") + message.blockingOperationIds[i] = new $util.LongBits(object.blockingOperationIds[i].low >>> 0, object.blockingOperationIds[i].high >>> 0).toNumber(); + } return message; }; @@ -60821,8 +61102,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.sourceUris = []; + object.blockingOperationIds = []; + } if (options.defaults) { object.genericMetadata = null; if ($util.Long) { @@ -60873,6 +61156,14 @@ object.timestampOutsideRetentionRowsCount = options.longs === String ? String(message.timestampOutsideRetentionRowsCount) : message.timestampOutsideRetentionRowsCount; else object.timestampOutsideRetentionRowsCount = options.longs === String ? $util.Long.prototype.toString.call(message.timestampOutsideRetentionRowsCount) : options.longs === Number ? new $util.LongBits(message.timestampOutsideRetentionRowsCount.low >>> 0, message.timestampOutsideRetentionRowsCount.high >>> 0).toNumber() : message.timestampOutsideRetentionRowsCount; + if (message.blockingOperationIds && message.blockingOperationIds.length) { + object.blockingOperationIds = []; + for (var j = 0; j < message.blockingOperationIds.length; ++j) + if (typeof message.blockingOperationIds[j] === "number") + object.blockingOperationIds[j] = options.longs === String ? String(message.blockingOperationIds[j]) : message.blockingOperationIds[j]; + else + object.blockingOperationIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.blockingOperationIds[j]) : options.longs === Number ? new $util.LongBits(message.blockingOperationIds[j].low >>> 0, message.blockingOperationIds[j].high >>> 0).toNumber() : message.blockingOperationIds[j]; + } return object; }; @@ -103339,175 +103630,250 @@ return LineageSubgraph; })(); - v1.MetadataSchema = (function() { + v1.MatchService = (function() { /** - * Properties of a MetadataSchema. + * Constructs a new MatchService service. * @memberof google.cloud.aiplatform.v1 - * @interface IMetadataSchema - * @property {string|null} [name] MetadataSchema name - * @property {string|null} [schemaVersion] MetadataSchema schemaVersion - * @property {string|null} [schema] MetadataSchema schema - * @property {google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType|null} [schemaType] MetadataSchema schemaType - * @property {google.protobuf.ITimestamp|null} [createTime] MetadataSchema createTime - * @property {string|null} [description] MetadataSchema description + * @classdesc Represents a MatchService + * @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 MatchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MatchService; /** - * Constructs a new MetadataSchema. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MetadataSchema. - * @implements IMetadataSchema - * @constructor - * @param {google.cloud.aiplatform.v1.IMetadataSchema=} [properties] Properties to set + * Creates new MatchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.MatchService + * @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 {MatchService} RPC service. Useful where requests and/or responses are streamed. */ - function MetadataSchema(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + MatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * MetadataSchema name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * Callback as used by {@link google.cloud.aiplatform.v1.MatchService|findNeighbors}. + * @memberof google.cloud.aiplatform.v1.MatchService + * @typedef FindNeighborsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse} [response] FindNeighborsResponse + */ + + /** + * Calls FindNeighbors. + * @function findNeighbors + * @memberof google.cloud.aiplatform.v1.MatchService * @instance + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest} request FindNeighborsRequest message or plain object + * @param {google.cloud.aiplatform.v1.MatchService.FindNeighborsCallback} callback Node-style callback called with the error, if any, and FindNeighborsResponse + * @returns {undefined} + * @variation 1 */ - MetadataSchema.prototype.name = ""; + Object.defineProperty(MatchService.prototype.findNeighbors = function findNeighbors(request, callback) { + return this.rpcCall(findNeighbors, $root.google.cloud.aiplatform.v1.FindNeighborsRequest, $root.google.cloud.aiplatform.v1.FindNeighborsResponse, request, callback); + }, "name", { value: "FindNeighbors" }); /** - * MetadataSchema schemaVersion. - * @member {string} schemaVersion - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * Calls FindNeighbors. + * @function findNeighbors + * @memberof google.cloud.aiplatform.v1.MatchService * @instance + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest} request FindNeighborsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - MetadataSchema.prototype.schemaVersion = ""; /** - * MetadataSchema schema. - * @member {string} schema - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * Callback as used by {@link google.cloud.aiplatform.v1.MatchService|readIndexDatapoints}. + * @memberof google.cloud.aiplatform.v1.MatchService + * @typedef ReadIndexDatapointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} [response] ReadIndexDatapointsResponse + */ + + /** + * Calls ReadIndexDatapoints. + * @function readIndexDatapoints + * @memberof google.cloud.aiplatform.v1.MatchService * @instance + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest} request ReadIndexDatapointsRequest message or plain object + * @param {google.cloud.aiplatform.v1.MatchService.ReadIndexDatapointsCallback} callback Node-style callback called with the error, if any, and ReadIndexDatapointsResponse + * @returns {undefined} + * @variation 1 */ - MetadataSchema.prototype.schema = ""; + Object.defineProperty(MatchService.prototype.readIndexDatapoints = function readIndexDatapoints(request, callback) { + return this.rpcCall(readIndexDatapoints, $root.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest, $root.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse, request, callback); + }, "name", { value: "ReadIndexDatapoints" }); /** - * MetadataSchema schemaType. - * @member {google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType} schemaType - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * Calls ReadIndexDatapoints. + * @function readIndexDatapoints + * @memberof google.cloud.aiplatform.v1.MatchService * @instance + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest} request ReadIndexDatapointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - MetadataSchema.prototype.schemaType = 0; + + return MatchService; + })(); + + v1.FindNeighborsRequest = (function() { /** - * MetadataSchema createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * Properties of a FindNeighborsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IFindNeighborsRequest + * @property {string|null} [indexEndpoint] FindNeighborsRequest indexEndpoint + * @property {string|null} [deployedIndexId] FindNeighborsRequest deployedIndexId + * @property {Array.|null} [queries] FindNeighborsRequest queries + * @property {boolean|null} [returnFullDatapoint] FindNeighborsRequest returnFullDatapoint + */ + + /** + * Constructs a new FindNeighborsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a FindNeighborsRequest. + * @implements IFindNeighborsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest=} [properties] Properties to set + */ + function FindNeighborsRequest(properties) { + this.queries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindNeighborsRequest indexEndpoint. + * @member {string} indexEndpoint + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @instance */ - MetadataSchema.prototype.createTime = null; + FindNeighborsRequest.prototype.indexEndpoint = ""; /** - * MetadataSchema description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * FindNeighborsRequest deployedIndexId. + * @member {string} deployedIndexId + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @instance */ - MetadataSchema.prototype.description = ""; + FindNeighborsRequest.prototype.deployedIndexId = ""; /** - * Creates a new MetadataSchema instance using the specified properties. + * FindNeighborsRequest queries. + * @member {Array.} queries + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest + * @instance + */ + FindNeighborsRequest.prototype.queries = $util.emptyArray; + + /** + * FindNeighborsRequest returnFullDatapoint. + * @member {boolean} returnFullDatapoint + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest + * @instance + */ + FindNeighborsRequest.prototype.returnFullDatapoint = false; + + /** + * Creates a new FindNeighborsRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static - * @param {google.cloud.aiplatform.v1.IMetadataSchema=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema instance + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest} FindNeighborsRequest instance */ - MetadataSchema.create = function create(properties) { - return new MetadataSchema(properties); + FindNeighborsRequest.create = function create(properties) { + return new FindNeighborsRequest(properties); }; /** - * Encodes the specified MetadataSchema message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataSchema.verify|verify} messages. + * Encodes the specified FindNeighborsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static - * @param {google.cloud.aiplatform.v1.IMetadataSchema} message MetadataSchema message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest} message FindNeighborsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetadataSchema.encode = function encode(message, writer) { + FindNeighborsRequest.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.schemaVersion != null && Object.hasOwnProperty.call(message, "schemaVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaVersion); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.schema); - if (message.schemaType != null && Object.hasOwnProperty.call(message, "schemaType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.schemaType); - 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.indexEndpoint != null && Object.hasOwnProperty.call(message, "indexEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.indexEndpoint); + if (message.deployedIndexId != null && Object.hasOwnProperty.call(message, "deployedIndexId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployedIndexId); + if (message.queries != null && message.queries.length) + for (var i = 0; i < message.queries.length; ++i) + $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.encode(message.queries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.returnFullDatapoint != null && Object.hasOwnProperty.call(message, "returnFullDatapoint")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.returnFullDatapoint); return writer; }; /** - * Encodes the specified MetadataSchema message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataSchema.verify|verify} messages. + * Encodes the specified FindNeighborsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static - * @param {google.cloud.aiplatform.v1.IMetadataSchema} message MetadataSchema message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFindNeighborsRequest} message FindNeighborsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MetadataSchema.encodeDelimited = function encodeDelimited(message, writer) { + FindNeighborsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MetadataSchema message from the specified reader or buffer. + * Decodes a FindNeighborsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest} FindNeighborsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetadataSchema.decode = function decode(reader, length) { + FindNeighborsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataSchema(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FindNeighborsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.indexEndpoint = reader.string(); break; } case 2: { - message.schemaVersion = reader.string(); + message.deployedIndexId = reader.string(); break; } case 3: { - message.schema = reader.string(); + if (!(message.queries && message.queries.length)) + message.queries = []; + message.queries.push($root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.decode(reader, reader.uint32())); break; } case 4: { - message.schemaType = reader.int32(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.description = reader.string(); + message.returnFullDatapoint = reader.bool(); break; } default: @@ -103519,643 +103885,2460 @@ }; /** - * Decodes a MetadataSchema message from the specified reader or buffer, length delimited. + * Decodes a FindNeighborsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest} FindNeighborsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MetadataSchema.decodeDelimited = function decodeDelimited(reader) { + FindNeighborsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MetadataSchema message. + * Verifies a FindNeighborsRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MetadataSchema.verify = function verify(message) { + FindNeighborsRequest.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.schemaVersion != null && message.hasOwnProperty("schemaVersion")) - if (!$util.isString(message.schemaVersion)) - return "schemaVersion: string expected"; - if (message.schema != null && message.hasOwnProperty("schema")) - if (!$util.isString(message.schema)) - return "schema: string expected"; - if (message.schemaType != null && message.hasOwnProperty("schemaType")) - switch (message.schemaType) { - default: - return "schemaType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + if (!$util.isString(message.indexEndpoint)) + return "indexEndpoint: string expected"; + if (message.deployedIndexId != null && message.hasOwnProperty("deployedIndexId")) + if (!$util.isString(message.deployedIndexId)) + return "deployedIndexId: string expected"; + if (message.queries != null && message.hasOwnProperty("queries")) { + if (!Array.isArray(message.queries)) + return "queries: array expected"; + for (var i = 0; i < message.queries.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.verify(message.queries[i]); + if (error) + return "queries." + error; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.returnFullDatapoint != null && message.hasOwnProperty("returnFullDatapoint")) + if (typeof message.returnFullDatapoint !== "boolean") + return "returnFullDatapoint: boolean expected"; return null; }; /** - * Creates a MetadataSchema message from a plain object. Also converts values to their respective internal types. + * Creates a FindNeighborsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest} FindNeighborsRequest */ - MetadataSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MetadataSchema) + FindNeighborsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FindNeighborsRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.MetadataSchema(); - if (object.name != null) - message.name = String(object.name); - if (object.schemaVersion != null) - message.schemaVersion = String(object.schemaVersion); - if (object.schema != null) - message.schema = String(object.schema); - switch (object.schemaType) { - default: - if (typeof object.schemaType === "number") { - message.schemaType = object.schemaType; - break; + var message = new $root.google.cloud.aiplatform.v1.FindNeighborsRequest(); + if (object.indexEndpoint != null) + message.indexEndpoint = String(object.indexEndpoint); + if (object.deployedIndexId != null) + message.deployedIndexId = String(object.deployedIndexId); + if (object.queries) { + if (!Array.isArray(object.queries)) + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsRequest.queries: array expected"); + message.queries = []; + for (var i = 0; i < object.queries.length; ++i) { + if (typeof object.queries[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsRequest.queries: object expected"); + message.queries[i] = $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.fromObject(object.queries[i]); } - break; - case "METADATA_SCHEMA_TYPE_UNSPECIFIED": - case 0: - message.schemaType = 0; - break; - case "ARTIFACT_TYPE": - case 1: - message.schemaType = 1; - break; - case "EXECUTION_TYPE": - case 2: - message.schemaType = 2; - break; - case "CONTEXT_TYPE": - case 3: - message.schemaType = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MetadataSchema.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.description != null) - message.description = String(object.description); + if (object.returnFullDatapoint != null) + message.returnFullDatapoint = Boolean(object.returnFullDatapoint); return message; }; /** - * Creates a plain object from a MetadataSchema message. Also converts values to other types if specified. + * Creates a plain object from a FindNeighborsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static - * @param {google.cloud.aiplatform.v1.MetadataSchema} message MetadataSchema + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest} message FindNeighborsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MetadataSchema.toObject = function toObject(message, options) { + FindNeighborsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.queries = []; if (options.defaults) { - object.name = ""; - object.schemaVersion = ""; - object.schema = ""; - object.schemaType = options.enums === String ? "METADATA_SCHEMA_TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.description = ""; + object.indexEndpoint = ""; + object.deployedIndexId = ""; + object.returnFullDatapoint = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.schemaVersion != null && message.hasOwnProperty("schemaVersion")) - object.schemaVersion = message.schemaVersion; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = message.schema; - if (message.schemaType != null && message.hasOwnProperty("schemaType")) - object.schemaType = options.enums === String ? $root.google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType[message.schemaType] === undefined ? message.schemaType : $root.google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType[message.schemaType] : message.schemaType; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + object.indexEndpoint = message.indexEndpoint; + if (message.deployedIndexId != null && message.hasOwnProperty("deployedIndexId")) + object.deployedIndexId = message.deployedIndexId; + if (message.queries && message.queries.length) { + object.queries = []; + for (var j = 0; j < message.queries.length; ++j) + object.queries[j] = $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query.toObject(message.queries[j], options); + } + if (message.returnFullDatapoint != null && message.hasOwnProperty("returnFullDatapoint")) + object.returnFullDatapoint = message.returnFullDatapoint; return object; }; /** - * Converts this MetadataSchema to JSON. + * Converts this FindNeighborsRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @instance * @returns {Object.} JSON object */ - MetadataSchema.prototype.toJSON = function toJSON() { + FindNeighborsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MetadataSchema + * Gets the default type url for FindNeighborsRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MetadataSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FindNeighborsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataSchema"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FindNeighborsRequest"; }; - /** - * MetadataSchemaType enum. - * @name google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType - * @enum {number} - * @property {number} METADATA_SCHEMA_TYPE_UNSPECIFIED=0 METADATA_SCHEMA_TYPE_UNSPECIFIED value - * @property {number} ARTIFACT_TYPE=1 ARTIFACT_TYPE value - * @property {number} EXECUTION_TYPE=2 EXECUTION_TYPE value - * @property {number} CONTEXT_TYPE=3 CONTEXT_TYPE value - */ - MetadataSchema.MetadataSchemaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METADATA_SCHEMA_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ARTIFACT_TYPE"] = 1; - values[valuesById[2] = "EXECUTION_TYPE"] = 2; - values[valuesById[3] = "CONTEXT_TYPE"] = 3; - return values; + FindNeighborsRequest.Query = (function() { + + /** + * Properties of a Query. + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest + * @interface IQuery + * @property {google.cloud.aiplatform.v1.IIndexDatapoint|null} [datapoint] Query datapoint + * @property {number|null} [neighborCount] Query neighborCount + * @property {number|null} [perCrowdingAttributeNeighborCount] Query perCrowdingAttributeNeighborCount + * @property {number|null} [approximateNeighborCount] Query approximateNeighborCount + * @property {number|null} [fractionLeafNodesToSearchOverride] Query fractionLeafNodesToSearchOverride + */ + + /** + * Constructs a new Query. + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest + * @classdesc Represents a Query. + * @implements IQuery + * @constructor + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery=} [properties] Properties to set + */ + function Query(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Query datapoint. + * @member {google.cloud.aiplatform.v1.IIndexDatapoint|null|undefined} datapoint + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + */ + Query.prototype.datapoint = null; + + /** + * Query neighborCount. + * @member {number} neighborCount + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + */ + Query.prototype.neighborCount = 0; + + /** + * Query perCrowdingAttributeNeighborCount. + * @member {number} perCrowdingAttributeNeighborCount + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + */ + Query.prototype.perCrowdingAttributeNeighborCount = 0; + + /** + * Query approximateNeighborCount. + * @member {number} approximateNeighborCount + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + */ + Query.prototype.approximateNeighborCount = 0; + + /** + * Query fractionLeafNodesToSearchOverride. + * @member {number} fractionLeafNodesToSearchOverride + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + */ + Query.prototype.fractionLeafNodesToSearchOverride = 0; + + /** + * Creates a new Query instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest.Query} Query instance + */ + Query.create = function create(properties) { + return new Query(properties); + }; + + /** + * Encodes the specified Query message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.Query.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery} message Query message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Query.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datapoint != null && Object.hasOwnProperty.call(message, "datapoint")) + $root.google.cloud.aiplatform.v1.IndexDatapoint.encode(message.datapoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.neighborCount != null && Object.hasOwnProperty.call(message, "neighborCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.neighborCount); + if (message.perCrowdingAttributeNeighborCount != null && Object.hasOwnProperty.call(message, "perCrowdingAttributeNeighborCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.perCrowdingAttributeNeighborCount); + if (message.approximateNeighborCount != null && Object.hasOwnProperty.call(message, "approximateNeighborCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.approximateNeighborCount); + if (message.fractionLeafNodesToSearchOverride != null && Object.hasOwnProperty.call(message, "fractionLeafNodesToSearchOverride")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.fractionLeafNodesToSearchOverride); + return writer; + }; + + /** + * Encodes the specified Query message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsRequest.Query.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest.IQuery} message Query message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Query.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Query message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest.Query} Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Query.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.neighborCount = reader.int32(); + break; + } + case 3: { + message.perCrowdingAttributeNeighborCount = reader.int32(); + break; + } + case 4: { + message.approximateNeighborCount = reader.int32(); + break; + } + case 5: { + message.fractionLeafNodesToSearchOverride = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Query message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest.Query} Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Query.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Query message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Query.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datapoint != null && message.hasOwnProperty("datapoint")) { + var error = $root.google.cloud.aiplatform.v1.IndexDatapoint.verify(message.datapoint); + if (error) + return "datapoint." + error; + } + if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) + if (!$util.isInteger(message.neighborCount)) + return "neighborCount: integer expected"; + if (message.perCrowdingAttributeNeighborCount != null && message.hasOwnProperty("perCrowdingAttributeNeighborCount")) + if (!$util.isInteger(message.perCrowdingAttributeNeighborCount)) + return "perCrowdingAttributeNeighborCount: integer expected"; + if (message.approximateNeighborCount != null && message.hasOwnProperty("approximateNeighborCount")) + if (!$util.isInteger(message.approximateNeighborCount)) + return "approximateNeighborCount: integer expected"; + if (message.fractionLeafNodesToSearchOverride != null && message.hasOwnProperty("fractionLeafNodesToSearchOverride")) + if (typeof message.fractionLeafNodesToSearchOverride !== "number") + return "fractionLeafNodesToSearchOverride: number expected"; + return null; + }; + + /** + * Creates a Query message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FindNeighborsRequest.Query} Query + */ + Query.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query) + return object; + var message = new $root.google.cloud.aiplatform.v1.FindNeighborsRequest.Query(); + if (object.datapoint != null) { + if (typeof object.datapoint !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsRequest.Query.datapoint: object expected"); + message.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.fromObject(object.datapoint); + } + if (object.neighborCount != null) + message.neighborCount = object.neighborCount | 0; + if (object.perCrowdingAttributeNeighborCount != null) + message.perCrowdingAttributeNeighborCount = object.perCrowdingAttributeNeighborCount | 0; + if (object.approximateNeighborCount != null) + message.approximateNeighborCount = object.approximateNeighborCount | 0; + if (object.fractionLeafNodesToSearchOverride != null) + message.fractionLeafNodesToSearchOverride = Number(object.fractionLeafNodesToSearchOverride); + return message; + }; + + /** + * Creates a plain object from a Query message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsRequest.Query} message Query + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Query.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datapoint = null; + object.neighborCount = 0; + object.perCrowdingAttributeNeighborCount = 0; + object.approximateNeighborCount = 0; + object.fractionLeafNodesToSearchOverride = 0; + } + if (message.datapoint != null && message.hasOwnProperty("datapoint")) + object.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.toObject(message.datapoint, options); + if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) + object.neighborCount = message.neighborCount; + if (message.perCrowdingAttributeNeighborCount != null && message.hasOwnProperty("perCrowdingAttributeNeighborCount")) + object.perCrowdingAttributeNeighborCount = message.perCrowdingAttributeNeighborCount; + if (message.approximateNeighborCount != null && message.hasOwnProperty("approximateNeighborCount")) + object.approximateNeighborCount = message.approximateNeighborCount; + if (message.fractionLeafNodesToSearchOverride != null && message.hasOwnProperty("fractionLeafNodesToSearchOverride")) + object.fractionLeafNodesToSearchOverride = options.json && !isFinite(message.fractionLeafNodesToSearchOverride) ? String(message.fractionLeafNodesToSearchOverride) : message.fractionLeafNodesToSearchOverride; + return object; + }; + + /** + * Converts this Query to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @instance + * @returns {Object.} JSON object + */ + Query.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Query + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FindNeighborsRequest.Query + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Query.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FindNeighborsRequest.Query"; + }; + + return Query; })(); - return MetadataSchema; + return FindNeighborsRequest; })(); - v1.MetadataService = (function() { + v1.FindNeighborsResponse = (function() { /** - * Constructs a new MetadataService service. + * Properties of a FindNeighborsResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MetadataService - * @extends $protobuf.rpc.Service + * @interface IFindNeighborsResponse + * @property {Array.|null} [nearestNeighbors] FindNeighborsResponse nearestNeighbors + */ + + /** + * Constructs a new FindNeighborsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a FindNeighborsResponse. + * @implements IFindNeighborsResponse * @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 + * @param {google.cloud.aiplatform.v1.IFindNeighborsResponse=} [properties] Properties to set */ - function MetadataService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function FindNeighborsResponse(properties) { + this.nearestNeighbors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (MetadataService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetadataService; + /** + * FindNeighborsResponse nearestNeighbors. + * @member {Array.} nearestNeighbors + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @instance + */ + FindNeighborsResponse.prototype.nearestNeighbors = $util.emptyArray; /** - * Creates new MetadataService service using the specified rpc implementation. + * Creates a new FindNeighborsResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MetadataService + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse * @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 {MetadataService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.aiplatform.v1.IFindNeighborsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse} FindNeighborsResponse instance */ - MetadataService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + FindNeighborsResponse.create = function create(properties) { + return new FindNeighborsResponse(properties); }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createMetadataStore}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef CreateMetadataStoreCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified FindNeighborsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {google.cloud.aiplatform.v1.IFindNeighborsResponse} message FindNeighborsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + FindNeighborsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nearestNeighbors != null && message.nearestNeighbors.length) + for (var i = 0; i < message.nearestNeighbors.length; ++i) + $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.encode(message.nearestNeighbors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Calls CreateMetadataStore. - * @function createMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateMetadataStoreRequest} request CreateMetadataStoreRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.CreateMetadataStoreCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified FindNeighborsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {google.cloud.aiplatform.v1.IFindNeighborsResponse} message FindNeighborsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(MetadataService.prototype.createMetadataStore = function createMetadataStore(request, callback) { - return this.rpcCall(createMetadataStore, $root.google.cloud.aiplatform.v1.CreateMetadataStoreRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateMetadataStore" }); + FindNeighborsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateMetadataStore. - * @function createMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateMetadataStoreRequest} request CreateMetadataStoreRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a FindNeighborsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse} FindNeighborsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + FindNeighborsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.nearestNeighbors && message.nearestNeighbors.length)) + message.nearestNeighbors = []; + message.nearestNeighbors.push($root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getMetadataStore}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef GetMetadataStoreCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.MetadataStore} [response] MetadataStore + * Decodes a FindNeighborsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse} FindNeighborsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + FindNeighborsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetMetadataStore. - * @function getMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetMetadataStoreRequest} request GetMetadataStoreRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.GetMetadataStoreCallback} callback Node-style callback called with the error, if any, and MetadataStore - * @returns {undefined} - * @variation 1 + * Verifies a FindNeighborsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(MetadataService.prototype.getMetadataStore = function getMetadataStore(request, callback) { - return this.rpcCall(getMetadataStore, $root.google.cloud.aiplatform.v1.GetMetadataStoreRequest, $root.google.cloud.aiplatform.v1.MetadataStore, request, callback); - }, "name", { value: "GetMetadataStore" }); + FindNeighborsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nearestNeighbors != null && message.hasOwnProperty("nearestNeighbors")) { + if (!Array.isArray(message.nearestNeighbors)) + return "nearestNeighbors: array expected"; + for (var i = 0; i < message.nearestNeighbors.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.verify(message.nearestNeighbors[i]); + if (error) + return "nearestNeighbors." + error; + } + } + return null; + }; /** - * Calls GetMetadataStore. - * @function getMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetMetadataStoreRequest} request GetMetadataStoreRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listMetadataStores}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef ListMetadataStoresCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListMetadataStoresResponse} [response] ListMetadataStoresResponse + * Creates a FindNeighborsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse} FindNeighborsResponse */ + FindNeighborsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FindNeighborsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse(); + if (object.nearestNeighbors) { + if (!Array.isArray(object.nearestNeighbors)) + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsResponse.nearestNeighbors: array expected"); + message.nearestNeighbors = []; + for (var i = 0; i < object.nearestNeighbors.length; ++i) { + if (typeof object.nearestNeighbors[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsResponse.nearestNeighbors: object expected"); + message.nearestNeighbors[i] = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.fromObject(object.nearestNeighbors[i]); + } + } + return message; + }; /** - * Calls ListMetadataStores. - * @function listMetadataStores - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IListMetadataStoresRequest} request ListMetadataStoresRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.ListMetadataStoresCallback} callback Node-style callback called with the error, if any, and ListMetadataStoresResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a FindNeighborsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse} message FindNeighborsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(MetadataService.prototype.listMetadataStores = function listMetadataStores(request, callback) { - return this.rpcCall(listMetadataStores, $root.google.cloud.aiplatform.v1.ListMetadataStoresRequest, $root.google.cloud.aiplatform.v1.ListMetadataStoresResponse, request, callback); - }, "name", { value: "ListMetadataStores" }); + FindNeighborsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nearestNeighbors = []; + if (message.nearestNeighbors && message.nearestNeighbors.length) { + object.nearestNeighbors = []; + for (var j = 0; j < message.nearestNeighbors.length; ++j) + object.nearestNeighbors[j] = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.toObject(message.nearestNeighbors[j], options); + } + return object; + }; /** - * Calls ListMetadataStores. - * @function listMetadataStores - * @memberof google.cloud.aiplatform.v1.MetadataService + * Converts this FindNeighborsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse * @instance - * @param {google.cloud.aiplatform.v1.IListMetadataStoresRequest} request ListMetadataStoresRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + FindNeighborsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|deleteMetadataStore}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef DeleteMetadataStoreCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for FindNeighborsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + FindNeighborsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FindNeighborsResponse"; + }; + + FindNeighborsResponse.Neighbor = (function() { + + /** + * Properties of a Neighbor. + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @interface INeighbor + * @property {google.cloud.aiplatform.v1.IIndexDatapoint|null} [datapoint] Neighbor datapoint + * @property {number|null} [distance] Neighbor distance + */ + + /** + * Constructs a new Neighbor. + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @classdesc Represents a Neighbor. + * @implements INeighbor + * @constructor + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor=} [properties] Properties to set + */ + function Neighbor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Neighbor datapoint. + * @member {google.cloud.aiplatform.v1.IIndexDatapoint|null|undefined} datapoint + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @instance + */ + Neighbor.prototype.datapoint = null; + + /** + * Neighbor distance. + * @member {number} distance + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @instance + */ + Neighbor.prototype.distance = 0; + + /** + * Creates a new Neighbor instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} Neighbor instance + */ + Neighbor.create = function create(properties) { + return new Neighbor(properties); + }; + + /** + * Encodes the specified Neighbor message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor} message Neighbor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Neighbor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datapoint != null && Object.hasOwnProperty.call(message, "datapoint")) + $root.google.cloud.aiplatform.v1.IndexDatapoint.encode(message.datapoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.distance); + return writer; + }; + + /** + * Encodes the specified Neighbor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INeighbor} message Neighbor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Neighbor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Neighbor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Neighbor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.distance = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Neighbor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Neighbor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Neighbor message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Neighbor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datapoint != null && message.hasOwnProperty("datapoint")) { + var error = $root.google.cloud.aiplatform.v1.IndexDatapoint.verify(message.datapoint); + if (error) + return "datapoint." + error; + } + if (message.distance != null && message.hasOwnProperty("distance")) + if (typeof message.distance !== "number") + return "distance: number expected"; + return null; + }; + + /** + * Creates a Neighbor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} Neighbor + */ + Neighbor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor) + return object; + var message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor(); + if (object.datapoint != null) { + if (typeof object.datapoint !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.datapoint: object expected"); + message.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.fromObject(object.datapoint); + } + if (object.distance != null) + message.distance = Number(object.distance); + return message; + }; + + /** + * Creates a plain object from a Neighbor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor} message Neighbor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Neighbor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datapoint = null; + object.distance = 0; + } + if (message.datapoint != null && message.hasOwnProperty("datapoint")) + object.datapoint = $root.google.cloud.aiplatform.v1.IndexDatapoint.toObject(message.datapoint, options); + if (message.distance != null && message.hasOwnProperty("distance")) + object.distance = options.json && !isFinite(message.distance) ? String(message.distance) : message.distance; + return object; + }; + + /** + * Converts this Neighbor to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @instance + * @returns {Object.} JSON object + */ + Neighbor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Neighbor + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Neighbor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor"; + }; + + return Neighbor; + })(); + + FindNeighborsResponse.NearestNeighbors = (function() { + + /** + * Properties of a NearestNeighbors. + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @interface INearestNeighbors + * @property {string|null} [id] NearestNeighbors id + * @property {Array.|null} [neighbors] NearestNeighbors neighbors + */ + + /** + * Constructs a new NearestNeighbors. + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse + * @classdesc Represents a NearestNeighbors. + * @implements INearestNeighbors + * @constructor + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors=} [properties] Properties to set + */ + function NearestNeighbors(properties) { + this.neighbors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NearestNeighbors id. + * @member {string} id + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @instance + */ + NearestNeighbors.prototype.id = ""; + + /** + * NearestNeighbors neighbors. + * @member {Array.} neighbors + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @instance + */ + NearestNeighbors.prototype.neighbors = $util.emptyArray; + + /** + * Creates a new NearestNeighbors instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} NearestNeighbors instance + */ + NearestNeighbors.create = function create(properties) { + return new NearestNeighbors(properties); + }; + + /** + * Encodes the specified NearestNeighbors message. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors} message NearestNeighbors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NearestNeighbors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.neighbors != null && message.neighbors.length) + for (var i = 0; i < message.neighbors.length; ++i) + $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.encode(message.neighbors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NearestNeighbors message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.INearestNeighbors} message NearestNeighbors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NearestNeighbors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NearestNeighbors message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} NearestNeighbors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NearestNeighbors.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (!(message.neighbors && message.neighbors.length)) + message.neighbors = []; + message.neighbors.push($root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NearestNeighbors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} NearestNeighbors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NearestNeighbors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NearestNeighbors message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NearestNeighbors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.neighbors != null && message.hasOwnProperty("neighbors")) { + if (!Array.isArray(message.neighbors)) + return "neighbors: array expected"; + for (var i = 0; i < message.neighbors.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.verify(message.neighbors[i]); + if (error) + return "neighbors." + error; + } + } + return null; + }; + + /** + * Creates a NearestNeighbors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} NearestNeighbors + */ + NearestNeighbors.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors) + return object; + var message = new $root.google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors(); + if (object.id != null) + message.id = String(object.id); + if (object.neighbors) { + if (!Array.isArray(object.neighbors)) + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.neighbors: array expected"); + message.neighbors = []; + for (var i = 0; i < object.neighbors.length; ++i) { + if (typeof object.neighbors[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors.neighbors: object expected"); + message.neighbors[i] = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.fromObject(object.neighbors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NearestNeighbors message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors} message NearestNeighbors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NearestNeighbors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.neighbors = []; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.neighbors && message.neighbors.length) { + object.neighbors = []; + for (var j = 0; j < message.neighbors.length; ++j) + object.neighbors[j] = $root.google.cloud.aiplatform.v1.FindNeighborsResponse.Neighbor.toObject(message.neighbors[j], options); + } + return object; + }; + + /** + * Converts this NearestNeighbors to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @instance + * @returns {Object.} JSON object + */ + NearestNeighbors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NearestNeighbors + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NearestNeighbors.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FindNeighborsResponse.NearestNeighbors"; + }; + + return NearestNeighbors; + })(); + + return FindNeighborsResponse; + })(); + + v1.ReadIndexDatapointsRequest = (function() { /** - * Calls DeleteMetadataStore. - * @function deleteMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest} request DeleteMetadataStoreRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStoreCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Properties of a ReadIndexDatapointsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadIndexDatapointsRequest + * @property {string|null} [indexEndpoint] ReadIndexDatapointsRequest indexEndpoint + * @property {string|null} [deployedIndexId] ReadIndexDatapointsRequest deployedIndexId + * @property {Array.|null} [ids] ReadIndexDatapointsRequest ids */ - Object.defineProperty(MetadataService.prototype.deleteMetadataStore = function deleteMetadataStore(request, callback) { - return this.rpcCall(deleteMetadataStore, $root.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteMetadataStore" }); /** - * Calls DeleteMetadataStore. - * @function deleteMetadataStore - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest} request DeleteMetadataStoreRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Constructs a new ReadIndexDatapointsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadIndexDatapointsRequest. + * @implements IReadIndexDatapointsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest=} [properties] Properties to set */ + function ReadIndexDatapointsRequest(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createArtifact}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef CreateArtifactCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + * ReadIndexDatapointsRequest indexEndpoint. + * @member {string} indexEndpoint + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @instance */ + ReadIndexDatapointsRequest.prototype.indexEndpoint = ""; /** - * Calls CreateArtifact. - * @function createArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService + * ReadIndexDatapointsRequest deployedIndexId. + * @member {string} deployedIndexId + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest * @instance - * @param {google.cloud.aiplatform.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.CreateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(MetadataService.prototype.createArtifact = function createArtifact(request, callback) { - return this.rpcCall(createArtifact, $root.google.cloud.aiplatform.v1.CreateArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); - }, "name", { value: "CreateArtifact" }); + ReadIndexDatapointsRequest.prototype.deployedIndexId = ""; /** - * Calls CreateArtifact. - * @function createArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService + * ReadIndexDatapointsRequest ids. + * @member {Array.} ids + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest * @instance - * @param {google.cloud.aiplatform.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ReadIndexDatapointsRequest.prototype.ids = $util.emptyArray; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getArtifact}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef GetArtifactCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + * Creates a new ReadIndexDatapointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} ReadIndexDatapointsRequest instance */ + ReadIndexDatapointsRequest.create = function create(properties) { + return new ReadIndexDatapointsRequest(properties); + }; /** - * Calls GetArtifact. - * @function getArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.GetArtifactCallback} callback Node-style callback called with the error, if any, and Artifact - * @returns {undefined} - * @variation 1 + * Encodes the specified ReadIndexDatapointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest} message ReadIndexDatapointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(MetadataService.prototype.getArtifact = function getArtifact(request, callback) { - return this.rpcCall(getArtifact, $root.google.cloud.aiplatform.v1.GetArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); - }, "name", { value: "GetArtifact" }); + ReadIndexDatapointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexEndpoint != null && Object.hasOwnProperty.call(message, "indexEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.indexEndpoint); + if (message.deployedIndexId != null && Object.hasOwnProperty.call(message, "deployedIndexId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployedIndexId); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ids[i]); + return writer; + }; /** - * Calls GetArtifact. - * @function getArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified ReadIndexDatapointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsRequest} message ReadIndexDatapointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ReadIndexDatapointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listArtifacts}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef ListArtifactsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListArtifactsResponse} [response] ListArtifactsResponse + * Decodes a ReadIndexDatapointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} ReadIndexDatapointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReadIndexDatapointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.indexEndpoint = reader.string(); + break; + } + case 2: { + message.deployedIndexId = reader.string(); + break; + } + case 3: { + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListArtifacts. - * @function listArtifacts - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.ListArtifactsCallback} callback Node-style callback called with the error, if any, and ListArtifactsResponse - * @returns {undefined} - * @variation 1 + * Decodes a ReadIndexDatapointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} ReadIndexDatapointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(MetadataService.prototype.listArtifacts = function listArtifacts(request, callback) { - return this.rpcCall(listArtifacts, $root.google.cloud.aiplatform.v1.ListArtifactsRequest, $root.google.cloud.aiplatform.v1.ListArtifactsResponse, request, callback); - }, "name", { value: "ListArtifacts" }); + ReadIndexDatapointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListArtifacts. - * @function listArtifacts - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a ReadIndexDatapointsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ReadIndexDatapointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + if (!$util.isString(message.indexEndpoint)) + return "indexEndpoint: string expected"; + if (message.deployedIndexId != null && message.hasOwnProperty("deployedIndexId")) + if (!$util.isString(message.deployedIndexId)) + return "deployedIndexId: string expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isString(message.ids[i])) + return "ids: string[] expected"; + } + return null; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|updateArtifact}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef UpdateArtifactCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + * Creates a ReadIndexDatapointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} ReadIndexDatapointsRequest */ + ReadIndexDatapointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest(); + if (object.indexEndpoint != null) + message.indexEndpoint = String(object.indexEndpoint); + if (object.deployedIndexId != null) + message.deployedIndexId = String(object.deployedIndexId); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.aiplatform.v1.ReadIndexDatapointsRequest.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + message.ids[i] = String(object.ids[i]); + } + return message; + }; /** - * Calls UpdateArtifact. - * @function updateArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateArtifactRequest} request UpdateArtifactRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.UpdateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ReadIndexDatapointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {google.cloud.aiplatform.v1.ReadIndexDatapointsRequest} message ReadIndexDatapointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(MetadataService.prototype.updateArtifact = function updateArtifact(request, callback) { - return this.rpcCall(updateArtifact, $root.google.cloud.aiplatform.v1.UpdateArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); - }, "name", { value: "UpdateArtifact" }); + ReadIndexDatapointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.indexEndpoint = ""; + object.deployedIndexId = ""; + } + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + object.indexEndpoint = message.indexEndpoint; + if (message.deployedIndexId != null && message.hasOwnProperty("deployedIndexId")) + object.deployedIndexId = message.deployedIndexId; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = message.ids[j]; + } + return object; + }; /** - * Calls UpdateArtifact. - * @function updateArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService + * Converts this ReadIndexDatapointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest * @instance - * @param {google.cloud.aiplatform.v1.IUpdateArtifactRequest} request UpdateArtifactRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ReadIndexDatapointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|deleteArtifact}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef DeleteArtifactCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for ReadIndexDatapointsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + ReadIndexDatapointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadIndexDatapointsRequest"; + }; - /** - * Calls DeleteArtifact. - * @function deleteArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.DeleteArtifactCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetadataService.prototype.deleteArtifact = function deleteArtifact(request, callback) { - return this.rpcCall(deleteArtifact, $root.google.cloud.aiplatform.v1.DeleteArtifactRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteArtifact" }); + return ReadIndexDatapointsRequest; + })(); + + v1.ReadIndexDatapointsResponse = (function() { /** - * Calls DeleteArtifact. - * @function deleteArtifact - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a ReadIndexDatapointsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadIndexDatapointsResponse + * @property {Array.|null} [datapoints] ReadIndexDatapointsResponse datapoints */ /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|purgeArtifacts}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef PurgeArtifactsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new ReadIndexDatapointsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadIndexDatapointsResponse. + * @implements IReadIndexDatapointsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsResponse=} [properties] Properties to set */ + function ReadIndexDatapointsResponse(properties) { + this.datapoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls PurgeArtifacts. - * @function purgeArtifacts - * @memberof google.cloud.aiplatform.v1.MetadataService + * ReadIndexDatapointsResponse datapoints. + * @member {Array.} datapoints + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse * @instance - * @param {google.cloud.aiplatform.v1.IPurgeArtifactsRequest} request PurgeArtifactsRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.PurgeArtifactsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(MetadataService.prototype.purgeArtifacts = function purgeArtifacts(request, callback) { - return this.rpcCall(purgeArtifacts, $root.google.cloud.aiplatform.v1.PurgeArtifactsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PurgeArtifacts" }); + ReadIndexDatapointsResponse.prototype.datapoints = $util.emptyArray; /** - * Calls PurgeArtifacts. - * @function purgeArtifacts - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IPurgeArtifactsRequest} request PurgeArtifactsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new ReadIndexDatapointsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} ReadIndexDatapointsResponse instance */ + ReadIndexDatapointsResponse.create = function create(properties) { + return new ReadIndexDatapointsResponse(properties); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createContext}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef CreateContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Context} [response] Context + * Encodes the specified ReadIndexDatapointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsResponse} message ReadIndexDatapointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ReadIndexDatapointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datapoints != null && message.datapoints.length) + for (var i = 0; i < message.datapoints.length; ++i) + $root.google.cloud.aiplatform.v1.IndexDatapoint.encode(message.datapoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateContextRequest} request CreateContextRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.CreateContextCallback} callback Node-style callback called with the error, if any, and Context - * @returns {undefined} - * @variation 1 + * Encodes the specified ReadIndexDatapointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadIndexDatapointsResponse} message ReadIndexDatapointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(MetadataService.prototype.createContext = function createContext(request, callback) { - return this.rpcCall(createContext, $root.google.cloud.aiplatform.v1.CreateContextRequest, $root.google.cloud.aiplatform.v1.Context, request, callback); - }, "name", { value: "CreateContext" }); + ReadIndexDatapointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateContextRequest} request CreateContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a ReadIndexDatapointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} ReadIndexDatapointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReadIndexDatapointsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datapoints && message.datapoints.length)) + message.datapoints = []; + message.datapoints.push($root.google.cloud.aiplatform.v1.IndexDatapoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getContext}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef GetContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Context} [response] Context + * Decodes a ReadIndexDatapointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} ReadIndexDatapointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReadIndexDatapointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetContextRequest} request GetContextRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.GetContextCallback} callback Node-style callback called with the error, if any, and Context - * @returns {undefined} - * @variation 1 + * Verifies a ReadIndexDatapointsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(MetadataService.prototype.getContext = function getContext(request, callback) { - return this.rpcCall(getContext, $root.google.cloud.aiplatform.v1.GetContextRequest, $root.google.cloud.aiplatform.v1.Context, request, callback); - }, "name", { value: "GetContext" }); + ReadIndexDatapointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datapoints != null && message.hasOwnProperty("datapoints")) { + if (!Array.isArray(message.datapoints)) + return "datapoints: array expected"; + for (var i = 0; i < message.datapoints.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.IndexDatapoint.verify(message.datapoints[i]); + if (error) + return "datapoints." + error; + } + } + return null; + }; /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.aiplatform.v1.MetadataService - * @instance - * @param {google.cloud.aiplatform.v1.IGetContextRequest} request GetContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a ReadIndexDatapointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} ReadIndexDatapointsResponse */ + ReadIndexDatapointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse(); + if (object.datapoints) { + if (!Array.isArray(object.datapoints)) + throw TypeError(".google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.datapoints: array expected"); + message.datapoints = []; + for (var i = 0; i < object.datapoints.length; ++i) { + if (typeof object.datapoints[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadIndexDatapointsResponse.datapoints: object expected"); + message.datapoints[i] = $root.google.cloud.aiplatform.v1.IndexDatapoint.fromObject(object.datapoints[i]); + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listContexts}. - * @memberof google.cloud.aiplatform.v1.MetadataService - * @typedef ListContextsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListContextsResponse} [response] ListContextsResponse + * Creates a plain object from a ReadIndexDatapointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {google.cloud.aiplatform.v1.ReadIndexDatapointsResponse} message ReadIndexDatapointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + ReadIndexDatapointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.datapoints = []; + if (message.datapoints && message.datapoints.length) { + object.datapoints = []; + for (var j = 0; j < message.datapoints.length; ++j) + object.datapoints[j] = $root.google.cloud.aiplatform.v1.IndexDatapoint.toObject(message.datapoints[j], options); + } + return object; + }; /** - * Calls ListContexts. - * @function listContexts - * @memberof google.cloud.aiplatform.v1.MetadataService + * Converts this ReadIndexDatapointsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse * @instance - * @param {google.cloud.aiplatform.v1.IListContextsRequest} request ListContextsRequest message or plain object - * @param {google.cloud.aiplatform.v1.MetadataService.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object + */ + ReadIndexDatapointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadIndexDatapointsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadIndexDatapointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadIndexDatapointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadIndexDatapointsResponse"; + }; + + return ReadIndexDatapointsResponse; + })(); + + v1.MetadataSchema = (function() { + + /** + * Properties of a MetadataSchema. + * @memberof google.cloud.aiplatform.v1 + * @interface IMetadataSchema + * @property {string|null} [name] MetadataSchema name + * @property {string|null} [schemaVersion] MetadataSchema schemaVersion + * @property {string|null} [schema] MetadataSchema schema + * @property {google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType|null} [schemaType] MetadataSchema schemaType + * @property {google.protobuf.ITimestamp|null} [createTime] MetadataSchema createTime + * @property {string|null} [description] MetadataSchema description + */ + + /** + * Constructs a new MetadataSchema. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MetadataSchema. + * @implements IMetadataSchema + * @constructor + * @param {google.cloud.aiplatform.v1.IMetadataSchema=} [properties] Properties to set + */ + function MetadataSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataSchema name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.name = ""; + + /** + * MetadataSchema schemaVersion. + * @member {string} schemaVersion + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.schemaVersion = ""; + + /** + * MetadataSchema schema. + * @member {string} schema + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.schema = ""; + + /** + * MetadataSchema schemaType. + * @member {google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType} schemaType + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.schemaType = 0; + + /** + * MetadataSchema createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.createTime = null; + + /** + * MetadataSchema description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + */ + MetadataSchema.prototype.description = ""; + + /** + * Creates a new MetadataSchema instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {google.cloud.aiplatform.v1.IMetadataSchema=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema instance + */ + MetadataSchema.create = function create(properties) { + return new MetadataSchema(properties); + }; + + /** + * Encodes the specified MetadataSchema message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {google.cloud.aiplatform.v1.IMetadataSchema} message MetadataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataSchema.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.schemaVersion != null && Object.hasOwnProperty.call(message, "schemaVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaVersion); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schema); + if (message.schemaType != null && Object.hasOwnProperty.call(message, "schemaType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.schemaType); + 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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified MetadataSchema message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {google.cloud.aiplatform.v1.IMetadataSchema} message MetadataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataSchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.schemaVersion = reader.string(); + break; + } + case 3: { + message.schema = reader.string(); + break; + } + case 4: { + message.schemaType = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataSchema message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataSchema.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.schemaVersion != null && message.hasOwnProperty("schemaVersion")) + if (!$util.isString(message.schemaVersion)) + return "schemaVersion: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + if (message.schemaType != null && message.hasOwnProperty("schemaType")) + switch (message.schemaType) { + default: + return "schemaType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a MetadataSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MetadataSchema} MetadataSchema + */ + MetadataSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MetadataSchema) + return object; + var message = new $root.google.cloud.aiplatform.v1.MetadataSchema(); + if (object.name != null) + message.name = String(object.name); + if (object.schemaVersion != null) + message.schemaVersion = String(object.schemaVersion); + if (object.schema != null) + message.schema = String(object.schema); + switch (object.schemaType) { + default: + if (typeof object.schemaType === "number") { + message.schemaType = object.schemaType; + break; + } + break; + case "METADATA_SCHEMA_TYPE_UNSPECIFIED": + case 0: + message.schemaType = 0; + break; + case "ARTIFACT_TYPE": + case 1: + message.schemaType = 1; + break; + case "EXECUTION_TYPE": + case 2: + message.schemaType = 2; + break; + case "CONTEXT_TYPE": + case 3: + message.schemaType = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MetadataSchema.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a MetadataSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {google.cloud.aiplatform.v1.MetadataSchema} message MetadataSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.schemaVersion = ""; + object.schema = ""; + object.schemaType = options.enums === String ? "METADATA_SCHEMA_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.schemaVersion != null && message.hasOwnProperty("schemaVersion")) + object.schemaVersion = message.schemaVersion; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + if (message.schemaType != null && message.hasOwnProperty("schemaType")) + object.schemaType = options.enums === String ? $root.google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType[message.schemaType] === undefined ? message.schemaType : $root.google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType[message.schemaType] : message.schemaType; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this MetadataSchema to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @instance + * @returns {Object.} JSON object + */ + MetadataSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataSchema + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MetadataSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataSchema"; + }; + + /** + * MetadataSchemaType enum. + * @name google.cloud.aiplatform.v1.MetadataSchema.MetadataSchemaType + * @enum {number} + * @property {number} METADATA_SCHEMA_TYPE_UNSPECIFIED=0 METADATA_SCHEMA_TYPE_UNSPECIFIED value + * @property {number} ARTIFACT_TYPE=1 ARTIFACT_TYPE value + * @property {number} EXECUTION_TYPE=2 EXECUTION_TYPE value + * @property {number} CONTEXT_TYPE=3 CONTEXT_TYPE value + */ + MetadataSchema.MetadataSchemaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATA_SCHEMA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ARTIFACT_TYPE"] = 1; + values[valuesById[2] = "EXECUTION_TYPE"] = 2; + values[valuesById[3] = "CONTEXT_TYPE"] = 3; + return values; + })(); + + return MetadataSchema; + })(); + + v1.MetadataService = (function() { + + /** + * Constructs a new MetadataService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MetadataService + * @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 MetadataService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MetadataService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetadataService; + + /** + * Creates new MetadataService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.MetadataService + * @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 {MetadataService} RPC service. Useful where requests and/or responses are streamed. + */ + MetadataService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createMetadataStore}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef CreateMetadataStoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMetadataStore. + * @function createMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateMetadataStoreRequest} request CreateMetadataStoreRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.CreateMetadataStoreCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.createMetadataStore = function createMetadataStore(request, callback) { + return this.rpcCall(createMetadataStore, $root.google.cloud.aiplatform.v1.CreateMetadataStoreRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMetadataStore" }); + + /** + * Calls CreateMetadataStore. + * @function createMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateMetadataStoreRequest} request CreateMetadataStoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getMetadataStore}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef GetMetadataStoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.MetadataStore} [response] MetadataStore + */ + + /** + * Calls GetMetadataStore. + * @function getMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetMetadataStoreRequest} request GetMetadataStoreRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.GetMetadataStoreCallback} callback Node-style callback called with the error, if any, and MetadataStore + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.getMetadataStore = function getMetadataStore(request, callback) { + return this.rpcCall(getMetadataStore, $root.google.cloud.aiplatform.v1.GetMetadataStoreRequest, $root.google.cloud.aiplatform.v1.MetadataStore, request, callback); + }, "name", { value: "GetMetadataStore" }); + + /** + * Calls GetMetadataStore. + * @function getMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetMetadataStoreRequest} request GetMetadataStoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listMetadataStores}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef ListMetadataStoresCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListMetadataStoresResponse} [response] ListMetadataStoresResponse + */ + + /** + * Calls ListMetadataStores. + * @function listMetadataStores + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IListMetadataStoresRequest} request ListMetadataStoresRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.ListMetadataStoresCallback} callback Node-style callback called with the error, if any, and ListMetadataStoresResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.listMetadataStores = function listMetadataStores(request, callback) { + return this.rpcCall(listMetadataStores, $root.google.cloud.aiplatform.v1.ListMetadataStoresRequest, $root.google.cloud.aiplatform.v1.ListMetadataStoresResponse, request, callback); + }, "name", { value: "ListMetadataStores" }); + + /** + * Calls ListMetadataStores. + * @function listMetadataStores + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IListMetadataStoresRequest} request ListMetadataStoresRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|deleteMetadataStore}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef DeleteMetadataStoreCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMetadataStore. + * @function deleteMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest} request DeleteMetadataStoreRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStoreCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.deleteMetadataStore = function deleteMetadataStore(request, callback) { + return this.rpcCall(deleteMetadataStore, $root.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMetadataStore" }); + + /** + * Calls DeleteMetadataStore. + * @function deleteMetadataStore + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest} request DeleteMetadataStoreRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createArtifact}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef CreateArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + */ + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.CreateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.createArtifact = function createArtifact(request, callback) { + return this.rpcCall(createArtifact, $root.google.cloud.aiplatform.v1.CreateArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); + }, "name", { value: "CreateArtifact" }); + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getArtifact}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef GetArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + */ + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.GetArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.getArtifact = function getArtifact(request, callback) { + return this.rpcCall(getArtifact, $root.google.cloud.aiplatform.v1.GetArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); + }, "name", { value: "GetArtifact" }); + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listArtifacts}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef ListArtifactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListArtifactsResponse} [response] ListArtifactsResponse + */ + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.ListArtifactsCallback} callback Node-style callback called with the error, if any, and ListArtifactsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.listArtifacts = function listArtifacts(request, callback) { + return this.rpcCall(listArtifacts, $root.google.cloud.aiplatform.v1.ListArtifactsRequest, $root.google.cloud.aiplatform.v1.ListArtifactsResponse, request, callback); + }, "name", { value: "ListArtifacts" }); + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|updateArtifact}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef UpdateArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Artifact} [response] Artifact + */ + + /** + * Calls UpdateArtifact. + * @function updateArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateArtifactRequest} request UpdateArtifactRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.UpdateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.updateArtifact = function updateArtifact(request, callback) { + return this.rpcCall(updateArtifact, $root.google.cloud.aiplatform.v1.UpdateArtifactRequest, $root.google.cloud.aiplatform.v1.Artifact, request, callback); + }, "name", { value: "UpdateArtifact" }); + + /** + * Calls UpdateArtifact. + * @function updateArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateArtifactRequest} request UpdateArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|deleteArtifact}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef DeleteArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.DeleteArtifactCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.deleteArtifact = function deleteArtifact(request, callback) { + return this.rpcCall(deleteArtifact, $root.google.cloud.aiplatform.v1.DeleteArtifactRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteArtifact" }); + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|purgeArtifacts}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef PurgeArtifactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeArtifacts. + * @function purgeArtifacts + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IPurgeArtifactsRequest} request PurgeArtifactsRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.PurgeArtifactsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.purgeArtifacts = function purgeArtifacts(request, callback) { + return this.rpcCall(purgeArtifacts, $root.google.cloud.aiplatform.v1.PurgeArtifactsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeArtifacts" }); + + /** + * Calls PurgeArtifacts. + * @function purgeArtifacts + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IPurgeArtifactsRequest} request PurgeArtifactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|createContext}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef CreateContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Context} [response] Context + */ + + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateContextRequest} request CreateContextRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.CreateContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.createContext = function createContext(request, callback) { + return this.rpcCall(createContext, $root.google.cloud.aiplatform.v1.CreateContextRequest, $root.google.cloud.aiplatform.v1.Context, request, callback); + }, "name", { value: "CreateContext" }); + + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateContextRequest} request CreateContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|getContext}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef GetContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Context} [response] Context + */ + + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetContextRequest} request GetContextRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.GetContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.getContext = function getContext(request, callback) { + return this.rpcCall(getContext, $root.google.cloud.aiplatform.v1.GetContextRequest, $root.google.cloud.aiplatform.v1.Context, request, callback); + }, "name", { value: "GetContext" }); + + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetContextRequest} request GetContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.MetadataService|listContexts}. + * @memberof google.cloud.aiplatform.v1.MetadataService + * @typedef ListContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListContextsResponse} [response] ListContextsResponse + */ + + /** + * Calls ListContexts. + * @function listContexts + * @memberof google.cloud.aiplatform.v1.MetadataService + * @instance + * @param {google.cloud.aiplatform.v1.IListContextsRequest} request ListContextsRequest message or plain object + * @param {google.cloud.aiplatform.v1.MetadataService.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse + * @returns {undefined} + * @variation 1 */ Object.defineProperty(MetadataService.prototype.listContexts = function listContexts(request, callback) { return this.rpcCall(listContexts, $root.google.cloud.aiplatform.v1.ListContextsRequest, $root.google.cloud.aiplatform.v1.ListContextsResponse, request, callback); @@ -115483,160 +117666,3158 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMetadataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + GetMetadataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMetadataSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMetadataSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest(); + 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 GetMetadataSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMetadataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMetadataSchemaRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMetadataSchemaRequest.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 GetMetadataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest + */ + GetMetadataSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMetadataSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} message GetMetadataSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMetadataSchemaRequest.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 GetMetadataSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetMetadataSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMetadataSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMetadataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetMetadataSchemaRequest"; + }; + + return GetMetadataSchemaRequest; + })(); + + v1.ListMetadataSchemasRequest = (function() { + + /** + * Properties of a ListMetadataSchemasRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListMetadataSchemasRequest + * @property {string|null} [parent] ListMetadataSchemasRequest parent + * @property {number|null} [pageSize] ListMetadataSchemasRequest pageSize + * @property {string|null} [pageToken] ListMetadataSchemasRequest pageToken + * @property {string|null} [filter] ListMetadataSchemasRequest filter + */ + + /** + * Constructs a new ListMetadataSchemasRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListMetadataSchemasRequest. + * @implements IListMetadataSchemasRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest=} [properties] Properties to set + */ + function ListMetadataSchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMetadataSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @instance + */ + ListMetadataSchemasRequest.prototype.parent = ""; + + /** + * ListMetadataSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @instance + */ + ListMetadataSchemasRequest.prototype.pageSize = 0; + + /** + * ListMetadataSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @instance + */ + ListMetadataSchemasRequest.prototype.pageToken = ""; + + /** + * ListMetadataSchemasRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @instance + */ + ListMetadataSchemasRequest.prototype.filter = ""; + + /** + * Creates a new ListMetadataSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest instance + */ + ListMetadataSchemasRequest.create = function create(properties) { + return new ListMetadataSchemasRequest(properties); + }; + + /** + * Encodes the specified ListMetadataSchemasRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest} message ListMetadataSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMetadataSchemasRequest.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 ListMetadataSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest} message ListMetadataSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMetadataSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMetadataSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMetadataSchemasRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest(); + 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 ListMetadataSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMetadataSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMetadataSchemasRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMetadataSchemasRequest.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 ListMetadataSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + */ + ListMetadataSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest(); + 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 ListMetadataSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} message ListMetadataSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMetadataSchemasRequest.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 ListMetadataSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListMetadataSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMetadataSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMetadataSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListMetadataSchemasRequest"; + }; + + return ListMetadataSchemasRequest; + })(); + + v1.ListMetadataSchemasResponse = (function() { + + /** + * Properties of a ListMetadataSchemasResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListMetadataSchemasResponse + * @property {Array.|null} [metadataSchemas] ListMetadataSchemasResponse metadataSchemas + * @property {string|null} [nextPageToken] ListMetadataSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListMetadataSchemasResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListMetadataSchemasResponse. + * @implements IListMetadataSchemasResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse=} [properties] Properties to set + */ + function ListMetadataSchemasResponse(properties) { + this.metadataSchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMetadataSchemasResponse metadataSchemas. + * @member {Array.} metadataSchemas + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @instance + */ + ListMetadataSchemasResponse.prototype.metadataSchemas = $util.emptyArray; + + /** + * ListMetadataSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @instance + */ + ListMetadataSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMetadataSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse instance + */ + ListMetadataSchemasResponse.create = function create(properties) { + return new ListMetadataSchemasResponse(properties); + }; + + /** + * Encodes the specified ListMetadataSchemasResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse} message ListMetadataSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMetadataSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataSchemas != null && message.metadataSchemas.length) + for (var i = 0; i < message.metadataSchemas.length; ++i) + $root.google.cloud.aiplatform.v1.MetadataSchema.encode(message.metadataSchemas[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 ListMetadataSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse} message ListMetadataSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMetadataSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMetadataSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMetadataSchemasResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.metadataSchemas && message.metadataSchemas.length)) + message.metadataSchemas = []; + message.metadataSchemas.push($root.google.cloud.aiplatform.v1.MetadataSchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMetadataSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMetadataSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMetadataSchemasResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMetadataSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadataSchemas != null && message.hasOwnProperty("metadataSchemas")) { + if (!Array.isArray(message.metadataSchemas)) + return "metadataSchemas: array expected"; + for (var i = 0; i < message.metadataSchemas.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MetadataSchema.verify(message.metadataSchemas[i]); + if (error) + return "metadataSchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMetadataSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + */ + ListMetadataSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse(); + if (object.metadataSchemas) { + if (!Array.isArray(object.metadataSchemas)) + throw TypeError(".google.cloud.aiplatform.v1.ListMetadataSchemasResponse.metadataSchemas: array expected"); + message.metadataSchemas = []; + for (var i = 0; i < object.metadataSchemas.length; ++i) { + if (typeof object.metadataSchemas[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListMetadataSchemasResponse.metadataSchemas: object expected"); + message.metadataSchemas[i] = $root.google.cloud.aiplatform.v1.MetadataSchema.fromObject(object.metadataSchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMetadataSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} message ListMetadataSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMetadataSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataSchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.metadataSchemas && message.metadataSchemas.length) { + object.metadataSchemas = []; + for (var j = 0; j < message.metadataSchemas.length; ++j) + object.metadataSchemas[j] = $root.google.cloud.aiplatform.v1.MetadataSchema.toObject(message.metadataSchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMetadataSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListMetadataSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMetadataSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMetadataSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListMetadataSchemasResponse"; + }; + + return ListMetadataSchemasResponse; + })(); + + v1.QueryArtifactLineageSubgraphRequest = (function() { + + /** + * Properties of a QueryArtifactLineageSubgraphRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IQueryArtifactLineageSubgraphRequest + * @property {string|null} [artifact] QueryArtifactLineageSubgraphRequest artifact + * @property {number|null} [maxHops] QueryArtifactLineageSubgraphRequest maxHops + * @property {string|null} [filter] QueryArtifactLineageSubgraphRequest filter + */ + + /** + * Constructs a new QueryArtifactLineageSubgraphRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a QueryArtifactLineageSubgraphRequest. + * @implements IQueryArtifactLineageSubgraphRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest=} [properties] Properties to set + */ + function QueryArtifactLineageSubgraphRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryArtifactLineageSubgraphRequest artifact. + * @member {string} artifact + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @instance + */ + QueryArtifactLineageSubgraphRequest.prototype.artifact = ""; + + /** + * QueryArtifactLineageSubgraphRequest maxHops. + * @member {number} maxHops + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @instance + */ + QueryArtifactLineageSubgraphRequest.prototype.maxHops = 0; + + /** + * QueryArtifactLineageSubgraphRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @instance + */ + QueryArtifactLineageSubgraphRequest.prototype.filter = ""; + + /** + * Creates a new QueryArtifactLineageSubgraphRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest instance + */ + QueryArtifactLineageSubgraphRequest.create = function create(properties) { + return new QueryArtifactLineageSubgraphRequest(properties); + }; + + /** + * Encodes the specified QueryArtifactLineageSubgraphRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryArtifactLineageSubgraphRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.artifact != null && Object.hasOwnProperty.call(message, "artifact")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.artifact); + if (message.maxHops != null && Object.hasOwnProperty.call(message, "maxHops")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxHops); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified QueryArtifactLineageSubgraphRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryArtifactLineageSubgraphRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryArtifactLineageSubgraphRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryArtifactLineageSubgraphRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.artifact = reader.string(); + break; + } + case 2: { + message.maxHops = reader.int32(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryArtifactLineageSubgraphRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryArtifactLineageSubgraphRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryArtifactLineageSubgraphRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryArtifactLineageSubgraphRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.artifact != null && message.hasOwnProperty("artifact")) + if (!$util.isString(message.artifact)) + return "artifact: string expected"; + if (message.maxHops != null && message.hasOwnProperty("maxHops")) + if (!$util.isInteger(message.maxHops)) + return "maxHops: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a QueryArtifactLineageSubgraphRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest + */ + QueryArtifactLineageSubgraphRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest(); + if (object.artifact != null) + message.artifact = String(object.artifact); + if (object.maxHops != null) + message.maxHops = object.maxHops | 0; + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a QueryArtifactLineageSubgraphRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryArtifactLineageSubgraphRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.artifact = ""; + object.maxHops = 0; + object.filter = ""; + } + if (message.artifact != null && message.hasOwnProperty("artifact")) + object.artifact = message.artifact; + if (message.maxHops != null && message.hasOwnProperty("maxHops")) + object.maxHops = message.maxHops; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this QueryArtifactLineageSubgraphRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @instance + * @returns {Object.} JSON object + */ + QueryArtifactLineageSubgraphRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryArtifactLineageSubgraphRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryArtifactLineageSubgraphRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest"; + }; + + return QueryArtifactLineageSubgraphRequest; + })(); + + v1.MetadataStore = (function() { + + /** + * Properties of a MetadataStore. + * @memberof google.cloud.aiplatform.v1 + * @interface IMetadataStore + * @property {string|null} [name] MetadataStore name + * @property {google.protobuf.ITimestamp|null} [createTime] MetadataStore createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MetadataStore updateTime + * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] MetadataStore encryptionSpec + * @property {string|null} [description] MetadataStore description + * @property {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState|null} [state] MetadataStore state + */ + + /** + * Constructs a new MetadataStore. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MetadataStore. + * @implements IMetadataStore + * @constructor + * @param {google.cloud.aiplatform.v1.IMetadataStore=} [properties] Properties to set + */ + function MetadataStore(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataStore name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.name = ""; + + /** + * MetadataStore createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.createTime = null; + + /** + * MetadataStore updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.updateTime = null; + + /** + * MetadataStore encryptionSpec. + * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.encryptionSpec = null; + + /** + * MetadataStore description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.description = ""; + + /** + * MetadataStore state. + * @member {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState|null|undefined} state + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + */ + MetadataStore.prototype.state = null; + + /** + * Creates a new MetadataStore instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {google.cloud.aiplatform.v1.IMetadataStore=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore instance + */ + MetadataStore.create = function create(properties) { + return new MetadataStore(properties); + }; + + /** + * Encodes the specified MetadataStore message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {google.cloud.aiplatform.v1.IMetadataStore} message MetadataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataStore.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 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.encode(message.state, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {google.cloud.aiplatform.v1.IMetadataStore} message MetadataStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataStore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataStore message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataStore.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.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) { + var error = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify(message.state); + if (error) + return "state." + error; + } + return null; + }; + + /** + * Creates a MetadataStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore + */ + MetadataStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MetadataStore) + return object; + var message = new $root.google.cloud.aiplatform.v1.MetadataStore(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.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.aiplatform.v1.MetadataStore.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } + if (object.description != null) + message.description = String(object.description); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.state: object expected"); + message.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.fromObject(object.state); + } + return message; + }; + + /** + * Creates a plain object from a MetadataStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {google.cloud.aiplatform.v1.MetadataStore} message MetadataStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.encryptionSpec = null; + object.description = ""; + object.state = 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.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.toObject(message.state, options); + return object; + }; + + /** + * Converts this MetadataStore to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @instance + * @returns {Object.} JSON object + */ + MetadataStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataStore + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataStore"; + }; + + MetadataStore.MetadataStoreState = (function() { + + /** + * Properties of a MetadataStoreState. + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @interface IMetadataStoreState + * @property {number|Long|null} [diskUtilizationBytes] MetadataStoreState diskUtilizationBytes + */ + + /** + * Constructs a new MetadataStoreState. + * @memberof google.cloud.aiplatform.v1.MetadataStore + * @classdesc Represents a MetadataStoreState. + * @implements IMetadataStoreState + * @constructor + * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState=} [properties] Properties to set + */ + function MetadataStoreState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataStoreState diskUtilizationBytes. + * @member {number|Long} diskUtilizationBytes + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @instance + */ + MetadataStoreState.prototype.diskUtilizationBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new MetadataStoreState instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState instance + */ + MetadataStoreState.create = function create(properties) { + return new MetadataStoreState(properties); + }; + + /** + * Encodes the specified MetadataStoreState message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState} message MetadataStoreState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataStoreState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskUtilizationBytes != null && Object.hasOwnProperty.call(message, "diskUtilizationBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.diskUtilizationBytes); + return writer; + }; + + /** + * Encodes the specified MetadataStoreState message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState} message MetadataStoreState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataStoreState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataStoreState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataStoreState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.diskUtilizationBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataStoreState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataStoreState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataStoreState message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataStoreState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.diskUtilizationBytes != null && message.hasOwnProperty("diskUtilizationBytes")) + if (!$util.isInteger(message.diskUtilizationBytes) && !(message.diskUtilizationBytes && $util.isInteger(message.diskUtilizationBytes.low) && $util.isInteger(message.diskUtilizationBytes.high))) + return "diskUtilizationBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a MetadataStoreState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState + */ + MetadataStoreState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState) + return object; + var message = new $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState(); + if (object.diskUtilizationBytes != null) + if ($util.Long) + (message.diskUtilizationBytes = $util.Long.fromValue(object.diskUtilizationBytes)).unsigned = false; + else if (typeof object.diskUtilizationBytes === "string") + message.diskUtilizationBytes = parseInt(object.diskUtilizationBytes, 10); + else if (typeof object.diskUtilizationBytes === "number") + message.diskUtilizationBytes = object.diskUtilizationBytes; + else if (typeof object.diskUtilizationBytes === "object") + message.diskUtilizationBytes = new $util.LongBits(object.diskUtilizationBytes.low >>> 0, object.diskUtilizationBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a MetadataStoreState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} message MetadataStoreState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataStoreState.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.diskUtilizationBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskUtilizationBytes = options.longs === String ? "0" : 0; + if (message.diskUtilizationBytes != null && message.hasOwnProperty("diskUtilizationBytes")) + if (typeof message.diskUtilizationBytes === "number") + object.diskUtilizationBytes = options.longs === String ? String(message.diskUtilizationBytes) : message.diskUtilizationBytes; + else + object.diskUtilizationBytes = options.longs === String ? $util.Long.prototype.toString.call(message.diskUtilizationBytes) : options.longs === Number ? new $util.LongBits(message.diskUtilizationBytes.low >>> 0, message.diskUtilizationBytes.high >>> 0).toNumber() : message.diskUtilizationBytes; + return object; + }; + + /** + * Converts this MetadataStoreState to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @instance + * @returns {Object.} JSON object + */ + MetadataStoreState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataStoreState + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataStoreState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState"; + }; + + return MetadataStoreState; + })(); + + return MetadataStore; + })(); + + v1.MigratableResource = (function() { + + /** + * Properties of a MigratableResource. + * @memberof google.cloud.aiplatform.v1 + * @interface IMigratableResource + * @property {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion|null} [mlEngineModelVersion] MigratableResource mlEngineModelVersion + * @property {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel|null} [automlModel] MigratableResource automlModel + * @property {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset|null} [automlDataset] MigratableResource automlDataset + * @property {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset|null} [dataLabelingDataset] MigratableResource dataLabelingDataset + * @property {google.protobuf.ITimestamp|null} [lastMigrateTime] MigratableResource lastMigrateTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] MigratableResource lastUpdateTime + */ + + /** + * Constructs a new MigratableResource. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MigratableResource. + * @implements IMigratableResource + * @constructor + * @param {google.cloud.aiplatform.v1.IMigratableResource=} [properties] Properties to set + */ + function MigratableResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigratableResource mlEngineModelVersion. + * @member {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion|null|undefined} mlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.mlEngineModelVersion = null; + + /** + * MigratableResource automlModel. + * @member {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel|null|undefined} automlModel + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.automlModel = null; + + /** + * MigratableResource automlDataset. + * @member {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset|null|undefined} automlDataset + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.automlDataset = null; + + /** + * MigratableResource dataLabelingDataset. + * @member {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset|null|undefined} dataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.dataLabelingDataset = null; + + /** + * MigratableResource lastMigrateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastMigrateTime + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.lastMigrateTime = null; + + /** + * MigratableResource lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + MigratableResource.prototype.lastUpdateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MigratableResource resource. + * @member {"mlEngineModelVersion"|"automlModel"|"automlDataset"|"dataLabelingDataset"|undefined} resource + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + */ + Object.defineProperty(MigratableResource.prototype, "resource", { + get: $util.oneOfGetter($oneOfFields = ["mlEngineModelVersion", "automlModel", "automlDataset", "dataLabelingDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MigratableResource instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {google.cloud.aiplatform.v1.IMigratableResource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource instance + */ + MigratableResource.create = function create(properties) { + return new MigratableResource(properties); + }; + + /** + * Encodes the specified MigratableResource message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {google.cloud.aiplatform.v1.IMigratableResource} message MigratableResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigratableResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mlEngineModelVersion != null && Object.hasOwnProperty.call(message, "mlEngineModelVersion")) + $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.encode(message.mlEngineModelVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.automlModel != null && Object.hasOwnProperty.call(message, "automlModel")) + $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.encode(message.automlModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.automlDataset != null && Object.hasOwnProperty.call(message, "automlDataset")) + $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.encode(message.automlDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataLabelingDataset != null && Object.hasOwnProperty.call(message, "dataLabelingDataset")) + $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.encode(message.dataLabelingDataset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastMigrateTime != null && Object.hasOwnProperty.call(message, "lastMigrateTime")) + $root.google.protobuf.Timestamp.encode(message.lastMigrateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigratableResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {google.cloud.aiplatform.v1.IMigratableResource} message MigratableResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigratableResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigratableResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigratableResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + message.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.decode(reader, reader.uint32()); + break; + } + case 3: { + message.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.decode(reader, reader.uint32()); + break; + } + case 5: { + message.lastMigrateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigratableResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigratableResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigratableResource message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigratableResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mlEngineModelVersion != null && message.hasOwnProperty("mlEngineModelVersion")) { + properties.resource = 1; + { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify(message.mlEngineModelVersion); + if (error) + return "mlEngineModelVersion." + error; + } + } + if (message.automlModel != null && message.hasOwnProperty("automlModel")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify(message.automlModel); + if (error) + return "automlModel." + error; + } + } + if (message.automlDataset != null && message.hasOwnProperty("automlDataset")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify(message.automlDataset); + if (error) + return "automlDataset." + error; + } + } + if (message.dataLabelingDataset != null && message.hasOwnProperty("dataLabelingDataset")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify(message.dataLabelingDataset); + if (error) + return "dataLabelingDataset." + error; + } + } + if (message.lastMigrateTime != null && message.hasOwnProperty("lastMigrateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastMigrateTime); + if (error) + return "lastMigrateTime." + error; + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + return null; + }; + + /** + * Creates a MigratableResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + */ + MigratableResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource(); + if (object.mlEngineModelVersion != null) { + if (typeof object.mlEngineModelVersion !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.mlEngineModelVersion: object expected"); + message.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.fromObject(object.mlEngineModelVersion); + } + if (object.automlModel != null) { + if (typeof object.automlModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.automlModel: object expected"); + message.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.fromObject(object.automlModel); + } + if (object.automlDataset != null) { + if (typeof object.automlDataset !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.automlDataset: object expected"); + message.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.fromObject(object.automlDataset); + } + if (object.dataLabelingDataset != null) { + if (typeof object.dataLabelingDataset !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.dataLabelingDataset: object expected"); + message.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.fromObject(object.dataLabelingDataset); + } + if (object.lastMigrateTime != null) { + if (typeof object.lastMigrateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.lastMigrateTime: object expected"); + message.lastMigrateTime = $root.google.protobuf.Timestamp.fromObject(object.lastMigrateTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a MigratableResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource} message MigratableResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigratableResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastMigrateTime = null; + object.lastUpdateTime = null; + } + if (message.mlEngineModelVersion != null && message.hasOwnProperty("mlEngineModelVersion")) { + object.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.toObject(message.mlEngineModelVersion, options); + if (options.oneofs) + object.resource = "mlEngineModelVersion"; + } + if (message.automlModel != null && message.hasOwnProperty("automlModel")) { + object.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.toObject(message.automlModel, options); + if (options.oneofs) + object.resource = "automlModel"; + } + if (message.automlDataset != null && message.hasOwnProperty("automlDataset")) { + object.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.toObject(message.automlDataset, options); + if (options.oneofs) + object.resource = "automlDataset"; + } + if (message.dataLabelingDataset != null && message.hasOwnProperty("dataLabelingDataset")) { + object.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.toObject(message.dataLabelingDataset, options); + if (options.oneofs) + object.resource = "dataLabelingDataset"; + } + if (message.lastMigrateTime != null && message.hasOwnProperty("lastMigrateTime")) + object.lastMigrateTime = $root.google.protobuf.Timestamp.toObject(message.lastMigrateTime, options); + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + return object; + }; + + /** + * Converts this MigratableResource to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @instance + * @returns {Object.} JSON object + */ + MigratableResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigratableResource + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigratableResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource"; + }; + + MigratableResource.MlEngineModelVersion = (function() { + + /** + * Properties of a MlEngineModelVersion. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @interface IMlEngineModelVersion + * @property {string|null} [endpoint] MlEngineModelVersion endpoint + * @property {string|null} [version] MlEngineModelVersion version + */ + + /** + * Constructs a new MlEngineModelVersion. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @classdesc Represents a MlEngineModelVersion. + * @implements IMlEngineModelVersion + * @constructor + * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion=} [properties] Properties to set + */ + function MlEngineModelVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MlEngineModelVersion endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @instance + */ + MlEngineModelVersion.prototype.endpoint = ""; + + /** + * MlEngineModelVersion version. + * @member {string} version + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @instance + */ + MlEngineModelVersion.prototype.version = ""; + + /** + * Creates a new MlEngineModelVersion instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion instance + */ + MlEngineModelVersion.create = function create(properties) { + return new MlEngineModelVersion(properties); + }; + + /** + * Encodes the specified MlEngineModelVersion message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion} message MlEngineModelVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MlEngineModelVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified MlEngineModelVersion message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion} message MlEngineModelVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MlEngineModelVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MlEngineModelVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MlEngineModelVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MlEngineModelVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MlEngineModelVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MlEngineModelVersion message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MlEngineModelVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a MlEngineModelVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + */ + MlEngineModelVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a MlEngineModelVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} message MlEngineModelVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MlEngineModelVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpoint = ""; + object.version = ""; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this MlEngineModelVersion to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @instance + * @returns {Object.} JSON object + */ + MlEngineModelVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MlEngineModelVersion + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MlEngineModelVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion"; + }; + + return MlEngineModelVersion; + })(); + + MigratableResource.AutomlModel = (function() { + + /** + * Properties of an AutomlModel. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @interface IAutomlModel + * @property {string|null} [model] AutomlModel model + * @property {string|null} [modelDisplayName] AutomlModel modelDisplayName + */ + + /** + * Constructs a new AutomlModel. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @classdesc Represents an AutomlModel. + * @implements IAutomlModel + * @constructor + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel=} [properties] Properties to set + */ + function AutomlModel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomlModel model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @instance + */ + AutomlModel.prototype.model = ""; + + /** + * AutomlModel modelDisplayName. + * @member {string} modelDisplayName + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @instance + */ + AutomlModel.prototype.modelDisplayName = ""; + + /** + * Creates a new AutomlModel instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel instance + */ + AutomlModel.create = function create(properties) { + return new AutomlModel(properties); + }; + + /** + * Encodes the specified AutomlModel message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel} message AutomlModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomlModel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelDisplayName); + return writer; + }; + + /** + * Encodes the specified AutomlModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel} message AutomlModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomlModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomlModel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomlModel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 3: { + message.modelDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomlModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomlModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomlModel message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomlModel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + if (!$util.isString(message.modelDisplayName)) + return "modelDisplayName: string expected"; + return null; + }; + + /** + * Creates an AutomlModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + */ + AutomlModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel(); + if (object.model != null) + message.model = String(object.model); + if (object.modelDisplayName != null) + message.modelDisplayName = String(object.modelDisplayName); + return message; + }; + + /** + * Creates a plain object from an AutomlModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} message AutomlModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomlModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.modelDisplayName = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + object.modelDisplayName = message.modelDisplayName; + return object; + }; + + /** + * Converts this AutomlModel to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @instance + * @returns {Object.} JSON object + */ + AutomlModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomlModel + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomlModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.AutomlModel"; + }; + + return AutomlModel; + })(); + + MigratableResource.AutomlDataset = (function() { + + /** + * Properties of an AutomlDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @interface IAutomlDataset + * @property {string|null} [dataset] AutomlDataset dataset + * @property {string|null} [datasetDisplayName] AutomlDataset datasetDisplayName + */ + + /** + * Constructs a new AutomlDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @classdesc Represents an AutomlDataset. + * @implements IAutomlDataset + * @constructor + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset=} [properties] Properties to set + */ + function AutomlDataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomlDataset dataset. + * @member {string} dataset + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @instance + */ + AutomlDataset.prototype.dataset = ""; + + /** + * AutomlDataset datasetDisplayName. + * @member {string} datasetDisplayName + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @instance + */ + AutomlDataset.prototype.datasetDisplayName = ""; + + /** + * Creates a new AutomlDataset instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset instance + */ + AutomlDataset.create = function create(properties) { + return new AutomlDataset(properties); + }; + + /** + * Encodes the specified AutomlDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset} message AutomlDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomlDataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.datasetDisplayName); + return writer; + }; + + /** + * Encodes the specified AutomlDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset} message AutomlDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomlDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomlDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomlDataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 4: { + message.datasetDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomlDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomlDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomlDataset message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomlDataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) + if (!$util.isString(message.datasetDisplayName)) + return "datasetDisplayName: string expected"; + return null; + }; + + /** + * Creates an AutomlDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + */ + AutomlDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.datasetDisplayName != null) + message.datasetDisplayName = String(object.datasetDisplayName); + return message; + }; + + /** + * Creates a plain object from an AutomlDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} message AutomlDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomlDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.datasetDisplayName = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) + object.datasetDisplayName = message.datasetDisplayName; + return object; + }; + + /** + * Converts this AutomlDataset to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @instance + * @returns {Object.} JSON object + */ + AutomlDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomlDataset + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomlDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.AutomlDataset"; + }; + + return AutomlDataset; + })(); + + MigratableResource.DataLabelingDataset = (function() { + + /** + * Properties of a DataLabelingDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @interface IDataLabelingDataset + * @property {string|null} [dataset] DataLabelingDataset dataset + * @property {string|null} [datasetDisplayName] DataLabelingDataset datasetDisplayName + * @property {Array.|null} [dataLabelingAnnotatedDatasets] DataLabelingDataset dataLabelingAnnotatedDatasets + */ + + /** + * Constructs a new DataLabelingDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource + * @classdesc Represents a DataLabelingDataset. + * @implements IDataLabelingDataset + * @constructor + * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset=} [properties] Properties to set + */ + function DataLabelingDataset(properties) { + this.dataLabelingAnnotatedDatasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataLabelingDataset dataset. + * @member {string} dataset + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @instance + */ + DataLabelingDataset.prototype.dataset = ""; + + /** + * DataLabelingDataset datasetDisplayName. + * @member {string} datasetDisplayName + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @instance + */ + DataLabelingDataset.prototype.datasetDisplayName = ""; + + /** + * DataLabelingDataset dataLabelingAnnotatedDatasets. + * @member {Array.} dataLabelingAnnotatedDatasets + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @instance + */ + DataLabelingDataset.prototype.dataLabelingAnnotatedDatasets = $util.emptyArray; + + /** + * Creates a new DataLabelingDataset instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset instance + */ + DataLabelingDataset.create = function create(properties) { + return new DataLabelingDataset(properties); + }; + + /** + * Encodes the specified DataLabelingDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset} message DataLabelingDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataLabelingDataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.dataLabelingAnnotatedDatasets != null && message.dataLabelingAnnotatedDatasets.length) + for (var i = 0; i < message.dataLabelingAnnotatedDatasets.length; ++i) + $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.encode(message.dataLabelingAnnotatedDatasets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.datasetDisplayName); + return writer; + }; + + /** + * Encodes the specified DataLabelingDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset} message DataLabelingDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataLabelingDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataLabelingDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataLabelingDataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 4: { + message.datasetDisplayName = reader.string(); + break; + } + case 3: { + if (!(message.dataLabelingAnnotatedDatasets && message.dataLabelingAnnotatedDatasets.length)) + message.dataLabelingAnnotatedDatasets = []; + message.dataLabelingAnnotatedDatasets.push($root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataLabelingDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataLabelingDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataLabelingDataset message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataLabelingDataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) + if (!$util.isString(message.datasetDisplayName)) + return "datasetDisplayName: string expected"; + if (message.dataLabelingAnnotatedDatasets != null && message.hasOwnProperty("dataLabelingAnnotatedDatasets")) { + if (!Array.isArray(message.dataLabelingAnnotatedDatasets)) + return "dataLabelingAnnotatedDatasets: array expected"; + for (var i = 0; i < message.dataLabelingAnnotatedDatasets.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify(message.dataLabelingAnnotatedDatasets[i]); + if (error) + return "dataLabelingAnnotatedDatasets." + error; + } + } + return null; + }; + + /** + * Creates a DataLabelingDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + */ + DataLabelingDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.datasetDisplayName != null) + message.datasetDisplayName = String(object.datasetDisplayName); + if (object.dataLabelingAnnotatedDatasets) { + if (!Array.isArray(object.dataLabelingAnnotatedDatasets)) + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.dataLabelingAnnotatedDatasets: array expected"); + message.dataLabelingAnnotatedDatasets = []; + for (var i = 0; i < object.dataLabelingAnnotatedDatasets.length; ++i) { + if (typeof object.dataLabelingAnnotatedDatasets[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.dataLabelingAnnotatedDatasets: object expected"); + message.dataLabelingAnnotatedDatasets[i] = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.fromObject(object.dataLabelingAnnotatedDatasets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataLabelingDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} message DataLabelingDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataLabelingDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataLabelingAnnotatedDatasets = []; + if (options.defaults) { + object.dataset = ""; + object.datasetDisplayName = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.dataLabelingAnnotatedDatasets && message.dataLabelingAnnotatedDatasets.length) { + object.dataLabelingAnnotatedDatasets = []; + for (var j = 0; j < message.dataLabelingAnnotatedDatasets.length; ++j) + object.dataLabelingAnnotatedDatasets[j] = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.toObject(message.dataLabelingAnnotatedDatasets[j], options); + } + if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) + object.datasetDisplayName = message.datasetDisplayName; + return object; + }; + + /** + * Converts this DataLabelingDataset to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @instance + * @returns {Object.} JSON object + */ + DataLabelingDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataLabelingDataset + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataLabelingDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset"; + }; + + DataLabelingDataset.DataLabelingAnnotatedDataset = (function() { + + /** + * Properties of a DataLabelingAnnotatedDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @interface IDataLabelingAnnotatedDataset + * @property {string|null} [annotatedDataset] DataLabelingAnnotatedDataset annotatedDataset + * @property {string|null} [annotatedDatasetDisplayName] DataLabelingAnnotatedDataset annotatedDatasetDisplayName + */ + + /** + * Constructs a new DataLabelingAnnotatedDataset. + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @classdesc Represents a DataLabelingAnnotatedDataset. + * @implements IDataLabelingAnnotatedDataset + * @constructor + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset=} [properties] Properties to set + */ + function DataLabelingAnnotatedDataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataLabelingAnnotatedDataset annotatedDataset. + * @member {string} annotatedDataset + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @instance + */ + DataLabelingAnnotatedDataset.prototype.annotatedDataset = ""; + + /** + * DataLabelingAnnotatedDataset annotatedDatasetDisplayName. + * @member {string} annotatedDatasetDisplayName + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @instance + */ + DataLabelingAnnotatedDataset.prototype.annotatedDatasetDisplayName = ""; + + /** + * Creates a new DataLabelingAnnotatedDataset instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset instance + */ + DataLabelingAnnotatedDataset.create = function create(properties) { + return new DataLabelingAnnotatedDataset(properties); + }; + + /** + * Encodes the specified DataLabelingAnnotatedDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataLabelingAnnotatedDataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotatedDataset != null && Object.hasOwnProperty.call(message, "annotatedDataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotatedDataset); + if (message.annotatedDatasetDisplayName != null && Object.hasOwnProperty.call(message, "annotatedDatasetDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotatedDatasetDisplayName); + return writer; + }; + + /** + * Encodes the specified DataLabelingAnnotatedDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataLabelingAnnotatedDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataLabelingAnnotatedDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataLabelingAnnotatedDataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.annotatedDataset = reader.string(); + break; + } + case 3: { + message.annotatedDatasetDisplayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataLabelingAnnotatedDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataLabelingAnnotatedDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataLabelingAnnotatedDataset message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataLabelingAnnotatedDataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) + if (!$util.isString(message.annotatedDataset)) + return "annotatedDataset: string expected"; + if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) + if (!$util.isString(message.annotatedDatasetDisplayName)) + return "annotatedDatasetDisplayName: string expected"; + return null; + }; + + /** + * Creates a DataLabelingAnnotatedDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + */ + DataLabelingAnnotatedDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset) + return object; + var message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset(); + if (object.annotatedDataset != null) + message.annotatedDataset = String(object.annotatedDataset); + if (object.annotatedDatasetDisplayName != null) + message.annotatedDatasetDisplayName = String(object.annotatedDatasetDisplayName); + return message; + }; + + /** + * Creates a plain object from a DataLabelingAnnotatedDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataLabelingAnnotatedDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotatedDataset = ""; + object.annotatedDatasetDisplayName = ""; + } + if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) + object.annotatedDataset = message.annotatedDataset; + if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) + object.annotatedDatasetDisplayName = message.annotatedDatasetDisplayName; + return object; + }; + + /** + * Converts this DataLabelingAnnotatedDataset to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @instance + * @returns {Object.} JSON object + */ + DataLabelingAnnotatedDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataLabelingAnnotatedDataset + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataLabelingAnnotatedDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset"; + }; + + return DataLabelingAnnotatedDataset; + })(); + + return DataLabelingDataset; + })(); + + return MigratableResource; + })(); + + v1.MigrationService = (function() { + + /** + * Constructs a new MigrationService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MigrationService + * @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 MigrationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MigrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MigrationService; /** - * Decodes a GetMetadataSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * Creates new MigrationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.MigrationService * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @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 {MigrationService} RPC service. Useful where requests and/or responses are streamed. */ - GetMetadataSchemaRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest(); - 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; + MigrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Decodes a GetMetadataSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.aiplatform.v1.MigrationService|searchMigratableResources}. + * @memberof google.cloud.aiplatform.v1.MigrationService + * @typedef SearchMigratableResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} [response] SearchMigratableResourcesResponse */ - GetMetadataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GetMetadataSchemaRequest message. - * @function verify - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls SearchMigratableResources. + * @function searchMigratableResources + * @memberof google.cloud.aiplatform.v1.MigrationService + * @instance + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} request SearchMigratableResourcesRequest message or plain object + * @param {google.cloud.aiplatform.v1.MigrationService.SearchMigratableResourcesCallback} callback Node-style callback called with the error, if any, and SearchMigratableResourcesResponse + * @returns {undefined} + * @variation 1 */ - GetMetadataSchemaRequest.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; - }; + Object.defineProperty(MigrationService.prototype.searchMigratableResources = function searchMigratableResources(request, callback) { + return this.rpcCall(searchMigratableResources, $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest, $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse, request, callback); + }, "name", { value: "SearchMigratableResources" }); /** - * Creates a GetMetadataSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} GetMetadataSchemaRequest + * Calls SearchMigratableResources. + * @function searchMigratableResources + * @memberof google.cloud.aiplatform.v1.MigrationService + * @instance + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} request SearchMigratableResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetadataSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest) - return object; - var message = new $root.google.cloud.aiplatform.v1.GetMetadataSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a GetMetadataSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest - * @static - * @param {google.cloud.aiplatform.v1.GetMetadataSchemaRequest} message GetMetadataSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.aiplatform.v1.MigrationService|batchMigrateResources}. + * @memberof google.cloud.aiplatform.v1.MigrationService + * @typedef BatchMigrateResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - GetMetadataSchemaRequest.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 GetMetadataSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest + * Calls BatchMigrateResources. + * @function batchMigrateResources + * @memberof google.cloud.aiplatform.v1.MigrationService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} request BatchMigrateResourcesRequest message or plain object + * @param {google.cloud.aiplatform.v1.MigrationService.BatchMigrateResourcesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GetMetadataSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(MigrationService.prototype.batchMigrateResources = function batchMigrateResources(request, callback) { + return this.rpcCall(batchMigrateResources, $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchMigrateResources" }); /** - * Gets the default type url for GetMetadataSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetMetadataSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls BatchMigrateResources. + * @function batchMigrateResources + * @memberof google.cloud.aiplatform.v1.MigrationService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} request BatchMigrateResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetadataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetMetadataSchemaRequest"; - }; - return GetMetadataSchemaRequest; + return MigrationService; })(); - v1.ListMetadataSchemasRequest = (function() { + v1.SearchMigratableResourcesRequest = (function() { /** - * Properties of a ListMetadataSchemasRequest. + * Properties of a SearchMigratableResourcesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListMetadataSchemasRequest - * @property {string|null} [parent] ListMetadataSchemasRequest parent - * @property {number|null} [pageSize] ListMetadataSchemasRequest pageSize - * @property {string|null} [pageToken] ListMetadataSchemasRequest pageToken - * @property {string|null} [filter] ListMetadataSchemasRequest filter + * @interface ISearchMigratableResourcesRequest + * @property {string|null} [parent] SearchMigratableResourcesRequest parent + * @property {number|null} [pageSize] SearchMigratableResourcesRequest pageSize + * @property {string|null} [pageToken] SearchMigratableResourcesRequest pageToken + * @property {string|null} [filter] SearchMigratableResourcesRequest filter */ /** - * Constructs a new ListMetadataSchemasRequest. + * Constructs a new SearchMigratableResourcesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListMetadataSchemasRequest. - * @implements IListMetadataSchemasRequest + * @classdesc Represents a SearchMigratableResourcesRequest. + * @implements ISearchMigratableResourcesRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest=} [properties] Properties to set */ - function ListMetadataSchemasRequest(properties) { + function SearchMigratableResourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -115644,59 +120825,59 @@ } /** - * ListMetadataSchemasRequest parent. + * SearchMigratableResourcesRequest parent. * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @instance */ - ListMetadataSchemasRequest.prototype.parent = ""; + SearchMigratableResourcesRequest.prototype.parent = ""; /** - * ListMetadataSchemasRequest pageSize. + * SearchMigratableResourcesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @instance */ - ListMetadataSchemasRequest.prototype.pageSize = 0; + SearchMigratableResourcesRequest.prototype.pageSize = 0; /** - * ListMetadataSchemasRequest pageToken. + * SearchMigratableResourcesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @instance */ - ListMetadataSchemasRequest.prototype.pageToken = ""; + SearchMigratableResourcesRequest.prototype.pageToken = ""; /** - * ListMetadataSchemasRequest filter. + * SearchMigratableResourcesRequest filter. * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @instance */ - ListMetadataSchemasRequest.prototype.filter = ""; + SearchMigratableResourcesRequest.prototype.filter = ""; /** - * Creates a new ListMetadataSchemasRequest instance using the specified properties. + * Creates a new SearchMigratableResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest instance + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest instance */ - ListMetadataSchemasRequest.create = function create(properties) { - return new ListMetadataSchemasRequest(properties); + SearchMigratableResourcesRequest.create = function create(properties) { + return new SearchMigratableResourcesRequest(properties); }; /** - * Encodes the specified ListMetadataSchemasRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasRequest.verify|verify} messages. + * Encodes the specified SearchMigratableResourcesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest} message ListMetadataSchemasRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} message SearchMigratableResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetadataSchemasRequest.encode = function encode(message, writer) { + SearchMigratableResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -115711,33 +120892,33 @@ }; /** - * Encodes the specified ListMetadataSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasRequest.verify|verify} messages. + * Encodes the specified SearchMigratableResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasRequest} message ListMetadataSchemasRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} message SearchMigratableResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetadataSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchMigratableResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMetadataSchemasRequest message from the specified reader or buffer. + * Decodes a SearchMigratableResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetadataSchemasRequest.decode = function decode(reader, length) { + SearchMigratableResourcesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -115766,30 +120947,30 @@ }; /** - * Decodes a ListMetadataSchemasRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchMigratableResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetadataSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + SearchMigratableResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMetadataSchemasRequest message. + * Verifies a SearchMigratableResourcesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMetadataSchemasRequest.verify = function verify(message) { + SearchMigratableResourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -115808,17 +120989,17 @@ }; /** - * Creates a ListMetadataSchemasRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchMigratableResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} ListMetadataSchemasRequest + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest */ - ListMetadataSchemasRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest) + SearchMigratableResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasRequest(); + var message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) @@ -115831,15 +121012,15 @@ }; /** - * Creates a plain object from a ListMetadataSchemasRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchMigratableResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.ListMetadataSchemasRequest} message ListMetadataSchemasRequest + * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} message SearchMigratableResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMetadataSchemasRequest.toObject = function toObject(message, options) { + SearchMigratableResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -115861,54 +121042,54 @@ }; /** - * Converts this ListMetadataSchemasRequest to JSON. + * Converts this SearchMigratableResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @instance * @returns {Object.} JSON object */ - ListMetadataSchemasRequest.prototype.toJSON = function toJSON() { + SearchMigratableResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMetadataSchemasRequest + * Gets the default type url for SearchMigratableResourcesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasRequest + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMetadataSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SearchMigratableResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListMetadataSchemasRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SearchMigratableResourcesRequest"; }; - return ListMetadataSchemasRequest; + return SearchMigratableResourcesRequest; })(); - v1.ListMetadataSchemasResponse = (function() { + v1.SearchMigratableResourcesResponse = (function() { /** - * Properties of a ListMetadataSchemasResponse. + * Properties of a SearchMigratableResourcesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IListMetadataSchemasResponse - * @property {Array.|null} [metadataSchemas] ListMetadataSchemasResponse metadataSchemas - * @property {string|null} [nextPageToken] ListMetadataSchemasResponse nextPageToken + * @interface ISearchMigratableResourcesResponse + * @property {Array.|null} [migratableResources] SearchMigratableResourcesResponse migratableResources + * @property {string|null} [nextPageToken] SearchMigratableResourcesResponse nextPageToken */ /** - * Constructs a new ListMetadataSchemasResponse. + * Constructs a new SearchMigratableResourcesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListMetadataSchemasResponse. - * @implements IListMetadataSchemasResponse + * @classdesc Represents a SearchMigratableResourcesResponse. + * @implements ISearchMigratableResourcesResponse * @constructor - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse=} [properties] Properties to set */ - function ListMetadataSchemasResponse(properties) { - this.metadataSchemas = []; + function SearchMigratableResourcesResponse(properties) { + this.migratableResources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -115916,88 +121097,88 @@ } /** - * ListMetadataSchemasResponse metadataSchemas. - * @member {Array.} metadataSchemas - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * SearchMigratableResourcesResponse migratableResources. + * @member {Array.} migratableResources + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @instance */ - ListMetadataSchemasResponse.prototype.metadataSchemas = $util.emptyArray; + SearchMigratableResourcesResponse.prototype.migratableResources = $util.emptyArray; /** - * ListMetadataSchemasResponse nextPageToken. + * SearchMigratableResourcesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @instance */ - ListMetadataSchemasResponse.prototype.nextPageToken = ""; + SearchMigratableResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new ListMetadataSchemasResponse instance using the specified properties. + * Creates a new SearchMigratableResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse instance + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse instance */ - ListMetadataSchemasResponse.create = function create(properties) { - return new ListMetadataSchemasResponse(properties); + SearchMigratableResourcesResponse.create = function create(properties) { + return new SearchMigratableResourcesResponse(properties); }; /** - * Encodes the specified ListMetadataSchemasResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasResponse.verify|verify} messages. + * Encodes the specified SearchMigratableResourcesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse} message ListMetadataSchemasResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse} message SearchMigratableResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetadataSchemasResponse.encode = function encode(message, writer) { + SearchMigratableResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metadataSchemas != null && message.metadataSchemas.length) - for (var i = 0; i < message.metadataSchemas.length; ++i) - $root.google.cloud.aiplatform.v1.MetadataSchema.encode(message.metadataSchemas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.migratableResources != null && message.migratableResources.length) + for (var i = 0; i < message.migratableResources.length; ++i) + $root.google.cloud.aiplatform.v1.MigratableResource.encode(message.migratableResources[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 ListMetadataSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListMetadataSchemasResponse.verify|verify} messages. + * Encodes the specified SearchMigratableResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.IListMetadataSchemasResponse} message ListMetadataSchemasResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse} message SearchMigratableResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetadataSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchMigratableResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMetadataSchemasResponse message from the specified reader or buffer. + * Decodes a SearchMigratableResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetadataSchemasResponse.decode = function decode(reader, length) { + SearchMigratableResourcesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.metadataSchemas && message.metadataSchemas.length)) - message.metadataSchemas = []; - message.metadataSchemas.push($root.google.cloud.aiplatform.v1.MetadataSchema.decode(reader, reader.uint32())); + if (!(message.migratableResources && message.migratableResources.length)) + message.migratableResources = []; + message.migratableResources.push($root.google.cloud.aiplatform.v1.MigratableResource.decode(reader, reader.uint32())); break; } case 2: { @@ -116013,39 +121194,39 @@ }; /** - * Decodes a ListMetadataSchemasResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchMigratableResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetadataSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + SearchMigratableResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMetadataSchemasResponse message. + * Verifies a SearchMigratableResourcesResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMetadataSchemasResponse.verify = function verify(message) { + SearchMigratableResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.metadataSchemas != null && message.hasOwnProperty("metadataSchemas")) { - if (!Array.isArray(message.metadataSchemas)) - return "metadataSchemas: array expected"; - for (var i = 0; i < message.metadataSchemas.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MetadataSchema.verify(message.metadataSchemas[i]); + if (message.migratableResources != null && message.hasOwnProperty("migratableResources")) { + if (!Array.isArray(message.migratableResources)) + return "migratableResources: array expected"; + for (var i = 0; i < message.migratableResources.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.verify(message.migratableResources[i]); if (error) - return "metadataSchemas." + error; + return "migratableResources." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -116055,25 +121236,25 @@ }; /** - * Creates a ListMetadataSchemasResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchMigratableResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} ListMetadataSchemasResponse + * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse */ - ListMetadataSchemasResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse) + SearchMigratableResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.ListMetadataSchemasResponse(); - if (object.metadataSchemas) { - if (!Array.isArray(object.metadataSchemas)) - throw TypeError(".google.cloud.aiplatform.v1.ListMetadataSchemasResponse.metadataSchemas: array expected"); - message.metadataSchemas = []; - for (var i = 0; i < object.metadataSchemas.length; ++i) { - if (typeof object.metadataSchemas[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListMetadataSchemasResponse.metadataSchemas: object expected"); - message.metadataSchemas[i] = $root.google.cloud.aiplatform.v1.MetadataSchema.fromObject(object.metadataSchemas[i]); + var message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse(); + if (object.migratableResources) { + if (!Array.isArray(object.migratableResources)) + throw TypeError(".google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.migratableResources: array expected"); + message.migratableResources = []; + for (var i = 0; i < object.migratableResources.length; ++i) { + if (typeof object.migratableResources[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.migratableResources: object expected"); + message.migratableResources[i] = $root.google.cloud.aiplatform.v1.MigratableResource.fromObject(object.migratableResources[i]); } } if (object.nextPageToken != null) @@ -116082,26 +121263,26 @@ }; /** - * Creates a plain object from a ListMetadataSchemasResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchMigratableResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.ListMetadataSchemasResponse} message ListMetadataSchemasResponse + * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} message SearchMigratableResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMetadataSchemasResponse.toObject = function toObject(message, options) { + SearchMigratableResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.metadataSchemas = []; + object.migratableResources = []; if (options.defaults) object.nextPageToken = ""; - if (message.metadataSchemas && message.metadataSchemas.length) { - object.metadataSchemas = []; - for (var j = 0; j < message.metadataSchemas.length; ++j) - object.metadataSchemas[j] = $root.google.cloud.aiplatform.v1.MetadataSchema.toObject(message.metadataSchemas[j], options); + if (message.migratableResources && message.migratableResources.length) { + object.migratableResources = []; + for (var j = 0; j < message.migratableResources.length; ++j) + object.migratableResources[j] = $root.google.cloud.aiplatform.v1.MigratableResource.toObject(message.migratableResources[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -116109,54 +121290,54 @@ }; /** - * Converts this ListMetadataSchemasResponse to JSON. + * Converts this SearchMigratableResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @instance * @returns {Object.} JSON object */ - ListMetadataSchemasResponse.prototype.toJSON = function toJSON() { + SearchMigratableResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMetadataSchemasResponse + * Gets the default type url for SearchMigratableResourcesResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListMetadataSchemasResponse + * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMetadataSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SearchMigratableResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListMetadataSchemasResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SearchMigratableResourcesResponse"; }; - return ListMetadataSchemasResponse; + return SearchMigratableResourcesResponse; })(); - v1.QueryArtifactLineageSubgraphRequest = (function() { + v1.BatchMigrateResourcesRequest = (function() { /** - * Properties of a QueryArtifactLineageSubgraphRequest. + * Properties of a BatchMigrateResourcesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IQueryArtifactLineageSubgraphRequest - * @property {string|null} [artifact] QueryArtifactLineageSubgraphRequest artifact - * @property {number|null} [maxHops] QueryArtifactLineageSubgraphRequest maxHops - * @property {string|null} [filter] QueryArtifactLineageSubgraphRequest filter + * @interface IBatchMigrateResourcesRequest + * @property {string|null} [parent] BatchMigrateResourcesRequest parent + * @property {Array.|null} [migrateResourceRequests] BatchMigrateResourcesRequest migrateResourceRequests */ /** - * Constructs a new QueryArtifactLineageSubgraphRequest. + * Constructs a new BatchMigrateResourcesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a QueryArtifactLineageSubgraphRequest. - * @implements IQueryArtifactLineageSubgraphRequest + * @classdesc Represents a BatchMigrateResourcesRequest. + * @implements IBatchMigrateResourcesRequest * @constructor - * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest=} [properties] Properties to set */ - function QueryArtifactLineageSubgraphRequest(properties) { + function BatchMigrateResourcesRequest(properties) { + this.migrateResourceRequests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -116164,103 +121345,92 @@ } /** - * QueryArtifactLineageSubgraphRequest artifact. - * @member {string} artifact - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest - * @instance - */ - QueryArtifactLineageSubgraphRequest.prototype.artifact = ""; - - /** - * QueryArtifactLineageSubgraphRequest maxHops. - * @member {number} maxHops - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * BatchMigrateResourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @instance */ - QueryArtifactLineageSubgraphRequest.prototype.maxHops = 0; + BatchMigrateResourcesRequest.prototype.parent = ""; /** - * QueryArtifactLineageSubgraphRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * BatchMigrateResourcesRequest migrateResourceRequests. + * @member {Array.} migrateResourceRequests + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @instance */ - QueryArtifactLineageSubgraphRequest.prototype.filter = ""; + BatchMigrateResourcesRequest.prototype.migrateResourceRequests = $util.emptyArray; /** - * Creates a new QueryArtifactLineageSubgraphRequest instance using the specified properties. + * Creates a new BatchMigrateResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest instance + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest instance */ - QueryArtifactLineageSubgraphRequest.create = function create(properties) { - return new QueryArtifactLineageSubgraphRequest(properties); + BatchMigrateResourcesRequest.create = function create(properties) { + return new BatchMigrateResourcesRequest(properties); }; /** - * Encodes the specified QueryArtifactLineageSubgraphRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} message BatchMigrateResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryArtifactLineageSubgraphRequest.encode = function encode(message, writer) { + BatchMigrateResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.artifact != null && Object.hasOwnProperty.call(message, "artifact")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.artifact); - if (message.maxHops != null && Object.hasOwnProperty.call(message, "maxHops")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxHops); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.migrateResourceRequests != null && message.migrateResourceRequests.length) + for (var i = 0; i < message.migrateResourceRequests.length; ++i) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.encode(message.migrateResourceRequests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryArtifactLineageSubgraphRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} message BatchMigrateResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryArtifactLineageSubgraphRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchMigrateResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryArtifactLineageSubgraphRequest message from the specified reader or buffer. + * Decodes a BatchMigrateResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryArtifactLineageSubgraphRequest.decode = function decode(reader, length) { + BatchMigrateResourcesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.artifact = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.maxHops = reader.int32(); - break; - } - case 3: { - message.filter = reader.string(); + if (!(message.migrateResourceRequests && message.migrateResourceRequests.length)) + message.migrateResourceRequests = []; + message.migrateResourceRequests.push($root.google.cloud.aiplatform.v1.MigrateResourceRequest.decode(reader, reader.uint32())); break; } default: @@ -116272,700 +121442,151 @@ }; /** - * Decodes a QueryArtifactLineageSubgraphRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchMigrateResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryArtifactLineageSubgraphRequest.decodeDelimited = function decodeDelimited(reader) { + BatchMigrateResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryArtifactLineageSubgraphRequest message. + * Verifies a BatchMigrateResourcesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryArtifactLineageSubgraphRequest.verify = function verify(message) { + BatchMigrateResourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.artifact != null && message.hasOwnProperty("artifact")) - if (!$util.isString(message.artifact)) - return "artifact: string expected"; - if (message.maxHops != null && message.hasOwnProperty("maxHops")) - if (!$util.isInteger(message.maxHops)) - return "maxHops: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a QueryArtifactLineageSubgraphRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} QueryArtifactLineageSubgraphRequest - */ - QueryArtifactLineageSubgraphRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest) - return object; - var message = new $root.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest(); - if (object.artifact != null) - message.artifact = String(object.artifact); - if (object.maxHops != null) - message.maxHops = object.maxHops | 0; - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a QueryArtifactLineageSubgraphRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest - * @static - * @param {google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest} message QueryArtifactLineageSubgraphRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArtifactLineageSubgraphRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.artifact = ""; - object.maxHops = 0; - object.filter = ""; - } - if (message.artifact != null && message.hasOwnProperty("artifact")) - object.artifact = message.artifact; - if (message.maxHops != null && message.hasOwnProperty("maxHops")) - object.maxHops = message.maxHops; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this QueryArtifactLineageSubgraphRequest to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest - * @instance - * @returns {Object.} JSON object - */ - QueryArtifactLineageSubgraphRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryArtifactLineageSubgraphRequest - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryArtifactLineageSubgraphRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest"; - }; - - return QueryArtifactLineageSubgraphRequest; - })(); - - v1.MetadataStore = (function() { - - /** - * Properties of a MetadataStore. - * @memberof google.cloud.aiplatform.v1 - * @interface IMetadataStore - * @property {string|null} [name] MetadataStore name - * @property {google.protobuf.ITimestamp|null} [createTime] MetadataStore createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] MetadataStore updateTime - * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] MetadataStore encryptionSpec - * @property {string|null} [description] MetadataStore description - * @property {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState|null} [state] MetadataStore state - */ - - /** - * Constructs a new MetadataStore. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MetadataStore. - * @implements IMetadataStore - * @constructor - * @param {google.cloud.aiplatform.v1.IMetadataStore=} [properties] Properties to set - */ - function MetadataStore(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetadataStore name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.name = ""; - - /** - * MetadataStore createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.createTime = null; - - /** - * MetadataStore updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.updateTime = null; - - /** - * MetadataStore encryptionSpec. - * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.encryptionSpec = null; - - /** - * MetadataStore description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.description = ""; - - /** - * MetadataStore state. - * @member {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState|null|undefined} state - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @instance - */ - MetadataStore.prototype.state = null; - - /** - * Creates a new MetadataStore instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {google.cloud.aiplatform.v1.IMetadataStore=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore instance - */ - MetadataStore.create = function create(properties) { - return new MetadataStore(properties); - }; - - /** - * Encodes the specified MetadataStore message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {google.cloud.aiplatform.v1.IMetadataStore} message MetadataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetadataStore.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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) - $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.encode(message.state, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MetadataStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {google.cloud.aiplatform.v1.IMetadataStore} message MetadataStore message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetadataStore.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetadataStore message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetadataStore.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataStore(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); - break; - } - case 6: { - message.description = reader.string(); - break; - } - case 7: { - message.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.migrateResourceRequests != null && message.hasOwnProperty("migrateResourceRequests")) { + if (!Array.isArray(message.migrateResourceRequests)) + return "migrateResourceRequests: array expected"; + for (var i = 0; i < message.migrateResourceRequests.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.verify(message.migrateResourceRequests[i]); + if (error) + return "migrateResourceRequests." + error; } } - return message; - }; - - /** - * Decodes a MetadataStore message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetadataStore.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetadataStore message. - * @function verify - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetadataStore.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.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { - var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); - if (error) - return "encryptionSpec." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.state != null && message.hasOwnProperty("state")) { - var error = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify(message.state); - if (error) - return "state." + error; - } return null; }; /** - * Creates a MetadataStore message from a plain object. Also converts values to their respective internal types. + * Creates a BatchMigrateResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MetadataStore + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MetadataStore} MetadataStore + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest */ - MetadataStore.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MetadataStore) + BatchMigrateResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.MetadataStore(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.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.aiplatform.v1.MetadataStore.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.encryptionSpec != null) { - if (typeof object.encryptionSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.encryptionSpec: object expected"); - message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); - } - if (object.description != null) - message.description = String(object.description); - if (object.state != null) { - if (typeof object.state !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MetadataStore.state: object expected"); - message.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.fromObject(object.state); + var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.migrateResourceRequests) { + if (!Array.isArray(object.migrateResourceRequests)) + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.migrateResourceRequests: array expected"); + message.migrateResourceRequests = []; + for (var i = 0; i < object.migrateResourceRequests.length; ++i) { + if (typeof object.migrateResourceRequests[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.migrateResourceRequests: object expected"); + message.migrateResourceRequests[i] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.fromObject(object.migrateResourceRequests[i]); + } } return message; }; /** - * Creates a plain object from a MetadataStore message. Also converts values to other types if specified. + * Creates a plain object from a BatchMigrateResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MetadataStore + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static - * @param {google.cloud.aiplatform.v1.MetadataStore} message MetadataStore + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} message BatchMigrateResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MetadataStore.toObject = function toObject(message, options) { + BatchMigrateResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.encryptionSpec = null; - object.description = ""; - object.state = null; + if (options.arrays || options.defaults) + object.migrateResourceRequests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.migrateResourceRequests && message.migrateResourceRequests.length) { + object.migrateResourceRequests = []; + for (var j = 0; j < message.migrateResourceRequests.length; ++j) + object.migrateResourceRequests[j] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.toObject(message.migrateResourceRequests[j], options); } - 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.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) - object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.state != null && message.hasOwnProperty("state")) - object.state = $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.toObject(message.state, options); return object; }; /** - * Converts this MetadataStore to JSON. + * Converts this BatchMigrateResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MetadataStore + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @instance * @returns {Object.} JSON object */ - MetadataStore.prototype.toJSON = function toJSON() { + BatchMigrateResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MetadataStore + * Gets the default type url for BatchMigrateResourcesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MetadataStore + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MetadataStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchMigrateResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataStore"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesRequest"; }; - MetadataStore.MetadataStoreState = (function() { - - /** - * Properties of a MetadataStoreState. - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @interface IMetadataStoreState - * @property {number|Long|null} [diskUtilizationBytes] MetadataStoreState diskUtilizationBytes - */ - - /** - * Constructs a new MetadataStoreState. - * @memberof google.cloud.aiplatform.v1.MetadataStore - * @classdesc Represents a MetadataStoreState. - * @implements IMetadataStoreState - * @constructor - * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState=} [properties] Properties to set - */ - function MetadataStoreState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetadataStoreState diskUtilizationBytes. - * @member {number|Long} diskUtilizationBytes - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @instance - */ - MetadataStoreState.prototype.diskUtilizationBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new MetadataStoreState instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState instance - */ - MetadataStoreState.create = function create(properties) { - return new MetadataStoreState(properties); - }; - - /** - * Encodes the specified MetadataStoreState message. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState} message MetadataStoreState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetadataStoreState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.diskUtilizationBytes != null && Object.hasOwnProperty.call(message, "diskUtilizationBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.diskUtilizationBytes); - return writer; - }; - - /** - * Encodes the specified MetadataStoreState message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {google.cloud.aiplatform.v1.MetadataStore.IMetadataStoreState} message MetadataStoreState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetadataStoreState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetadataStoreState message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetadataStoreState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.diskUtilizationBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetadataStoreState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetadataStoreState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetadataStoreState message. - * @function verify - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetadataStoreState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.diskUtilizationBytes != null && message.hasOwnProperty("diskUtilizationBytes")) - if (!$util.isInteger(message.diskUtilizationBytes) && !(message.diskUtilizationBytes && $util.isInteger(message.diskUtilizationBytes.low) && $util.isInteger(message.diskUtilizationBytes.high))) - return "diskUtilizationBytes: integer|Long expected"; - return null; - }; - - /** - * Creates a MetadataStoreState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} MetadataStoreState - */ - MetadataStoreState.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState) - return object; - var message = new $root.google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState(); - if (object.diskUtilizationBytes != null) - if ($util.Long) - (message.diskUtilizationBytes = $util.Long.fromValue(object.diskUtilizationBytes)).unsigned = false; - else if (typeof object.diskUtilizationBytes === "string") - message.diskUtilizationBytes = parseInt(object.diskUtilizationBytes, 10); - else if (typeof object.diskUtilizationBytes === "number") - message.diskUtilizationBytes = object.diskUtilizationBytes; - else if (typeof object.diskUtilizationBytes === "object") - message.diskUtilizationBytes = new $util.LongBits(object.diskUtilizationBytes.low >>> 0, object.diskUtilizationBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a MetadataStoreState message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState} message MetadataStoreState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetadataStoreState.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.diskUtilizationBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.diskUtilizationBytes = options.longs === String ? "0" : 0; - if (message.diskUtilizationBytes != null && message.hasOwnProperty("diskUtilizationBytes")) - if (typeof message.diskUtilizationBytes === "number") - object.diskUtilizationBytes = options.longs === String ? String(message.diskUtilizationBytes) : message.diskUtilizationBytes; - else - object.diskUtilizationBytes = options.longs === String ? $util.Long.prototype.toString.call(message.diskUtilizationBytes) : options.longs === Number ? new $util.LongBits(message.diskUtilizationBytes.low >>> 0, message.diskUtilizationBytes.high >>> 0).toNumber() : message.diskUtilizationBytes; - return object; - }; - - /** - * Converts this MetadataStoreState to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @instance - * @returns {Object.} JSON object - */ - MetadataStoreState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetadataStoreState - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetadataStoreState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MetadataStore.MetadataStoreState"; - }; - - return MetadataStoreState; - })(); - - return MetadataStore; + return BatchMigrateResourcesRequest; })(); - v1.MigratableResource = (function() { + v1.MigrateResourceRequest = (function() { /** - * Properties of a MigratableResource. + * Properties of a MigrateResourceRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IMigratableResource - * @property {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion|null} [mlEngineModelVersion] MigratableResource mlEngineModelVersion - * @property {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel|null} [automlModel] MigratableResource automlModel - * @property {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset|null} [automlDataset] MigratableResource automlDataset - * @property {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset|null} [dataLabelingDataset] MigratableResource dataLabelingDataset - * @property {google.protobuf.ITimestamp|null} [lastMigrateTime] MigratableResource lastMigrateTime - * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] MigratableResource lastUpdateTime + * @interface IMigrateResourceRequest + * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig|null} [migrateMlEngineModelVersionConfig] MigrateResourceRequest migrateMlEngineModelVersionConfig + * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig|null} [migrateAutomlModelConfig] MigrateResourceRequest migrateAutomlModelConfig + * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig|null} [migrateAutomlDatasetConfig] MigrateResourceRequest migrateAutomlDatasetConfig + * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig|null} [migrateDataLabelingDatasetConfig] MigrateResourceRequest migrateDataLabelingDatasetConfig */ /** - * Constructs a new MigratableResource. + * Constructs a new MigrateResourceRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MigratableResource. - * @implements IMigratableResource + * @classdesc Represents a MigrateResourceRequest. + * @implements IMigrateResourceRequest * @constructor - * @param {google.cloud.aiplatform.v1.IMigratableResource=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest=} [properties] Properties to set */ - function MigratableResource(properties) { + function MigrateResourceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -116973,159 +121594,131 @@ } /** - * MigratableResource mlEngineModelVersion. - * @member {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion|null|undefined} mlEngineModelVersion - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @instance - */ - MigratableResource.prototype.mlEngineModelVersion = null; - - /** - * MigratableResource automlModel. - * @member {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel|null|undefined} automlModel - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @instance - */ - MigratableResource.prototype.automlModel = null; - - /** - * MigratableResource automlDataset. - * @member {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset|null|undefined} automlDataset - * @memberof google.cloud.aiplatform.v1.MigratableResource + * MigrateResourceRequest migrateMlEngineModelVersionConfig. + * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig|null|undefined} migrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance */ - MigratableResource.prototype.automlDataset = null; + MigrateResourceRequest.prototype.migrateMlEngineModelVersionConfig = null; /** - * MigratableResource dataLabelingDataset. - * @member {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset|null|undefined} dataLabelingDataset - * @memberof google.cloud.aiplatform.v1.MigratableResource + * MigrateResourceRequest migrateAutomlModelConfig. + * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig|null|undefined} migrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance */ - MigratableResource.prototype.dataLabelingDataset = null; + MigrateResourceRequest.prototype.migrateAutomlModelConfig = null; /** - * MigratableResource lastMigrateTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastMigrateTime - * @memberof google.cloud.aiplatform.v1.MigratableResource + * MigrateResourceRequest migrateAutomlDatasetConfig. + * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig|null|undefined} migrateAutomlDatasetConfig + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance */ - MigratableResource.prototype.lastMigrateTime = null; + MigrateResourceRequest.prototype.migrateAutomlDatasetConfig = null; /** - * MigratableResource lastUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime - * @memberof google.cloud.aiplatform.v1.MigratableResource + * MigrateResourceRequest migrateDataLabelingDatasetConfig. + * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig|null|undefined} migrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance */ - MigratableResource.prototype.lastUpdateTime = null; + MigrateResourceRequest.prototype.migrateDataLabelingDatasetConfig = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * MigratableResource resource. - * @member {"mlEngineModelVersion"|"automlModel"|"automlDataset"|"dataLabelingDataset"|undefined} resource - * @memberof google.cloud.aiplatform.v1.MigratableResource + * MigrateResourceRequest request. + * @member {"migrateMlEngineModelVersionConfig"|"migrateAutomlModelConfig"|"migrateAutomlDatasetConfig"|"migrateDataLabelingDatasetConfig"|undefined} request + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance */ - Object.defineProperty(MigratableResource.prototype, "resource", { - get: $util.oneOfGetter($oneOfFields = ["mlEngineModelVersion", "automlModel", "automlDataset", "dataLabelingDataset"]), + Object.defineProperty(MigrateResourceRequest.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["migrateMlEngineModelVersionConfig", "migrateAutomlModelConfig", "migrateAutomlDatasetConfig", "migrateDataLabelingDatasetConfig"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new MigratableResource instance using the specified properties. + * Creates a new MigrateResourceRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static - * @param {google.cloud.aiplatform.v1.IMigratableResource=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource instance + * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest instance */ - MigratableResource.create = function create(properties) { - return new MigratableResource(properties); + MigrateResourceRequest.create = function create(properties) { + return new MigrateResourceRequest(properties); }; /** - * Encodes the specified MigratableResource message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.verify|verify} messages. + * Encodes the specified MigrateResourceRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static - * @param {google.cloud.aiplatform.v1.IMigratableResource} message MigratableResource message or plain object to encode + * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest} message MigrateResourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigratableResource.encode = function encode(message, writer) { + MigrateResourceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mlEngineModelVersion != null && Object.hasOwnProperty.call(message, "mlEngineModelVersion")) - $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.encode(message.mlEngineModelVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.automlModel != null && Object.hasOwnProperty.call(message, "automlModel")) - $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.encode(message.automlModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.automlDataset != null && Object.hasOwnProperty.call(message, "automlDataset")) - $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.encode(message.automlDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.dataLabelingDataset != null && Object.hasOwnProperty.call(message, "dataLabelingDataset")) - $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.encode(message.dataLabelingDataset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.lastMigrateTime != null && Object.hasOwnProperty.call(message, "lastMigrateTime")) - $root.google.protobuf.Timestamp.encode(message.lastMigrateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.migrateMlEngineModelVersionConfig != null && Object.hasOwnProperty.call(message, "migrateMlEngineModelVersionConfig")) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.encode(message.migrateMlEngineModelVersionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.migrateAutomlModelConfig != null && Object.hasOwnProperty.call(message, "migrateAutomlModelConfig")) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.encode(message.migrateAutomlModelConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.migrateAutomlDatasetConfig != null && Object.hasOwnProperty.call(message, "migrateAutomlDatasetConfig")) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.encode(message.migrateAutomlDatasetConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.migrateDataLabelingDatasetConfig != null && Object.hasOwnProperty.call(message, "migrateDataLabelingDatasetConfig")) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.encode(message.migrateDataLabelingDatasetConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified MigratableResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.verify|verify} messages. + * Encodes the specified MigrateResourceRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static - * @param {google.cloud.aiplatform.v1.IMigratableResource} message MigratableResource message or plain object to encode + * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest} message MigrateResourceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigratableResource.encodeDelimited = function encodeDelimited(message, writer) { + MigrateResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigratableResource message from the specified reader or buffer. + * Decodes a MigrateResourceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigratableResource.decode = function decode(reader, length) { + MigrateResourceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.decode(reader, reader.uint32()); + message.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.decode(reader, reader.uint32()); break; } case 2: { - message.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.decode(reader, reader.uint32()); + message.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.decode(reader, reader.uint32()); break; } case 3: { - message.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.decode(reader, reader.uint32()); + message.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.decode(reader, reader.uint32()); break; } case 4: { - message.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.decode(reader, reader.uint32()); - break; - } - case 5: { - message.lastMigrateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.decode(reader, reader.uint32()); break; } default: @@ -117137,218 +121730,191 @@ }; /** - * Decodes a MigratableResource message from the specified reader or buffer, length delimited. + * Decodes a MigrateResourceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigratableResource.decodeDelimited = function decodeDelimited(reader) { + MigrateResourceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigratableResource message. + * Verifies a MigrateResourceRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigratableResource.verify = function verify(message) { + MigrateResourceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.mlEngineModelVersion != null && message.hasOwnProperty("mlEngineModelVersion")) { - properties.resource = 1; + if (message.migrateMlEngineModelVersionConfig != null && message.hasOwnProperty("migrateMlEngineModelVersionConfig")) { + properties.request = 1; { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify(message.mlEngineModelVersion); + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify(message.migrateMlEngineModelVersionConfig); if (error) - return "mlEngineModelVersion." + error; + return "migrateMlEngineModelVersionConfig." + error; } } - if (message.automlModel != null && message.hasOwnProperty("automlModel")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; + if (message.migrateAutomlModelConfig != null && message.hasOwnProperty("migrateAutomlModelConfig")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify(message.automlModel); + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify(message.migrateAutomlModelConfig); if (error) - return "automlModel." + error; + return "migrateAutomlModelConfig." + error; } } - if (message.automlDataset != null && message.hasOwnProperty("automlDataset")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; + if (message.migrateAutomlDatasetConfig != null && message.hasOwnProperty("migrateAutomlDatasetConfig")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify(message.automlDataset); + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify(message.migrateAutomlDatasetConfig); if (error) - return "automlDataset." + error; + return "migrateAutomlDatasetConfig." + error; } } - if (message.dataLabelingDataset != null && message.hasOwnProperty("dataLabelingDataset")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; + if (message.migrateDataLabelingDatasetConfig != null && message.hasOwnProperty("migrateDataLabelingDatasetConfig")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify(message.dataLabelingDataset); + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify(message.migrateDataLabelingDatasetConfig); if (error) - return "dataLabelingDataset." + error; + return "migrateDataLabelingDatasetConfig." + error; } } - if (message.lastMigrateTime != null && message.hasOwnProperty("lastMigrateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastMigrateTime); - if (error) - return "lastMigrateTime." + error; - } - if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); - if (error) - return "lastUpdateTime." + error; - } return null; }; /** - * Creates a MigratableResource message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateResourceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource} MigratableResource + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest */ - MigratableResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource) + MigrateResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource(); - if (object.mlEngineModelVersion != null) { - if (typeof object.mlEngineModelVersion !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.mlEngineModelVersion: object expected"); - message.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.fromObject(object.mlEngineModelVersion); - } - if (object.automlModel != null) { - if (typeof object.automlModel !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.automlModel: object expected"); - message.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.fromObject(object.automlModel); - } - if (object.automlDataset != null) { - if (typeof object.automlDataset !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.automlDataset: object expected"); - message.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.fromObject(object.automlDataset); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest(); + if (object.migrateMlEngineModelVersionConfig != null) { + if (typeof object.migrateMlEngineModelVersionConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateMlEngineModelVersionConfig: object expected"); + message.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.fromObject(object.migrateMlEngineModelVersionConfig); } - if (object.dataLabelingDataset != null) { - if (typeof object.dataLabelingDataset !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.dataLabelingDataset: object expected"); - message.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.fromObject(object.dataLabelingDataset); + if (object.migrateAutomlModelConfig != null) { + if (typeof object.migrateAutomlModelConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateAutomlModelConfig: object expected"); + message.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.fromObject(object.migrateAutomlModelConfig); } - if (object.lastMigrateTime != null) { - if (typeof object.lastMigrateTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.lastMigrateTime: object expected"); - message.lastMigrateTime = $root.google.protobuf.Timestamp.fromObject(object.lastMigrateTime); + if (object.migrateAutomlDatasetConfig != null) { + if (typeof object.migrateAutomlDatasetConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateAutomlDatasetConfig: object expected"); + message.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.fromObject(object.migrateAutomlDatasetConfig); } - if (object.lastUpdateTime != null) { - if (typeof object.lastUpdateTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.lastUpdateTime: object expected"); - message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + if (object.migrateDataLabelingDatasetConfig != null) { + if (typeof object.migrateDataLabelingDatasetConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateDataLabelingDatasetConfig: object expected"); + message.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.fromObject(object.migrateDataLabelingDatasetConfig); } return message; }; /** - * Creates a plain object from a MigratableResource message. Also converts values to other types if specified. + * Creates a plain object from a MigrateResourceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static - * @param {google.cloud.aiplatform.v1.MigratableResource} message MigratableResource + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest} message MigrateResourceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigratableResource.toObject = function toObject(message, options) { + MigrateResourceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.lastMigrateTime = null; - object.lastUpdateTime = null; - } - if (message.mlEngineModelVersion != null && message.hasOwnProperty("mlEngineModelVersion")) { - object.mlEngineModelVersion = $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.toObject(message.mlEngineModelVersion, options); + if (message.migrateMlEngineModelVersionConfig != null && message.hasOwnProperty("migrateMlEngineModelVersionConfig")) { + object.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.toObject(message.migrateMlEngineModelVersionConfig, options); if (options.oneofs) - object.resource = "mlEngineModelVersion"; + object.request = "migrateMlEngineModelVersionConfig"; } - if (message.automlModel != null && message.hasOwnProperty("automlModel")) { - object.automlModel = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel.toObject(message.automlModel, options); + if (message.migrateAutomlModelConfig != null && message.hasOwnProperty("migrateAutomlModelConfig")) { + object.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.toObject(message.migrateAutomlModelConfig, options); if (options.oneofs) - object.resource = "automlModel"; + object.request = "migrateAutomlModelConfig"; } - if (message.automlDataset != null && message.hasOwnProperty("automlDataset")) { - object.automlDataset = $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.toObject(message.automlDataset, options); + if (message.migrateAutomlDatasetConfig != null && message.hasOwnProperty("migrateAutomlDatasetConfig")) { + object.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.toObject(message.migrateAutomlDatasetConfig, options); if (options.oneofs) - object.resource = "automlDataset"; + object.request = "migrateAutomlDatasetConfig"; } - if (message.dataLabelingDataset != null && message.hasOwnProperty("dataLabelingDataset")) { - object.dataLabelingDataset = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.toObject(message.dataLabelingDataset, options); + if (message.migrateDataLabelingDatasetConfig != null && message.hasOwnProperty("migrateDataLabelingDatasetConfig")) { + object.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.toObject(message.migrateDataLabelingDatasetConfig, options); if (options.oneofs) - object.resource = "dataLabelingDataset"; + object.request = "migrateDataLabelingDatasetConfig"; } - if (message.lastMigrateTime != null && message.hasOwnProperty("lastMigrateTime")) - object.lastMigrateTime = $root.google.protobuf.Timestamp.toObject(message.lastMigrateTime, options); - if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) - object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); return object; }; /** - * Converts this MigratableResource to JSON. + * Converts this MigrateResourceRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @instance * @returns {Object.} JSON object */ - MigratableResource.prototype.toJSON = function toJSON() { + MigrateResourceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigratableResource + * Gets the default type url for MigrateResourceRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigratableResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest"; }; - MigratableResource.MlEngineModelVersion = (function() { + MigrateResourceRequest.MigrateMlEngineModelVersionConfig = (function() { /** - * Properties of a MlEngineModelVersion. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @interface IMlEngineModelVersion - * @property {string|null} [endpoint] MlEngineModelVersion endpoint - * @property {string|null} [version] MlEngineModelVersion version + * Properties of a MigrateMlEngineModelVersionConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @interface IMigrateMlEngineModelVersionConfig + * @property {string|null} [endpoint] MigrateMlEngineModelVersionConfig endpoint + * @property {string|null} [modelVersion] MigrateMlEngineModelVersionConfig modelVersion + * @property {string|null} [modelDisplayName] MigrateMlEngineModelVersionConfig modelDisplayName */ /** - * Constructs a new MlEngineModelVersion. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @classdesc Represents a MlEngineModelVersion. - * @implements IMlEngineModelVersion + * Constructs a new MigrateMlEngineModelVersionConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @classdesc Represents a MigrateMlEngineModelVersionConfig. + * @implements IMigrateMlEngineModelVersionConfig * @constructor - * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig=} [properties] Properties to set */ - function MlEngineModelVersion(properties) { + function MigrateMlEngineModelVersionConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -117356,80 +121922,90 @@ } /** - * MlEngineModelVersion endpoint. + * MigrateMlEngineModelVersionConfig endpoint. * @member {string} endpoint - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @instance */ - MlEngineModelVersion.prototype.endpoint = ""; + MigrateMlEngineModelVersionConfig.prototype.endpoint = ""; /** - * MlEngineModelVersion version. - * @member {string} version - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * MigrateMlEngineModelVersionConfig modelVersion. + * @member {string} modelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @instance */ - MlEngineModelVersion.prototype.version = ""; + MigrateMlEngineModelVersionConfig.prototype.modelVersion = ""; /** - * Creates a new MlEngineModelVersion instance using the specified properties. + * MigrateMlEngineModelVersionConfig modelDisplayName. + * @member {string} modelDisplayName + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @instance + */ + MigrateMlEngineModelVersionConfig.prototype.modelDisplayName = ""; + + /** + * Creates a new MigrateMlEngineModelVersionConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion instance + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig instance */ - MlEngineModelVersion.create = function create(properties) { - return new MlEngineModelVersion(properties); + MigrateMlEngineModelVersionConfig.create = function create(properties) { + return new MigrateMlEngineModelVersionConfig(properties); }; /** - * Encodes the specified MlEngineModelVersion message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify|verify} messages. + * Encodes the specified MigrateMlEngineModelVersionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion} message MlEngineModelVersion message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MlEngineModelVersion.encode = function encode(message, writer) { + MigrateMlEngineModelVersionConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelVersion); + if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelDisplayName); return writer; }; /** - * Encodes the specified MlEngineModelVersion message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion.verify|verify} messages. + * Encodes the specified MigrateMlEngineModelVersionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IMlEngineModelVersion} message MlEngineModelVersion message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MlEngineModelVersion.encodeDelimited = function encodeDelimited(message, writer) { + MigrateMlEngineModelVersionConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MlEngineModelVersion message from the specified reader or buffer. + * Decodes a MigrateMlEngineModelVersionConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MlEngineModelVersion.decode = function decode(reader, length) { + MigrateMlEngineModelVersionConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -117438,7 +122014,11 @@ break; } case 2: { - message.version = reader.string(); + message.modelVersion = reader.string(); + break; + } + case 3: { + message.modelDisplayName = reader.string(); break; } default: @@ -117450,132 +122030,140 @@ }; /** - * Decodes a MlEngineModelVersion message from the specified reader or buffer, length delimited. + * Decodes a MigrateMlEngineModelVersionConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MlEngineModelVersion.decodeDelimited = function decodeDelimited(reader) { + MigrateMlEngineModelVersionConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MlEngineModelVersion message. + * Verifies a MigrateMlEngineModelVersionConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MlEngineModelVersion.verify = function verify(message) { + MigrateMlEngineModelVersionConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.endpoint != null && message.hasOwnProperty("endpoint")) if (!$util.isString(message.endpoint)) return "endpoint: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + if (!$util.isString(message.modelVersion)) + return "modelVersion: string expected"; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + if (!$util.isString(message.modelDisplayName)) + return "modelDisplayName: string expected"; return null; }; /** - * Creates a MlEngineModelVersion message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateMlEngineModelVersionConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} MlEngineModelVersion + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig */ - MlEngineModelVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion) + MigrateMlEngineModelVersionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion(); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig(); if (object.endpoint != null) message.endpoint = String(object.endpoint); - if (object.version != null) - message.version = String(object.version); + if (object.modelVersion != null) + message.modelVersion = String(object.modelVersion); + if (object.modelDisplayName != null) + message.modelDisplayName = String(object.modelDisplayName); return message; }; /** - * Creates a plain object from a MlEngineModelVersion message. Also converts values to other types if specified. + * Creates a plain object from a MigrateMlEngineModelVersionConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion} message MlEngineModelVersion + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MlEngineModelVersion.toObject = function toObject(message, options) { + MigrateMlEngineModelVersionConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.endpoint = ""; - object.version = ""; + object.modelVersion = ""; + object.modelDisplayName = ""; } if (message.endpoint != null && message.hasOwnProperty("endpoint")) object.endpoint = message.endpoint; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + object.modelVersion = message.modelVersion; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + object.modelDisplayName = message.modelDisplayName; return object; }; /** - * Converts this MlEngineModelVersion to JSON. + * Converts this MigrateMlEngineModelVersionConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @instance * @returns {Object.} JSON object */ - MlEngineModelVersion.prototype.toJSON = function toJSON() { + MigrateMlEngineModelVersionConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MlEngineModelVersion + * Gets the default type url for MigrateMlEngineModelVersionConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MlEngineModelVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateMlEngineModelVersionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.MlEngineModelVersion"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig"; }; - return MlEngineModelVersion; + return MigrateMlEngineModelVersionConfig; })(); - MigratableResource.AutomlModel = (function() { + MigrateResourceRequest.MigrateAutomlModelConfig = (function() { /** - * Properties of an AutomlModel. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @interface IAutomlModel - * @property {string|null} [model] AutomlModel model - * @property {string|null} [modelDisplayName] AutomlModel modelDisplayName + * Properties of a MigrateAutomlModelConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @interface IMigrateAutomlModelConfig + * @property {string|null} [model] MigrateAutomlModelConfig model + * @property {string|null} [modelDisplayName] MigrateAutomlModelConfig modelDisplayName */ /** - * Constructs a new AutomlModel. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @classdesc Represents an AutomlModel. - * @implements IAutomlModel + * Constructs a new MigrateAutomlModelConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @classdesc Represents a MigrateAutomlModelConfig. + * @implements IMigrateAutomlModelConfig * @constructor - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig=} [properties] Properties to set */ - function AutomlModel(properties) { + function MigrateAutomlModelConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -117583,80 +122171,80 @@ } /** - * AutomlModel model. + * MigrateAutomlModelConfig model. * @member {string} model - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @instance */ - AutomlModel.prototype.model = ""; + MigrateAutomlModelConfig.prototype.model = ""; /** - * AutomlModel modelDisplayName. + * MigrateAutomlModelConfig modelDisplayName. * @member {string} modelDisplayName - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @instance */ - AutomlModel.prototype.modelDisplayName = ""; + MigrateAutomlModelConfig.prototype.modelDisplayName = ""; /** - * Creates a new AutomlModel instance using the specified properties. + * Creates a new MigrateAutomlModelConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel instance + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig instance */ - AutomlModel.create = function create(properties) { - return new AutomlModel(properties); + MigrateAutomlModelConfig.create = function create(properties) { + return new MigrateAutomlModelConfig(properties); }; /** - * Encodes the specified AutomlModel message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify|verify} messages. + * Encodes the specified MigrateAutomlModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel} message AutomlModel message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig} message MigrateAutomlModelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomlModel.encode = function encode(message, writer) { + MigrateAutomlModelConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelDisplayName); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelDisplayName); return writer; }; /** - * Encodes the specified AutomlModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlModel.verify|verify} messages. + * Encodes the specified MigrateAutomlModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlModel} message AutomlModel message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig} message MigrateAutomlModelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomlModel.encodeDelimited = function encodeDelimited(message, writer) { + MigrateAutomlModelConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomlModel message from the specified reader or buffer. + * Decodes a MigrateAutomlModelConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomlModel.decode = function decode(reader, length) { + MigrateAutomlModelConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -117664,7 +122252,7 @@ message.model = reader.string(); break; } - case 3: { + case 2: { message.modelDisplayName = reader.string(); break; } @@ -117677,30 +122265,30 @@ }; /** - * Decodes an AutomlModel message from the specified reader or buffer, length delimited. + * Decodes a MigrateAutomlModelConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomlModel.decodeDelimited = function decodeDelimited(reader) { + MigrateAutomlModelConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomlModel message. + * Verifies a MigrateAutomlModelConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AutomlModel.verify = function verify(message) { + MigrateAutomlModelConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.model != null && message.hasOwnProperty("model")) @@ -117713,17 +122301,17 @@ }; /** - * Creates an AutomlModel message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateAutomlModelConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} AutomlModel + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig */ - AutomlModel.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel) + MigrateAutomlModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlModel(); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig(); if (object.model != null) message.model = String(object.model); if (object.modelDisplayName != null) @@ -117732,15 +122320,15 @@ }; /** - * Creates a plain object from an AutomlModel message. Also converts values to other types if specified. + * Creates a plain object from a MigrateAutomlModelConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.AutomlModel} message AutomlModel + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} message MigrateAutomlModelConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomlModel.toObject = function toObject(message, options) { + MigrateAutomlModelConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -117756,53 +122344,53 @@ }; /** - * Converts this AutomlModel to JSON. + * Converts this MigrateAutomlModelConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @instance * @returns {Object.} JSON object */ - AutomlModel.prototype.toJSON = function toJSON() { + MigrateAutomlModelConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomlModel + * Gets the default type url for MigrateAutomlModelConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlModel + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomlModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateAutomlModelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.AutomlModel"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig"; }; - return AutomlModel; + return MigrateAutomlModelConfig; })(); - MigratableResource.AutomlDataset = (function() { + MigrateResourceRequest.MigrateAutomlDatasetConfig = (function() { /** - * Properties of an AutomlDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @interface IAutomlDataset - * @property {string|null} [dataset] AutomlDataset dataset - * @property {string|null} [datasetDisplayName] AutomlDataset datasetDisplayName + * Properties of a MigrateAutomlDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @interface IMigrateAutomlDatasetConfig + * @property {string|null} [dataset] MigrateAutomlDatasetConfig dataset + * @property {string|null} [datasetDisplayName] MigrateAutomlDatasetConfig datasetDisplayName */ /** - * Constructs a new AutomlDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @classdesc Represents an AutomlDataset. - * @implements IAutomlDataset + * Constructs a new MigrateAutomlDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @classdesc Represents a MigrateAutomlDatasetConfig. + * @implements IMigrateAutomlDatasetConfig * @constructor - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig=} [properties] Properties to set */ - function AutomlDataset(properties) { + function MigrateAutomlDatasetConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -117810,80 +122398,80 @@ } /** - * AutomlDataset dataset. + * MigrateAutomlDatasetConfig dataset. * @member {string} dataset - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @instance */ - AutomlDataset.prototype.dataset = ""; + MigrateAutomlDatasetConfig.prototype.dataset = ""; /** - * AutomlDataset datasetDisplayName. + * MigrateAutomlDatasetConfig datasetDisplayName. * @member {string} datasetDisplayName - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @instance */ - AutomlDataset.prototype.datasetDisplayName = ""; + MigrateAutomlDatasetConfig.prototype.datasetDisplayName = ""; /** - * Creates a new AutomlDataset instance using the specified properties. + * Creates a new MigrateAutomlDatasetConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset instance + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig instance */ - AutomlDataset.create = function create(properties) { - return new AutomlDataset(properties); + MigrateAutomlDatasetConfig.create = function create(properties) { + return new MigrateAutomlDatasetConfig(properties); }; /** - * Encodes the specified AutomlDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify|verify} messages. + * Encodes the specified MigrateAutomlDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset} message AutomlDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomlDataset.encode = function encode(message, writer) { + MigrateAutomlDatasetConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.datasetDisplayName); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetDisplayName); return writer; }; /** - * Encodes the specified AutomlDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.AutomlDataset.verify|verify} messages. + * Encodes the specified MigrateAutomlDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IAutomlDataset} message AutomlDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomlDataset.encodeDelimited = function encodeDelimited(message, writer) { + MigrateAutomlDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomlDataset message from the specified reader or buffer. + * Decodes a MigrateAutomlDatasetConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomlDataset.decode = function decode(reader, length) { + MigrateAutomlDatasetConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -117891,7 +122479,7 @@ message.dataset = reader.string(); break; } - case 4: { + case 2: { message.datasetDisplayName = reader.string(); break; } @@ -117904,30 +122492,30 @@ }; /** - * Decodes an AutomlDataset message from the specified reader or buffer, length delimited. + * Decodes a MigrateAutomlDatasetConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomlDataset.decodeDelimited = function decodeDelimited(reader) { + MigrateAutomlDatasetConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomlDataset message. + * Verifies a MigrateAutomlDatasetConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AutomlDataset.verify = function verify(message) { + MigrateAutomlDatasetConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.dataset != null && message.hasOwnProperty("dataset")) @@ -117940,17 +122528,17 @@ }; /** - * Creates an AutomlDataset message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateAutomlDatasetConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} AutomlDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig */ - AutomlDataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset) + MigrateAutomlDatasetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource.AutomlDataset(); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig(); if (object.dataset != null) message.dataset = String(object.dataset); if (object.datasetDisplayName != null) @@ -117959,15 +122547,15 @@ }; /** - * Creates a plain object from an AutomlDataset message. Also converts values to other types if specified. + * Creates a plain object from a MigrateAutomlDatasetConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.AutomlDataset} message AutomlDataset + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomlDataset.toObject = function toObject(message, options) { + MigrateAutomlDatasetConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -117983,55 +122571,55 @@ }; /** - * Converts this AutomlDataset to JSON. + * Converts this MigrateAutomlDatasetConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @instance * @returns {Object.} JSON object */ - AutomlDataset.prototype.toJSON = function toJSON() { + MigrateAutomlDatasetConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomlDataset + * Gets the default type url for MigrateAutomlDatasetConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource.AutomlDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomlDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateAutomlDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.AutomlDataset"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig"; }; - return AutomlDataset; + return MigrateAutomlDatasetConfig; })(); - MigratableResource.DataLabelingDataset = (function() { + MigrateResourceRequest.MigrateDataLabelingDatasetConfig = (function() { /** - * Properties of a DataLabelingDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @interface IDataLabelingDataset - * @property {string|null} [dataset] DataLabelingDataset dataset - * @property {string|null} [datasetDisplayName] DataLabelingDataset datasetDisplayName - * @property {Array.|null} [dataLabelingAnnotatedDatasets] DataLabelingDataset dataLabelingAnnotatedDatasets + * Properties of a MigrateDataLabelingDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @interface IMigrateDataLabelingDatasetConfig + * @property {string|null} [dataset] MigrateDataLabelingDatasetConfig dataset + * @property {string|null} [datasetDisplayName] MigrateDataLabelingDatasetConfig datasetDisplayName + * @property {Array.|null} [migrateDataLabelingAnnotatedDatasetConfigs] MigrateDataLabelingDatasetConfig migrateDataLabelingAnnotatedDatasetConfigs */ /** - * Constructs a new DataLabelingDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource - * @classdesc Represents a DataLabelingDataset. - * @implements IDataLabelingDataset + * Constructs a new MigrateDataLabelingDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @classdesc Represents a MigrateDataLabelingDatasetConfig. + * @implements IMigrateDataLabelingDatasetConfig * @constructor - * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig=} [properties] Properties to set */ - function DataLabelingDataset(properties) { - this.dataLabelingAnnotatedDatasets = []; + function MigrateDataLabelingDatasetConfig(properties) { + this.migrateDataLabelingAnnotatedDatasetConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -118039,91 +122627,91 @@ } /** - * DataLabelingDataset dataset. + * MigrateDataLabelingDatasetConfig dataset. * @member {string} dataset - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @instance */ - DataLabelingDataset.prototype.dataset = ""; + MigrateDataLabelingDatasetConfig.prototype.dataset = ""; /** - * DataLabelingDataset datasetDisplayName. + * MigrateDataLabelingDatasetConfig datasetDisplayName. * @member {string} datasetDisplayName - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @instance */ - DataLabelingDataset.prototype.datasetDisplayName = ""; + MigrateDataLabelingDatasetConfig.prototype.datasetDisplayName = ""; /** - * DataLabelingDataset dataLabelingAnnotatedDatasets. - * @member {Array.} dataLabelingAnnotatedDatasets - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * MigrateDataLabelingDatasetConfig migrateDataLabelingAnnotatedDatasetConfigs. + * @member {Array.} migrateDataLabelingAnnotatedDatasetConfigs + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @instance */ - DataLabelingDataset.prototype.dataLabelingAnnotatedDatasets = $util.emptyArray; + MigrateDataLabelingDatasetConfig.prototype.migrateDataLabelingAnnotatedDatasetConfigs = $util.emptyArray; /** - * Creates a new DataLabelingDataset instance using the specified properties. + * Creates a new MigrateDataLabelingDatasetConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset instance + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig instance */ - DataLabelingDataset.create = function create(properties) { - return new DataLabelingDataset(properties); + MigrateDataLabelingDatasetConfig.create = function create(properties) { + return new MigrateDataLabelingDatasetConfig(properties); }; /** - * Encodes the specified DataLabelingDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify|verify} messages. + * Encodes the specified MigrateDataLabelingDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset} message DataLabelingDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataLabelingDataset.encode = function encode(message, writer) { + MigrateDataLabelingDatasetConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.dataLabelingAnnotatedDatasets != null && message.dataLabelingAnnotatedDatasets.length) - for (var i = 0; i < message.dataLabelingAnnotatedDatasets.length; ++i) - $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.encode(message.dataLabelingAnnotatedDatasets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.datasetDisplayName); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetDisplayName); + if (message.migrateDataLabelingAnnotatedDatasetConfigs != null && message.migrateDataLabelingAnnotatedDatasetConfigs.length) + for (var i = 0; i < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.encode(message.migrateDataLabelingAnnotatedDatasetConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DataLabelingDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.verify|verify} messages. + * Encodes the specified MigrateDataLabelingDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.IDataLabelingDataset} message DataLabelingDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataLabelingDataset.encodeDelimited = function encodeDelimited(message, writer) { + MigrateDataLabelingDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataLabelingDataset message from the specified reader or buffer. + * Decodes a MigrateDataLabelingDatasetConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataLabelingDataset.decode = function decode(reader, length) { + MigrateDataLabelingDatasetConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -118131,14 +122719,14 @@ message.dataset = reader.string(); break; } - case 4: { + case 2: { message.datasetDisplayName = reader.string(); break; } case 3: { - if (!(message.dataLabelingAnnotatedDatasets && message.dataLabelingAnnotatedDatasets.length)) - message.dataLabelingAnnotatedDatasets = []; - message.dataLabelingAnnotatedDatasets.push($root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.decode(reader, reader.uint32())); + if (!(message.migrateDataLabelingAnnotatedDatasetConfigs && message.migrateDataLabelingAnnotatedDatasetConfigs.length)) + message.migrateDataLabelingAnnotatedDatasetConfigs = []; + message.migrateDataLabelingAnnotatedDatasetConfigs.push($root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.decode(reader, reader.uint32())); break; } default: @@ -118150,30 +122738,30 @@ }; /** - * Decodes a DataLabelingDataset message from the specified reader or buffer, length delimited. + * Decodes a MigrateDataLabelingDatasetConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataLabelingDataset.decodeDelimited = function decodeDelimited(reader) { + MigrateDataLabelingDatasetConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataLabelingDataset message. + * Verifies a MigrateDataLabelingDatasetConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataLabelingDataset.verify = function verify(message) { + MigrateDataLabelingDatasetConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.dataset != null && message.hasOwnProperty("dataset")) @@ -118182,123 +122770,122 @@ if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) if (!$util.isString(message.datasetDisplayName)) return "datasetDisplayName: string expected"; - if (message.dataLabelingAnnotatedDatasets != null && message.hasOwnProperty("dataLabelingAnnotatedDatasets")) { - if (!Array.isArray(message.dataLabelingAnnotatedDatasets)) - return "dataLabelingAnnotatedDatasets: array expected"; - for (var i = 0; i < message.dataLabelingAnnotatedDatasets.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify(message.dataLabelingAnnotatedDatasets[i]); + if (message.migrateDataLabelingAnnotatedDatasetConfigs != null && message.hasOwnProperty("migrateDataLabelingAnnotatedDatasetConfigs")) { + if (!Array.isArray(message.migrateDataLabelingAnnotatedDatasetConfigs)) + return "migrateDataLabelingAnnotatedDatasetConfigs: array expected"; + for (var i = 0; i < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify(message.migrateDataLabelingAnnotatedDatasetConfigs[i]); if (error) - return "dataLabelingAnnotatedDatasets." + error; + return "migrateDataLabelingAnnotatedDatasetConfigs." + error; } } return null; }; /** - * Creates a DataLabelingDataset message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateDataLabelingDatasetConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} DataLabelingDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig */ - DataLabelingDataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset) + MigrateDataLabelingDatasetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset(); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig(); if (object.dataset != null) message.dataset = String(object.dataset); if (object.datasetDisplayName != null) message.datasetDisplayName = String(object.datasetDisplayName); - if (object.dataLabelingAnnotatedDatasets) { - if (!Array.isArray(object.dataLabelingAnnotatedDatasets)) - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.dataLabelingAnnotatedDatasets: array expected"); - message.dataLabelingAnnotatedDatasets = []; - for (var i = 0; i < object.dataLabelingAnnotatedDatasets.length; ++i) { - if (typeof object.dataLabelingAnnotatedDatasets[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.dataLabelingAnnotatedDatasets: object expected"); - message.dataLabelingAnnotatedDatasets[i] = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.fromObject(object.dataLabelingAnnotatedDatasets[i]); + if (object.migrateDataLabelingAnnotatedDatasetConfigs) { + if (!Array.isArray(object.migrateDataLabelingAnnotatedDatasetConfigs)) + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.migrateDataLabelingAnnotatedDatasetConfigs: array expected"); + message.migrateDataLabelingAnnotatedDatasetConfigs = []; + for (var i = 0; i < object.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) { + if (typeof object.migrateDataLabelingAnnotatedDatasetConfigs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.migrateDataLabelingAnnotatedDatasetConfigs: object expected"); + message.migrateDataLabelingAnnotatedDatasetConfigs[i] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.fromObject(object.migrateDataLabelingAnnotatedDatasetConfigs[i]); } } return message; }; /** - * Creates a plain object from a DataLabelingDataset message. Also converts values to other types if specified. + * Creates a plain object from a MigrateDataLabelingDatasetConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset} message DataLabelingDataset + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataLabelingDataset.toObject = function toObject(message, options) { + MigrateDataLabelingDatasetConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.dataLabelingAnnotatedDatasets = []; + object.migrateDataLabelingAnnotatedDatasetConfigs = []; if (options.defaults) { object.dataset = ""; object.datasetDisplayName = ""; } if (message.dataset != null && message.hasOwnProperty("dataset")) object.dataset = message.dataset; - if (message.dataLabelingAnnotatedDatasets && message.dataLabelingAnnotatedDatasets.length) { - object.dataLabelingAnnotatedDatasets = []; - for (var j = 0; j < message.dataLabelingAnnotatedDatasets.length; ++j) - object.dataLabelingAnnotatedDatasets[j] = $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.toObject(message.dataLabelingAnnotatedDatasets[j], options); - } if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) object.datasetDisplayName = message.datasetDisplayName; + if (message.migrateDataLabelingAnnotatedDatasetConfigs && message.migrateDataLabelingAnnotatedDatasetConfigs.length) { + object.migrateDataLabelingAnnotatedDatasetConfigs = []; + for (var j = 0; j < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++j) + object.migrateDataLabelingAnnotatedDatasetConfigs[j] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.toObject(message.migrateDataLabelingAnnotatedDatasetConfigs[j], options); + } return object; }; /** - * Converts this DataLabelingDataset to JSON. + * Converts this MigrateDataLabelingDatasetConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @instance * @returns {Object.} JSON object */ - DataLabelingDataset.prototype.toJSON = function toJSON() { + MigrateDataLabelingDatasetConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataLabelingDataset + * Gets the default type url for MigrateDataLabelingDatasetConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataLabelingDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateDataLabelingDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig"; }; - DataLabelingDataset.DataLabelingAnnotatedDataset = (function() { + MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig = (function() { /** - * Properties of a DataLabelingAnnotatedDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset - * @interface IDataLabelingAnnotatedDataset - * @property {string|null} [annotatedDataset] DataLabelingAnnotatedDataset annotatedDataset - * @property {string|null} [annotatedDatasetDisplayName] DataLabelingAnnotatedDataset annotatedDatasetDisplayName + * Properties of a MigrateDataLabelingAnnotatedDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @interface IMigrateDataLabelingAnnotatedDatasetConfig + * @property {string|null} [annotatedDataset] MigrateDataLabelingAnnotatedDatasetConfig annotatedDataset */ /** - * Constructs a new DataLabelingAnnotatedDataset. - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset - * @classdesc Represents a DataLabelingAnnotatedDataset. - * @implements IDataLabelingAnnotatedDataset + * Constructs a new MigrateDataLabelingAnnotatedDatasetConfig. + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @classdesc Represents a MigrateDataLabelingAnnotatedDatasetConfig. + * @implements IMigrateDataLabelingAnnotatedDatasetConfig * @constructor - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig=} [properties] Properties to set */ - function DataLabelingAnnotatedDataset(properties) { + function MigrateDataLabelingAnnotatedDatasetConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -118306,80 +122893,70 @@ } /** - * DataLabelingAnnotatedDataset annotatedDataset. + * MigrateDataLabelingAnnotatedDatasetConfig annotatedDataset. * @member {string} annotatedDataset - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset - * @instance - */ - DataLabelingAnnotatedDataset.prototype.annotatedDataset = ""; - - /** - * DataLabelingAnnotatedDataset annotatedDatasetDisplayName. - * @member {string} annotatedDatasetDisplayName - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @instance */ - DataLabelingAnnotatedDataset.prototype.annotatedDatasetDisplayName = ""; + MigrateDataLabelingAnnotatedDatasetConfig.prototype.annotatedDataset = ""; /** - * Creates a new DataLabelingAnnotatedDataset instance using the specified properties. + * Creates a new MigrateDataLabelingAnnotatedDatasetConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset instance + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig instance */ - DataLabelingAnnotatedDataset.create = function create(properties) { - return new DataLabelingAnnotatedDataset(properties); + MigrateDataLabelingAnnotatedDatasetConfig.create = function create(properties) { + return new MigrateDataLabelingAnnotatedDatasetConfig(properties); }; /** - * Encodes the specified DataLabelingAnnotatedDataset message. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify|verify} messages. + * Encodes the specified MigrateDataLabelingAnnotatedDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataLabelingAnnotatedDataset.encode = function encode(message, writer) { + MigrateDataLabelingAnnotatedDatasetConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.annotatedDataset != null && Object.hasOwnProperty.call(message, "annotatedDataset")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotatedDataset); - if (message.annotatedDatasetDisplayName != null && Object.hasOwnProperty.call(message, "annotatedDatasetDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotatedDatasetDisplayName); return writer; }; /** - * Encodes the specified DataLabelingAnnotatedDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset.verify|verify} messages. + * Encodes the specified MigrateDataLabelingAnnotatedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.IDataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset message or plain object to encode + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataLabelingAnnotatedDataset.encodeDelimited = function encodeDelimited(message, writer) { + MigrateDataLabelingAnnotatedDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DataLabelingAnnotatedDataset message from the specified reader or buffer. + * Decodes a MigrateDataLabelingAnnotatedDatasetConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataLabelingAnnotatedDataset.decode = function decode(reader, length) { + MigrateDataLabelingAnnotatedDatasetConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -118387,10 +122964,6 @@ message.annotatedDataset = reader.string(); break; } - case 3: { - message.annotatedDatasetDisplayName = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -118400,241 +122973,129 @@ }; /** - * Decodes a DataLabelingAnnotatedDataset message from the specified reader or buffer, length delimited. + * Decodes a MigrateDataLabelingAnnotatedDatasetConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DataLabelingAnnotatedDataset.decodeDelimited = function decodeDelimited(reader) { + MigrateDataLabelingAnnotatedDatasetConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DataLabelingAnnotatedDataset message. + * Verifies a MigrateDataLabelingAnnotatedDatasetConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DataLabelingAnnotatedDataset.verify = function verify(message) { + MigrateDataLabelingAnnotatedDatasetConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) if (!$util.isString(message.annotatedDataset)) return "annotatedDataset: string expected"; - if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) - if (!$util.isString(message.annotatedDatasetDisplayName)) - return "annotatedDatasetDisplayName: string expected"; return null; }; /** - * Creates a DataLabelingAnnotatedDataset message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateDataLabelingAnnotatedDatasetConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} DataLabelingAnnotatedDataset + * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig */ - DataLabelingAnnotatedDataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset) + MigrateDataLabelingAnnotatedDatasetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset(); + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig(); if (object.annotatedDataset != null) message.annotatedDataset = String(object.annotatedDataset); - if (object.annotatedDatasetDisplayName != null) - message.annotatedDatasetDisplayName = String(object.annotatedDatasetDisplayName); return message; }; /** - * Creates a plain object from a DataLabelingAnnotatedDataset message. Also converts values to other types if specified. + * Creates a plain object from a MigrateDataLabelingAnnotatedDatasetConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static - * @param {google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset} message DataLabelingAnnotatedDataset + * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataLabelingAnnotatedDataset.toObject = function toObject(message, options) { + MigrateDataLabelingAnnotatedDatasetConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.annotatedDataset = ""; - object.annotatedDatasetDisplayName = ""; - } if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) object.annotatedDataset = message.annotatedDataset; - if (message.annotatedDatasetDisplayName != null && message.hasOwnProperty("annotatedDatasetDisplayName")) - object.annotatedDatasetDisplayName = message.annotatedDatasetDisplayName; return object; }; /** - * Converts this DataLabelingAnnotatedDataset to JSON. + * Converts this MigrateDataLabelingAnnotatedDatasetConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @instance * @returns {Object.} JSON object */ - DataLabelingAnnotatedDataset.prototype.toJSON = function toJSON() { + MigrateDataLabelingAnnotatedDatasetConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DataLabelingAnnotatedDataset + * Gets the default type url for MigrateDataLabelingAnnotatedDatasetConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DataLabelingAnnotatedDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateDataLabelingAnnotatedDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigratableResource.DataLabelingDataset.DataLabelingAnnotatedDataset"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig"; }; - return DataLabelingAnnotatedDataset; + return MigrateDataLabelingAnnotatedDatasetConfig; })(); - return DataLabelingDataset; + return MigrateDataLabelingDatasetConfig; })(); - return MigratableResource; - })(); - - v1.MigrationService = (function() { - - /** - * Constructs a new MigrationService service. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MigrationService - * @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 MigrationService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (MigrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MigrationService; - - /** - * Creates new MigrationService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.aiplatform.v1.MigrationService - * @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 {MigrationService} RPC service. Useful where requests and/or responses are streamed. - */ - MigrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.MigrationService|searchMigratableResources}. - * @memberof google.cloud.aiplatform.v1.MigrationService - * @typedef SearchMigratableResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} [response] SearchMigratableResourcesResponse - */ - - /** - * Calls SearchMigratableResources. - * @function searchMigratableResources - * @memberof google.cloud.aiplatform.v1.MigrationService - * @instance - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} request SearchMigratableResourcesRequest message or plain object - * @param {google.cloud.aiplatform.v1.MigrationService.SearchMigratableResourcesCallback} callback Node-style callback called with the error, if any, and SearchMigratableResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MigrationService.prototype.searchMigratableResources = function searchMigratableResources(request, callback) { - return this.rpcCall(searchMigratableResources, $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest, $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse, request, callback); - }, "name", { value: "SearchMigratableResources" }); - - /** - * Calls SearchMigratableResources. - * @function searchMigratableResources - * @memberof google.cloud.aiplatform.v1.MigrationService - * @instance - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} request SearchMigratableResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.MigrationService|batchMigrateResources}. - * @memberof google.cloud.aiplatform.v1.MigrationService - * @typedef BatchMigrateResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchMigrateResources. - * @function batchMigrateResources - * @memberof google.cloud.aiplatform.v1.MigrationService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} request BatchMigrateResourcesRequest message or plain object - * @param {google.cloud.aiplatform.v1.MigrationService.BatchMigrateResourcesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MigrationService.prototype.batchMigrateResources = function batchMigrateResources(request, callback) { - return this.rpcCall(batchMigrateResources, $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchMigrateResources" }); - - /** - * Calls BatchMigrateResources. - * @function batchMigrateResources - * @memberof google.cloud.aiplatform.v1.MigrationService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} request BatchMigrateResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return MigrationService; + return MigrateResourceRequest; })(); - v1.SearchMigratableResourcesRequest = (function() { + v1.BatchMigrateResourcesResponse = (function() { /** - * Properties of a SearchMigratableResourcesRequest. + * Properties of a BatchMigrateResourcesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface ISearchMigratableResourcesRequest - * @property {string|null} [parent] SearchMigratableResourcesRequest parent - * @property {number|null} [pageSize] SearchMigratableResourcesRequest pageSize - * @property {string|null} [pageToken] SearchMigratableResourcesRequest pageToken - * @property {string|null} [filter] SearchMigratableResourcesRequest filter + * @interface IBatchMigrateResourcesResponse + * @property {Array.|null} [migrateResourceResponses] BatchMigrateResourcesResponse migrateResourceResponses */ /** - * Constructs a new SearchMigratableResourcesRequest. + * Constructs a new BatchMigrateResourcesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a SearchMigratableResourcesRequest. - * @implements ISearchMigratableResourcesRequest + * @classdesc Represents a BatchMigrateResourcesResponse. + * @implements IBatchMigrateResourcesResponse * @constructor - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse=} [properties] Properties to set */ - function SearchMigratableResourcesRequest(properties) { + function BatchMigrateResourcesResponse(properties) { + this.migrateResourceResponses = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -118642,117 +123103,78 @@ } /** - * SearchMigratableResourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest - * @instance - */ - SearchMigratableResourcesRequest.prototype.parent = ""; - - /** - * SearchMigratableResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest - * @instance - */ - SearchMigratableResourcesRequest.prototype.pageSize = 0; - - /** - * SearchMigratableResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest - * @instance - */ - SearchMigratableResourcesRequest.prototype.pageToken = ""; - - /** - * SearchMigratableResourcesRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * BatchMigrateResourcesResponse migrateResourceResponses. + * @member {Array.} migrateResourceResponses + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @instance */ - SearchMigratableResourcesRequest.prototype.filter = ""; + BatchMigrateResourcesResponse.prototype.migrateResourceResponses = $util.emptyArray; /** - * Creates a new SearchMigratableResourcesRequest instance using the specified properties. + * Creates a new BatchMigrateResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest instance + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse instance */ - SearchMigratableResourcesRequest.create = function create(properties) { - return new SearchMigratableResourcesRequest(properties); + BatchMigrateResourcesResponse.create = function create(properties) { + return new BatchMigrateResourcesResponse(properties); }; /** - * Encodes the specified SearchMigratableResourcesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} message SearchMigratableResourcesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse} message BatchMigrateResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchMigratableResourcesRequest.encode = function encode(message, writer) { + BatchMigrateResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.migrateResourceResponses != null && message.migrateResourceResponses.length) + for (var i = 0; i < message.migrateResourceResponses.length; ++i) + $root.google.cloud.aiplatform.v1.MigrateResourceResponse.encode(message.migrateResourceResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchMigratableResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest} message SearchMigratableResourcesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse} message BatchMigrateResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchMigratableResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchMigrateResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchMigratableResourcesRequest message from the specified reader or buffer. + * Decodes a BatchMigrateResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchMigratableResourcesRequest.decode = function decode(reader, length) { + BatchMigrateResourcesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse(); 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(); + if (!(message.migrateResourceResponses && message.migrateResourceResponses.length)) + message.migrateResourceResponses = []; + message.migrateResourceResponses.push($root.google.cloud.aiplatform.v1.MigrateResourceResponse.decode(reader, reader.uint32())); break; } default: @@ -118764,149 +123186,141 @@ }; /** - * Decodes a SearchMigratableResourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchMigrateResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchMigratableResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + BatchMigrateResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchMigratableResourcesRequest message. + * Verifies a BatchMigrateResourcesResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchMigratableResourcesRequest.verify = function verify(message) { + BatchMigrateResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.migrateResourceResponses != null && message.hasOwnProperty("migrateResourceResponses")) { + if (!Array.isArray(message.migrateResourceResponses)) + return "migrateResourceResponses: array expected"; + for (var i = 0; i < message.migrateResourceResponses.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.verify(message.migrateResourceResponses[i]); + if (error) + return "migrateResourceResponses." + error; + } + } return null; }; /** - * Creates a SearchMigratableResourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchMigrateResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} SearchMigratableResourcesRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse */ - SearchMigratableResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest) + BatchMigrateResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest(); - 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); + var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse(); + if (object.migrateResourceResponses) { + if (!Array.isArray(object.migrateResourceResponses)) + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.migrateResourceResponses: array expected"); + message.migrateResourceResponses = []; + for (var i = 0; i < object.migrateResourceResponses.length; ++i) { + if (typeof object.migrateResourceResponses[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.migrateResourceResponses: object expected"); + message.migrateResourceResponses[i] = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.fromObject(object.migrateResourceResponses[i]); + } + } return message; }; /** - * Creates a plain object from a SearchMigratableResourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchMigrateResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static - * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesRequest} message SearchMigratableResourcesRequest + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} message BatchMigrateResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchMigratableResourcesRequest.toObject = function toObject(message, options) { + BatchMigrateResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + if (options.arrays || options.defaults) + object.migrateResourceResponses = []; + if (message.migrateResourceResponses && message.migrateResourceResponses.length) { + object.migrateResourceResponses = []; + for (var j = 0; j < message.migrateResourceResponses.length; ++j) + object.migrateResourceResponses[j] = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.toObject(message.migrateResourceResponses[j], options); } - 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 SearchMigratableResourcesRequest to JSON. + * Converts this BatchMigrateResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @instance * @returns {Object.} JSON object */ - SearchMigratableResourcesRequest.prototype.toJSON = function toJSON() { + BatchMigrateResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SearchMigratableResourcesRequest + * Gets the default type url for BatchMigrateResourcesResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SearchMigratableResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchMigrateResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.SearchMigratableResourcesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesResponse"; }; - return SearchMigratableResourcesRequest; + return BatchMigrateResourcesResponse; })(); - v1.SearchMigratableResourcesResponse = (function() { + v1.MigrateResourceResponse = (function() { /** - * Properties of a SearchMigratableResourcesResponse. + * Properties of a MigrateResourceResponse. * @memberof google.cloud.aiplatform.v1 - * @interface ISearchMigratableResourcesResponse - * @property {Array.|null} [migratableResources] SearchMigratableResourcesResponse migratableResources - * @property {string|null} [nextPageToken] SearchMigratableResourcesResponse nextPageToken + * @interface IMigrateResourceResponse + * @property {string|null} [dataset] MigrateResourceResponse dataset + * @property {string|null} [model] MigrateResourceResponse model + * @property {google.cloud.aiplatform.v1.IMigratableResource|null} [migratableResource] MigrateResourceResponse migratableResource */ /** - * Constructs a new SearchMigratableResourcesResponse. + * Constructs a new MigrateResourceResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a SearchMigratableResourcesResponse. - * @implements ISearchMigratableResourcesResponse + * @classdesc Represents a MigrateResourceResponse. + * @implements IMigrateResourceResponse * @constructor - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse=} [properties] Properties to set */ - function SearchMigratableResourcesResponse(properties) { - this.migratableResources = []; + function MigrateResourceResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -118914,340 +123328,117 @@ } /** - * SearchMigratableResourcesResponse migratableResources. - * @member {Array.} migratableResources - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse + * MigrateResourceResponse dataset. + * @member {string|null|undefined} dataset + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @instance */ - SearchMigratableResourcesResponse.prototype.migratableResources = $util.emptyArray; + MigrateResourceResponse.prototype.dataset = null; /** - * SearchMigratableResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse + * MigrateResourceResponse model. + * @member {string|null|undefined} model + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @instance */ - SearchMigratableResourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchMigratableResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse instance - */ - SearchMigratableResourcesResponse.create = function create(properties) { - return new SearchMigratableResourcesResponse(properties); - }; - - /** - * Encodes the specified SearchMigratableResourcesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse} message SearchMigratableResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchMigratableResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.migratableResources != null && message.migratableResources.length) - for (var i = 0; i < message.migratableResources.length; ++i) - $root.google.cloud.aiplatform.v1.MigratableResource.encode(message.migratableResources[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 SearchMigratableResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse} message SearchMigratableResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchMigratableResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchMigratableResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchMigratableResourcesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.migratableResources && message.migratableResources.length)) - message.migratableResources = []; - message.migratableResources.push($root.google.cloud.aiplatform.v1.MigratableResource.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchMigratableResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchMigratableResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchMigratableResourcesResponse message. - * @function verify - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchMigratableResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.migratableResources != null && message.hasOwnProperty("migratableResources")) { - if (!Array.isArray(message.migratableResources)) - return "migratableResources: array expected"; - for (var i = 0; i < message.migratableResources.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.verify(message.migratableResources[i]); - if (error) - return "migratableResources." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchMigratableResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} SearchMigratableResourcesResponse - */ - SearchMigratableResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse) - return object; - var message = new $root.google.cloud.aiplatform.v1.SearchMigratableResourcesResponse(); - if (object.migratableResources) { - if (!Array.isArray(object.migratableResources)) - throw TypeError(".google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.migratableResources: array expected"); - message.migratableResources = []; - for (var i = 0; i < object.migratableResources.length; ++i) { - if (typeof object.migratableResources[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.SearchMigratableResourcesResponse.migratableResources: object expected"); - message.migratableResources[i] = $root.google.cloud.aiplatform.v1.MigratableResource.fromObject(object.migratableResources[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchMigratableResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.SearchMigratableResourcesResponse} message SearchMigratableResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchMigratableResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.migratableResources = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.migratableResources && message.migratableResources.length) { - object.migratableResources = []; - for (var j = 0; j < message.migratableResources.length; ++j) - object.migratableResources[j] = $root.google.cloud.aiplatform.v1.MigratableResource.toObject(message.migratableResources[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + MigrateResourceResponse.prototype.model = null; /** - * Converts this SearchMigratableResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse + * MigrateResourceResponse migratableResource. + * @member {google.cloud.aiplatform.v1.IMigratableResource|null|undefined} migratableResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @instance - * @returns {Object.} JSON object - */ - SearchMigratableResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchMigratableResourcesResponse - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.SearchMigratableResourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchMigratableResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.SearchMigratableResourcesResponse"; - }; - - return SearchMigratableResourcesResponse; - })(); - - v1.BatchMigrateResourcesRequest = (function() { - - /** - * Properties of a BatchMigrateResourcesRequest. - * @memberof google.cloud.aiplatform.v1 - * @interface IBatchMigrateResourcesRequest - * @property {string|null} [parent] BatchMigrateResourcesRequest parent - * @property {Array.|null} [migrateResourceRequests] BatchMigrateResourcesRequest migrateResourceRequests - */ - - /** - * Constructs a new BatchMigrateResourcesRequest. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchMigrateResourcesRequest. - * @implements IBatchMigrateResourcesRequest - * @constructor - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest=} [properties] Properties to set */ - function BatchMigrateResourcesRequest(properties) { - this.migrateResourceRequests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + MigrateResourceResponse.prototype.migratableResource = null; - /** - * BatchMigrateResourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest - * @instance - */ - BatchMigrateResourcesRequest.prototype.parent = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchMigrateResourcesRequest migrateResourceRequests. - * @member {Array.} migrateResourceRequests - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * MigrateResourceResponse migratedResource. + * @member {"dataset"|"model"|undefined} migratedResource + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @instance */ - BatchMigrateResourcesRequest.prototype.migrateResourceRequests = $util.emptyArray; + Object.defineProperty(MigrateResourceResponse.prototype, "migratedResource", { + get: $util.oneOfGetter($oneOfFields = ["dataset", "model"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchMigrateResourcesRequest instance using the specified properties. + * Creates a new MigrateResourceResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest instance + * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse instance */ - BatchMigrateResourcesRequest.create = function create(properties) { - return new BatchMigrateResourcesRequest(properties); + MigrateResourceResponse.create = function create(properties) { + return new MigrateResourceResponse(properties); }; /** - * Encodes the specified BatchMigrateResourcesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.verify|verify} messages. + * Encodes the specified MigrateResourceResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} message BatchMigrateResourcesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse} message MigrateResourceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchMigrateResourcesRequest.encode = function encode(message, writer) { + MigrateResourceResponse.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.migrateResourceRequests != null && message.migrateResourceRequests.length) - for (var i = 0; i < message.migrateResourceRequests.length; ++i) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.encode(message.migrateResourceRequests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.migratableResource != null && Object.hasOwnProperty.call(message, "migratableResource")) + $root.google.cloud.aiplatform.v1.MigratableResource.encode(message.migratableResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchMigrateResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.verify|verify} messages. + * Encodes the specified MigrateResourceResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest} message BatchMigrateResourcesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse} message MigrateResourceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchMigrateResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + MigrateResourceResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchMigrateResourcesRequest message from the specified reader or buffer. + * Decodes a MigrateResourceResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest + * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchMigrateResourcesRequest.decode = function decode(reader, length) { + MigrateResourceResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.dataset = reader.string(); break; } case 2: { - if (!(message.migrateResourceRequests && message.migrateResourceRequests.length)) - message.migrateResourceRequests = []; - message.migrateResourceRequests.push($root.google.cloud.aiplatform.v1.MigrateResourceRequest.decode(reader, reader.uint32())); + message.model = reader.string(); + break; + } + case 3: { + message.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.decode(reader, reader.uint32()); break; } default: @@ -119259,151 +123450,156 @@ }; /** - * Decodes a BatchMigrateResourcesRequest message from the specified reader or buffer, length delimited. + * Decodes a MigrateResourceResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest + * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchMigrateResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + MigrateResourceResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchMigrateResourcesRequest message. + * Verifies a MigrateResourceResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchMigrateResourcesRequest.verify = function verify(message) { + MigrateResourceResponse.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.migrateResourceRequests != null && message.hasOwnProperty("migrateResourceRequests")) { - if (!Array.isArray(message.migrateResourceRequests)) - return "migrateResourceRequests: array expected"; - for (var i = 0; i < message.migrateResourceRequests.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.verify(message.migrateResourceRequests[i]); - if (error) - return "migrateResourceRequests." + error; - } + var properties = {}; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + properties.migratedResource = 1; + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + } + if (message.model != null && message.hasOwnProperty("model")) { + if (properties.migratedResource === 1) + return "migratedResource: multiple values"; + properties.migratedResource = 1; + if (!$util.isString(message.model)) + return "model: string expected"; + } + if (message.migratableResource != null && message.hasOwnProperty("migratableResource")) { + var error = $root.google.cloud.aiplatform.v1.MigratableResource.verify(message.migratableResource); + if (error) + return "migratableResource." + error; } return null; }; /** - * Creates a BatchMigrateResourcesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateResourceResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} BatchMigrateResourcesRequest + * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse */ - BatchMigrateResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest) + MigrateResourceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.migrateResourceRequests) { - if (!Array.isArray(object.migrateResourceRequests)) - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.migrateResourceRequests: array expected"); - message.migrateResourceRequests = []; - for (var i = 0; i < object.migrateResourceRequests.length; ++i) { - if (typeof object.migrateResourceRequests[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesRequest.migrateResourceRequests: object expected"); - message.migrateResourceRequests[i] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.fromObject(object.migrateResourceRequests[i]); - } + var message = new $root.google.cloud.aiplatform.v1.MigrateResourceResponse(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.model != null) + message.model = String(object.model); + if (object.migratableResource != null) { + if (typeof object.migratableResource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceResponse.migratableResource: object expected"); + message.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.fromObject(object.migratableResource); } return message; }; /** - * Creates a plain object from a BatchMigrateResourcesRequest message. Also converts values to other types if specified. + * Creates a plain object from a MigrateResourceResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesRequest} message BatchMigrateResourcesRequest + * @param {google.cloud.aiplatform.v1.MigrateResourceResponse} message MigrateResourceResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchMigrateResourcesRequest.toObject = function toObject(message, options) { + MigrateResourceResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.migrateResourceRequests = []; if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.migrateResourceRequests && message.migrateResourceRequests.length) { - object.migrateResourceRequests = []; - for (var j = 0; j < message.migrateResourceRequests.length; ++j) - object.migrateResourceRequests[j] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.toObject(message.migrateResourceRequests[j], options); + object.migratableResource = null; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + object.dataset = message.dataset; + if (options.oneofs) + object.migratedResource = "dataset"; + } + if (message.model != null && message.hasOwnProperty("model")) { + object.model = message.model; + if (options.oneofs) + object.migratedResource = "model"; } + if (message.migratableResource != null && message.hasOwnProperty("migratableResource")) + object.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.toObject(message.migratableResource, options); return object; }; /** - * Converts this BatchMigrateResourcesRequest to JSON. + * Converts this MigrateResourceResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @instance * @returns {Object.} JSON object */ - BatchMigrateResourcesRequest.prototype.toJSON = function toJSON() { + MigrateResourceResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchMigrateResourcesRequest + * Gets the default type url for MigrateResourceResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesRequest + * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchMigrateResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrateResourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceResponse"; }; - return BatchMigrateResourcesRequest; + return MigrateResourceResponse; })(); - v1.MigrateResourceRequest = (function() { + v1.BatchMigrateResourcesOperationMetadata = (function() { /** - * Properties of a MigrateResourceRequest. + * Properties of a BatchMigrateResourcesOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IMigrateResourceRequest - * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig|null} [migrateMlEngineModelVersionConfig] MigrateResourceRequest migrateMlEngineModelVersionConfig - * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig|null} [migrateAutomlModelConfig] MigrateResourceRequest migrateAutomlModelConfig - * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig|null} [migrateAutomlDatasetConfig] MigrateResourceRequest migrateAutomlDatasetConfig - * @property {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig|null} [migrateDataLabelingDatasetConfig] MigrateResourceRequest migrateDataLabelingDatasetConfig + * @interface IBatchMigrateResourcesOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] BatchMigrateResourcesOperationMetadata genericMetadata + * @property {Array.|null} [partialResults] BatchMigrateResourcesOperationMetadata partialResults */ /** - * Constructs a new MigrateResourceRequest. + * Constructs a new BatchMigrateResourcesOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MigrateResourceRequest. - * @implements IMigrateResourceRequest + * @classdesc Represents a BatchMigrateResourcesOperationMetadata. + * @implements IBatchMigrateResourcesOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata=} [properties] Properties to set */ - function MigrateResourceRequest(properties) { + function BatchMigrateResourcesOperationMetadata(properties) { + this.partialResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -119411,131 +123607,92 @@ } /** - * MigrateResourceRequest migrateMlEngineModelVersionConfig. - * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig|null|undefined} migrateMlEngineModelVersionConfig - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @instance - */ - MigrateResourceRequest.prototype.migrateMlEngineModelVersionConfig = null; - - /** - * MigrateResourceRequest migrateAutomlModelConfig. - * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig|null|undefined} migrateAutomlModelConfig - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @instance - */ - MigrateResourceRequest.prototype.migrateAutomlModelConfig = null; - - /** - * MigrateResourceRequest migrateAutomlDatasetConfig. - * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig|null|undefined} migrateAutomlDatasetConfig - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @instance - */ - MigrateResourceRequest.prototype.migrateAutomlDatasetConfig = null; - - /** - * MigrateResourceRequest migrateDataLabelingDatasetConfig. - * @member {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig|null|undefined} migrateDataLabelingDatasetConfig - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * BatchMigrateResourcesOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @instance */ - MigrateResourceRequest.prototype.migrateDataLabelingDatasetConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + BatchMigrateResourcesOperationMetadata.prototype.genericMetadata = null; /** - * MigrateResourceRequest request. - * @member {"migrateMlEngineModelVersionConfig"|"migrateAutomlModelConfig"|"migrateAutomlDatasetConfig"|"migrateDataLabelingDatasetConfig"|undefined} request - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * BatchMigrateResourcesOperationMetadata partialResults. + * @member {Array.} partialResults + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @instance */ - Object.defineProperty(MigrateResourceRequest.prototype, "request", { - get: $util.oneOfGetter($oneOfFields = ["migrateMlEngineModelVersionConfig", "migrateAutomlModelConfig", "migrateAutomlDatasetConfig", "migrateDataLabelingDatasetConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); + BatchMigrateResourcesOperationMetadata.prototype.partialResults = $util.emptyArray; /** - * Creates a new MigrateResourceRequest instance using the specified properties. + * Creates a new BatchMigrateResourcesOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest instance + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata instance */ - MigrateResourceRequest.create = function create(properties) { - return new MigrateResourceRequest(properties); + BatchMigrateResourcesOperationMetadata.create = function create(properties) { + return new BatchMigrateResourcesOperationMetadata(properties); }; /** - * Encodes the specified MigrateResourceRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest} message MigrateResourceRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateResourceRequest.encode = function encode(message, writer) { + BatchMigrateResourcesOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.migrateMlEngineModelVersionConfig != null && Object.hasOwnProperty.call(message, "migrateMlEngineModelVersionConfig")) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.encode(message.migrateMlEngineModelVersionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.migrateAutomlModelConfig != null && Object.hasOwnProperty.call(message, "migrateAutomlModelConfig")) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.encode(message.migrateAutomlModelConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.migrateAutomlDatasetConfig != null && Object.hasOwnProperty.call(message, "migrateAutomlDatasetConfig")) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.encode(message.migrateAutomlDatasetConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.migrateDataLabelingDatasetConfig != null && Object.hasOwnProperty.call(message, "migrateDataLabelingDatasetConfig")) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.encode(message.migrateDataLabelingDatasetConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partialResults != null && message.partialResults.length) + for (var i = 0; i < message.partialResults.length; ++i) + $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.encode(message.partialResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MigrateResourceRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.verify|verify} messages. + * Encodes the specified BatchMigrateResourcesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceRequest} message MigrateResourceRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchMigrateResourcesOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateResourceRequest message from the specified reader or buffer. + * Decodes a BatchMigrateResourcesOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateResourceRequest.decode = function decode(reader, length) { + BatchMigrateResourcesOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.decode(reader, reader.uint32()); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } case 2: { - message.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.decode(reader, reader.uint32()); + if (!(message.partialResults && message.partialResults.length)) + message.partialResults = []; + message.partialResults.push($root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.decode(reader, reader.uint32())); break; } default: @@ -119547,191 +123704,153 @@ }; /** - * Decodes a MigrateResourceRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchMigrateResourcesOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateResourceRequest.decodeDelimited = function decodeDelimited(reader) { + BatchMigrateResourcesOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateResourceRequest message. + * Verifies a BatchMigrateResourcesOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateResourceRequest.verify = function verify(message) { + BatchMigrateResourcesOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.migrateMlEngineModelVersionConfig != null && message.hasOwnProperty("migrateMlEngineModelVersionConfig")) { - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify(message.migrateMlEngineModelVersionConfig); - if (error) - return "migrateMlEngineModelVersionConfig." + error; - } - } - if (message.migrateAutomlModelConfig != null && message.hasOwnProperty("migrateAutomlModelConfig")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify(message.migrateAutomlModelConfig); - if (error) - return "migrateAutomlModelConfig." + error; - } - } - if (message.migrateAutomlDatasetConfig != null && message.hasOwnProperty("migrateAutomlDatasetConfig")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify(message.migrateAutomlDatasetConfig); - if (error) - return "migrateAutomlDatasetConfig." + error; - } + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; } - if (message.migrateDataLabelingDatasetConfig != null && message.hasOwnProperty("migrateDataLabelingDatasetConfig")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify(message.migrateDataLabelingDatasetConfig); + if (message.partialResults != null && message.hasOwnProperty("partialResults")) { + if (!Array.isArray(message.partialResults)) + return "partialResults: array expected"; + for (var i = 0; i < message.partialResults.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify(message.partialResults[i]); if (error) - return "migrateDataLabelingDatasetConfig." + error; + return "partialResults." + error; } } return null; }; /** - * Creates a MigrateResourceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchMigrateResourcesOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest} MigrateResourceRequest + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata */ - MigrateResourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest) + BatchMigrateResourcesOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest(); - if (object.migrateMlEngineModelVersionConfig != null) { - if (typeof object.migrateMlEngineModelVersionConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateMlEngineModelVersionConfig: object expected"); - message.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.fromObject(object.migrateMlEngineModelVersionConfig); - } - if (object.migrateAutomlModelConfig != null) { - if (typeof object.migrateAutomlModelConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateAutomlModelConfig: object expected"); - message.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.fromObject(object.migrateAutomlModelConfig); - } - if (object.migrateAutomlDatasetConfig != null) { - if (typeof object.migrateAutomlDatasetConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateAutomlDatasetConfig: object expected"); - message.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.fromObject(object.migrateAutomlDatasetConfig); + var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); } - if (object.migrateDataLabelingDatasetConfig != null) { - if (typeof object.migrateDataLabelingDatasetConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.migrateDataLabelingDatasetConfig: object expected"); - message.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.fromObject(object.migrateDataLabelingDatasetConfig); + if (object.partialResults) { + if (!Array.isArray(object.partialResults)) + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.partialResults: array expected"); + message.partialResults = []; + for (var i = 0; i < object.partialResults.length; ++i) { + if (typeof object.partialResults[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.partialResults: object expected"); + message.partialResults[i] = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.fromObject(object.partialResults[i]); + } } return message; }; /** - * Creates a plain object from a MigrateResourceRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchMigrateResourcesOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest} message MigrateResourceRequest + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateResourceRequest.toObject = function toObject(message, options) { + BatchMigrateResourcesOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.migrateMlEngineModelVersionConfig != null && message.hasOwnProperty("migrateMlEngineModelVersionConfig")) { - object.migrateMlEngineModelVersionConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.toObject(message.migrateMlEngineModelVersionConfig, options); - if (options.oneofs) - object.request = "migrateMlEngineModelVersionConfig"; - } - if (message.migrateAutomlModelConfig != null && message.hasOwnProperty("migrateAutomlModelConfig")) { - object.migrateAutomlModelConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.toObject(message.migrateAutomlModelConfig, options); - if (options.oneofs) - object.request = "migrateAutomlModelConfig"; - } - if (message.migrateAutomlDatasetConfig != null && message.hasOwnProperty("migrateAutomlDatasetConfig")) { - object.migrateAutomlDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.toObject(message.migrateAutomlDatasetConfig, options); - if (options.oneofs) - object.request = "migrateAutomlDatasetConfig"; - } - if (message.migrateDataLabelingDatasetConfig != null && message.hasOwnProperty("migrateDataLabelingDatasetConfig")) { - object.migrateDataLabelingDatasetConfig = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.toObject(message.migrateDataLabelingDatasetConfig, options); - if (options.oneofs) - object.request = "migrateDataLabelingDatasetConfig"; + if (options.arrays || options.defaults) + object.partialResults = []; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (message.partialResults && message.partialResults.length) { + object.partialResults = []; + for (var j = 0; j < message.partialResults.length; ++j) + object.partialResults[j] = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.toObject(message.partialResults[j], options); } return object; }; /** - * Converts this MigrateResourceRequest to JSON. + * Converts this BatchMigrateResourcesOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @instance * @returns {Object.} JSON object */ - MigrateResourceRequest.prototype.toJSON = function toJSON() { + BatchMigrateResourcesOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrateResourceRequest + * Gets the default type url for BatchMigrateResourcesOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrateResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchMigrateResourcesOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata"; }; - MigrateResourceRequest.MigrateMlEngineModelVersionConfig = (function() { + BatchMigrateResourcesOperationMetadata.PartialResult = (function() { /** - * Properties of a MigrateMlEngineModelVersionConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @interface IMigrateMlEngineModelVersionConfig - * @property {string|null} [endpoint] MigrateMlEngineModelVersionConfig endpoint - * @property {string|null} [modelVersion] MigrateMlEngineModelVersionConfig modelVersion - * @property {string|null} [modelDisplayName] MigrateMlEngineModelVersionConfig modelDisplayName + * Properties of a PartialResult. + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata + * @interface IPartialResult + * @property {google.rpc.IStatus|null} [error] PartialResult error + * @property {string|null} [model] PartialResult model + * @property {string|null} [dataset] PartialResult dataset + * @property {google.cloud.aiplatform.v1.IMigrateResourceRequest|null} [request] PartialResult request */ /** - * Constructs a new MigrateMlEngineModelVersionConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @classdesc Represents a MigrateMlEngineModelVersionConfig. - * @implements IMigrateMlEngineModelVersionConfig + * Constructs a new PartialResult. + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata + * @classdesc Represents a PartialResult. + * @implements IPartialResult * @constructor - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult=} [properties] Properties to set */ - function MigrateMlEngineModelVersionConfig(properties) { + function PartialResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -119739,103 +123858,131 @@ } /** - * MigrateMlEngineModelVersionConfig endpoint. - * @member {string} endpoint - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * PartialResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @instance */ - MigrateMlEngineModelVersionConfig.prototype.endpoint = ""; + PartialResult.prototype.error = null; /** - * MigrateMlEngineModelVersionConfig modelVersion. - * @member {string} modelVersion - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * PartialResult model. + * @member {string|null|undefined} model + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @instance */ - MigrateMlEngineModelVersionConfig.prototype.modelVersion = ""; + PartialResult.prototype.model = null; /** - * MigrateMlEngineModelVersionConfig modelDisplayName. - * @member {string} modelDisplayName - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * PartialResult dataset. + * @member {string|null|undefined} dataset + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @instance */ - MigrateMlEngineModelVersionConfig.prototype.modelDisplayName = ""; + PartialResult.prototype.dataset = null; /** - * Creates a new MigrateMlEngineModelVersionConfig instance using the specified properties. + * PartialResult request. + * @member {google.cloud.aiplatform.v1.IMigrateResourceRequest|null|undefined} request + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult + * @instance + */ + PartialResult.prototype.request = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PartialResult result. + * @member {"error"|"model"|"dataset"|undefined} result + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult + * @instance + */ + Object.defineProperty(PartialResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "model", "dataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartialResult instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig instance + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult instance */ - MigrateMlEngineModelVersionConfig.create = function create(properties) { - return new MigrateMlEngineModelVersionConfig(properties); + PartialResult.create = function create(properties) { + return new PartialResult(properties); }; /** - * Encodes the specified MigrateMlEngineModelVersionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify|verify} messages. + * Encodes the specified PartialResult message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult} message PartialResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateMlEngineModelVersionConfig.encode = function encode(message, writer) { + PartialResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); - if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelVersion); - if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelDisplayName); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.aiplatform.v1.MigrateResourceRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataset); return writer; }; /** - * Encodes the specified MigrateMlEngineModelVersionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig.verify|verify} messages. + * Encodes the specified PartialResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult} message PartialResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateMlEngineModelVersionConfig.encodeDelimited = function encodeDelimited(message, writer) { + PartialResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateMlEngineModelVersionConfig message from the specified reader or buffer. + * Decodes a PartialResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateMlEngineModelVersionConfig.decode = function decode(reader, length) { + PartialResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.endpoint = reader.string(); - break; - } case 2: { - message.modelVersion = reader.string(); + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; } case 3: { - message.modelDisplayName = reader.string(); + message.model = reader.string(); + break; + } + case 4: { + message.dataset = reader.string(); + break; + } + case 1: { + message.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.decode(reader, reader.uint32()); break; } default: @@ -119847,140 +123994,668 @@ }; /** - * Decodes a MigrateMlEngineModelVersionConfig message from the specified reader or buffer, length delimited. + * Decodes a PartialResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateMlEngineModelVersionConfig.decodeDelimited = function decodeDelimited(reader) { + PartialResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateMlEngineModelVersionConfig message. + * Verifies a PartialResult message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateMlEngineModelVersionConfig.verify = function verify(message) { + PartialResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.endpoint != null && message.hasOwnProperty("endpoint")) - if (!$util.isString(message.endpoint)) - return "endpoint: string expected"; - if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) - if (!$util.isString(message.modelVersion)) - return "modelVersion: string expected"; - if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) - if (!$util.isString(message.modelDisplayName)) - return "modelDisplayName: string expected"; + var properties = {}; + 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.model != null && message.hasOwnProperty("model")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + if (!$util.isString(message.model)) + return "model: string expected"; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + } + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.verify(message.request); + if (error) + return "request." + error; + } return null; }; /** - * Creates a MigrateMlEngineModelVersionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PartialResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} MigrateMlEngineModelVersionConfig + * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult */ - MigrateMlEngineModelVersionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig) + PartialResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult) return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig(); - if (object.endpoint != null) - message.endpoint = String(object.endpoint); - if (object.modelVersion != null) - message.modelVersion = String(object.modelVersion); - if (object.modelDisplayName != null) - message.modelDisplayName = String(object.modelDisplayName); + var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.model != null) + message.model = String(object.model); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.request: object expected"); + message.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.fromObject(object.request); + } return message; }; /** - * Creates a plain object from a MigrateMlEngineModelVersionConfig message. Also converts values to other types if specified. + * Creates a plain object from a PartialResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig} message MigrateMlEngineModelVersionConfig + * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} message PartialResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateMlEngineModelVersionConfig.toObject = function toObject(message, options) { + PartialResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.endpoint = ""; - object.modelVersion = ""; - object.modelDisplayName = ""; + if (options.defaults) + object.request = null; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.toObject(message.request, options); + 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.model != null && message.hasOwnProperty("model")) { + object.model = message.model; + if (options.oneofs) + object.result = "model"; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) { + object.dataset = message.dataset; + if (options.oneofs) + object.result = "dataset"; + } + return object; + }; + + /** + * Converts this PartialResult to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult + * @instance + * @returns {Object.} JSON object + */ + PartialResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartialResult + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartialResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult"; + }; + + return PartialResult; + })(); + + return BatchMigrateResourcesOperationMetadata; + })(); + + v1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.aiplatform.v1 + * @interface IModelEvaluation + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {string|null} [metricsSchemaUri] ModelEvaluation metricsSchemaUri + * @property {google.protobuf.IValue|null} [metrics] ModelEvaluation metrics + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {Array.|null} [sliceDimensions] ModelEvaluation sliceDimensions + * @property {string|null} [dataItemSchemaUri] ModelEvaluation dataItemSchemaUri + * @property {string|null} [annotationSchemaUri] ModelEvaluation annotationSchemaUri + * @property {google.cloud.aiplatform.v1.IModelExplanation|null} [modelExplanation] ModelEvaluation modelExplanation + * @property {Array.|null} [explanationSpecs] ModelEvaluation explanationSpecs + * @property {google.protobuf.IValue|null} [metadata] ModelEvaluation metadata + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.aiplatform.v1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + this.sliceDimensions = []; + this.explanationSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation metricsSchemaUri. + * @member {string} metricsSchemaUri + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.metricsSchemaUri = ""; + + /** + * ModelEvaluation metrics. + * @member {google.protobuf.IValue|null|undefined} metrics + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.metrics = null; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation sliceDimensions. + * @member {Array.} sliceDimensions + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.sliceDimensions = $util.emptyArray; + + /** + * ModelEvaluation dataItemSchemaUri. + * @member {string} dataItemSchemaUri + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.dataItemSchemaUri = ""; + + /** + * ModelEvaluation annotationSchemaUri. + * @member {string} annotationSchemaUri + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSchemaUri = ""; + + /** + * ModelEvaluation modelExplanation. + * @member {google.cloud.aiplatform.v1.IModelExplanation|null|undefined} modelExplanation + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.modelExplanation = null; + + /** + * ModelEvaluation explanationSpecs. + * @member {Array.} explanationSpecs + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.explanationSpecs = $util.emptyArray; + + /** + * ModelEvaluation metadata. + * @member {google.protobuf.IValue|null|undefined} metadata + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.metadata = null; + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.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.metricsSchemaUri != null && Object.hasOwnProperty.call(message, "metricsSchemaUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metricsSchemaUri); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.protobuf.Value.encode(message.metrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sliceDimensions != null && message.sliceDimensions.length) + for (var i = 0; i < message.sliceDimensions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sliceDimensions[i]); + if (message.dataItemSchemaUri != null && Object.hasOwnProperty.call(message, "dataItemSchemaUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataItemSchemaUri); + if (message.annotationSchemaUri != null && Object.hasOwnProperty.call(message, "annotationSchemaUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.annotationSchemaUri); + if (message.modelExplanation != null && Object.hasOwnProperty.call(message, "modelExplanation")) + $root.google.cloud.aiplatform.v1.ModelExplanation.encode(message.modelExplanation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.explanationSpecs != null && message.explanationSpecs.length) + for (var i = 0; i < message.explanationSpecs.length; ++i) + $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.encode(message.explanationSpecs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Value.encode(message.metadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 2: { + message.metricsSchemaUri = reader.string(); + break; + } + case 3: { + message.metrics = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.sliceDimensions && message.sliceDimensions.length)) + message.sliceDimensions = []; + message.sliceDimensions.push(reader.string()); + break; + } + case 6: { + message.dataItemSchemaUri = reader.string(); + break; + } + case 7: { + message.annotationSchemaUri = reader.string(); + break; + } + case 8: { + message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.explanationSpecs && message.explanationSpecs.length)) + message.explanationSpecs = []; + message.explanationSpecs.push($root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.decode(reader, reader.uint32())); + break; + } + case 11: { + message.metadata = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.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.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) + if (!$util.isString(message.metricsSchemaUri)) + return "metricsSchemaUri: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.protobuf.Value.verify(message.metrics); + if (error) + return "metrics." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sliceDimensions != null && message.hasOwnProperty("sliceDimensions")) { + if (!Array.isArray(message.sliceDimensions)) + return "sliceDimensions: array expected"; + for (var i = 0; i < message.sliceDimensions.length; ++i) + if (!$util.isString(message.sliceDimensions[i])) + return "sliceDimensions: string[] expected"; + } + if (message.dataItemSchemaUri != null && message.hasOwnProperty("dataItemSchemaUri")) + if (!$util.isString(message.dataItemSchemaUri)) + return "dataItemSchemaUri: string expected"; + if (message.annotationSchemaUri != null && message.hasOwnProperty("annotationSchemaUri")) + if (!$util.isString(message.annotationSchemaUri)) + return "annotationSchemaUri: string expected"; + if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) { + var error = $root.google.cloud.aiplatform.v1.ModelExplanation.verify(message.modelExplanation); + if (error) + return "modelExplanation." + error; + } + if (message.explanationSpecs != null && message.hasOwnProperty("explanationSpecs")) { + if (!Array.isArray(message.explanationSpecs)) + return "explanationSpecs: array expected"; + for (var i = 0; i < message.explanationSpecs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify(message.explanationSpecs[i]); + if (error) + return "explanationSpecs." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Value.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluation) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluation(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.metricsSchemaUri != null) + message.metricsSchemaUri = String(object.metricsSchemaUri); + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.metrics: object expected"); + message.metrics = $root.google.protobuf.Value.fromObject(object.metrics); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sliceDimensions) { + if (!Array.isArray(object.sliceDimensions)) + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.sliceDimensions: array expected"); + message.sliceDimensions = []; + for (var i = 0; i < object.sliceDimensions.length; ++i) + message.sliceDimensions[i] = String(object.sliceDimensions[i]); + } + if (object.dataItemSchemaUri != null) + message.dataItemSchemaUri = String(object.dataItemSchemaUri); + if (object.annotationSchemaUri != null) + message.annotationSchemaUri = String(object.annotationSchemaUri); + if (object.modelExplanation != null) { + if (typeof object.modelExplanation !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.modelExplanation: object expected"); + message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.fromObject(object.modelExplanation); + } + if (object.explanationSpecs) { + if (!Array.isArray(object.explanationSpecs)) + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.explanationSpecs: array expected"); + message.explanationSpecs = []; + for (var i = 0; i < object.explanationSpecs.length; ++i) { + if (typeof object.explanationSpecs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.explanationSpecs: object expected"); + message.explanationSpecs[i] = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.fromObject(object.explanationSpecs[i]); } - if (message.endpoint != null && message.hasOwnProperty("endpoint")) - object.endpoint = message.endpoint; - if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) - object.modelVersion = message.modelVersion; - if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) - object.modelDisplayName = message.modelDisplayName; - return object; - }; + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.metadata: object expected"); + message.metadata = $root.google.protobuf.Value.fromObject(object.metadata); + } + return message; + }; - /** - * Converts this MigrateMlEngineModelVersionConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig - * @instance - * @returns {Object.} JSON object - */ - MigrateMlEngineModelVersionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sliceDimensions = []; + object.explanationSpecs = []; + } + if (options.defaults) { + object.name = ""; + object.metricsSchemaUri = ""; + object.metrics = null; + object.createTime = null; + object.dataItemSchemaUri = ""; + object.annotationSchemaUri = ""; + object.modelExplanation = null; + object.displayName = ""; + object.metadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) + object.metricsSchemaUri = message.metricsSchemaUri; + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.protobuf.Value.toObject(message.metrics, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.sliceDimensions && message.sliceDimensions.length) { + object.sliceDimensions = []; + for (var j = 0; j < message.sliceDimensions.length; ++j) + object.sliceDimensions[j] = message.sliceDimensions[j]; + } + if (message.dataItemSchemaUri != null && message.hasOwnProperty("dataItemSchemaUri")) + object.dataItemSchemaUri = message.dataItemSchemaUri; + if (message.annotationSchemaUri != null && message.hasOwnProperty("annotationSchemaUri")) + object.annotationSchemaUri = message.annotationSchemaUri; + if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) + object.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.toObject(message.modelExplanation, options); + if (message.explanationSpecs && message.explanationSpecs.length) { + object.explanationSpecs = []; + for (var j = 0; j < message.explanationSpecs.length; ++j) + object.explanationSpecs[j] = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.toObject(message.explanationSpecs[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Value.toObject(message.metadata, options); + return object; + }; - /** - * Gets the default type url for MigrateMlEngineModelVersionConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrateMlEngineModelVersionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateMlEngineModelVersionConfig"; - }; + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return MigrateMlEngineModelVersionConfig; - })(); + /** + * Gets the default type url for ModelEvaluation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluation"; + }; - MigrateResourceRequest.MigrateAutomlModelConfig = (function() { + ModelEvaluation.ModelEvaluationExplanationSpec = (function() { /** - * Properties of a MigrateAutomlModelConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @interface IMigrateAutomlModelConfig - * @property {string|null} [model] MigrateAutomlModelConfig model - * @property {string|null} [modelDisplayName] MigrateAutomlModelConfig modelDisplayName + * Properties of a ModelEvaluationExplanationSpec. + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @interface IModelEvaluationExplanationSpec + * @property {string|null} [explanationType] ModelEvaluationExplanationSpec explanationType + * @property {google.cloud.aiplatform.v1.IExplanationSpec|null} [explanationSpec] ModelEvaluationExplanationSpec explanationSpec */ /** - * Constructs a new MigrateAutomlModelConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @classdesc Represents a MigrateAutomlModelConfig. - * @implements IMigrateAutomlModelConfig + * Constructs a new ModelEvaluationExplanationSpec. + * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @classdesc Represents a ModelEvaluationExplanationSpec. + * @implements IModelEvaluationExplanationSpec * @constructor - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec=} [properties] Properties to set */ - function MigrateAutomlModelConfig(properties) { + function ModelEvaluationExplanationSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -119988,89 +124663,89 @@ } /** - * MigrateAutomlModelConfig model. - * @member {string} model - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * ModelEvaluationExplanationSpec explanationType. + * @member {string} explanationType + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @instance */ - MigrateAutomlModelConfig.prototype.model = ""; + ModelEvaluationExplanationSpec.prototype.explanationType = ""; /** - * MigrateAutomlModelConfig modelDisplayName. - * @member {string} modelDisplayName - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * ModelEvaluationExplanationSpec explanationSpec. + * @member {google.cloud.aiplatform.v1.IExplanationSpec|null|undefined} explanationSpec + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @instance */ - MigrateAutomlModelConfig.prototype.modelDisplayName = ""; + ModelEvaluationExplanationSpec.prototype.explanationSpec = null; /** - * Creates a new MigrateAutomlModelConfig instance using the specified properties. + * Creates a new ModelEvaluationExplanationSpec instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig instance + * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec instance */ - MigrateAutomlModelConfig.create = function create(properties) { - return new MigrateAutomlModelConfig(properties); + ModelEvaluationExplanationSpec.create = function create(properties) { + return new ModelEvaluationExplanationSpec(properties); }; /** - * Encodes the specified MigrateAutomlModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify|verify} messages. + * Encodes the specified ModelEvaluationExplanationSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig} message MigrateAutomlModelConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateAutomlModelConfig.encode = function encode(message, writer) { + ModelEvaluationExplanationSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); - if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelDisplayName); + if (message.explanationType != null && Object.hasOwnProperty.call(message, "explanationType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.explanationType); + if (message.explanationSpec != null && Object.hasOwnProperty.call(message, "explanationSpec")) + $root.google.cloud.aiplatform.v1.ExplanationSpec.encode(message.explanationSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MigrateAutomlModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig.verify|verify} messages. + * Encodes the specified ModelEvaluationExplanationSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlModelConfig} message MigrateAutomlModelConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateAutomlModelConfig.encodeDelimited = function encodeDelimited(message, writer) { + ModelEvaluationExplanationSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateAutomlModelConfig message from the specified reader or buffer. + * Decodes a ModelEvaluationExplanationSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateAutomlModelConfig.decode = function decode(reader, length) { + ModelEvaluationExplanationSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.model = reader.string(); + message.explanationType = reader.string(); break; } case 2: { - message.modelDisplayName = reader.string(); + message.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.decode(reader, reader.uint32()); break; } default: @@ -120082,361 +124757,477 @@ }; /** - * Decodes a MigrateAutomlModelConfig message from the specified reader or buffer, length delimited. + * Decodes a ModelEvaluationExplanationSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateAutomlModelConfig.decodeDelimited = function decodeDelimited(reader) { + ModelEvaluationExplanationSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateAutomlModelConfig message. + * Verifies a ModelEvaluationExplanationSpec message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateAutomlModelConfig.verify = function verify(message) { + ModelEvaluationExplanationSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) - if (!$util.isString(message.modelDisplayName)) - return "modelDisplayName: string expected"; + if (message.explanationType != null && message.hasOwnProperty("explanationType")) + if (!$util.isString(message.explanationType)) + return "explanationType: string expected"; + if (message.explanationSpec != null && message.hasOwnProperty("explanationSpec")) { + var error = $root.google.cloud.aiplatform.v1.ExplanationSpec.verify(message.explanationSpec); + if (error) + return "explanationSpec." + error; + } return null; }; /** - * Creates a MigrateAutomlModelConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ModelEvaluationExplanationSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} MigrateAutomlModelConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec */ - MigrateAutomlModelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig) + ModelEvaluationExplanationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec) return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig(); - if (object.model != null) - message.model = String(object.model); - if (object.modelDisplayName != null) - message.modelDisplayName = String(object.modelDisplayName); + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec(); + if (object.explanationType != null) + message.explanationType = String(object.explanationType); + if (object.explanationSpec != null) { + if (typeof object.explanationSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.explanationSpec: object expected"); + message.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.fromObject(object.explanationSpec); + } return message; }; /** - * Creates a plain object from a MigrateAutomlModelConfig message. Also converts values to other types if specified. + * Creates a plain object from a ModelEvaluationExplanationSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig} message MigrateAutomlModelConfig + * @param {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateAutomlModelConfig.toObject = function toObject(message, options) { + ModelEvaluationExplanationSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.model = ""; - object.modelDisplayName = ""; + object.explanationType = ""; + object.explanationSpec = null; } - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) - object.modelDisplayName = message.modelDisplayName; + if (message.explanationType != null && message.hasOwnProperty("explanationType")) + object.explanationType = message.explanationType; + if (message.explanationSpec != null && message.hasOwnProperty("explanationSpec")) + object.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.toObject(message.explanationSpec, options); return object; }; /** - * Converts this MigrateAutomlModelConfig to JSON. + * Converts this ModelEvaluationExplanationSpec to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @instance * @returns {Object.} JSON object */ - MigrateAutomlModelConfig.prototype.toJSON = function toJSON() { + ModelEvaluationExplanationSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrateAutomlModelConfig + * Gets the default type url for ModelEvaluationExplanationSpec * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrateAutomlModelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ModelEvaluationExplanationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlModelConfig"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec"; }; - return MigrateAutomlModelConfig; + return ModelEvaluationExplanationSpec; })(); - MigrateResourceRequest.MigrateAutomlDatasetConfig = (function() { + return ModelEvaluation; + })(); - /** - * Properties of a MigrateAutomlDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @interface IMigrateAutomlDatasetConfig - * @property {string|null} [dataset] MigrateAutomlDatasetConfig dataset - * @property {string|null} [datasetDisplayName] MigrateAutomlDatasetConfig datasetDisplayName - */ + v1.ModelEvaluationSlice = (function() { - /** - * Constructs a new MigrateAutomlDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @classdesc Represents a MigrateAutomlDatasetConfig. - * @implements IMigrateAutomlDatasetConfig - * @constructor - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig=} [properties] Properties to set - */ - function MigrateAutomlDatasetConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ModelEvaluationSlice. + * @memberof google.cloud.aiplatform.v1 + * @interface IModelEvaluationSlice + * @property {string|null} [name] ModelEvaluationSlice name + * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice|null} [slice] ModelEvaluationSlice slice + * @property {string|null} [metricsSchemaUri] ModelEvaluationSlice metricsSchemaUri + * @property {google.protobuf.IValue|null} [metrics] ModelEvaluationSlice metrics + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluationSlice createTime + * @property {google.cloud.aiplatform.v1.IModelExplanation|null} [modelExplanation] ModelEvaluationSlice modelExplanation + */ - /** - * MigrateAutomlDatasetConfig dataset. - * @member {string} dataset - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @instance - */ - MigrateAutomlDatasetConfig.prototype.dataset = ""; + /** + * Constructs a new ModelEvaluationSlice. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ModelEvaluationSlice. + * @implements IModelEvaluationSlice + * @constructor + * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice=} [properties] Properties to set + */ + function ModelEvaluationSlice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MigrateAutomlDatasetConfig datasetDisplayName. - * @member {string} datasetDisplayName - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @instance - */ - MigrateAutomlDatasetConfig.prototype.datasetDisplayName = ""; + /** + * ModelEvaluationSlice name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.name = ""; - /** - * Creates a new MigrateAutomlDatasetConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig instance - */ - MigrateAutomlDatasetConfig.create = function create(properties) { - return new MigrateAutomlDatasetConfig(properties); - }; + /** + * ModelEvaluationSlice slice. + * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice|null|undefined} slice + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.slice = null; - /** - * Encodes the specified MigrateAutomlDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrateAutomlDatasetConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetDisplayName); - return writer; - }; + /** + * ModelEvaluationSlice metricsSchemaUri. + * @member {string} metricsSchemaUri + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.metricsSchemaUri = ""; - /** - * Encodes the specified MigrateAutomlDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrateAutomlDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ModelEvaluationSlice metrics. + * @member {google.protobuf.IValue|null|undefined} metrics + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.metrics = null; - /** - * Decodes a MigrateAutomlDatasetConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrateAutomlDatasetConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - case 2: { - message.datasetDisplayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * ModelEvaluationSlice createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.createTime = null; + + /** + * ModelEvaluationSlice modelExplanation. + * @member {google.cloud.aiplatform.v1.IModelExplanation|null|undefined} modelExplanation + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + */ + ModelEvaluationSlice.prototype.modelExplanation = null; + + /** + * Creates a new ModelEvaluationSlice instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice instance + */ + ModelEvaluationSlice.create = function create(properties) { + return new ModelEvaluationSlice(properties); + }; + + /** + * Encodes the specified ModelEvaluationSlice message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice} message ModelEvaluationSlice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluationSlice.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.slice != null && Object.hasOwnProperty.call(message, "slice")) + $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.encode(message.slice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metricsSchemaUri != null && Object.hasOwnProperty.call(message, "metricsSchemaUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.metricsSchemaUri); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.protobuf.Value.encode(message.metrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.modelExplanation != null && Object.hasOwnProperty.call(message, "modelExplanation")) + $root.google.cloud.aiplatform.v1.ModelExplanation.encode(message.modelExplanation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelEvaluationSlice message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice} message ModelEvaluationSlice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluationSlice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluationSlice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluationSlice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.decode(reader, reader.uint32()); + break; + } + case 3: { + message.metricsSchemaUri = reader.string(); + break; + } + case 4: { + message.metrics = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a MigrateAutomlDatasetConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrateAutomlDatasetConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a MigrateAutomlDatasetConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrateAutomlDatasetConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) - if (!$util.isString(message.datasetDisplayName)) - return "datasetDisplayName: string expected"; - return null; - }; + /** + * Decodes a ModelEvaluationSlice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluationSlice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a MigrateAutomlDatasetConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} MigrateAutomlDatasetConfig - */ - MigrateAutomlDatasetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.datasetDisplayName != null) - message.datasetDisplayName = String(object.datasetDisplayName); - return message; - }; + /** + * Verifies a ModelEvaluationSlice message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluationSlice.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.slice != null && message.hasOwnProperty("slice")) { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify(message.slice); + if (error) + return "slice." + error; + } + if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) + if (!$util.isString(message.metricsSchemaUri)) + return "metricsSchemaUri: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.protobuf.Value.verify(message.metrics); + if (error) + return "metrics." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) { + var error = $root.google.cloud.aiplatform.v1.ModelExplanation.verify(message.modelExplanation); + if (error) + return "modelExplanation." + error; + } + return null; + }; - /** - * Creates a plain object from a MigrateAutomlDatasetConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig} message MigrateAutomlDatasetConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrateAutomlDatasetConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = ""; - object.datasetDisplayName = ""; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) - object.datasetDisplayName = message.datasetDisplayName; + /** + * Creates a ModelEvaluationSlice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice + */ + ModelEvaluationSlice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice) return object; - }; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice(); + if (object.name != null) + message.name = String(object.name); + if (object.slice != null) { + if (typeof object.slice !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.slice: object expected"); + message.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.fromObject(object.slice); + } + if (object.metricsSchemaUri != null) + message.metricsSchemaUri = String(object.metricsSchemaUri); + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics: object expected"); + message.metrics = $root.google.protobuf.Value.fromObject(object.metrics); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.modelExplanation != null) { + if (typeof object.modelExplanation !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.modelExplanation: object expected"); + message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.fromObject(object.modelExplanation); + } + return message; + }; - /** - * Converts this MigrateAutomlDatasetConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @instance - * @returns {Object.} JSON object - */ - MigrateAutomlDatasetConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ModelEvaluationSlice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice} message ModelEvaluationSlice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluationSlice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.slice = null; + object.metricsSchemaUri = ""; + object.metrics = null; + object.createTime = null; + object.modelExplanation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slice != null && message.hasOwnProperty("slice")) + object.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.toObject(message.slice, options); + if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) + object.metricsSchemaUri = message.metricsSchemaUri; + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.protobuf.Value.toObject(message.metrics, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) + object.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.toObject(message.modelExplanation, options); + return object; + }; - /** - * Gets the default type url for MigrateAutomlDatasetConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrateAutomlDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateAutomlDatasetConfig"; - }; + /** + * Converts this ModelEvaluationSlice to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluationSlice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return MigrateAutomlDatasetConfig; - })(); + /** + * Gets the default type url for ModelEvaluationSlice + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluationSlice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice"; + }; - MigrateResourceRequest.MigrateDataLabelingDatasetConfig = (function() { + ModelEvaluationSlice.Slice = (function() { /** - * Properties of a MigrateDataLabelingDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @interface IMigrateDataLabelingDatasetConfig - * @property {string|null} [dataset] MigrateDataLabelingDatasetConfig dataset - * @property {string|null} [datasetDisplayName] MigrateDataLabelingDatasetConfig datasetDisplayName - * @property {Array.|null} [migrateDataLabelingAnnotatedDatasetConfigs] MigrateDataLabelingDatasetConfig migrateDataLabelingAnnotatedDatasetConfigs + * Properties of a Slice. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @interface ISlice + * @property {string|null} [dimension] Slice dimension + * @property {string|null} [value] Slice value + * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec|null} [sliceSpec] Slice sliceSpec */ /** - * Constructs a new MigrateDataLabelingDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest - * @classdesc Represents a MigrateDataLabelingDatasetConfig. - * @implements IMigrateDataLabelingDatasetConfig + * Constructs a new Slice. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice + * @classdesc Represents a Slice. + * @implements ISlice * @constructor - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice=} [properties] Properties to set */ - function MigrateDataLabelingDatasetConfig(properties) { - this.migrateDataLabelingAnnotatedDatasetConfigs = []; + function Slice(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -120444,106 +125235,103 @@ } /** - * MigrateDataLabelingDatasetConfig dataset. - * @member {string} dataset - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * Slice dimension. + * @member {string} dimension + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @instance */ - MigrateDataLabelingDatasetConfig.prototype.dataset = ""; + Slice.prototype.dimension = ""; /** - * MigrateDataLabelingDatasetConfig datasetDisplayName. - * @member {string} datasetDisplayName - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * Slice value. + * @member {string} value + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @instance */ - MigrateDataLabelingDatasetConfig.prototype.datasetDisplayName = ""; + Slice.prototype.value = ""; /** - * MigrateDataLabelingDatasetConfig migrateDataLabelingAnnotatedDatasetConfigs. - * @member {Array.} migrateDataLabelingAnnotatedDatasetConfigs - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * Slice sliceSpec. + * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec|null|undefined} sliceSpec + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @instance */ - MigrateDataLabelingDatasetConfig.prototype.migrateDataLabelingAnnotatedDatasetConfigs = $util.emptyArray; + Slice.prototype.sliceSpec = null; /** - * Creates a new MigrateDataLabelingDatasetConfig instance using the specified properties. + * Creates a new Slice instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig instance + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice instance */ - MigrateDataLabelingDatasetConfig.create = function create(properties) { - return new MigrateDataLabelingDatasetConfig(properties); + Slice.create = function create(properties) { + return new Slice(properties); }; /** - * Encodes the specified MigrateDataLabelingDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify|verify} messages. + * Encodes the specified Slice message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice} message Slice message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateDataLabelingDatasetConfig.encode = function encode(message, writer) { + Slice.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.datasetDisplayName != null && Object.hasOwnProperty.call(message, "datasetDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetDisplayName); - if (message.migrateDataLabelingAnnotatedDatasetConfigs != null && message.migrateDataLabelingAnnotatedDatasetConfigs.length) - for (var i = 0; i < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.encode(message.migrateDataLabelingAnnotatedDatasetConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimension); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.sliceSpec != null && Object.hasOwnProperty.call(message, "sliceSpec")) + $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.encode(message.sliceSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified MigrateDataLabelingDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.verify|verify} messages. + * Encodes the specified Slice message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.IMigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice} message Slice message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateDataLabelingDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { + Slice.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateDataLabelingDatasetConfig message from the specified reader or buffer. + * Decodes a Slice message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateDataLabelingDatasetConfig.decode = function decode(reader, length) { + Slice.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dataset = reader.string(); + message.dimension = reader.string(); break; } case 2: { - message.datasetDisplayName = reader.string(); + message.value = reader.string(); break; } case 3: { - if (!(message.migrateDataLabelingAnnotatedDatasetConfigs && message.migrateDataLabelingAnnotatedDatasetConfigs.length)) - message.migrateDataLabelingAnnotatedDatasetConfigs = []; - message.migrateDataLabelingAnnotatedDatasetConfigs.push($root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.decode(reader, reader.uint32())); + message.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.decode(reader, reader.uint32()); break; } default: @@ -120555,154 +125343,142 @@ }; /** - * Decodes a MigrateDataLabelingDatasetConfig message from the specified reader or buffer, length delimited. + * Decodes a Slice message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateDataLabelingDatasetConfig.decodeDelimited = function decodeDelimited(reader) { + Slice.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateDataLabelingDatasetConfig message. + * Verifies a Slice message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateDataLabelingDatasetConfig.verify = function verify(message) { + Slice.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) - if (!$util.isString(message.datasetDisplayName)) - return "datasetDisplayName: string expected"; - if (message.migrateDataLabelingAnnotatedDatasetConfigs != null && message.hasOwnProperty("migrateDataLabelingAnnotatedDatasetConfigs")) { - if (!Array.isArray(message.migrateDataLabelingAnnotatedDatasetConfigs)) - return "migrateDataLabelingAnnotatedDatasetConfigs: array expected"; - for (var i = 0; i < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify(message.migrateDataLabelingAnnotatedDatasetConfigs[i]); - if (error) - return "migrateDataLabelingAnnotatedDatasetConfigs." + error; - } + if (message.dimension != null && message.hasOwnProperty("dimension")) + if (!$util.isString(message.dimension)) + return "dimension: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.sliceSpec != null && message.hasOwnProperty("sliceSpec")) { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify(message.sliceSpec); + if (error) + return "sliceSpec." + error; } return null; }; /** - * Creates a MigrateDataLabelingDatasetConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Slice message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} MigrateDataLabelingDatasetConfig - */ - MigrateDataLabelingDatasetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.datasetDisplayName != null) - message.datasetDisplayName = String(object.datasetDisplayName); - if (object.migrateDataLabelingAnnotatedDatasetConfigs) { - if (!Array.isArray(object.migrateDataLabelingAnnotatedDatasetConfigs)) - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.migrateDataLabelingAnnotatedDatasetConfigs: array expected"); - message.migrateDataLabelingAnnotatedDatasetConfigs = []; - for (var i = 0; i < object.migrateDataLabelingAnnotatedDatasetConfigs.length; ++i) { - if (typeof object.migrateDataLabelingAnnotatedDatasetConfigs[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.migrateDataLabelingAnnotatedDatasetConfigs: object expected"); - message.migrateDataLabelingAnnotatedDatasetConfigs[i] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.fromObject(object.migrateDataLabelingAnnotatedDatasetConfigs[i]); - } + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice + */ + Slice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice(); + if (object.dimension != null) + message.dimension = String(object.dimension); + if (object.value != null) + message.value = String(object.value); + if (object.sliceSpec != null) { + if (typeof object.sliceSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.sliceSpec: object expected"); + message.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.fromObject(object.sliceSpec); } return message; }; /** - * Creates a plain object from a MigrateDataLabelingDatasetConfig message. Also converts values to other types if specified. + * Creates a plain object from a Slice message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig} message MigrateDataLabelingDatasetConfig + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} message Slice * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateDataLabelingDatasetConfig.toObject = function toObject(message, options) { + Slice.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.migrateDataLabelingAnnotatedDatasetConfigs = []; if (options.defaults) { - object.dataset = ""; - object.datasetDisplayName = ""; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.datasetDisplayName != null && message.hasOwnProperty("datasetDisplayName")) - object.datasetDisplayName = message.datasetDisplayName; - if (message.migrateDataLabelingAnnotatedDatasetConfigs && message.migrateDataLabelingAnnotatedDatasetConfigs.length) { - object.migrateDataLabelingAnnotatedDatasetConfigs = []; - for (var j = 0; j < message.migrateDataLabelingAnnotatedDatasetConfigs.length; ++j) - object.migrateDataLabelingAnnotatedDatasetConfigs[j] = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.toObject(message.migrateDataLabelingAnnotatedDatasetConfigs[j], options); + object.dimension = ""; + object.value = ""; + object.sliceSpec = null; } + if (message.dimension != null && message.hasOwnProperty("dimension")) + object.dimension = message.dimension; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.sliceSpec != null && message.hasOwnProperty("sliceSpec")) + object.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.toObject(message.sliceSpec, options); return object; }; /** - * Converts this MigrateDataLabelingDatasetConfig to JSON. + * Converts this Slice to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @instance * @returns {Object.} JSON object */ - MigrateDataLabelingDatasetConfig.prototype.toJSON = function toJSON() { + Slice.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrateDataLabelingDatasetConfig + * Gets the default type url for Slice * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrateDataLabelingDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Slice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice"; }; - MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig = (function() { + Slice.SliceSpec = (function() { /** - * Properties of a MigrateDataLabelingAnnotatedDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig - * @interface IMigrateDataLabelingAnnotatedDatasetConfig - * @property {string|null} [annotatedDataset] MigrateDataLabelingAnnotatedDatasetConfig annotatedDataset + * Properties of a SliceSpec. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @interface ISliceSpec + * @property {Object.|null} [configs] SliceSpec configs */ /** - * Constructs a new MigrateDataLabelingAnnotatedDatasetConfig. - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig - * @classdesc Represents a MigrateDataLabelingAnnotatedDatasetConfig. - * @implements IMigrateDataLabelingAnnotatedDatasetConfig + * Constructs a new SliceSpec. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @classdesc Represents a SliceSpec. + * @implements ISliceSpec * @constructor - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec=} [properties] Properties to set */ - function MigrateDataLabelingAnnotatedDatasetConfig(properties) { + function SliceSpec(properties) { + this.configs = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -120710,75 +125486,97 @@ } /** - * MigrateDataLabelingAnnotatedDatasetConfig annotatedDataset. - * @member {string} annotatedDataset - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * SliceSpec configs. + * @member {Object.} configs + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @instance */ - MigrateDataLabelingAnnotatedDatasetConfig.prototype.annotatedDataset = ""; + SliceSpec.prototype.configs = $util.emptyObject; /** - * Creates a new MigrateDataLabelingAnnotatedDatasetConfig instance using the specified properties. + * Creates a new SliceSpec instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig instance + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec instance */ - MigrateDataLabelingAnnotatedDatasetConfig.create = function create(properties) { - return new MigrateDataLabelingAnnotatedDatasetConfig(properties); + SliceSpec.create = function create(properties) { + return new SliceSpec(properties); }; /** - * Encodes the specified MigrateDataLabelingAnnotatedDatasetConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify|verify} messages. + * Encodes the specified SliceSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec} message SliceSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateDataLabelingAnnotatedDatasetConfig.encode = function encode(message, writer) { + SliceSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.annotatedDataset != null && Object.hasOwnProperty.call(message, "annotatedDataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotatedDataset); + if (message.configs != null && Object.hasOwnProperty.call(message, "configs")) + for (var keys = Object.keys(message.configs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.encode(message.configs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified MigrateDataLabelingAnnotatedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig.verify|verify} messages. + * Encodes the specified SliceSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.IMigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec} message SliceSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateDataLabelingAnnotatedDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { + SliceSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateDataLabelingAnnotatedDatasetConfig message from the specified reader or buffer. + * Decodes a SliceSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateDataLabelingAnnotatedDatasetConfig.decode = function decode(reader, length) { + SliceSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.annotatedDataset = reader.string(); + if (message.configs === $util.emptyObject) + message.configs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.configs[key] = value; break; } default: @@ -120790,354 +125588,1009 @@ }; /** - * Decodes a MigrateDataLabelingAnnotatedDatasetConfig message from the specified reader or buffer, length delimited. + * Decodes a SliceSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateDataLabelingAnnotatedDatasetConfig.decodeDelimited = function decodeDelimited(reader) { + SliceSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateDataLabelingAnnotatedDatasetConfig message. + * Verifies a SliceSpec message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateDataLabelingAnnotatedDatasetConfig.verify = function verify(message) { + SliceSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) - if (!$util.isString(message.annotatedDataset)) - return "annotatedDataset: string expected"; + if (message.configs != null && message.hasOwnProperty("configs")) { + if (!$util.isObject(message.configs)) + return "configs: object expected"; + var key = Object.keys(message.configs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify(message.configs[key[i]]); + if (error) + return "configs." + error; + } + } return null; }; /** - * Creates a MigrateDataLabelingAnnotatedDatasetConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SliceSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} MigrateDataLabelingAnnotatedDatasetConfig + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec */ - MigrateDataLabelingAnnotatedDatasetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig) + SliceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec) return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig(); - if (object.annotatedDataset != null) - message.annotatedDataset = String(object.annotatedDataset); + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec(); + if (object.configs) { + if (typeof object.configs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.configs: object expected"); + message.configs = {}; + for (var keys = Object.keys(object.configs), i = 0; i < keys.length; ++i) { + if (typeof object.configs[keys[i]] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.configs: object expected"); + message.configs[keys[i]] = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.fromObject(object.configs[keys[i]]); + } + } return message; }; /** - * Creates a plain object from a MigrateDataLabelingAnnotatedDatasetConfig message. Also converts values to other types if specified. + * Creates a plain object from a SliceSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig} message MigrateDataLabelingAnnotatedDatasetConfig + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} message SliceSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrateDataLabelingAnnotatedDatasetConfig.toObject = function toObject(message, options) { + SliceSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.annotatedDataset = ""; - if (message.annotatedDataset != null && message.hasOwnProperty("annotatedDataset")) - object.annotatedDataset = message.annotatedDataset; + if (options.objects || options.defaults) + object.configs = {}; + var keys2; + if (message.configs && (keys2 = Object.keys(message.configs)).length) { + object.configs = {}; + for (var j = 0; j < keys2.length; ++j) + object.configs[keys2[j]] = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.toObject(message.configs[keys2[j]], options); + } return object; }; /** - * Converts this MigrateDataLabelingAnnotatedDatasetConfig to JSON. + * Converts this SliceSpec to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @instance * @returns {Object.} JSON object */ - MigrateDataLabelingAnnotatedDatasetConfig.prototype.toJSON = function toJSON() { + SliceSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrateDataLabelingAnnotatedDatasetConfig + * Gets the default type url for SliceSpec * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrateDataLabelingAnnotatedDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SliceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceRequest.MigrateDataLabelingDatasetConfig.MigrateDataLabelingAnnotatedDatasetConfig"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec"; }; - return MigrateDataLabelingAnnotatedDatasetConfig; + SliceSpec.SliceConfig = (function() { + + /** + * Properties of a SliceConfig. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @interface ISliceConfig + * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue|null} [value] SliceConfig value + * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange|null} [range] SliceConfig range + * @property {google.protobuf.IBoolValue|null} [allValues] SliceConfig allValues + */ + + /** + * Constructs a new SliceConfig. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @classdesc Represents a SliceConfig. + * @implements ISliceConfig + * @constructor + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig=} [properties] Properties to set + */ + function SliceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SliceConfig value. + * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue|null|undefined} value + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @instance + */ + SliceConfig.prototype.value = null; + + /** + * SliceConfig range. + * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange|null|undefined} range + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @instance + */ + SliceConfig.prototype.range = null; + + /** + * SliceConfig allValues. + * @member {google.protobuf.IBoolValue|null|undefined} allValues + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @instance + */ + SliceConfig.prototype.allValues = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SliceConfig kind. + * @member {"value"|"range"|"allValues"|undefined} kind + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @instance + */ + Object.defineProperty(SliceConfig.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["value", "range", "allValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SliceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig instance + */ + SliceConfig.create = function create(properties) { + return new SliceConfig(properties); + }; + + /** + * Encodes the specified SliceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig} message SliceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SliceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.encode(message.value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) + $root.google.protobuf.BoolValue.encode(message.allValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SliceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig} message SliceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SliceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SliceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SliceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allValues = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SliceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SliceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SliceConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SliceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.kind = 1; + { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify(message.value); + if (error) + return "value." + error; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify(message.range); + if (error) + return "range." + error; + } + } + if (message.allValues != null && message.hasOwnProperty("allValues")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.BoolValue.verify(message.allValues); + if (error) + return "allValues." + error; + } + } + return null; + }; + + /** + * Creates a SliceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig + */ + SliceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig(); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.value: object expected"); + message.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.fromObject(object.value); + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.range: object expected"); + message.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.fromObject(object.range); + } + if (object.allValues != null) { + if (typeof object.allValues !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.allValues: object expected"); + message.allValues = $root.google.protobuf.BoolValue.fromObject(object.allValues); + } + return message; + }; + + /** + * Creates a plain object from a SliceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} message SliceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SliceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.toObject(message.value, options); + if (options.oneofs) + object.kind = "value"; + } + if (message.range != null && message.hasOwnProperty("range")) { + object.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.toObject(message.range, options); + if (options.oneofs) + object.kind = "range"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) { + object.allValues = $root.google.protobuf.BoolValue.toObject(message.allValues, options); + if (options.oneofs) + object.kind = "allValues"; + } + return object; + }; + + /** + * Converts this SliceConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @instance + * @returns {Object.} JSON object + */ + SliceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SliceConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SliceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig"; + }; + + return SliceConfig; + })(); + + SliceSpec.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @interface IRange + * @property {number|null} [low] Range low + * @property {number|null} [high] Range high + */ + + /** + * Constructs a new Range. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range low. + * @member {number} low + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @instance + */ + Range.prototype.low = 0; + + /** + * Range high. + * @member {number} high + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @instance + */ + Range.prototype.high = 0; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.low != null && Object.hasOwnProperty.call(message, "low")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.low); + if (message.high != null && Object.hasOwnProperty.call(message, "high")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.high); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.low = reader.float(); + break; + } + case 2: { + message.high = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.low != null && message.hasOwnProperty("low")) + if (typeof message.low !== "number") + return "low: number expected"; + if (message.high != null && message.hasOwnProperty("high")) + if (typeof message.high !== "number") + return "high: number expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range(); + if (object.low != null) + message.low = Number(object.low); + if (object.high != null) + message.high = Number(object.high); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.low = 0; + object.high = 0; + } + if (message.low != null && message.hasOwnProperty("low")) + object.low = options.json && !isFinite(message.low) ? String(message.low) : message.low; + if (message.high != null && message.hasOwnProperty("high")) + object.high = options.json && !isFinite(message.high) ? String(message.high) : message.high; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range"; + }; + + return Range; + })(); + + SliceSpec.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @interface IValue + * @property {string|null} [stringValue] Value stringValue + * @property {number|null} [floatValue] Value floatValue + */ + + /** + * Constructs a new Value. + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @instance + */ + Value.prototype.floatValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"stringValue"|"floatValue"|undefined} kind + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "floatValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.floatValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + case 2: { + message.floatValue = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.kind = "floatValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value"; + }; + + return Value; + })(); + + return SliceSpec; })(); - return MigrateDataLabelingDatasetConfig; + return Slice; })(); - return MigrateResourceRequest; - })(); - - v1.BatchMigrateResourcesResponse = (function() { + return ModelEvaluationSlice; + })(); - /** - * Properties of a BatchMigrateResourcesResponse. - * @memberof google.cloud.aiplatform.v1 - * @interface IBatchMigrateResourcesResponse - * @property {Array.|null} [migrateResourceResponses] BatchMigrateResourcesResponse migrateResourceResponses - */ + v1.ModelGardenService = (function() { /** - * Constructs a new BatchMigrateResourcesResponse. + * Constructs a new ModelGardenService service. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchMigrateResourcesResponse. - * @implements IBatchMigrateResourcesResponse + * @classdesc Represents a ModelGardenService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse=} [properties] Properties to set + * @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 BatchMigrateResourcesResponse(properties) { - this.migrateResourceResponses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function ModelGardenService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * BatchMigrateResourcesResponse migrateResourceResponses. - * @member {Array.} migrateResourceResponses - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @instance - */ - BatchMigrateResourcesResponse.prototype.migrateResourceResponses = $util.emptyArray; + (ModelGardenService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelGardenService; /** - * Creates a new BatchMigrateResourcesResponse instance using the specified properties. + * Creates new ModelGardenService service using the specified rpc implementation. * @function create - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse instance - */ - BatchMigrateResourcesResponse.create = function create(properties) { - return new BatchMigrateResourcesResponse(properties); - }; - - /** - * Encodes the specified BatchMigrateResourcesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse} message BatchMigrateResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchMigrateResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.migrateResourceResponses != null && message.migrateResourceResponses.length) - for (var i = 0; i < message.migrateResourceResponses.length; ++i) - $root.google.cloud.aiplatform.v1.MigrateResourceResponse.encode(message.migrateResourceResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchMigrateResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesResponse} message BatchMigrateResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchMigrateResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchMigrateResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchMigrateResourcesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.migrateResourceResponses && message.migrateResourceResponses.length)) - message.migrateResourceResponses = []; - message.migrateResourceResponses.push($root.google.cloud.aiplatform.v1.MigrateResourceResponse.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchMigrateResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchMigrateResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchMigrateResourcesResponse message. - * @function verify - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse + * @memberof google.cloud.aiplatform.v1.ModelGardenService * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * @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 {ModelGardenService} RPC service. Useful where requests and/or responses are streamed. */ - BatchMigrateResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.migrateResourceResponses != null && message.hasOwnProperty("migrateResourceResponses")) { - if (!Array.isArray(message.migrateResourceResponses)) - return "migrateResourceResponses: array expected"; - for (var i = 0; i < message.migrateResourceResponses.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.verify(message.migrateResourceResponses[i]); - if (error) - return "migrateResourceResponses." + error; - } - } - return null; + ModelGardenService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Creates a BatchMigrateResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} BatchMigrateResourcesResponse + * Callback as used by {@link google.cloud.aiplatform.v1.ModelGardenService|getPublisherModel}. + * @memberof google.cloud.aiplatform.v1.ModelGardenService + * @typedef GetPublisherModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.PublisherModel} [response] PublisherModel */ - BatchMigrateResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse) - return object; - var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse(); - if (object.migrateResourceResponses) { - if (!Array.isArray(object.migrateResourceResponses)) - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.migrateResourceResponses: array expected"); - message.migrateResourceResponses = []; - for (var i = 0; i < object.migrateResourceResponses.length; ++i) { - if (typeof object.migrateResourceResponses[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesResponse.migrateResourceResponses: object expected"); - message.migrateResourceResponses[i] = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.fromObject(object.migrateResourceResponses[i]); - } - } - return message; - }; /** - * Creates a plain object from a BatchMigrateResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesResponse} message BatchMigrateResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetPublisherModel. + * @function getPublisherModel + * @memberof google.cloud.aiplatform.v1.ModelGardenService + * @instance + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest} request GetPublisherModelRequest message or plain object + * @param {google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModelCallback} callback Node-style callback called with the error, if any, and PublisherModel + * @returns {undefined} + * @variation 1 */ - BatchMigrateResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.migrateResourceResponses = []; - if (message.migrateResourceResponses && message.migrateResourceResponses.length) { - object.migrateResourceResponses = []; - for (var j = 0; j < message.migrateResourceResponses.length; ++j) - object.migrateResourceResponses[j] = $root.google.cloud.aiplatform.v1.MigrateResourceResponse.toObject(message.migrateResourceResponses[j], options); - } - return object; - }; + Object.defineProperty(ModelGardenService.prototype.getPublisherModel = function getPublisherModel(request, callback) { + return this.rpcCall(getPublisherModel, $root.google.cloud.aiplatform.v1.GetPublisherModelRequest, $root.google.cloud.aiplatform.v1.PublisherModel, request, callback); + }, "name", { value: "GetPublisherModel" }); /** - * Converts this BatchMigrateResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse + * Calls GetPublisherModel. + * @function getPublisherModel + * @memberof google.cloud.aiplatform.v1.ModelGardenService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest} request GetPublisherModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchMigrateResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for BatchMigrateResourcesResponse - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchMigrateResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesResponse"; - }; + return ModelGardenService; + })(); - return BatchMigrateResourcesResponse; + /** + * PublisherModelView enum. + * @name google.cloud.aiplatform.v1.PublisherModelView + * @enum {number} + * @property {number} PUBLISHER_MODEL_VIEW_UNSPECIFIED=0 PUBLISHER_MODEL_VIEW_UNSPECIFIED value + * @property {number} PUBLISHER_MODEL_VIEW_BASIC=1 PUBLISHER_MODEL_VIEW_BASIC value + * @property {number} PUBLISHER_MODEL_VIEW_FULL=2 PUBLISHER_MODEL_VIEW_FULL value + * @property {number} PUBLISHER_MODEL_VERSION_VIEW_BASIC=3 PUBLISHER_MODEL_VERSION_VIEW_BASIC value + */ + v1.PublisherModelView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PUBLISHER_MODEL_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUBLISHER_MODEL_VIEW_BASIC"] = 1; + values[valuesById[2] = "PUBLISHER_MODEL_VIEW_FULL"] = 2; + values[valuesById[3] = "PUBLISHER_MODEL_VERSION_VIEW_BASIC"] = 3; + return values; })(); - v1.MigrateResourceResponse = (function() { + v1.GetPublisherModelRequest = (function() { /** - * Properties of a MigrateResourceResponse. + * Properties of a GetPublisherModelRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IMigrateResourceResponse - * @property {string|null} [dataset] MigrateResourceResponse dataset - * @property {string|null} [model] MigrateResourceResponse model - * @property {google.cloud.aiplatform.v1.IMigratableResource|null} [migratableResource] MigrateResourceResponse migratableResource + * @interface IGetPublisherModelRequest + * @property {string|null} [name] GetPublisherModelRequest name + * @property {string|null} [languageCode] GetPublisherModelRequest languageCode + * @property {google.cloud.aiplatform.v1.PublisherModelView|null} [view] GetPublisherModelRequest view */ /** - * Constructs a new MigrateResourceResponse. + * Constructs a new GetPublisherModelRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MigrateResourceResponse. - * @implements IMigrateResourceResponse + * @classdesc Represents a GetPublisherModelRequest. + * @implements IGetPublisherModelRequest * @constructor - * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest=} [properties] Properties to set */ - function MigrateResourceResponse(properties) { + function GetPublisherModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -121145,117 +126598,103 @@ } /** - * MigrateResourceResponse dataset. - * @member {string|null|undefined} dataset - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse - * @instance - */ - MigrateResourceResponse.prototype.dataset = null; - - /** - * MigrateResourceResponse model. - * @member {string|null|undefined} model - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * GetPublisherModelRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @instance */ - MigrateResourceResponse.prototype.model = null; + GetPublisherModelRequest.prototype.name = ""; /** - * MigrateResourceResponse migratableResource. - * @member {google.cloud.aiplatform.v1.IMigratableResource|null|undefined} migratableResource - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * GetPublisherModelRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @instance */ - MigrateResourceResponse.prototype.migratableResource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GetPublisherModelRequest.prototype.languageCode = ""; /** - * MigrateResourceResponse migratedResource. - * @member {"dataset"|"model"|undefined} migratedResource - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * GetPublisherModelRequest view. + * @member {google.cloud.aiplatform.v1.PublisherModelView} view + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @instance */ - Object.defineProperty(MigrateResourceResponse.prototype, "migratedResource", { - get: $util.oneOfGetter($oneOfFields = ["dataset", "model"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetPublisherModelRequest.prototype.view = 0; /** - * Creates a new MigrateResourceResponse instance using the specified properties. + * Creates a new GetPublisherModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse instance + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetPublisherModelRequest} GetPublisherModelRequest instance */ - MigrateResourceResponse.create = function create(properties) { - return new MigrateResourceResponse(properties); + GetPublisherModelRequest.create = function create(properties) { + return new GetPublisherModelRequest(properties); }; /** - * Encodes the specified MigrateResourceResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceResponse.verify|verify} messages. + * Encodes the specified GetPublisherModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetPublisherModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse} message MigrateResourceResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest} message GetPublisherModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateResourceResponse.encode = function encode(message, writer) { + GetPublisherModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); - if (message.migratableResource != null && Object.hasOwnProperty.call(message, "migratableResource")) - $root.google.cloud.aiplatform.v1.MigratableResource.encode(message.migratableResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); return writer; }; /** - * Encodes the specified MigrateResourceResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MigrateResourceResponse.verify|verify} messages. + * Encodes the specified GetPublisherModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetPublisherModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static - * @param {google.cloud.aiplatform.v1.IMigrateResourceResponse} message MigrateResourceResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetPublisherModelRequest} message GetPublisherModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrateResourceResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetPublisherModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrateResourceResponse message from the specified reader or buffer. + * Decodes a GetPublisherModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse + * @returns {google.cloud.aiplatform.v1.GetPublisherModelRequest} GetPublisherModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateResourceResponse.decode = function decode(reader, length) { + GetPublisherModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MigrateResourceResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetPublisherModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dataset = reader.string(); + message.name = reader.string(); break; } case 2: { - message.model = reader.string(); + message.languageCode = reader.string(); break; } case 3: { - message.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.decode(reader, reader.uint32()); + message.view = reader.int32(); break; } default: @@ -121267,733 +126706,176 @@ }; /** - * Decodes a MigrateResourceResponse message from the specified reader or buffer, length delimited. + * Decodes a GetPublisherModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse + * @returns {google.cloud.aiplatform.v1.GetPublisherModelRequest} GetPublisherModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrateResourceResponse.decodeDelimited = function decodeDelimited(reader) { + GetPublisherModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrateResourceResponse message. + * Verifies a GetPublisherModelRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrateResourceResponse.verify = function verify(message) { + GetPublisherModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.dataset != null && message.hasOwnProperty("dataset")) { - properties.migratedResource = 1; - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - } - if (message.model != null && message.hasOwnProperty("model")) { - if (properties.migratedResource === 1) - return "migratedResource: multiple values"; - properties.migratedResource = 1; - if (!$util.isString(message.model)) - return "model: string expected"; - } - if (message.migratableResource != null && message.hasOwnProperty("migratableResource")) { - var error = $root.google.cloud.aiplatform.v1.MigratableResource.verify(message.migratableResource); - if (error) - return "migratableResource." + error; - } - return null; - }; - - /** - * Creates a MigrateResourceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MigrateResourceResponse} MigrateResourceResponse - */ - MigrateResourceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MigrateResourceResponse) - return object; - var message = new $root.google.cloud.aiplatform.v1.MigrateResourceResponse(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.model != null) - message.model = String(object.model); - if (object.migratableResource != null) { - if (typeof object.migratableResource !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MigrateResourceResponse.migratableResource: object expected"); - message.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.fromObject(object.migratableResource); - } - return message; - }; - - /** - * Creates a plain object from a MigrateResourceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse - * @static - * @param {google.cloud.aiplatform.v1.MigrateResourceResponse} message MigrateResourceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrateResourceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.migratableResource = null; - if (message.dataset != null && message.hasOwnProperty("dataset")) { - object.dataset = message.dataset; - if (options.oneofs) - object.migratedResource = "dataset"; - } - if (message.model != null && message.hasOwnProperty("model")) { - object.model = message.model; - if (options.oneofs) - object.migratedResource = "model"; - } - if (message.migratableResource != null && message.hasOwnProperty("migratableResource")) - object.migratableResource = $root.google.cloud.aiplatform.v1.MigratableResource.toObject(message.migratableResource, options); - return object; - }; - - /** - * Converts this MigrateResourceResponse to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse - * @instance - * @returns {Object.} JSON object - */ - MigrateResourceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MigrateResourceResponse - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MigrateResourceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrateResourceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MigrateResourceResponse"; - }; - - return MigrateResourceResponse; - })(); - - v1.BatchMigrateResourcesOperationMetadata = (function() { - - /** - * Properties of a BatchMigrateResourcesOperationMetadata. - * @memberof google.cloud.aiplatform.v1 - * @interface IBatchMigrateResourcesOperationMetadata - * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] BatchMigrateResourcesOperationMetadata genericMetadata - * @property {Array.|null} [partialResults] BatchMigrateResourcesOperationMetadata partialResults - */ - - /** - * Constructs a new BatchMigrateResourcesOperationMetadata. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchMigrateResourcesOperationMetadata. - * @implements IBatchMigrateResourcesOperationMetadata - * @constructor - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata=} [properties] Properties to set - */ - function BatchMigrateResourcesOperationMetadata(properties) { - this.partialResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchMigrateResourcesOperationMetadata genericMetadata. - * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @instance - */ - BatchMigrateResourcesOperationMetadata.prototype.genericMetadata = null; - - /** - * BatchMigrateResourcesOperationMetadata partialResults. - * @member {Array.} partialResults - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @instance - */ - BatchMigrateResourcesOperationMetadata.prototype.partialResults = $util.emptyArray; - - /** - * Creates a new BatchMigrateResourcesOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata instance - */ - BatchMigrateResourcesOperationMetadata.create = function create(properties) { - return new BatchMigrateResourcesOperationMetadata(properties); - }; - - /** - * Encodes the specified BatchMigrateResourcesOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchMigrateResourcesOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) - $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partialResults != null && message.partialResults.length) - for (var i = 0; i < message.partialResults.length; ++i) - $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.encode(message.partialResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchMigrateResourcesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {google.cloud.aiplatform.v1.IBatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchMigrateResourcesOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchMigrateResourcesOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchMigrateResourcesOperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.partialResults && message.partialResults.length)) - message.partialResults = []; - message.partialResults.push($root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.decode(reader, reader.uint32())); - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { default: - reader.skipType(tag & 7); + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; } - } - return message; - }; - - /** - * Decodes a BatchMigrateResourcesOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchMigrateResourcesOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchMigrateResourcesOperationMetadata message. - * @function verify - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchMigrateResourcesOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { - var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); - if (error) - return "genericMetadata." + error; - } - if (message.partialResults != null && message.hasOwnProperty("partialResults")) { - if (!Array.isArray(message.partialResults)) - return "partialResults: array expected"; - for (var i = 0; i < message.partialResults.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify(message.partialResults[i]); - if (error) - return "partialResults." + error; - } - } return null; }; /** - * Creates a BatchMigrateResourcesOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetPublisherModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} BatchMigrateResourcesOperationMetadata + * @returns {google.cloud.aiplatform.v1.GetPublisherModelRequest} GetPublisherModelRequest */ - BatchMigrateResourcesOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata) + GetPublisherModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetPublisherModelRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata(); - if (object.genericMetadata != null) { - if (typeof object.genericMetadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.genericMetadata: object expected"); - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); - } - if (object.partialResults) { - if (!Array.isArray(object.partialResults)) - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.partialResults: array expected"); - message.partialResults = []; - for (var i = 0; i < object.partialResults.length; ++i) { - if (typeof object.partialResults[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.partialResults: object expected"); - message.partialResults[i] = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.fromObject(object.partialResults[i]); + var message = new $root.google.cloud.aiplatform.v1.GetPublisherModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; } + break; + case "PUBLISHER_MODEL_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "PUBLISHER_MODEL_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "PUBLISHER_MODEL_VIEW_FULL": + case 2: + message.view = 2; + break; + case "PUBLISHER_MODEL_VERSION_VIEW_BASIC": + case 3: + message.view = 3; + break; } return message; }; /** - * Creates a plain object from a BatchMigrateResourcesOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata} message BatchMigrateResourcesOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchMigrateResourcesOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.partialResults = []; - if (options.defaults) - object.genericMetadata = null; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) - object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); - if (message.partialResults && message.partialResults.length) { - object.partialResults = []; - for (var j = 0; j < message.partialResults.length; ++j) - object.partialResults[j] = $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.toObject(message.partialResults[j], options); - } - return object; - }; - - /** - * Converts this BatchMigrateResourcesOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchMigrateResourcesOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchMigrateResourcesOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchMigrateResourcesOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata"; - }; - - BatchMigrateResourcesOperationMetadata.PartialResult = (function() { - - /** - * Properties of a PartialResult. - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @interface IPartialResult - * @property {google.rpc.IStatus|null} [error] PartialResult error - * @property {string|null} [model] PartialResult model - * @property {string|null} [dataset] PartialResult dataset - * @property {google.cloud.aiplatform.v1.IMigrateResourceRequest|null} [request] PartialResult request - */ - - /** - * Constructs a new PartialResult. - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata - * @classdesc Represents a PartialResult. - * @implements IPartialResult - * @constructor - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult=} [properties] Properties to set - */ - function PartialResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartialResult error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - */ - PartialResult.prototype.error = null; - - /** - * PartialResult model. - * @member {string|null|undefined} model - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - */ - PartialResult.prototype.model = null; - - /** - * PartialResult dataset. - * @member {string|null|undefined} dataset - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - */ - PartialResult.prototype.dataset = null; - - /** - * PartialResult request. - * @member {google.cloud.aiplatform.v1.IMigrateResourceRequest|null|undefined} request - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - */ - PartialResult.prototype.request = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PartialResult result. - * @member {"error"|"model"|"dataset"|undefined} result - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - */ - Object.defineProperty(PartialResult.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "model", "dataset"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PartialResult instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult instance - */ - PartialResult.create = function create(properties) { - return new PartialResult(properties); - }; - - /** - * Encodes the specified PartialResult message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult} message PartialResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.request != null && Object.hasOwnProperty.call(message, "request")) - $root.google.cloud.aiplatform.v1.MigrateResourceRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataset); - return writer; - }; - - /** - * Encodes the specified PartialResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.IPartialResult} message PartialResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartialResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartialResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.model = reader.string(); - break; - } - case 4: { - message.dataset = reader.string(); - break; - } - case 1: { - message.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartialResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartialResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartialResult message. - * @function verify - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartialResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - 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.model != null && message.hasOwnProperty("model")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - if (!$util.isString(message.model)) - return "model: string expected"; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - } - if (message.request != null && message.hasOwnProperty("request")) { - var error = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.verify(message.request); - if (error) - return "request." + error; - } - return null; - }; - - /** - * Creates a PartialResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} PartialResult - */ - PartialResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult) - return object; - var message = new $root.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult(); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.model != null) - message.model = String(object.model); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.request != null) { - if (typeof object.request !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult.request: object expected"); - message.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.fromObject(object.request); - } - return message; - }; - - /** - * Creates a plain object from a PartialResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult} message PartialResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartialResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.request = null; - if (message.request != null && message.hasOwnProperty("request")) - object.request = $root.google.cloud.aiplatform.v1.MigrateResourceRequest.toObject(message.request, options); - 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.model != null && message.hasOwnProperty("model")) { - object.model = message.model; - if (options.oneofs) - object.result = "model"; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) { - object.dataset = message.dataset; - if (options.oneofs) - object.result = "dataset"; - } - return object; - }; - - /** - * Converts this PartialResult to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @instance - * @returns {Object.} JSON object - */ - PartialResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + * Creates a plain object from a GetPublisherModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest + * @static + * @param {google.cloud.aiplatform.v1.GetPublisherModelRequest} message GetPublisherModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPublisherModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + object.view = options.enums === String ? "PUBLISHER_MODEL_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.aiplatform.v1.PublisherModelView[message.view] === undefined ? message.view : $root.google.cloud.aiplatform.v1.PublisherModelView[message.view] : message.view; + return object; + }; - /** - * Gets the default type url for PartialResult - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartialResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata.PartialResult"; - }; + /** + * Converts this GetPublisherModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetPublisherModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PartialResult; - })(); + /** + * Gets the default type url for GetPublisherModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetPublisherModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPublisherModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetPublisherModelRequest"; + }; - return BatchMigrateResourcesOperationMetadata; + return GetPublisherModelRequest; })(); - v1.ModelEvaluation = (function() { + v1.PublisherModel = (function() { /** - * Properties of a ModelEvaluation. + * Properties of a PublisherModel. * @memberof google.cloud.aiplatform.v1 - * @interface IModelEvaluation - * @property {string|null} [name] ModelEvaluation name - * @property {string|null} [displayName] ModelEvaluation displayName - * @property {string|null} [metricsSchemaUri] ModelEvaluation metricsSchemaUri - * @property {google.protobuf.IValue|null} [metrics] ModelEvaluation metrics - * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime - * @property {Array.|null} [sliceDimensions] ModelEvaluation sliceDimensions - * @property {string|null} [dataItemSchemaUri] ModelEvaluation dataItemSchemaUri - * @property {string|null} [annotationSchemaUri] ModelEvaluation annotationSchemaUri - * @property {google.cloud.aiplatform.v1.IModelExplanation|null} [modelExplanation] ModelEvaluation modelExplanation - * @property {Array.|null} [explanationSpecs] ModelEvaluation explanationSpecs - * @property {google.protobuf.IValue|null} [metadata] ModelEvaluation metadata + * @interface IPublisherModel + * @property {string|null} [name] PublisherModel name + * @property {string|null} [versionId] PublisherModel versionId + * @property {google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory|null} [openSourceCategory] PublisherModel openSourceCategory + * @property {google.cloud.aiplatform.v1.PublisherModel.ICallToAction|null} [supportedActions] PublisherModel supportedActions + * @property {Array.|null} [frameworks] PublisherModel frameworks + * @property {google.cloud.aiplatform.v1.PublisherModel.LaunchStage|null} [launchStage] PublisherModel launchStage + * @property {string|null} [publisherModelTemplate] PublisherModel publisherModelTemplate + * @property {google.cloud.aiplatform.v1.IPredictSchemata|null} [predictSchemata] PublisherModel predictSchemata */ /** - * Constructs a new ModelEvaluation. + * Constructs a new PublisherModel. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ModelEvaluation. - * @implements IModelEvaluation + * @classdesc Represents a PublisherModel. + * @implements IPublisherModel * @constructor - * @param {google.cloud.aiplatform.v1.IModelEvaluation=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IPublisherModel=} [properties] Properties to set */ - function ModelEvaluation(properties) { - this.sliceDimensions = []; - this.explanationSpecs = []; + function PublisherModel(properties) { + this.frameworks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -122001,172 +126883,141 @@ } /** - * ModelEvaluation name. + * PublisherModel name. * @member {string} name - * @memberof google.cloud.aiplatform.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.name = ""; - - /** - * ModelEvaluation displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.displayName = ""; - - /** - * ModelEvaluation metricsSchemaUri. - * @member {string} metricsSchemaUri - * @memberof google.cloud.aiplatform.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.metricsSchemaUri = ""; - - /** - * ModelEvaluation metrics. - * @member {google.protobuf.IValue|null|undefined} metrics - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.metrics = null; + PublisherModel.prototype.name = ""; /** - * ModelEvaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel versionId. + * @member {string} versionId + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.createTime = null; + PublisherModel.prototype.versionId = ""; /** - * ModelEvaluation sliceDimensions. - * @member {Array.} sliceDimensions - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel openSourceCategory. + * @member {google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory} openSourceCategory + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.sliceDimensions = $util.emptyArray; + PublisherModel.prototype.openSourceCategory = 0; /** - * ModelEvaluation dataItemSchemaUri. - * @member {string} dataItemSchemaUri - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel supportedActions. + * @member {google.cloud.aiplatform.v1.PublisherModel.ICallToAction|null|undefined} supportedActions + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.dataItemSchemaUri = ""; + PublisherModel.prototype.supportedActions = null; /** - * ModelEvaluation annotationSchemaUri. - * @member {string} annotationSchemaUri - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel frameworks. + * @member {Array.} frameworks + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.annotationSchemaUri = ""; + PublisherModel.prototype.frameworks = $util.emptyArray; /** - * ModelEvaluation modelExplanation. - * @member {google.cloud.aiplatform.v1.IModelExplanation|null|undefined} modelExplanation - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel launchStage. + * @member {google.cloud.aiplatform.v1.PublisherModel.LaunchStage} launchStage + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.modelExplanation = null; + PublisherModel.prototype.launchStage = 0; /** - * ModelEvaluation explanationSpecs. - * @member {Array.} explanationSpecs - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel publisherModelTemplate. + * @member {string} publisherModelTemplate + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.explanationSpecs = $util.emptyArray; + PublisherModel.prototype.publisherModelTemplate = ""; /** - * ModelEvaluation metadata. - * @member {google.protobuf.IValue|null|undefined} metadata - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * PublisherModel predictSchemata. + * @member {google.cloud.aiplatform.v1.IPredictSchemata|null|undefined} predictSchemata + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance */ - ModelEvaluation.prototype.metadata = null; + PublisherModel.prototype.predictSchemata = null; /** - * Creates a new ModelEvaluation instance using the specified properties. + * Creates a new PublisherModel instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation instance + * @param {google.cloud.aiplatform.v1.IPublisherModel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel} PublisherModel instance */ - ModelEvaluation.create = function create(properties) { - return new ModelEvaluation(properties); + PublisherModel.create = function create(properties) { + return new PublisherModel(properties); }; /** - * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.verify|verify} messages. + * Encodes the specified PublisherModel message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {google.cloud.aiplatform.v1.IPublisherModel} message PublisherModel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluation.encode = function encode(message, writer) { + PublisherModel.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.metricsSchemaUri != null && Object.hasOwnProperty.call(message, "metricsSchemaUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metricsSchemaUri); - if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) - $root.google.protobuf.Value.encode(message.metrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sliceDimensions != null && message.sliceDimensions.length) - for (var i = 0; i < message.sliceDimensions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.sliceDimensions[i]); - if (message.dataItemSchemaUri != null && Object.hasOwnProperty.call(message, "dataItemSchemaUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataItemSchemaUri); - if (message.annotationSchemaUri != null && Object.hasOwnProperty.call(message, "annotationSchemaUri")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.annotationSchemaUri); - if (message.modelExplanation != null && Object.hasOwnProperty.call(message, "modelExplanation")) - $root.google.cloud.aiplatform.v1.ModelExplanation.encode(message.modelExplanation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.explanationSpecs != null && message.explanationSpecs.length) - for (var i = 0; i < message.explanationSpecs.length; ++i) - $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.encode(message.explanationSpecs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Value.encode(message.metadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.versionId != null && Object.hasOwnProperty.call(message, "versionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.versionId); + if (message.openSourceCategory != null && Object.hasOwnProperty.call(message, "openSourceCategory")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.openSourceCategory); + if (message.supportedActions != null && Object.hasOwnProperty.call(message, "supportedActions")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.encode(message.supportedActions, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.frameworks != null && message.frameworks.length) + for (var i = 0; i < message.frameworks.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.frameworks[i]); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.launchStage); + if (message.publisherModelTemplate != null && Object.hasOwnProperty.call(message, "publisherModelTemplate")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.publisherModelTemplate); + if (message.predictSchemata != null && Object.hasOwnProperty.call(message, "predictSchemata")) + $root.google.cloud.aiplatform.v1.PredictSchemata.encode(message.predictSchemata, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); return writer; }; /** - * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.verify|verify} messages. + * Encodes the specified PublisherModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {google.cloud.aiplatform.v1.IPublisherModel} message PublisherModel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + PublisherModel.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ModelEvaluation message from the specified reader or buffer. + * Decodes a PublisherModel message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.aiplatform.v1.PublisherModel} PublisherModel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluation.decode = function decode(reader, length) { + PublisherModel.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -122174,48 +127025,34 @@ message.name = reader.string(); break; } - case 10: { - message.displayName = reader.string(); - break; - } case 2: { - message.metricsSchemaUri = reader.string(); - break; - } - case 3: { - message.metrics = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.versionId = reader.string(); break; } - case 5: { - if (!(message.sliceDimensions && message.sliceDimensions.length)) - message.sliceDimensions = []; - message.sliceDimensions.push(reader.string()); + case 7: { + message.openSourceCategory = reader.int32(); break; } - case 6: { - message.dataItemSchemaUri = reader.string(); + case 19: { + message.supportedActions = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.decode(reader, reader.uint32()); break; } - case 7: { - message.annotationSchemaUri = reader.string(); + case 23: { + if (!(message.frameworks && message.frameworks.length)) + message.frameworks = []; + message.frameworks.push(reader.string()); break; } - case 8: { - message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.decode(reader, reader.uint32()); + case 29: { + message.launchStage = reader.int32(); break; } - case 9: { - if (!(message.explanationSpecs && message.explanationSpecs.length)) - message.explanationSpecs = []; - message.explanationSpecs.push($root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.decode(reader, reader.uint32())); + case 30: { + message.publisherModelTemplate = reader.string(); break; } - case 11: { - message.metadata = $root.google.protobuf.Value.decode(reader, reader.uint32()); + case 31: { + message.predictSchemata = $root.google.cloud.aiplatform.v1.PredictSchemata.decode(reader, reader.uint32()); break; } default: @@ -122227,252 +127064,273 @@ }; /** - * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * Decodes a PublisherModel message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.aiplatform.v1.PublisherModel} PublisherModel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + PublisherModel.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ModelEvaluation message. + * Verifies a PublisherModel message. * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ModelEvaluation.verify = function verify(message) { + PublisherModel.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.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) - if (!$util.isString(message.metricsSchemaUri)) - return "metricsSchemaUri: string expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - var error = $root.google.protobuf.Value.verify(message.metrics); - if (error) - return "metrics." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.versionId != null && message.hasOwnProperty("versionId")) + if (!$util.isString(message.versionId)) + return "versionId: string expected"; + if (message.openSourceCategory != null && message.hasOwnProperty("openSourceCategory")) + switch (message.openSourceCategory) { + default: + return "openSourceCategory: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.supportedActions != null && message.hasOwnProperty("supportedActions")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.verify(message.supportedActions); if (error) - return "createTime." + error; - } - if (message.sliceDimensions != null && message.hasOwnProperty("sliceDimensions")) { - if (!Array.isArray(message.sliceDimensions)) - return "sliceDimensions: array expected"; - for (var i = 0; i < message.sliceDimensions.length; ++i) - if (!$util.isString(message.sliceDimensions[i])) - return "sliceDimensions: string[] expected"; + return "supportedActions." + error; } - if (message.dataItemSchemaUri != null && message.hasOwnProperty("dataItemSchemaUri")) - if (!$util.isString(message.dataItemSchemaUri)) - return "dataItemSchemaUri: string expected"; - if (message.annotationSchemaUri != null && message.hasOwnProperty("annotationSchemaUri")) - if (!$util.isString(message.annotationSchemaUri)) - return "annotationSchemaUri: string expected"; - if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) { - var error = $root.google.cloud.aiplatform.v1.ModelExplanation.verify(message.modelExplanation); - if (error) - return "modelExplanation." + error; + if (message.frameworks != null && message.hasOwnProperty("frameworks")) { + if (!Array.isArray(message.frameworks)) + return "frameworks: array expected"; + for (var i = 0; i < message.frameworks.length; ++i) + if (!$util.isString(message.frameworks[i])) + return "frameworks: string[] expected"; } - if (message.explanationSpecs != null && message.hasOwnProperty("explanationSpecs")) { - if (!Array.isArray(message.explanationSpecs)) - return "explanationSpecs: array expected"; - for (var i = 0; i < message.explanationSpecs.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify(message.explanationSpecs[i]); - if (error) - return "explanationSpecs." + error; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Value.verify(message.metadata); + if (message.publisherModelTemplate != null && message.hasOwnProperty("publisherModelTemplate")) + if (!$util.isString(message.publisherModelTemplate)) + return "publisherModelTemplate: string expected"; + if (message.predictSchemata != null && message.hasOwnProperty("predictSchemata")) { + var error = $root.google.cloud.aiplatform.v1.PredictSchemata.verify(message.predictSchemata); if (error) - return "metadata." + error; + return "predictSchemata." + error; } return null; }; /** - * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * Creates a PublisherModel message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.aiplatform.v1.PublisherModel} PublisherModel */ - ModelEvaluation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluation) + PublisherModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel) return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluation(); + var message = new $root.google.cloud.aiplatform.v1.PublisherModel(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.metricsSchemaUri != null) - message.metricsSchemaUri = String(object.metricsSchemaUri); - if (object.metrics != null) { - if (typeof object.metrics !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.metrics: object expected"); - message.metrics = $root.google.protobuf.Value.fromObject(object.metrics); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (object.versionId != null) + message.versionId = String(object.versionId); + switch (object.openSourceCategory) { + default: + if (typeof object.openSourceCategory === "number") { + message.openSourceCategory = object.openSourceCategory; + break; + } + break; + case "OPEN_SOURCE_CATEGORY_UNSPECIFIED": + case 0: + message.openSourceCategory = 0; + break; + case "PROPRIETARY": + case 1: + message.openSourceCategory = 1; + break; + case "GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT": + case 2: + message.openSourceCategory = 2; + break; + case "THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT": + case 3: + message.openSourceCategory = 3; + break; + case "GOOGLE_OWNED_OSS": + case 4: + message.openSourceCategory = 4; + break; + case "THIRD_PARTY_OWNED_OSS": + case 5: + message.openSourceCategory = 5; + break; } - if (object.sliceDimensions) { - if (!Array.isArray(object.sliceDimensions)) - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.sliceDimensions: array expected"); - message.sliceDimensions = []; - for (var i = 0; i < object.sliceDimensions.length; ++i) - message.sliceDimensions[i] = String(object.sliceDimensions[i]); + if (object.supportedActions != null) { + if (typeof object.supportedActions !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.supportedActions: object expected"); + message.supportedActions = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.fromObject(object.supportedActions); } - if (object.dataItemSchemaUri != null) - message.dataItemSchemaUri = String(object.dataItemSchemaUri); - if (object.annotationSchemaUri != null) - message.annotationSchemaUri = String(object.annotationSchemaUri); - if (object.modelExplanation != null) { - if (typeof object.modelExplanation !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.modelExplanation: object expected"); - message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.fromObject(object.modelExplanation); + if (object.frameworks) { + if (!Array.isArray(object.frameworks)) + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.frameworks: array expected"); + message.frameworks = []; + for (var i = 0; i < object.frameworks.length; ++i) + message.frameworks[i] = String(object.frameworks[i]); } - if (object.explanationSpecs) { - if (!Array.isArray(object.explanationSpecs)) - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.explanationSpecs: array expected"); - message.explanationSpecs = []; - for (var i = 0; i < object.explanationSpecs.length; ++i) { - if (typeof object.explanationSpecs[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.explanationSpecs: object expected"); - message.explanationSpecs[i] = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.fromObject(object.explanationSpecs[i]); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "EXPERIMENTAL": + case 1: + message.launchStage = 1; + break; + case "PRIVATE_PREVIEW": + case 2: + message.launchStage = 2; + break; + case "PUBLIC_PREVIEW": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.metadata: object expected"); - message.metadata = $root.google.protobuf.Value.fromObject(object.metadata); + if (object.publisherModelTemplate != null) + message.publisherModelTemplate = String(object.publisherModelTemplate); + if (object.predictSchemata != null) { + if (typeof object.predictSchemata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.predictSchemata: object expected"); + message.predictSchemata = $root.google.cloud.aiplatform.v1.PredictSchemata.fromObject(object.predictSchemata); } return message; }; /** - * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * Creates a plain object from a PublisherModel message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluation} message ModelEvaluation + * @param {google.cloud.aiplatform.v1.PublisherModel} message PublisherModel * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ModelEvaluation.toObject = function toObject(message, options) { + PublisherModel.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sliceDimensions = []; - object.explanationSpecs = []; - } + if (options.arrays || options.defaults) + object.frameworks = []; if (options.defaults) { object.name = ""; - object.metricsSchemaUri = ""; - object.metrics = null; - object.createTime = null; - object.dataItemSchemaUri = ""; - object.annotationSchemaUri = ""; - object.modelExplanation = null; - object.displayName = ""; - object.metadata = null; + object.versionId = ""; + object.openSourceCategory = options.enums === String ? "OPEN_SOURCE_CATEGORY_UNSPECIFIED" : 0; + object.supportedActions = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.publisherModelTemplate = ""; + object.predictSchemata = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) - object.metricsSchemaUri = message.metricsSchemaUri; - if (message.metrics != null && message.hasOwnProperty("metrics")) - object.metrics = $root.google.protobuf.Value.toObject(message.metrics, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sliceDimensions && message.sliceDimensions.length) { - object.sliceDimensions = []; - for (var j = 0; j < message.sliceDimensions.length; ++j) - object.sliceDimensions[j] = message.sliceDimensions[j]; - } - if (message.dataItemSchemaUri != null && message.hasOwnProperty("dataItemSchemaUri")) - object.dataItemSchemaUri = message.dataItemSchemaUri; - if (message.annotationSchemaUri != null && message.hasOwnProperty("annotationSchemaUri")) - object.annotationSchemaUri = message.annotationSchemaUri; - if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) - object.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.toObject(message.modelExplanation, options); - if (message.explanationSpecs && message.explanationSpecs.length) { - object.explanationSpecs = []; - for (var j = 0; j < message.explanationSpecs.length; ++j) - object.explanationSpecs[j] = $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.toObject(message.explanationSpecs[j], options); + if (message.versionId != null && message.hasOwnProperty("versionId")) + object.versionId = message.versionId; + if (message.openSourceCategory != null && message.hasOwnProperty("openSourceCategory")) + object.openSourceCategory = options.enums === String ? $root.google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory[message.openSourceCategory] === undefined ? message.openSourceCategory : $root.google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory[message.openSourceCategory] : message.openSourceCategory; + if (message.supportedActions != null && message.hasOwnProperty("supportedActions")) + object.supportedActions = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.toObject(message.supportedActions, options); + if (message.frameworks && message.frameworks.length) { + object.frameworks = []; + for (var j = 0; j < message.frameworks.length; ++j) + object.frameworks[j] = message.frameworks[j]; } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Value.toObject(message.metadata, options); + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.aiplatform.v1.PublisherModel.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.aiplatform.v1.PublisherModel.LaunchStage[message.launchStage] : message.launchStage; + if (message.publisherModelTemplate != null && message.hasOwnProperty("publisherModelTemplate")) + object.publisherModelTemplate = message.publisherModelTemplate; + if (message.predictSchemata != null && message.hasOwnProperty("predictSchemata")) + object.predictSchemata = $root.google.cloud.aiplatform.v1.PredictSchemata.toObject(message.predictSchemata, options); return object; }; /** - * Converts this ModelEvaluation to JSON. + * Converts this PublisherModel to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @instance * @returns {Object.} JSON object */ - ModelEvaluation.prototype.toJSON = function toJSON() { + PublisherModel.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ModelEvaluation + * Gets the default type url for PublisherModel * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluation + * @memberof google.cloud.aiplatform.v1.PublisherModel * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PublisherModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluation"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel"; }; - ModelEvaluation.ModelEvaluationExplanationSpec = (function() { + PublisherModel.ResourceReference = (function() { /** - * Properties of a ModelEvaluationExplanationSpec. - * @memberof google.cloud.aiplatform.v1.ModelEvaluation - * @interface IModelEvaluationExplanationSpec - * @property {string|null} [explanationType] ModelEvaluationExplanationSpec explanationType - * @property {google.cloud.aiplatform.v1.IExplanationSpec|null} [explanationSpec] ModelEvaluationExplanationSpec explanationSpec + * Properties of a ResourceReference. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @interface IResourceReference + * @property {string|null} [uri] ResourceReference uri + * @property {string|null} [resourceName] ResourceReference resourceName */ /** - * Constructs a new ModelEvaluationExplanationSpec. - * @memberof google.cloud.aiplatform.v1.ModelEvaluation - * @classdesc Represents a ModelEvaluationExplanationSpec. - * @implements IModelEvaluationExplanationSpec + * Constructs a new ResourceReference. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.PublisherModel.IResourceReference=} [properties] Properties to set */ - function ModelEvaluationExplanationSpec(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -122480,89 +127338,103 @@ } /** - * ModelEvaluationExplanationSpec explanationType. - * @member {string} explanationType - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * ResourceReference uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @instance */ - ModelEvaluationExplanationSpec.prototype.explanationType = ""; + ResourceReference.prototype.uri = null; /** - * ModelEvaluationExplanationSpec explanationSpec. - * @member {google.cloud.aiplatform.v1.IExplanationSpec|null|undefined} explanationSpec - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * ResourceReference resourceName. + * @member {string|null|undefined} resourceName + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @instance */ - ModelEvaluationExplanationSpec.prototype.explanationSpec = null; + ResourceReference.prototype.resourceName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ModelEvaluationExplanationSpec instance using the specified properties. + * ResourceReference reference. + * @member {"uri"|"resourceName"|undefined} reference + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference + * @instance + */ + Object.defineProperty(ResourceReference.prototype, "reference", { + get: $util.oneOfGetter($oneOfFields = ["uri", "resourceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec instance + * @param {google.cloud.aiplatform.v1.PublisherModel.IResourceReference=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.ResourceReference} ResourceReference instance */ - ModelEvaluationExplanationSpec.create = function create(properties) { - return new ModelEvaluationExplanationSpec(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified ModelEvaluationExplanationSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluationExplanationSpec.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.explanationType != null && Object.hasOwnProperty.call(message, "explanationType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.explanationType); - if (message.explanationSpec != null && Object.hasOwnProperty.call(message, "explanationSpec")) - $root.google.cloud.aiplatform.v1.ExplanationSpec.encode(message.explanationSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceName); return writer; }; /** - * Encodes the specified ModelEvaluationExplanationSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluation.IModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluationExplanationSpec.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ModelEvaluationExplanationSpec message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluationExplanationSpec.decode = function decode(reader, length) { + 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.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.explanationType = reader.string(); + message.uri = reader.string(); break; } case 2: { - message.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.decode(reader, reader.uint32()); + message.resourceName = reader.string(); break; } default: @@ -122574,477 +127446,375 @@ }; /** - * Decodes a ModelEvaluationExplanationSpec message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluationExplanationSpec.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ModelEvaluationExplanationSpec message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ModelEvaluationExplanationSpec.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.explanationType != null && message.hasOwnProperty("explanationType")) - if (!$util.isString(message.explanationType)) - return "explanationType: string expected"; - if (message.explanationSpec != null && message.hasOwnProperty("explanationSpec")) { - var error = $root.google.cloud.aiplatform.v1.ExplanationSpec.verify(message.explanationSpec); - if (error) - return "explanationSpec." + error; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.reference = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) { + if (properties.reference === 1) + return "reference: multiple values"; + properties.reference = 1; + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; } return null; }; /** - * Creates a ModelEvaluationExplanationSpec message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} ModelEvaluationExplanationSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.ResourceReference} ResourceReference */ - ModelEvaluationExplanationSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference) return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec(); - if (object.explanationType != null) - message.explanationType = String(object.explanationType); - if (object.explanationSpec != null) { - if (typeof object.explanationSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec.explanationSpec: object expected"); - message.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.fromObject(object.explanationSpec); - } + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); return message; }; /** - * Creates a plain object from a ModelEvaluationExplanationSpec message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec} message ModelEvaluationExplanationSpec + * @param {google.cloud.aiplatform.v1.PublisherModel.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ModelEvaluationExplanationSpec.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.explanationType = ""; - object.explanationSpec = null; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.reference = "uri"; + } + if (message.resourceName != null && message.hasOwnProperty("resourceName")) { + object.resourceName = message.resourceName; + if (options.oneofs) + object.reference = "resourceName"; } - if (message.explanationType != null && message.hasOwnProperty("explanationType")) - object.explanationType = message.explanationType; - if (message.explanationSpec != null && message.hasOwnProperty("explanationSpec")) - object.explanationSpec = $root.google.cloud.aiplatform.v1.ExplanationSpec.toObject(message.explanationSpec, options); return object; }; /** - * Converts this ModelEvaluationExplanationSpec to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @instance * @returns {Object.} JSON object */ - ModelEvaluationExplanationSpec.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ModelEvaluationExplanationSpec + * Gets the default type url for ResourceReference * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.ResourceReference * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ModelEvaluationExplanationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluation.ModelEvaluationExplanationSpec"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.ResourceReference"; }; - return ModelEvaluationExplanationSpec; + return ResourceReference; })(); - return ModelEvaluation; - })(); - - v1.ModelEvaluationSlice = (function() { - - /** - * Properties of a ModelEvaluationSlice. - * @memberof google.cloud.aiplatform.v1 - * @interface IModelEvaluationSlice - * @property {string|null} [name] ModelEvaluationSlice name - * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice|null} [slice] ModelEvaluationSlice slice - * @property {string|null} [metricsSchemaUri] ModelEvaluationSlice metricsSchemaUri - * @property {google.protobuf.IValue|null} [metrics] ModelEvaluationSlice metrics - * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluationSlice createTime - * @property {google.cloud.aiplatform.v1.IModelExplanation|null} [modelExplanation] ModelEvaluationSlice modelExplanation - */ - - /** - * Constructs a new ModelEvaluationSlice. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ModelEvaluationSlice. - * @implements IModelEvaluationSlice - * @constructor - * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice=} [properties] Properties to set - */ - function ModelEvaluationSlice(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModelEvaluationSlice name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.name = ""; - - /** - * ModelEvaluationSlice slice. - * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice|null|undefined} slice - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.slice = null; + PublisherModel.Documentation = (function() { - /** - * ModelEvaluationSlice metricsSchemaUri. - * @member {string} metricsSchemaUri - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.metricsSchemaUri = ""; + /** + * Properties of a Documentation. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @interface IDocumentation + * @property {string|null} [title] Documentation title + * @property {string|null} [content] Documentation content + */ - /** - * ModelEvaluationSlice metrics. - * @member {google.protobuf.IValue|null|undefined} metrics - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.metrics = null; + /** + * Constructs a new Documentation. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @classdesc Represents a Documentation. + * @implements IDocumentation + * @constructor + * @param {google.cloud.aiplatform.v1.PublisherModel.IDocumentation=} [properties] Properties to set + */ + function Documentation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ModelEvaluationSlice createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.createTime = null; + /** + * Documentation title. + * @member {string} title + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @instance + */ + Documentation.prototype.title = ""; - /** - * ModelEvaluationSlice modelExplanation. - * @member {google.cloud.aiplatform.v1.IModelExplanation|null|undefined} modelExplanation - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - */ - ModelEvaluationSlice.prototype.modelExplanation = null; + /** + * Documentation content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @instance + */ + Documentation.prototype.content = ""; - /** - * Creates a new ModelEvaluationSlice instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice instance - */ - ModelEvaluationSlice.create = function create(properties) { - return new ModelEvaluationSlice(properties); - }; + /** + * Creates a new Documentation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.IDocumentation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.Documentation} Documentation instance + */ + Documentation.create = function create(properties) { + return new Documentation(properties); + }; - /** - * Encodes the specified ModelEvaluationSlice message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice} message ModelEvaluationSlice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelEvaluationSlice.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.slice != null && Object.hasOwnProperty.call(message, "slice")) - $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.encode(message.slice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metricsSchemaUri != null && Object.hasOwnProperty.call(message, "metricsSchemaUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.metricsSchemaUri); - if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) - $root.google.protobuf.Value.encode(message.metrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.modelExplanation != null && Object.hasOwnProperty.call(message, "modelExplanation")) - $root.google.cloud.aiplatform.v1.ModelExplanation.encode(message.modelExplanation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.Documentation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + return writer; + }; - /** - * Encodes the specified ModelEvaluationSlice message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {google.cloud.aiplatform.v1.IModelEvaluationSlice} message ModelEvaluationSlice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModelEvaluationSlice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.Documentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ModelEvaluationSlice message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelEvaluationSlice.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.decode(reader, reader.uint32()); - break; - } - case 3: { - message.metricsSchemaUri = reader.string(); - break; - } - case 4: { - message.metrics = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.decode(reader, reader.uint32()); + /** + * Decodes a Documentation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PublisherModel.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.Documentation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a ModelEvaluationSlice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModelEvaluationSlice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a ModelEvaluationSlice message. - * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModelEvaluationSlice.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.slice != null && message.hasOwnProperty("slice")) { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify(message.slice); - if (error) - return "slice." + error; - } - if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) - if (!$util.isString(message.metricsSchemaUri)) - return "metricsSchemaUri: string expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - var error = $root.google.protobuf.Value.verify(message.metrics); - if (error) - return "metrics." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) { - var error = $root.google.cloud.aiplatform.v1.ModelExplanation.verify(message.modelExplanation); - if (error) - return "modelExplanation." + error; - } - return null; - }; + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PublisherModel.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a ModelEvaluationSlice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice} ModelEvaluationSlice - */ - ModelEvaluationSlice.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice) + /** + * Verifies a Documentation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PublisherModel.Documentation} Documentation + */ + Documentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.Documentation) + return object; + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.Documentation(); + if (object.title != null) + message.title = String(object.title); + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.Documentation} message Documentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.content = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice(); - if (object.name != null) - message.name = String(object.name); - if (object.slice != null) { - if (typeof object.slice !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.slice: object expected"); - message.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.fromObject(object.slice); - } - if (object.metricsSchemaUri != null) - message.metricsSchemaUri = String(object.metricsSchemaUri); - if (object.metrics != null) { - if (typeof object.metrics !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics: object expected"); - message.metrics = $root.google.protobuf.Value.fromObject(object.metrics); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.modelExplanation != null) { - if (typeof object.modelExplanation !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.modelExplanation: object expected"); - message.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.fromObject(object.modelExplanation); - } - return message; - }; + }; - /** - * Creates a plain object from a ModelEvaluationSlice message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice} message ModelEvaluationSlice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModelEvaluationSlice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.slice = null; - object.metricsSchemaUri = ""; - object.metrics = null; - object.createTime = null; - object.modelExplanation = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.slice != null && message.hasOwnProperty("slice")) - object.slice = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.toObject(message.slice, options); - if (message.metricsSchemaUri != null && message.hasOwnProperty("metricsSchemaUri")) - object.metricsSchemaUri = message.metricsSchemaUri; - if (message.metrics != null && message.hasOwnProperty("metrics")) - object.metrics = $root.google.protobuf.Value.toObject(message.metrics, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.modelExplanation != null && message.hasOwnProperty("modelExplanation")) - object.modelExplanation = $root.google.cloud.aiplatform.v1.ModelExplanation.toObject(message.modelExplanation, options); - return object; - }; + /** + * Converts this Documentation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @instance + * @returns {Object.} JSON object + */ + Documentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ModelEvaluationSlice to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @instance - * @returns {Object.} JSON object - */ - ModelEvaluationSlice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Documentation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PublisherModel.Documentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.Documentation"; + }; - /** - * Gets the default type url for ModelEvaluationSlice - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ModelEvaluationSlice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice"; - }; + return Documentation; + })(); - ModelEvaluationSlice.Slice = (function() { + PublisherModel.CallToAction = (function() { /** - * Properties of a Slice. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @interface ISlice - * @property {string|null} [dimension] Slice dimension - * @property {string|null} [value] Slice value - * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec|null} [sliceSpec] Slice sliceSpec + * Properties of a CallToAction. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @interface ICallToAction + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi|null} [viewRestApi] CallToAction viewRestApi + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openNotebook] CallToAction openNotebook + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [createApplication] CallToAction createApplication + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openFineTuningPipeline] CallToAction openFineTuningPipeline + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openPromptTuningPipeline] CallToAction openPromptTuningPipeline + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenie] CallToAction openGenie + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy|null} [deploy] CallToAction deploy + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenerationAiStudio] CallToAction openGenerationAiStudio + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [requestAccess] CallToAction requestAccess */ /** - * Constructs a new Slice. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice - * @classdesc Represents a Slice. - * @implements ISlice + * Constructs a new CallToAction. + * @memberof google.cloud.aiplatform.v1.PublisherModel + * @classdesc Represents a CallToAction. + * @implements ICallToAction * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.PublisherModel.ICallToAction=} [properties] Properties to set */ - function Slice(properties) { + function CallToAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -123052,103 +127822,187 @@ } /** - * Slice dimension. - * @member {string} dimension - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * CallToAction viewRestApi. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi|null|undefined} viewRestApi + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @instance */ - Slice.prototype.dimension = ""; + CallToAction.prototype.viewRestApi = null; /** - * Slice value. - * @member {string} value - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * CallToAction openNotebook. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} openNotebook + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @instance */ - Slice.prototype.value = ""; + CallToAction.prototype.openNotebook = null; /** - * Slice sliceSpec. - * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec|null|undefined} sliceSpec - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * CallToAction createApplication. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} createApplication + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @instance */ - Slice.prototype.sliceSpec = null; + CallToAction.prototype.createApplication = null; /** - * Creates a new Slice instance using the specified properties. + * CallToAction openFineTuningPipeline. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} openFineTuningPipeline + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.openFineTuningPipeline = null; + + /** + * CallToAction openPromptTuningPipeline. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} openPromptTuningPipeline + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.openPromptTuningPipeline = null; + + /** + * CallToAction openGenie. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} openGenie + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.openGenie = null; + + /** + * CallToAction deploy. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy|null|undefined} deploy + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.deploy = null; + + /** + * CallToAction openGenerationAiStudio. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} openGenerationAiStudio + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.openGenerationAiStudio = null; + + /** + * CallToAction requestAccess. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} requestAccess + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.requestAccess = null; + + /** + * Creates a new CallToAction instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice instance + * @param {google.cloud.aiplatform.v1.PublisherModel.ICallToAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction} CallToAction instance */ - Slice.create = function create(properties) { - return new Slice(properties); + CallToAction.create = function create(properties) { + return new CallToAction(properties); }; /** - * Encodes the specified Slice message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify|verify} messages. + * Encodes the specified CallToAction message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice} message Slice message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.ICallToAction} message CallToAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Slice.encode = function encode(message, writer) { + CallToAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dimension != null && Object.hasOwnProperty.call(message, "dimension")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dimension); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.sliceSpec != null && Object.hasOwnProperty.call(message, "sliceSpec")) - $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.encode(message.sliceSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.viewRestApi != null && Object.hasOwnProperty.call(message, "viewRestApi")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.encode(message.viewRestApi, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.openNotebook != null && Object.hasOwnProperty.call(message, "openNotebook")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openNotebook, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createApplication != null && Object.hasOwnProperty.call(message, "createApplication")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.createApplication, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.openFineTuningPipeline != null && Object.hasOwnProperty.call(message, "openFineTuningPipeline")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openFineTuningPipeline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.openPromptTuningPipeline != null && Object.hasOwnProperty.call(message, "openPromptTuningPipeline")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openPromptTuningPipeline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.openGenie != null && Object.hasOwnProperty.call(message, "openGenie")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openGenie, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deploy != null && Object.hasOwnProperty.call(message, "deploy")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.encode(message.deploy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.openGenerationAiStudio != null && Object.hasOwnProperty.call(message, "openGenerationAiStudio")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openGenerationAiStudio, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestAccess != null && Object.hasOwnProperty.call(message, "requestAccess")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.requestAccess, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified Slice message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.verify|verify} messages. + * Encodes the specified CallToAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.ISlice} message Slice message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.ICallToAction} message CallToAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Slice.encodeDelimited = function encodeDelimited(message, writer) { + CallToAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Slice message from the specified reader or buffer. + * Decodes a CallToAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction} CallToAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Slice.decode = function decode(reader, length) { + CallToAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dimension = reader.string(); + message.viewRestApi = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.decode(reader, reader.uint32()); break; } case 2: { - message.value = reader.string(); + message.openNotebook = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); break; } case 3: { - message.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.decode(reader, reader.uint32()); + message.createApplication = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } + case 4: { + message.openFineTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } + case 5: { + message.openPromptTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } + case 6: { + message.openGenie = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deploy = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.openGenerationAiStudio = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requestAccess = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); break; } default: @@ -123160,142 +128014,231 @@ }; /** - * Decodes a Slice message from the specified reader or buffer, length delimited. + * Decodes a CallToAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction} CallToAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Slice.decodeDelimited = function decodeDelimited(reader) { + CallToAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Slice message. + * Verifies a CallToAction message. * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Slice.verify = function verify(message) { + CallToAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dimension != null && message.hasOwnProperty("dimension")) - if (!$util.isString(message.dimension)) - return "dimension: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.sliceSpec != null && message.hasOwnProperty("sliceSpec")) { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify(message.sliceSpec); + if (message.viewRestApi != null && message.hasOwnProperty("viewRestApi")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.verify(message.viewRestApi); if (error) - return "sliceSpec." + error; + return "viewRestApi." + error; + } + if (message.openNotebook != null && message.hasOwnProperty("openNotebook")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.openNotebook); + if (error) + return "openNotebook." + error; + } + if (message.createApplication != null && message.hasOwnProperty("createApplication")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.createApplication); + if (error) + return "createApplication." + error; + } + if (message.openFineTuningPipeline != null && message.hasOwnProperty("openFineTuningPipeline")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.openFineTuningPipeline); + if (error) + return "openFineTuningPipeline." + error; + } + if (message.openPromptTuningPipeline != null && message.hasOwnProperty("openPromptTuningPipeline")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.openPromptTuningPipeline); + if (error) + return "openPromptTuningPipeline." + error; + } + if (message.openGenie != null && message.hasOwnProperty("openGenie")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.openGenie); + if (error) + return "openGenie." + error; + } + if (message.deploy != null && message.hasOwnProperty("deploy")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.verify(message.deploy); + if (error) + return "deploy." + error; + } + if (message.openGenerationAiStudio != null && message.hasOwnProperty("openGenerationAiStudio")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.openGenerationAiStudio); + if (error) + return "openGenerationAiStudio." + error; + } + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.requestAccess); + if (error) + return "requestAccess." + error; } return null; }; /** - * Creates a Slice message from a plain object. Also converts values to their respective internal types. + * Creates a CallToAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} Slice + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction} CallToAction */ - Slice.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice) + CallToAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction) return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice(); - if (object.dimension != null) - message.dimension = String(object.dimension); - if (object.value != null) - message.value = String(object.value); - if (object.sliceSpec != null) { - if (typeof object.sliceSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.sliceSpec: object expected"); - message.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.fromObject(object.sliceSpec); + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction(); + if (object.viewRestApi != null) { + if (typeof object.viewRestApi !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.viewRestApi: object expected"); + message.viewRestApi = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.fromObject(object.viewRestApi); + } + if (object.openNotebook != null) { + if (typeof object.openNotebook !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.openNotebook: object expected"); + message.openNotebook = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openNotebook); + } + if (object.createApplication != null) { + if (typeof object.createApplication !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.createApplication: object expected"); + message.createApplication = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.createApplication); + } + if (object.openFineTuningPipeline != null) { + if (typeof object.openFineTuningPipeline !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.openFineTuningPipeline: object expected"); + message.openFineTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openFineTuningPipeline); + } + if (object.openPromptTuningPipeline != null) { + if (typeof object.openPromptTuningPipeline !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.openPromptTuningPipeline: object expected"); + message.openPromptTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openPromptTuningPipeline); + } + if (object.openGenie != null) { + if (typeof object.openGenie !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.openGenie: object expected"); + message.openGenie = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openGenie); + } + if (object.deploy != null) { + if (typeof object.deploy !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.deploy: object expected"); + message.deploy = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.fromObject(object.deploy); + } + if (object.openGenerationAiStudio != null) { + if (typeof object.openGenerationAiStudio !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.openGenerationAiStudio: object expected"); + message.openGenerationAiStudio = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openGenerationAiStudio); + } + if (object.requestAccess != null) { + if (typeof object.requestAccess !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.requestAccess: object expected"); + message.requestAccess = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.requestAccess); } return message; }; /** - * Creates a plain object from a Slice message. Also converts values to other types if specified. + * Creates a plain object from a CallToAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice} message Slice + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction} message CallToAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Slice.toObject = function toObject(message, options) { + CallToAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.dimension = ""; - object.value = ""; - object.sliceSpec = null; + object.viewRestApi = null; + object.openNotebook = null; + object.createApplication = null; + object.openFineTuningPipeline = null; + object.openPromptTuningPipeline = null; + object.openGenie = null; + object.deploy = null; + object.openGenerationAiStudio = null; + object.requestAccess = null; } - if (message.dimension != null && message.hasOwnProperty("dimension")) - object.dimension = message.dimension; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.sliceSpec != null && message.hasOwnProperty("sliceSpec")) - object.sliceSpec = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.toObject(message.sliceSpec, options); + if (message.viewRestApi != null && message.hasOwnProperty("viewRestApi")) + object.viewRestApi = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.toObject(message.viewRestApi, options); + if (message.openNotebook != null && message.hasOwnProperty("openNotebook")) + object.openNotebook = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openNotebook, options); + if (message.createApplication != null && message.hasOwnProperty("createApplication")) + object.createApplication = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.createApplication, options); + if (message.openFineTuningPipeline != null && message.hasOwnProperty("openFineTuningPipeline")) + object.openFineTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openFineTuningPipeline, options); + if (message.openPromptTuningPipeline != null && message.hasOwnProperty("openPromptTuningPipeline")) + object.openPromptTuningPipeline = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openPromptTuningPipeline, options); + if (message.openGenie != null && message.hasOwnProperty("openGenie")) + object.openGenie = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openGenie, options); + if (message.deploy != null && message.hasOwnProperty("deploy")) + object.deploy = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.toObject(message.deploy, options); + if (message.openGenerationAiStudio != null && message.hasOwnProperty("openGenerationAiStudio")) + object.openGenerationAiStudio = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openGenerationAiStudio, options); + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) + object.requestAccess = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.requestAccess, options); return object; }; /** - * Converts this Slice to JSON. + * Converts this CallToAction to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @instance * @returns {Object.} JSON object */ - Slice.prototype.toJSON = function toJSON() { + CallToAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Slice + * Gets the default type url for CallToAction * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Slice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CallToAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction"; }; - Slice.SliceSpec = (function() { + CallToAction.RegionalResourceReferences = (function() { /** - * Properties of a SliceSpec. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice - * @interface ISliceSpec - * @property {Object.|null} [configs] SliceSpec configs + * Properties of a RegionalResourceReferences. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @interface IRegionalResourceReferences + * @property {Object.|null} [references] RegionalResourceReferences references + * @property {string|null} [title] RegionalResourceReferences title */ /** - * Constructs a new SliceSpec. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice - * @classdesc Represents a SliceSpec. - * @implements ISliceSpec + * Constructs a new RegionalResourceReferences. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @classdesc Represents a RegionalResourceReferences. + * @implements IRegionalResourceReferences * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences=} [properties] Properties to set */ - function SliceSpec(properties) { - this.configs = {}; + function RegionalResourceReferences(properties) { + this.references = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -123303,79 +128246,89 @@ } /** - * SliceSpec configs. - * @member {Object.} configs - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * RegionalResourceReferences references. + * @member {Object.} references + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences * @instance */ - SliceSpec.prototype.configs = $util.emptyObject; + RegionalResourceReferences.prototype.references = $util.emptyObject; /** - * Creates a new SliceSpec instance using the specified properties. + * RegionalResourceReferences title. + * @member {string} title + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @instance + */ + RegionalResourceReferences.prototype.title = ""; + + /** + * Creates a new RegionalResourceReferences instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec instance + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences} RegionalResourceReferences instance */ - SliceSpec.create = function create(properties) { - return new SliceSpec(properties); + RegionalResourceReferences.create = function create(properties) { + return new RegionalResourceReferences(properties); }; /** - * Encodes the specified SliceSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify|verify} messages. + * Encodes the specified RegionalResourceReferences message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec} message SliceSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences} message RegionalResourceReferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SliceSpec.encode = function encode(message, writer) { + RegionalResourceReferences.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.configs != null && Object.hasOwnProperty.call(message, "configs")) - for (var keys = Object.keys(message.configs), i = 0; i < keys.length; ++i) { + if (message.references != null && Object.hasOwnProperty.call(message, "references")) + for (var keys = Object.keys(message.references), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.encode(message.configs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference.encode(message.references[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); return writer; }; /** - * Encodes the specified SliceSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.verify|verify} messages. + * Encodes the specified RegionalResourceReferences message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.ISliceSpec} message SliceSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences} message RegionalResourceReferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SliceSpec.encodeDelimited = function encodeDelimited(message, writer) { + RegionalResourceReferences.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SliceSpec message from the specified reader or buffer. + * Decodes a RegionalResourceReferences message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences} RegionalResourceReferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SliceSpec.decode = function decode(reader, length) { + RegionalResourceReferences.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (message.configs === $util.emptyObject) - message.configs = {}; + if (message.references === $util.emptyObject) + message.references = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = null; @@ -123386,14 +128339,616 @@ key = reader.string(); break; case 2: - value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.decode(reader, reader.uint32()); + value = $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference.decode(reader, reader.uint32()); break; default: reader.skipType(tag2 & 7); break; } } - message.configs[key] = value; + message.references[key] = value; + break; + } + case 2: { + message.title = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionalResourceReferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences} RegionalResourceReferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionalResourceReferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionalResourceReferences message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionalResourceReferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.references != null && message.hasOwnProperty("references")) { + if (!$util.isObject(message.references)) + return "references: object expected"; + var key = Object.keys(message.references); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference.verify(message.references[key[i]]); + if (error) + return "references." + error; + } + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + return null; + }; + + /** + * Creates a RegionalResourceReferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences} RegionalResourceReferences + */ + RegionalResourceReferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences) + return object; + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences(); + if (object.references) { + if (typeof object.references !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.references: object expected"); + message.references = {}; + for (var keys = Object.keys(object.references), i = 0; i < keys.length; ++i) { + if (typeof object.references[keys[i]] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences.references: object expected"); + message.references[keys[i]] = $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference.fromObject(object.references[keys[i]]); + } + } + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a RegionalResourceReferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences} message RegionalResourceReferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionalResourceReferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.references = {}; + if (options.defaults) + object.title = ""; + var keys2; + if (message.references && (keys2 = Object.keys(message.references)).length) { + object.references = {}; + for (var j = 0; j < keys2.length; ++j) + object.references[keys2[j]] = $root.google.cloud.aiplatform.v1.PublisherModel.ResourceReference.toObject(message.references[keys2[j]], options); + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + return object; + }; + + /** + * Converts this RegionalResourceReferences to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @instance + * @returns {Object.} JSON object + */ + RegionalResourceReferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegionalResourceReferences + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegionalResourceReferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction.RegionalResourceReferences"; + }; + + return RegionalResourceReferences; + })(); + + CallToAction.ViewRestApi = (function() { + + /** + * Properties of a ViewRestApi. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @interface IViewRestApi + * @property {Array.|null} [documentations] ViewRestApi documentations + * @property {string|null} [title] ViewRestApi title + */ + + /** + * Constructs a new ViewRestApi. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @classdesc Represents a ViewRestApi. + * @implements IViewRestApi + * @constructor + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi=} [properties] Properties to set + */ + function ViewRestApi(properties) { + this.documentations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViewRestApi documentations. + * @member {Array.} documentations + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @instance + */ + ViewRestApi.prototype.documentations = $util.emptyArray; + + /** + * ViewRestApi title. + * @member {string} title + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @instance + */ + ViewRestApi.prototype.title = ""; + + /** + * Creates a new ViewRestApi instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi} ViewRestApi instance + */ + ViewRestApi.create = function create(properties) { + return new ViewRestApi(properties); + }; + + /** + * Encodes the specified ViewRestApi message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi} message ViewRestApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewRestApi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentations != null && message.documentations.length) + for (var i = 0; i < message.documentations.length; ++i) + $root.google.cloud.aiplatform.v1.PublisherModel.Documentation.encode(message.documentations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + return writer; + }; + + /** + * Encodes the specified ViewRestApi message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IViewRestApi} message ViewRestApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewRestApi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViewRestApi message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi} ViewRestApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewRestApi.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documentations && message.documentations.length)) + message.documentations = []; + message.documentations.push($root.google.cloud.aiplatform.v1.PublisherModel.Documentation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.title = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViewRestApi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi} ViewRestApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewRestApi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViewRestApi message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViewRestApi.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentations != null && message.hasOwnProperty("documentations")) { + if (!Array.isArray(message.documentations)) + return "documentations: array expected"; + for (var i = 0; i < message.documentations.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.Documentation.verify(message.documentations[i]); + if (error) + return "documentations." + error; + } + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + return null; + }; + + /** + * Creates a ViewRestApi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi} ViewRestApi + */ + ViewRestApi.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi) + return object; + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi(); + if (object.documentations) { + if (!Array.isArray(object.documentations)) + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.documentations: array expected"); + message.documentations = []; + for (var i = 0; i < object.documentations.length; ++i) { + if (typeof object.documentations[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi.documentations: object expected"); + message.documentations[i] = $root.google.cloud.aiplatform.v1.PublisherModel.Documentation.fromObject(object.documentations[i]); + } + } + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a ViewRestApi message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi} message ViewRestApi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViewRestApi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentations = []; + if (options.defaults) + object.title = ""; + if (message.documentations && message.documentations.length) { + object.documentations = []; + for (var j = 0; j < message.documentations.length; ++j) + object.documentations[j] = $root.google.cloud.aiplatform.v1.PublisherModel.Documentation.toObject(message.documentations[j], options); + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + return object; + }; + + /** + * Converts this ViewRestApi to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @instance + * @returns {Object.} JSON object + */ + ViewRestApi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViewRestApi + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViewRestApi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction.ViewRestApi"; + }; + + return ViewRestApi; + })(); + + CallToAction.Deploy = (function() { + + /** + * Properties of a Deploy. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @interface IDeploy + * @property {google.cloud.aiplatform.v1.IDedicatedResources|null} [dedicatedResources] Deploy dedicatedResources + * @property {google.cloud.aiplatform.v1.IAutomaticResources|null} [automaticResources] Deploy automaticResources + * @property {string|null} [sharedResources] Deploy sharedResources + * @property {string|null} [modelDisplayName] Deploy modelDisplayName + * @property {google.cloud.aiplatform.v1.ILargeModelReference|null} [largeModelReference] Deploy largeModelReference + * @property {google.cloud.aiplatform.v1.IModelContainerSpec|null} [containerSpec] Deploy containerSpec + * @property {string|null} [artifactUri] Deploy artifactUri + * @property {string|null} [title] Deploy title + */ + + /** + * Constructs a new Deploy. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction + * @classdesc Represents a Deploy. + * @implements IDeploy + * @constructor + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy=} [properties] Properties to set + */ + function Deploy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deploy dedicatedResources. + * @member {google.cloud.aiplatform.v1.IDedicatedResources|null|undefined} dedicatedResources + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.dedicatedResources = null; + + /** + * Deploy automaticResources. + * @member {google.cloud.aiplatform.v1.IAutomaticResources|null|undefined} automaticResources + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.automaticResources = null; + + /** + * Deploy sharedResources. + * @member {string|null|undefined} sharedResources + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.sharedResources = null; + + /** + * Deploy modelDisplayName. + * @member {string} modelDisplayName + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.modelDisplayName = ""; + + /** + * Deploy largeModelReference. + * @member {google.cloud.aiplatform.v1.ILargeModelReference|null|undefined} largeModelReference + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.largeModelReference = null; + + /** + * Deploy containerSpec. + * @member {google.cloud.aiplatform.v1.IModelContainerSpec|null|undefined} containerSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.containerSpec = null; + + /** + * Deploy artifactUri. + * @member {string} artifactUri + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.artifactUri = ""; + + /** + * Deploy title. + * @member {string} title + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.title = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Deploy predictionResources. + * @member {"dedicatedResources"|"automaticResources"|"sharedResources"|undefined} predictionResources + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Object.defineProperty(Deploy.prototype, "predictionResources", { + get: $util.oneOfGetter($oneOfFields = ["dedicatedResources", "automaticResources", "sharedResources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Deploy instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy} Deploy instance + */ + Deploy.create = function create(properties) { + return new Deploy(properties); + }; + + /** + * Encodes the specified Deploy message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy} message Deploy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deploy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelDisplayName); + if (message.largeModelReference != null && Object.hasOwnProperty.call(message, "largeModelReference")) + $root.google.cloud.aiplatform.v1.LargeModelReference.encode(message.largeModelReference, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.containerSpec != null && Object.hasOwnProperty.call(message, "containerSpec")) + $root.google.cloud.aiplatform.v1.ModelContainerSpec.encode(message.containerSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.artifactUri != null && Object.hasOwnProperty.call(message, "artifactUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.artifactUri); + if (message.dedicatedResources != null && Object.hasOwnProperty.call(message, "dedicatedResources")) + $root.google.cloud.aiplatform.v1.DedicatedResources.encode(message.dedicatedResources, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.automaticResources != null && Object.hasOwnProperty.call(message, "automaticResources")) + $root.google.cloud.aiplatform.v1.AutomaticResources.encode(message.automaticResources, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sharedResources != null && Object.hasOwnProperty.call(message, "sharedResources")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.sharedResources); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); + return writer; + }; + + /** + * Encodes the specified Deploy message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.IDeploy} message Deploy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deploy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deploy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy} Deploy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deploy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.dedicatedResources = $root.google.cloud.aiplatform.v1.DedicatedResources.decode(reader, reader.uint32()); + break; + } + case 6: { + message.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.decode(reader, reader.uint32()); + break; + } + case 7: { + message.sharedResources = reader.string(); + break; + } + case 1: { + message.modelDisplayName = reader.string(); + break; + } + case 2: { + message.largeModelReference = $root.google.cloud.aiplatform.v1.LargeModelReference.decode(reader, reader.uint32()); + break; + } + case 3: { + message.containerSpec = $root.google.cloud.aiplatform.v1.ModelContainerSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.artifactUri = reader.string(); + break; + } + case 8: { + message.title = reader.string(); break; } default: @@ -123405,901 +128960,246 @@ }; /** - * Decodes a SliceSpec message from the specified reader or buffer, length delimited. + * Decodes a Deploy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy} Deploy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SliceSpec.decodeDelimited = function decodeDelimited(reader) { + Deploy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SliceSpec message. + * Verifies a Deploy message. * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SliceSpec.verify = function verify(message) { + Deploy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.configs != null && message.hasOwnProperty("configs")) { - if (!$util.isObject(message.configs)) - return "configs: object expected"; - var key = Object.keys(message.configs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify(message.configs[key[i]]); + var properties = {}; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) { + properties.predictionResources = 1; + { + var error = $root.google.cloud.aiplatform.v1.DedicatedResources.verify(message.dedicatedResources); if (error) - return "configs." + error; + return "dedicatedResources." + error; + } + } + if (message.automaticResources != null && message.hasOwnProperty("automaticResources")) { + if (properties.predictionResources === 1) + return "predictionResources: multiple values"; + properties.predictionResources = 1; + { + var error = $root.google.cloud.aiplatform.v1.AutomaticResources.verify(message.automaticResources); + if (error) + return "automaticResources." + error; } } + if (message.sharedResources != null && message.hasOwnProperty("sharedResources")) { + if (properties.predictionResources === 1) + return "predictionResources: multiple values"; + properties.predictionResources = 1; + if (!$util.isString(message.sharedResources)) + return "sharedResources: string expected"; + } + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + if (!$util.isString(message.modelDisplayName)) + return "modelDisplayName: string expected"; + if (message.largeModelReference != null && message.hasOwnProperty("largeModelReference")) { + var error = $root.google.cloud.aiplatform.v1.LargeModelReference.verify(message.largeModelReference); + if (error) + return "largeModelReference." + error; + } + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) { + var error = $root.google.cloud.aiplatform.v1.ModelContainerSpec.verify(message.containerSpec); + if (error) + return "containerSpec." + error; + } + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + if (!$util.isString(message.artifactUri)) + return "artifactUri: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; return null; }; /** - * Creates a SliceSpec message from a plain object. Also converts values to their respective internal types. + * Creates a Deploy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} SliceSpec + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy} Deploy */ - SliceSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec) + Deploy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy) return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec(); - if (object.configs) { - if (typeof object.configs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.configs: object expected"); - message.configs = {}; - for (var keys = Object.keys(object.configs), i = 0; i < keys.length; ++i) { - if (typeof object.configs[keys[i]] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.configs: object expected"); - message.configs[keys[i]] = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.fromObject(object.configs[keys[i]]); - } + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy(); + if (object.dedicatedResources != null) { + if (typeof object.dedicatedResources !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.dedicatedResources: object expected"); + message.dedicatedResources = $root.google.cloud.aiplatform.v1.DedicatedResources.fromObject(object.dedicatedResources); + } + if (object.automaticResources != null) { + if (typeof object.automaticResources !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.automaticResources: object expected"); + message.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.fromObject(object.automaticResources); + } + if (object.sharedResources != null) + message.sharedResources = String(object.sharedResources); + if (object.modelDisplayName != null) + message.modelDisplayName = String(object.modelDisplayName); + if (object.largeModelReference != null) { + if (typeof object.largeModelReference !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.largeModelReference: object expected"); + message.largeModelReference = $root.google.cloud.aiplatform.v1.LargeModelReference.fromObject(object.largeModelReference); + } + if (object.containerSpec != null) { + if (typeof object.containerSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.containerSpec: object expected"); + message.containerSpec = $root.google.cloud.aiplatform.v1.ModelContainerSpec.fromObject(object.containerSpec); } + if (object.artifactUri != null) + message.artifactUri = String(object.artifactUri); + if (object.title != null) + message.title = String(object.title); return message; }; /** - * Creates a plain object from a SliceSpec message. Also converts values to other types if specified. + * Creates a plain object from a Deploy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec} message SliceSpec + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy} message Deploy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SliceSpec.toObject = function toObject(message, options) { + Deploy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.configs = {}; - var keys2; - if (message.configs && (keys2 = Object.keys(message.configs)).length) { - object.configs = {}; - for (var j = 0; j < keys2.length; ++j) - object.configs[keys2[j]] = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.toObject(message.configs[keys2[j]], options); + if (options.defaults) { + object.modelDisplayName = ""; + object.largeModelReference = null; + object.containerSpec = null; + object.artifactUri = ""; + object.title = ""; + } + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + object.modelDisplayName = message.modelDisplayName; + if (message.largeModelReference != null && message.hasOwnProperty("largeModelReference")) + object.largeModelReference = $root.google.cloud.aiplatform.v1.LargeModelReference.toObject(message.largeModelReference, options); + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) + object.containerSpec = $root.google.cloud.aiplatform.v1.ModelContainerSpec.toObject(message.containerSpec, options); + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + object.artifactUri = message.artifactUri; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) { + object.dedicatedResources = $root.google.cloud.aiplatform.v1.DedicatedResources.toObject(message.dedicatedResources, options); + if (options.oneofs) + object.predictionResources = "dedicatedResources"; + } + if (message.automaticResources != null && message.hasOwnProperty("automaticResources")) { + object.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.toObject(message.automaticResources, options); + if (options.oneofs) + object.predictionResources = "automaticResources"; + } + if (message.sharedResources != null && message.hasOwnProperty("sharedResources")) { + object.sharedResources = message.sharedResources; + if (options.oneofs) + object.predictionResources = "sharedResources"; } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; return object; }; /** - * Converts this SliceSpec to JSON. + * Converts this Deploy to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @instance * @returns {Object.} JSON object */ - SliceSpec.prototype.toJSON = function toJSON() { + Deploy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SliceSpec + * Gets the default type url for Deploy * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SliceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Deploy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy"; }; - SliceSpec.SliceConfig = (function() { - - /** - * Properties of a SliceConfig. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @interface ISliceConfig - * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue|null} [value] SliceConfig value - * @property {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange|null} [range] SliceConfig range - * @property {google.protobuf.IBoolValue|null} [allValues] SliceConfig allValues - */ - - /** - * Constructs a new SliceConfig. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @classdesc Represents a SliceConfig. - * @implements ISliceConfig - * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig=} [properties] Properties to set - */ - function SliceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SliceConfig value. - * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue|null|undefined} value - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @instance - */ - SliceConfig.prototype.value = null; - - /** - * SliceConfig range. - * @member {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange|null|undefined} range - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @instance - */ - SliceConfig.prototype.range = null; - - /** - * SliceConfig allValues. - * @member {google.protobuf.IBoolValue|null|undefined} allValues - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @instance - */ - SliceConfig.prototype.allValues = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SliceConfig kind. - * @member {"value"|"range"|"allValues"|undefined} kind - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @instance - */ - Object.defineProperty(SliceConfig.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["value", "range", "allValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SliceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig instance - */ - SliceConfig.create = function create(properties) { - return new SliceConfig(properties); - }; - - /** - * Encodes the specified SliceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig} message SliceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SliceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.encode(message.value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.range != null && Object.hasOwnProperty.call(message, "range")) - $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) - $root.google.protobuf.BoolValue.encode(message.allValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SliceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.ISliceConfig} message SliceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SliceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SliceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SliceConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allValues = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SliceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SliceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SliceConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SliceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.kind = 1; - { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify(message.value); - if (error) - return "value." + error; - } - } - if (message.range != null && message.hasOwnProperty("range")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify(message.range); - if (error) - return "range." + error; - } - } - if (message.allValues != null && message.hasOwnProperty("allValues")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.BoolValue.verify(message.allValues); - if (error) - return "allValues." + error; - } - } - return null; - }; - - /** - * Creates a SliceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} SliceConfig - */ - SliceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig(); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.value: object expected"); - message.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.fromObject(object.value); - } - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.range: object expected"); - message.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.fromObject(object.range); - } - if (object.allValues != null) { - if (typeof object.allValues !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig.allValues: object expected"); - message.allValues = $root.google.protobuf.BoolValue.fromObject(object.allValues); - } - return message; - }; - - /** - * Creates a plain object from a SliceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig} message SliceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SliceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.toObject(message.value, options); - if (options.oneofs) - object.kind = "value"; - } - if (message.range != null && message.hasOwnProperty("range")) { - object.range = $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.toObject(message.range, options); - if (options.oneofs) - object.kind = "range"; - } - if (message.allValues != null && message.hasOwnProperty("allValues")) { - object.allValues = $root.google.protobuf.BoolValue.toObject(message.allValues, options); - if (options.oneofs) - object.kind = "allValues"; - } - return object; - }; - - /** - * Converts this SliceConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @instance - * @returns {Object.} JSON object - */ - SliceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SliceConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SliceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig"; - }; - - return SliceConfig; - })(); - - SliceSpec.Range = (function() { - - /** - * Properties of a Range. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @interface IRange - * @property {number|null} [low] Range low - * @property {number|null} [high] Range high - */ - - /** - * Constructs a new Range. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange=} [properties] Properties to set - */ - function Range(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Range low. - * @member {number} low - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @instance - */ - Range.prototype.low = 0; - - /** - * Range high. - * @member {number} high - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @instance - */ - Range.prototype.high = 0; - - /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range instance - */ - Range.create = function create(properties) { - return new Range(properties); - }; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.low != null && Object.hasOwnProperty.call(message, "low")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.low); - if (message.high != null && Object.hasOwnProperty.call(message, "high")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.high); - return writer; - }; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Range message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.low = reader.float(); - break; - } - case 2: { - message.high = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Range message. - * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Range.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.low != null && message.hasOwnProperty("low")) - if (typeof message.low !== "number") - return "low: number expected"; - if (message.high != null && message.hasOwnProperty("high")) - if (typeof message.high !== "number") - return "high: number expected"; - return null; - }; - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} Range - */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range) - return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range(); - if (object.low != null) - message.low = Number(object.low); - if (object.high != null) - message.high = Number(object.high); - return message; - }; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.low = 0; - object.high = 0; - } - if (message.low != null && message.hasOwnProperty("low")) - object.low = options.json && !isFinite(message.low) ? String(message.low) : message.low; - if (message.high != null && message.hasOwnProperty("high")) - object.high = options.json && !isFinite(message.high) ? String(message.high) : message.high; - return object; - }; - - /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @instance - * @returns {Object.} JSON object - */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Range - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range"; - }; - - return Range; - })(); - - SliceSpec.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @interface IValue - * @property {string|null} [stringValue] Value stringValue - * @property {number|null} [floatValue] Value floatValue - */ - - /** - * Constructs a new Value. - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value floatValue. - * @member {number|null|undefined} floatValue - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @instance - */ - Value.prototype.floatValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"stringValue"|"floatValue"|undefined} kind - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["stringValue", "floatValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); - if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.floatValue); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.stringValue = reader.string(); - break; - } - case 2: { - message.floatValue = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.floatValue != null && message.hasOwnProperty("floatValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.floatValue !== "number") - return "floatValue: number expected"; - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value) - return object; - var message = new $root.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value(); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.floatValue != null) - message.floatValue = Number(object.floatValue); - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.floatValue != null && message.hasOwnProperty("floatValue")) { - object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; - if (options.oneofs) - object.kind = "floatValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value"; - }; + return Deploy; + })(); - return Value; - })(); + return CallToAction; + })(); - return SliceSpec; - })(); + /** + * OpenSourceCategory enum. + * @name google.cloud.aiplatform.v1.PublisherModel.OpenSourceCategory + * @enum {number} + * @property {number} OPEN_SOURCE_CATEGORY_UNSPECIFIED=0 OPEN_SOURCE_CATEGORY_UNSPECIFIED value + * @property {number} PROPRIETARY=1 PROPRIETARY value + * @property {number} GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT=2 GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT value + * @property {number} THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT=3 THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT value + * @property {number} GOOGLE_OWNED_OSS=4 GOOGLE_OWNED_OSS value + * @property {number} THIRD_PARTY_OWNED_OSS=5 THIRD_PARTY_OWNED_OSS value + */ + PublisherModel.OpenSourceCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPEN_SOURCE_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPRIETARY"] = 1; + values[valuesById[2] = "GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT"] = 2; + values[valuesById[3] = "THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT"] = 3; + values[valuesById[4] = "GOOGLE_OWNED_OSS"] = 4; + values[valuesById[5] = "THIRD_PARTY_OWNED_OSS"] = 5; + return values; + })(); - return Slice; + /** + * LaunchStage enum. + * @name google.cloud.aiplatform.v1.PublisherModel.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} EXPERIMENTAL=1 EXPERIMENTAL value + * @property {number} PRIVATE_PREVIEW=2 PRIVATE_PREVIEW value + * @property {number} PUBLIC_PREVIEW=3 PUBLIC_PREVIEW value + * @property {number} GA=4 GA value + */ + PublisherModel.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXPERIMENTAL"] = 1; + values[valuesById[2] = "PRIVATE_PREVIEW"] = 2; + values[valuesById[3] = "PUBLIC_PREVIEW"] = 3; + values[valuesById[4] = "GA"] = 4; + return values; })(); - return ModelEvaluationSlice; + return PublisherModel; })(); v1.ModelService = (function() { @@ -252815,6 +257715,7 @@ * @property {Array.|null} [sourceUris] ImportFeatureValuesOperationMetadata sourceUris * @property {number|Long|null} [invalidRowCount] ImportFeatureValuesOperationMetadata invalidRowCount * @property {number|Long|null} [timestampOutsideRetentionRowsCount] ImportFeatureValuesOperationMetadata timestampOutsideRetentionRowsCount + * @property {Array.|null} [blockingOperationIds] ImportFeatureValuesOperationMetadata blockingOperationIds */ /** @@ -252827,6 +257728,7 @@ */ function ImportFeatureValuesOperationMetadata(properties) { this.sourceUris = []; + this.blockingOperationIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -252881,6 +257783,14 @@ */ ImportFeatureValuesOperationMetadata.prototype.timestampOutsideRetentionRowsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ImportFeatureValuesOperationMetadata blockingOperationIds. + * @member {Array.} blockingOperationIds + * @memberof google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata + * @instance + */ + ImportFeatureValuesOperationMetadata.prototype.blockingOperationIds = $util.emptyArray; + /** * Creates a new ImportFeatureValuesOperationMetadata instance using the specified properties. * @function create @@ -252918,6 +257828,12 @@ writer.uint32(/* id 6, wireType 0 =*/48).int64(message.invalidRowCount); if (message.timestampOutsideRetentionRowsCount != null && Object.hasOwnProperty.call(message, "timestampOutsideRetentionRowsCount")) writer.uint32(/* id 7, wireType 0 =*/56).int64(message.timestampOutsideRetentionRowsCount); + if (message.blockingOperationIds != null && message.blockingOperationIds.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.blockingOperationIds.length; ++i) + writer.int64(message.blockingOperationIds[i]); + writer.ldelim(); + } return writer; }; @@ -252978,6 +257894,17 @@ message.timestampOutsideRetentionRowsCount = reader.int64(); break; } + case 8: { + if (!(message.blockingOperationIds && message.blockingOperationIds.length)) + message.blockingOperationIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.blockingOperationIds.push(reader.int64()); + } else + message.blockingOperationIds.push(reader.int64()); + break; + } default: reader.skipType(tag & 7); break; @@ -253037,6 +257964,13 @@ if (message.timestampOutsideRetentionRowsCount != null && message.hasOwnProperty("timestampOutsideRetentionRowsCount")) if (!$util.isInteger(message.timestampOutsideRetentionRowsCount) && !(message.timestampOutsideRetentionRowsCount && $util.isInteger(message.timestampOutsideRetentionRowsCount.low) && $util.isInteger(message.timestampOutsideRetentionRowsCount.high))) return "timestampOutsideRetentionRowsCount: integer|Long expected"; + if (message.blockingOperationIds != null && message.hasOwnProperty("blockingOperationIds")) { + if (!Array.isArray(message.blockingOperationIds)) + return "blockingOperationIds: array expected"; + for (var i = 0; i < message.blockingOperationIds.length; ++i) + if (!$util.isInteger(message.blockingOperationIds[i]) && !(message.blockingOperationIds[i] && $util.isInteger(message.blockingOperationIds[i].low) && $util.isInteger(message.blockingOperationIds[i].high))) + return "blockingOperationIds: integer|Long[] expected"; + } return null; }; @@ -253100,6 +258034,20 @@ message.timestampOutsideRetentionRowsCount = object.timestampOutsideRetentionRowsCount; else if (typeof object.timestampOutsideRetentionRowsCount === "object") message.timestampOutsideRetentionRowsCount = new $util.LongBits(object.timestampOutsideRetentionRowsCount.low >>> 0, object.timestampOutsideRetentionRowsCount.high >>> 0).toNumber(); + if (object.blockingOperationIds) { + if (!Array.isArray(object.blockingOperationIds)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.blockingOperationIds: array expected"); + message.blockingOperationIds = []; + for (var i = 0; i < object.blockingOperationIds.length; ++i) + if ($util.Long) + (message.blockingOperationIds[i] = $util.Long.fromValue(object.blockingOperationIds[i])).unsigned = false; + else if (typeof object.blockingOperationIds[i] === "string") + message.blockingOperationIds[i] = parseInt(object.blockingOperationIds[i], 10); + else if (typeof object.blockingOperationIds[i] === "number") + message.blockingOperationIds[i] = object.blockingOperationIds[i]; + else if (typeof object.blockingOperationIds[i] === "object") + message.blockingOperationIds[i] = new $util.LongBits(object.blockingOperationIds[i].low >>> 0, object.blockingOperationIds[i].high >>> 0).toNumber(); + } return message; }; @@ -253116,8 +258064,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.sourceUris = []; + object.blockingOperationIds = []; + } if (options.defaults) { object.genericMetadata = null; if ($util.Long) { @@ -253168,6 +258118,14 @@ object.timestampOutsideRetentionRowsCount = options.longs === String ? String(message.timestampOutsideRetentionRowsCount) : message.timestampOutsideRetentionRowsCount; else object.timestampOutsideRetentionRowsCount = options.longs === String ? $util.Long.prototype.toString.call(message.timestampOutsideRetentionRowsCount) : options.longs === Number ? new $util.LongBits(message.timestampOutsideRetentionRowsCount.low >>> 0, message.timestampOutsideRetentionRowsCount.high >>> 0).toNumber() : message.timestampOutsideRetentionRowsCount; + if (message.blockingOperationIds && message.blockingOperationIds.length) { + object.blockingOperationIds = []; + for (var j = 0; j < message.blockingOperationIds.length; ++j) + if (typeof message.blockingOperationIds[j] === "number") + object.blockingOperationIds[j] = options.longs === String ? String(message.blockingOperationIds[j]) : message.blockingOperationIds[j]; + else + object.blockingOperationIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.blockingOperationIds[j]) : options.longs === Number ? new $util.LongBits(message.blockingOperationIds[j].low >>> 0, message.blockingOperationIds[j].high >>> 0).toNumber() : message.blockingOperationIds[j]; + } return object; }; @@ -313814,6 +318772,7 @@ * @property {google.cloud.aiplatform.v1beta1.PublisherModel.OpenSourceCategory|null} [openSourceCategory] PublisherModel openSourceCategory * @property {google.cloud.aiplatform.v1beta1.PublisherModel.ICallToAction|null} [supportedActions] PublisherModel supportedActions * @property {Array.|null} [frameworks] PublisherModel frameworks + * @property {google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage|null} [launchStage] PublisherModel launchStage * @property {string|null} [publisherModelTemplate] PublisherModel publisherModelTemplate * @property {google.cloud.aiplatform.v1beta1.IPredictSchemata|null} [predictSchemata] PublisherModel predictSchemata */ @@ -313874,6 +318833,14 @@ */ PublisherModel.prototype.frameworks = $util.emptyArray; + /** + * PublisherModel launchStage. + * @member {google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage} launchStage + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel + * @instance + */ + PublisherModel.prototype.launchStage = 0; + /** * PublisherModel publisherModelTemplate. * @member {string} publisherModelTemplate @@ -313925,6 +318892,8 @@ if (message.frameworks != null && message.frameworks.length) for (var i = 0; i < message.frameworks.length; ++i) writer.uint32(/* id 23, wireType 2 =*/186).string(message.frameworks[i]); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.launchStage); if (message.publisherModelTemplate != null && Object.hasOwnProperty.call(message, "publisherModelTemplate")) writer.uint32(/* id 30, wireType 2 =*/242).string(message.publisherModelTemplate); if (message.predictSchemata != null && Object.hasOwnProperty.call(message, "predictSchemata")) @@ -313985,6 +318954,10 @@ message.frameworks.push(reader.string()); break; } + case 29: { + message.launchStage = reader.int32(); + break; + } case 30: { message.publisherModelTemplate = reader.string(); break; @@ -314058,6 +319031,17 @@ if (!$util.isString(message.frameworks[i])) return "frameworks: string[] expected"; } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } if (message.publisherModelTemplate != null && message.hasOwnProperty("publisherModelTemplate")) if (!$util.isString(message.publisherModelTemplate)) return "publisherModelTemplate: string expected"; @@ -314129,6 +319113,34 @@ for (var i = 0; i < object.frameworks.length; ++i) message.frameworks[i] = String(object.frameworks[i]); } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "EXPERIMENTAL": + case 1: + message.launchStage = 1; + break; + case "PRIVATE_PREVIEW": + case 2: + message.launchStage = 2; + break; + case "PUBLIC_PREVIEW": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + } if (object.publisherModelTemplate != null) message.publisherModelTemplate = String(object.publisherModelTemplate); if (object.predictSchemata != null) { @@ -314159,6 +319171,7 @@ object.versionId = ""; object.openSourceCategory = options.enums === String ? "OPEN_SOURCE_CATEGORY_UNSPECIFIED" : 0; object.supportedActions = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; object.publisherModelTemplate = ""; object.predictSchemata = null; } @@ -314175,6 +319188,8 @@ for (var j = 0; j < message.frameworks.length; ++j) object.frameworks[j] = message.frameworks[j]; } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage[message.launchStage] : message.launchStage; if (message.publisherModelTemplate != null && message.hasOwnProperty("publisherModelTemplate")) object.publisherModelTemplate = message.publisherModelTemplate; if (message.predictSchemata != null && message.hasOwnProperty("predictSchemata")) @@ -314699,6 +319714,7 @@ * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenie] CallToAction openGenie * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy|null} [deploy] CallToAction deploy * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenerationAiStudio] CallToAction openGenerationAiStudio + * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [requestAccess] CallToAction requestAccess */ /** @@ -314780,6 +319796,14 @@ */ CallToAction.prototype.openGenerationAiStudio = null; + /** + * CallToAction requestAccess. + * @member {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null|undefined} requestAccess + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.requestAccess = null; + /** * Creates a new CallToAction instance using the specified properties. * @function create @@ -314820,6 +319844,8 @@ $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.encode(message.deploy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.openGenerationAiStudio != null && Object.hasOwnProperty.call(message, "openGenerationAiStudio")) $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.openGenerationAiStudio, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestAccess != null && Object.hasOwnProperty.call(message, "requestAccess")) + $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.encode(message.requestAccess, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -314886,6 +319912,10 @@ message.openGenerationAiStudio = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); break; } + case 9: { + message.requestAccess = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -314961,6 +319991,11 @@ if (error) return "openGenerationAiStudio." + error; } + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) { + var error = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.verify(message.requestAccess); + if (error) + return "requestAccess." + error; + } return null; }; @@ -315016,6 +320051,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.openGenerationAiStudio: object expected"); message.openGenerationAiStudio = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.openGenerationAiStudio); } + if (object.requestAccess != null) { + if (typeof object.requestAccess !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.requestAccess: object expected"); + message.requestAccess = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.fromObject(object.requestAccess); + } return message; }; @@ -315041,6 +320081,7 @@ object.openGenie = null; object.deploy = null; object.openGenerationAiStudio = null; + object.requestAccess = null; } if (message.viewRestApi != null && message.hasOwnProperty("viewRestApi")) object.viewRestApi = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.ViewRestApi.toObject(message.viewRestApi, options); @@ -315058,6 +320099,8 @@ object.deploy = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.toObject(message.deploy, options); if (message.openGenerationAiStudio != null && message.hasOwnProperty("openGenerationAiStudio")) object.openGenerationAiStudio = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.openGenerationAiStudio, options); + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) + object.requestAccess = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.RegionalResourceReferences.toObject(message.requestAccess, options); return object; }; @@ -316047,6 +321090,26 @@ return values; })(); + /** + * LaunchStage enum. + * @name google.cloud.aiplatform.v1beta1.PublisherModel.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} EXPERIMENTAL=1 EXPERIMENTAL value + * @property {number} PRIVATE_PREVIEW=2 PRIVATE_PREVIEW value + * @property {number} PUBLIC_PREVIEW=3 PUBLIC_PREVIEW value + * @property {number} GA=4 GA value + */ + PublisherModel.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXPERIMENTAL"] = 1; + values[valuesById[2] = "PRIVATE_PREVIEW"] = 2; + values[valuesById[3] = "PUBLIC_PREVIEW"] = 3; + values[valuesById[4] = "GA"] = 4; + return values; + })(); + return PublisherModel; })(); diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 779d16241963..01ba6cca4b49 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -28,6 +28,7 @@ "NVIDIA_TESLA_P4": 4, "NVIDIA_TESLA_T4": 5, "NVIDIA_TESLA_A100": 8, + "NVIDIA_A100_80GB": 9, "NVIDIA_L4": 11, "TPU_V2": 6, "TPU_V3": 7, @@ -1610,6 +1611,13 @@ "(google.api.resource_reference).type": "aiplatform.googleapis.com/TrainingPipeline" } }, + "pipelineJob": { + "type": "string", + "id": 47, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PipelineJob" + } + }, "containerSpec": { "type": "ModelContainerSpec", "id": 9, @@ -1760,6 +1768,17 @@ } } }, + "LargeModelReference": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "PredictSchemata": { "fields": { "instanceSchemaUri": { @@ -6496,6 +6515,11 @@ "timestampOutsideRetentionRowsCount": { "type": "int64", "id": 7 + }, + "blockingOperationIds": { + "rule": "repeated", + "type": "int64", + "id": 8 } } }, @@ -11014,6 +11038,166 @@ } } }, + "MatchService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "FindNeighbors": { + "requestType": "FindNeighborsRequest", + "responseType": "FindNeighborsResponse", + "options": { + "(google.api.http).post": "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:findNeighbors", + "body": "*" + } + } + ] + }, + "ReadIndexDatapoints": { + "requestType": "ReadIndexDatapointsRequest", + "responseType": "ReadIndexDatapointsResponse", + "options": { + "(google.api.http).post": "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:readIndexDatapoints", + "body": "*" + } + } + ] + } + } + }, + "FindNeighborsRequest": { + "fields": { + "indexEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/IndexEndpoint" + } + }, + "deployedIndexId": { + "type": "string", + "id": 2 + }, + "queries": { + "rule": "repeated", + "type": "Query", + "id": 3 + }, + "returnFullDatapoint": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "Query": { + "fields": { + "datapoint": { + "type": "IndexDatapoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "neighborCount": { + "type": "int32", + "id": 2 + }, + "perCrowdingAttributeNeighborCount": { + "type": "int32", + "id": 3 + }, + "approximateNeighborCount": { + "type": "int32", + "id": 4 + }, + "fractionLeafNodesToSearchOverride": { + "type": "double", + "id": 5 + } + } + } + } + }, + "FindNeighborsResponse": { + "fields": { + "nearestNeighbors": { + "rule": "repeated", + "type": "NearestNeighbors", + "id": 1 + } + }, + "nested": { + "Neighbor": { + "fields": { + "datapoint": { + "type": "IndexDatapoint", + "id": 1 + }, + "distance": { + "type": "double", + "id": 2 + } + } + }, + "NearestNeighbors": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "neighbors": { + "rule": "repeated", + "type": "Neighbor", + "id": 2 + } + } + } + } + }, + "ReadIndexDatapointsRequest": { + "fields": { + "indexEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/IndexEndpoint" + } + }, + "deployedIndexId": { + "type": "string", + "id": 2 + }, + "ids": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ReadIndexDatapointsResponse": { + "fields": { + "datapoints": { + "rule": "repeated", + "type": "IndexDatapoint", + "id": 1 + } + } + }, "MetadataSchema": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/MetadataSchema", @@ -13318,6 +13502,357 @@ } } }, + "ModelGardenService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetPublisherModel": { + "requestType": "GetPublisherModelRequest", + "responseType": "PublisherModel", + "options": { + "(google.api.http).get": "/v1/{name=publishers/*/models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=publishers/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "PublisherModelView": { + "values": { + "PUBLISHER_MODEL_VIEW_UNSPECIFIED": 0, + "PUBLISHER_MODEL_VIEW_BASIC": 1, + "PUBLISHER_MODEL_VIEW_FULL": 2, + "PUBLISHER_MODEL_VERSION_VIEW_BASIC": 3 + } + }, + "GetPublisherModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "PublisherModelView", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PublisherModel": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/PublisherModel", + "(google.api.resource).pattern": "publishers/{publisher}/models/{model}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "openSourceCategory": { + "type": "OpenSourceCategory", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "supportedActions": { + "type": "CallToAction", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "frameworks": { + "rule": "repeated", + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publisherModelTemplate": { + "type": "string", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "predictSchemata": { + "type": "PredictSchemata", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceReference": { + "oneofs": { + "reference": { + "oneof": [ + "uri", + "resourceName" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "resourceName": { + "type": "string", + "id": 2 + } + } + }, + "Documentation": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "content": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CallToAction": { + "fields": { + "viewRestApi": { + "type": "ViewRestApi", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openNotebook": { + "type": "RegionalResourceReferences", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createApplication": { + "type": "RegionalResourceReferences", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openFineTuningPipeline": { + "type": "RegionalResourceReferences", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openPromptTuningPipeline": { + "type": "RegionalResourceReferences", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openGenie": { + "type": "RegionalResourceReferences", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deploy": { + "type": "Deploy", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openGenerationAiStudio": { + "type": "RegionalResourceReferences", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestAccess": { + "type": "RegionalResourceReferences", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RegionalResourceReferences": { + "fields": { + "references": { + "keyType": "string", + "type": "ResourceReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ViewRestApi": { + "fields": { + "documentations": { + "rule": "repeated", + "type": "Documentation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Deploy": { + "oneofs": { + "predictionResources": { + "oneof": [ + "dedicatedResources", + "automaticResources", + "sharedResources" + ] + } + }, + "fields": { + "dedicatedResources": { + "type": "DedicatedResources", + "id": 5 + }, + "automaticResources": { + "type": "AutomaticResources", + "id": 6 + }, + "sharedResources": { + "type": "string", + "id": 7 + }, + "modelDisplayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "largeModelReference": { + "type": "LargeModelReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containerSpec": { + "type": "ModelContainerSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "title": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "OpenSourceCategory": { + "values": { + "OPEN_SOURCE_CATEGORY_UNSPECIFIED": 0, + "PROPRIETARY": 1, + "GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT": 2, + "THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT": 3, + "GOOGLE_OWNED_OSS": 4, + "THIRD_PARTY_OWNED_OSS": 5 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "EXPERIMENTAL": 1, + "PRIVATE_PREVIEW": 2, + "PUBLIC_PREVIEW": 3, + "GA": 4 + } + } + } + }, "ModelService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -26723,6 +27258,11 @@ "timestampOutsideRetentionRowsCount": { "type": "int64", "id": 7 + }, + "blockingOperationIds": { + "rule": "repeated", + "type": "int64", + "id": 8 } } }, @@ -33366,6 +33906,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "launchStage": { + "type": "LaunchStage", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "publisherModelTemplate": { "type": "string", "id": 30, @@ -33477,6 +34024,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "requestAccess": { + "type": "RegionalResourceReferences", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -33589,6 +34143,15 @@ "GOOGLE_OWNED_OSS": 4, "THIRD_PARTY_OWNED_OSS": 5 } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "EXPERIMENTAL": 1, + "PRIVATE_PREVIEW": 2, + "PUBLIC_PREVIEW": 3, + "GA": 4 + } } } }, diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 170299a41970..3820254c2b64 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -106,6 +106,8 @@ * [Job_service.resume_model_deployment_monitoring_job](#job_service.resume_model_deployment_monitoring_job) * [Job_service.search_model_deployment_monitoring_stats_anomalies](#job_service.search_model_deployment_monitoring_stats_anomalies) * [Job_service.update_model_deployment_monitoring_job](#job_service.update_model_deployment_monitoring_job) + * [Match_service.find_neighbors](#match_service.find_neighbors) + * [Match_service.read_index_datapoints](#match_service.read_index_datapoints) * [Metadata_service.add_context_artifacts_and_executions](#metadata_service.add_context_artifacts_and_executions) * [Metadata_service.add_context_children](#metadata_service.add_context_children) * [Metadata_service.add_execution_events](#metadata_service.add_execution_events) @@ -140,6 +142,7 @@ * [Metadata_service.update_execution](#metadata_service.update_execution) * [Migration_service.batch_migrate_resources](#migration_service.batch_migrate_resources) * [Migration_service.search_migratable_resources](#migration_service.search_migratable_resources) + * [Model_garden_service.get_publisher_model](#model_garden_service.get_publisher_model) * [Model_service.batch_import_evaluated_annotations](#model_service.batch_import_evaluated_annotations) * [Model_service.batch_import_model_evaluation_slices](#model_service.batch_import_model_evaluation_slices) * [Model_service.copy_model](#model_service.copy_model) @@ -2057,6 +2060,40 @@ __Usage:__ +### Match_service.find_neighbors + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js). + +[![Open in Cloud 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-aiplatform/samples/generated/v1/match_service.find_neighbors.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js` + + +----- + + + + +### Match_service.read_index_datapoints + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js). + +[![Open in Cloud 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-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js` + + +----- + + + + ### Metadata_service.add_context_artifacts_and_executions View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js). @@ -2635,6 +2672,23 @@ __Usage:__ +### Model_garden_service.get_publisher_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js). + +[![Open in Cloud 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-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js` + + +----- + + + + ### Model_service.batch_import_evaluated_annotations View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js index 516ec4982cee..be61c3c19d2b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js @@ -55,7 +55,7 @@ function main(entityType, featureSpecs) { // const entityType = 'abc123' /** * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. + * extracted from the column named entity_id. */ // const entityIdField = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js new file mode 100644 index 000000000000..10e858026fbd --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.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(indexEndpoint) { + // [START aiplatform_v1_generated_MatchService_FindNeighbors_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 index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + */ + // const indexEndpoint = 'abc123' + /** + * The ID of the DeployedIndex that will serve the request. This request is + * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + * has a DeployedIndex.id field. + * The value of the field below must equal one of the DeployedIndex.id + * fields of the IndexEndpoint that is being called for this request. + */ + // const deployedIndexId = 'abc123' + /** + * The list of queries. + */ + // const queries = 1234 + /** + * If set to true, the full datapoints (including all vector values and + * restricts) of the nearest neighbors are returned. + * Note that returning full datapoint will significantly increase the + * latency and cost of the query. + */ + // const returnFullDatapoint = true + + // Imports the Aiplatform library + const {MatchServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new MatchServiceClient(); + + async function callFindNeighbors() { + // Construct request + const request = { + indexEndpoint, + }; + + // Run request + const response = await aiplatformClient.findNeighbors(request); + console.log(response); + } + + callFindNeighbors(); + // [END aiplatform_v1_generated_MatchService_FindNeighbors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js new file mode 100644 index 000000000000..3cddeb897673 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js @@ -0,0 +1,71 @@ +// 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(indexEndpoint) { + // [START aiplatform_v1_generated_MatchService_ReadIndexDatapoints_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 index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + */ + // const indexEndpoint = 'abc123' + /** + * The ID of the DeployedIndex that will serve the request. + */ + // const deployedIndexId = 'abc123' + /** + * IDs of the datapoints to be searched for. + */ + // const ids = 'abc123' + + // Imports the Aiplatform library + const {MatchServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new MatchServiceClient(); + + async function callReadIndexDatapoints() { + // Construct request + const request = { + indexEndpoint, + }; + + // Run request + const response = await aiplatformClient.readIndexDatapoints(request); + console.log(response); + } + + callReadIndexDatapoints(); + // [END aiplatform_v1_generated_MatchService_ReadIndexDatapoints_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js index 9e6500337e7d..d5af87889b50 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js index a6299816118f..2cb4eceafed5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js index e8f8140a1544..4405bb6e12a3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js index 89e380302516..88ae6250c54b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js @@ -61,6 +61,9 @@ function main(artifact) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * Each of the above supported filter types can be combined together using * logical operators (`AND` & `OR`). Maximum nested expression depth allowed * is 5. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js index 4d282ef14c5e..a282072113f8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js @@ -37,7 +37,6 @@ function main(artifact) { // const artifact = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js index 6dfe2c6425b4..078d1c448a72 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js @@ -37,7 +37,6 @@ function main(context) { // const context = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js index 05325031ef82..2b1536b44a6c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js @@ -37,7 +37,6 @@ function main(execution) { // const execution = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js new file mode 100644 index 000000000000..77758ecc277f --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.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 aiplatform_v1_generated_ModelGardenService_GetPublisherModel_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 PublisherModel resource. + * Format: + * `publishers/{publisher}/models/{publisher_model}` + */ + // const name = 'abc123' + /** + * Optional. The IETF BCP-47 language code representing the language in which + * the publisher model's text information should be written in (see go/bcp47). + */ + // const languageCode = 'abc123' + /** + * Optional. PublisherModel view specifying which fields to read. + */ + // const view = {} + + // Imports the Aiplatform library + const {ModelGardenServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ModelGardenServiceClient(); + + async function callGetPublisherModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.getPublisherModel(request); + console.log(response); + } + + callGetPublisherModel(); + // [END aiplatform_v1_generated_ModelGardenService_GetPublisherModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index 5cca960f083e..f7976bea243b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -4447,6 +4447,106 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_MatchService_FindNeighbors_async", + "title": "DatasetService findNeighbors Sample", + "origin": "API_DEFINITION", + "description": " Finds the nearest neighbors of each vector within the request.", + "canonical": true, + "file": "match_service.find_neighbors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FindNeighbors", + "fullName": "google.cloud.aiplatform.v1.MatchService.FindNeighbors", + "async": true, + "parameters": [ + { + "name": "index_endpoint", + "type": "TYPE_STRING" + }, + { + "name": "deployed_index_id", + "type": "TYPE_STRING" + }, + { + "name": "queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "return_full_datapoint", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.aiplatform.v1.FindNeighborsResponse", + "client": { + "shortName": "MatchServiceClient", + "fullName": "google.cloud.aiplatform.v1.MatchServiceClient" + }, + "method": { + "shortName": "FindNeighbors", + "fullName": "google.cloud.aiplatform.v1.MatchService.FindNeighbors", + "service": { + "shortName": "MatchService", + "fullName": "google.cloud.aiplatform.v1.MatchService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_MatchService_ReadIndexDatapoints_async", + "title": "DatasetService readIndexDatapoints Sample", + "origin": "API_DEFINITION", + "description": " Reads the datapoints/vectors of the given IDs. A maximum of 1000 datapoints can be retrieved in a batch.", + "canonical": true, + "file": "match_service.read_index_datapoints.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadIndexDatapoints", + "fullName": "google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints", + "async": true, + "parameters": [ + { + "name": "index_endpoint", + "type": "TYPE_STRING" + }, + { + "name": "deployed_index_id", + "type": "TYPE_STRING" + }, + { + "name": "ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ReadIndexDatapointsResponse", + "client": { + "shortName": "MatchServiceClient", + "fullName": "google.cloud.aiplatform.v1.MatchServiceClient" + }, + "method": { + "shortName": "ReadIndexDatapoints", + "fullName": "google.cloud.aiplatform.v1.MatchService.ReadIndexDatapoints", + "service": { + "shortName": "MatchService", + "fullName": "google.cloud.aiplatform.v1.MatchService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_MetadataService_CreateMetadataStore_async", "title": "DatasetService createMetadataStore Sample", @@ -4726,7 +4826,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -4782,7 +4882,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -5010,7 +5110,7 @@ "segments": [ { "start": 25, - "end": 111, + "end": 114, "type": "FULL" } ], @@ -5066,7 +5166,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 65, "type": "FULL" } ], @@ -5474,7 +5574,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -5530,7 +5630,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -5894,7 +5994,7 @@ "segments": [ { "start": 25, - "end": 88, + "end": 91, "type": "FULL" } ], @@ -6027,6 +6127,54 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_ModelGardenService_GetPublisherModel_async", + "title": "DatasetService getPublisherModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a Model Garden publisher model.", + "canonical": true, + "file": "model_garden_service.get_publisher_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPublisherModel", + "fullName": "google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.aiplatform.v1.PublisherModelView" + } + ], + "resultType": ".google.cloud.aiplatform.v1.PublisherModel", + "client": { + "shortName": "ModelGardenServiceClient", + "fullName": "google.cloud.aiplatform.v1.ModelGardenServiceClient" + }, + "method": { + "shortName": "GetPublisherModel", + "fullName": "google.cloud.aiplatform.v1.ModelGardenService.GetPublisherModel", + "service": { + "shortName": "ModelGardenService", + "fullName": "google.cloud.aiplatform.v1.ModelGardenService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_ModelService_UploadModel_async", "title": "DatasetService uploadModel Sample", @@ -7379,7 +7527,7 @@ "regionTag": "aiplatform_v1_generated_PredictionService_Explain_async", "title": "DatasetService explain Sample", "origin": "API_DEFINITION", - "description": " Perform an online explanation. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is specified, the corresponding DeployModel must have [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] populated. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is not specified, all DeployedModels must have [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] populated. Only deployed AutoML tabular Models have explanation_spec.", + "description": " Perform an online explanation. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is specified, the corresponding DeployModel must have [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] populated. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is not specified, all DeployedModels must have [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] populated.", "canonical": true, "file": "prediction_service.explain.js", "language": "JAVASCRIPT", @@ -9207,7 +9355,7 @@ "regionTag": "aiplatform_v1_generated_VizierService_SuggestTrials_async", "title": "DatasetService suggestTrials Sample", "origin": "API_DEFINITION", - "description": " Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].", + "description": " Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse].", "canonical": true, "file": "vizier_service.suggest_trials.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js index 28d16cb58fc5..d237424c2030 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js @@ -55,7 +55,7 @@ function main(entityType, featureSpecs) { // const entityType = 'abc123' /** * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. + * extracted from the column named entity_id. */ // const entityIdField = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js index b8990f64912f..ef12c8c72045 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js index 449261341719..10662a86888f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js index a49794b0dfb3..fc0609364e24 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js @@ -64,6 +64,9 @@ function main(parent) { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js index da387bee1eb5..3f0acb1a4a81 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js @@ -61,6 +61,9 @@ function main(artifact) { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * Each of the above supported filter types can be combined together using * logical operators (`AND` & `OR`). Maximum nested expression depth allowed * is 5. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js index 75b56aa92da7..16f99b69a16a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js @@ -38,7 +38,6 @@ function main(artifact) { // const artifact = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js index 0157db781686..f215020896c0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js @@ -37,7 +37,6 @@ function main(context) { // const context = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js index d5b6004efd7d..227a0a639a3d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js @@ -38,7 +38,6 @@ function main(execution) { // const execution = {} /** * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. */ // const updateMask = {} /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index a8e6dbb67d4f..95a235e0d515 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -5046,7 +5046,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -5102,7 +5102,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 67, "type": "FULL" } ], @@ -5330,7 +5330,7 @@ "segments": [ { "start": 25, - "end": 111, + "end": 114, "type": "FULL" } ], @@ -5386,7 +5386,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -5794,7 +5794,7 @@ "segments": [ { "start": 25, - "end": 108, + "end": 111, "type": "FULL" } ], @@ -5850,7 +5850,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 67, "type": "FULL" } ], @@ -6214,7 +6214,7 @@ "segments": [ { "start": 25, - "end": 88, + "end": 91, "type": "FULL" } ], @@ -7787,7 +7787,7 @@ "regionTag": "aiplatform_v1beta1_generated_PredictionService_Explain_async", "title": "DatasetService explain Sample", "origin": "API_DEFINITION", - "description": " Perform an online explanation. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is specified, the corresponding DeployModel must have [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is not specified, all DeployedModels must have [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated. Only deployed AutoML tabular Models have explanation_spec.", + "description": " Perform an online explanation. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is specified, the corresponding DeployModel must have [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is not specified, all DeployedModels must have [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated.", "canonical": true, "file": "prediction_service.explain.js", "language": "JAVASCRIPT", @@ -9923,7 +9923,7 @@ "regionTag": "aiplatform_v1beta1_generated_VizierService_SuggestTrials_async", "title": "DatasetService suggestTrials Sample", "origin": "API_DEFINITION", - "description": " Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].", + "description": " Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a [SuggestTrialsResponse][google.cloud.aiplatform.v1beta1.SuggestTrialsResponse].", "canonical": true, "file": "vizier_service.suggest_trials.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-aiplatform/src/index.ts b/packages/google-cloud-aiplatform/src/index.ts index 870c98491fe3..f279e0ccb72b 100644 --- a/packages/google-cloud-aiplatform/src/index.ts +++ b/packages/google-cloud-aiplatform/src/index.ts @@ -51,6 +51,10 @@ const MetadataServiceClient = v1.MetadataServiceClient; type MetadataServiceClient = v1.MetadataServiceClient; const TensorboardServiceClient = v1.TensorboardServiceClient; type TensorboardServiceClient = v1.TensorboardServiceClient; +const MatchServiceClient = v1.MatchServiceClient; +type MatchServiceClient = v1.MatchServiceClient; +const ModelGardenServiceClient = v1.ModelGardenServiceClient; +type ModelGardenServiceClient = v1.ModelGardenServiceClient; export { v1beta1, @@ -70,6 +74,8 @@ export { FeaturestoreOnlineServingServiceClient, MetadataServiceClient, TensorboardServiceClient, + MatchServiceClient, + ModelGardenServiceClient, }; export default { v1beta1, @@ -89,6 +95,8 @@ export default { FeaturestoreOnlineServingServiceClient, MetadataServiceClient, TensorboardServiceClient, + MatchServiceClient, + ModelGardenServiceClient, }; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts index 84d7977eaf1c..37df669c89bc 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts @@ -277,6 +277,9 @@ export class DatasetServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -5884,6 +5887,46 @@ export class DatasetServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts index 3df5eb15641d..7c31127c5de0 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts @@ -276,6 +276,9 @@ export class EndpointServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -4986,6 +4989,46 @@ export class EndpointServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts index 3e82ff84d760..478b73642561 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts @@ -269,6 +269,9 @@ export class FeaturestoreOnlineServingServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -2696,6 +2699,46 @@ export class FeaturestoreOnlineServingServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts index 84b8f60a560f..6b7c9c9a2aa9 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts @@ -279,6 +279,9 @@ export class FeaturestoreServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -3375,7 +3378,7 @@ export class FeaturestoreServiceClient { * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` * @param {string} request.entityIdField * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. + * extracted from the column named entity_id. * @param {number[]} request.featureSpecs * Required. Specifications defining which Feature values to import from the * entity. The request fails if no feature_specs are provided, and having @@ -7608,6 +7611,46 @@ export class FeaturestoreServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index ead7be93841b..10d41e70480a 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -1118,6 +1118,40 @@ } } }, + "MatchService": { + "clients": { + "grpc": { + "libraryClient": "MatchServiceClient", + "rpcs": { + "FindNeighbors": { + "methods": [ + "findNeighbors" + ] + }, + "ReadIndexDatapoints": { + "methods": [ + "readIndexDatapoints" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MatchServiceClient", + "rpcs": { + "FindNeighbors": { + "methods": [ + "findNeighbors" + ] + }, + "ReadIndexDatapoints": { + "methods": [ + "readIndexDatapoints" + ] + } + } + } + } + }, "MetadataService": { "clients": { "grpc": { @@ -1510,6 +1544,30 @@ } } }, + "ModelGardenService": { + "clients": { + "grpc": { + "libraryClient": "ModelGardenServiceClient", + "rpcs": { + "GetPublisherModel": { + "methods": [ + "getPublisherModel" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelGardenServiceClient", + "rpcs": { + "GetPublisherModel": { + "methods": [ + "getPublisherModel" + ] + } + } + } + } + }, "ModelService": { "clients": { "grpc": { diff --git a/packages/google-cloud-aiplatform/src/v1/index.ts b/packages/google-cloud-aiplatform/src/v1/index.ts index 46e5062e243a..71b7ed96c15c 100644 --- a/packages/google-cloud-aiplatform/src/v1/index.ts +++ b/packages/google-cloud-aiplatform/src/v1/index.ts @@ -23,8 +23,10 @@ export {FeaturestoreServiceClient} from './featurestore_service_client'; export {IndexEndpointServiceClient} from './index_endpoint_service_client'; export {IndexServiceClient} from './index_service_client'; export {JobServiceClient} from './job_service_client'; +export {MatchServiceClient} from './match_service_client'; export {MetadataServiceClient} from './metadata_service_client'; export {MigrationServiceClient} from './migration_service_client'; +export {ModelGardenServiceClient} from './model_garden_service_client'; export {ModelServiceClient} from './model_service_client'; export {PipelineServiceClient} from './pipeline_service_client'; export {PredictionServiceClient} from './prediction_service_client'; diff --git a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts index 6465c6ef1d6f..fa0fac90cb1b 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts @@ -276,6 +276,9 @@ export class IndexEndpointServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -4918,6 +4921,46 @@ export class IndexEndpointServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts index b198cbb12f0d..fc884d007f20 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts @@ -276,6 +276,9 @@ export class IndexServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -4639,6 +4642,46 @@ export class IndexServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts index a2d11f61a188..566dba606294 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts @@ -276,6 +276,9 @@ export class JobServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -9019,6 +9022,46 @@ export class JobServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/match_service_client.ts b/packages/google-cloud-aiplatform/src/v1/match_service_client.ts new file mode 100644 index 000000000000..d2a88144dd73 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/match_service_client.ts @@ -0,0 +1,3324 @@ +// 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, + 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/match_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './match_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * MatchService is a Google managed service for efficient vector similarity + * search at scale. + * @class + * @memberof v1 + */ +export class MatchServiceClient { + 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}; + matchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MatchServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 MatchServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MatchServiceClient; + 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); + + // 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 if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.MatchService', + 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.matchServiceStub) { + return this.matchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.MatchService. + this.matchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.MatchService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.MatchService, + 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 matchServiceStubMethods = ['findNeighbors', 'readIndexDatapoints']; + for (const methodName of matchServiceStubMethods) { + const callPromise = this.matchServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.matchServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.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 'aiplatform.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 -- + // ------------------- + /** + * Finds the nearest neighbors of each vector within the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * The ID of the DeployedIndex that will serve the request. This request is + * sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That + * IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index + * has a DeployedIndex.id field. + * The value of the field below must equal one of the DeployedIndex.id + * fields of the IndexEndpoint that is being called for this request. + * @param {number[]} request.queries + * The list of queries. + * @param {boolean} request.returnFullDatapoint + * If set to true, the full datapoints (including all vector values and + * restricts) of the nearest neighbors are returned. + * Note that returning full datapoint will significantly increase the + * latency and cost of the query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.aiplatform.v1.FindNeighborsResponse | FindNeighborsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/match_service.find_neighbors.js + * region_tag:aiplatform_v1_generated_MatchService_FindNeighbors_async + */ + findNeighbors( + request?: protos.google.cloud.aiplatform.v1.IFindNeighborsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1.IFindNeighborsRequest | undefined, + {} | undefined + ] + >; + findNeighbors( + request: protos.google.cloud.aiplatform.v1.IFindNeighborsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + | protos.google.cloud.aiplatform.v1.IFindNeighborsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + findNeighbors( + request: protos.google.cloud.aiplatform.v1.IFindNeighborsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + | protos.google.cloud.aiplatform.v1.IFindNeighborsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + findNeighbors( + request?: protos.google.cloud.aiplatform.v1.IFindNeighborsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + | protos.google.cloud.aiplatform.v1.IFindNeighborsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + | protos.google.cloud.aiplatform.v1.IFindNeighborsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IFindNeighborsResponse, + protos.google.cloud.aiplatform.v1.IFindNeighborsRequest | 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({ + index_endpoint: request.indexEndpoint ?? '', + }); + this.initialize(); + return this.innerApiCalls.findNeighbors(request, options, callback); + } + /** + * Reads the datapoints/vectors of the given IDs. + * A maximum of 1000 datapoints can be retrieved in a batch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the index endpoint. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * The ID of the DeployedIndex that will serve the request. + * @param {string[]} request.ids + * IDs of the datapoints to be searched for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.aiplatform.v1.ReadIndexDatapointsResponse | ReadIndexDatapointsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/match_service.read_index_datapoints.js + * region_tag:aiplatform_v1_generated_MatchService_ReadIndexDatapoints_async + */ + readIndexDatapoints( + request?: protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest | undefined, + {} | undefined + ] + >; + readIndexDatapoints( + request: protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + | protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + readIndexDatapoints( + request: protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + | protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + readIndexDatapoints( + request?: protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + | protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + | protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse, + protos.google.cloud.aiplatform.v1.IReadIndexDatapointsRequest | 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({ + index_endpoint: request.indexEndpoint ?? '', + }); + this.initialize(); + return this.innerApiCalls.readIndexDatapoints(request, options, callback); + } + + /** + * 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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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 annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName) + .featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName) + .entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * 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.matchServiceStub && !this._terminated) { + return this.matchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/match_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/match_service_client_config.json new file mode 100644 index 000000000000..74c4fa0687c5 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/match_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.MatchService": { + "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": { + "FindNeighbors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadIndexDatapoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json new file mode 100644 index 000000000000..f987b709de89 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json @@ -0,0 +1,118 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts index 292ead32f7c6..e4c343ce4b86 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts @@ -279,6 +279,9 @@ export class MetadataServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1926,7 +1929,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the {@link google.cloud.aiplatform.v1.Artifact|Artifact} is * not found, a new {@link google.cloud.aiplatform.v1.Artifact|Artifact} is @@ -2217,7 +2219,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the {@link google.cloud.aiplatform.v1.Context|Context} is * not found, a new {@link google.cloud.aiplatform.v1.Context|Context} is created. @@ -2938,7 +2939,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the {@link google.cloud.aiplatform.v1.Execution|Execution} * is not found, a new {@link google.cloud.aiplatform.v1.Execution|Execution} is @@ -3471,6 +3471,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * Each of the above supported filter types can be combined together using * logical operators (`AND` & `OR`). Maximum nested expression depth allowed @@ -4998,6 +5001,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5141,6 +5147,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5232,6 +5241,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5322,6 +5334,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5469,6 +5484,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5564,6 +5582,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5658,6 +5679,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: @@ -5801,6 +5825,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: @@ -5892,6 +5919,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: @@ -8390,6 +8420,46 @@ export class MetadataServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts index 04751f12c388..06bd846ad9ed 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts @@ -277,6 +277,9 @@ export class MigrationServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -4091,6 +4094,46 @@ export class MigrationServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts new file mode 100644 index 000000000000..6ef58b4af07b --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts @@ -0,0 +1,3216 @@ +// 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, + 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/model_garden_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_garden_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The interface of Model Garden Service. + * @class + * @memberof v1 + */ +export class ModelGardenServiceClient { + 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}; + modelGardenServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ModelGardenServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 ModelGardenServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ModelGardenServiceClient; + 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); + + // 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 if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.ModelGardenService', + 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.modelGardenServiceStub) { + return this.modelGardenServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.ModelGardenService. + this.modelGardenServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.ModelGardenService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.ModelGardenService, + 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 modelGardenServiceStubMethods = ['getPublisherModel']; + for (const methodName of modelGardenServiceStubMethods) { + const callPromise = this.modelGardenServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelGardenServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.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 'aiplatform.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 a Model Garden publisher model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PublisherModel resource. + * Format: + * `publishers/{publisher}/models/{publisher_model}` + * @param {string} [request.languageCode] + * Optional. The IETF BCP-47 language code representing the language in which + * the publisher model's text information should be written in (see go/bcp47). + * @param {google.cloud.aiplatform.v1.PublisherModelView} [request.view] + * Optional. PublisherModel view specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.aiplatform.v1.PublisherModel | PublisherModel}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/model_garden_service.get_publisher_model.js + * region_tag:aiplatform_v1_generated_ModelGardenService_GetPublisherModel_async + */ + getPublisherModel( + request?: protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IPublisherModel, + protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest | undefined, + {} | undefined + ] + >; + getPublisherModel( + request: protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPublisherModel, + | protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPublisherModel( + request: protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPublisherModel, + | protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPublisherModel( + request?: protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IPublisherModel, + | protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IPublisherModel, + | protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IPublisherModel, + protos.google.cloud.aiplatform.v1.IGetPublisherModelRequest | 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.getPublisherModel(request, options, callback); + } + + /** + * 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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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 annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName) + .featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName) + .entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * 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.modelGardenServiceStub && !this._terminated) { + return this.modelGardenServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/model_garden_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client_config.json new file mode 100644 index 000000000000..9a44acc85176 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.ModelGardenService": { + "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": { + "GetPublisherModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json new file mode 100644 index 000000000000..f987b709de89 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json @@ -0,0 +1,118 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts index ac76d3921a2a..97de9b780c2c 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts @@ -276,6 +276,9 @@ export class ModelServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -6357,6 +6360,46 @@ export class ModelServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts index dc2e82011180..d94e3c91568d 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts @@ -278,6 +278,9 @@ export class PipelineServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -5261,6 +5264,46 @@ export class PipelineServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts index 3acab4bb4a1e..558dce4c79f9 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts @@ -268,6 +268,9 @@ export class PredictionServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -654,8 +657,7 @@ export class PredictionServiceClient { * {@link google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id|deployed_model_id} * is not specified, all DeployedModels must have * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} - * populated. Only deployed AutoML tabular Models have - * explanation_spec. + * populated. * * @param {Object} request * The request object that will be sent. @@ -2755,6 +2757,46 @@ export class PredictionServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts index 64919e2a7eda..31a3be9a73c4 100644 --- a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts @@ -282,6 +282,9 @@ export class SpecialistPoolServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -4460,6 +4463,46 @@ export class SpecialistPoolServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts index 979a93ac6ca1..5dda290f3c58 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts @@ -279,6 +279,9 @@ export class TensorboardServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -7778,6 +7781,46 @@ export class TensorboardServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts index 1794a94a3c38..53f0d6f52f6f 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts @@ -280,6 +280,9 @@ export class VizierServiceClient { new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -2531,7 +2534,8 @@ export class VizierServiceClient { * suggested by Vertex AI Vizier. Returns a long-running * operation associated with the generation of Trial suggestions. * When this long-running operation succeeds, it will contain - * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. + * a + * {@link google.cloud.aiplatform.v1.SuggestTrialsResponse|SuggestTrialsResponse}. * * @param {Object} request * The request object that will be sent. @@ -5405,6 +5409,46 @@ export class VizierServiceClient { ).model; } + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json index b7295bb569f7..f987b709de89 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json @@ -41,6 +41,7 @@ "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", @@ -50,6 +51,7 @@ "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/model_service.proto", "../../protos/google/cloud/aiplatform/v1/nas_job.proto", @@ -59,6 +61,7 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts index 17096fe7d1f1..d55acdce93ee 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts @@ -892,6 +892,10 @@ export class DatasetServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1097,6 +1101,9 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1281,6 +1288,9 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts index 42813a73106d..e7c097f2891b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts @@ -880,6 +880,10 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1085,6 +1089,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1269,6 +1276,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts index e1c2e0ee2007..27c67867f889 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts @@ -871,6 +871,10 @@ export class EndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1076,6 +1080,9 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1260,6 +1267,9 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts index 088db64f3480..b31c9c09d8e5 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts @@ -889,6 +889,10 @@ export class FeaturestoreServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1094,6 +1098,9 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1278,6 +1285,9 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, @@ -3552,7 +3562,7 @@ export class FeaturestoreServiceClient { * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` * @param {string} request.entityIdField * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. + * extracted from the column named entity_id. * @param {number[]} request.featureSpecs * Required. Specifications defining which Feature values to import from the * entity. The request fails if no feature_specs are provided, and having diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts index a45a40e4fa05..af5d9c55eaf6 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts @@ -871,6 +871,10 @@ export class IndexEndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1076,6 +1080,9 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1260,6 +1267,9 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts index 7167a438f994..fbb528c76d47 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts @@ -871,6 +871,10 @@ export class IndexServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1076,6 +1080,9 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1260,6 +1267,9 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts index 4fe870534fcf..489dedd41852 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts @@ -907,6 +907,10 @@ export class JobServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1112,6 +1116,9 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1296,6 +1303,9 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts index 05576fc00160..c18d0228468b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts @@ -894,6 +894,10 @@ export class MetadataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1099,6 +1103,9 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1283,6 +1290,9 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, @@ -2097,7 +2107,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the * {@link google.cloud.aiplatform.v1beta1.Artifact|Artifact} is not found, a new @@ -2394,7 +2403,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Context|Context} * is not found, a new {@link google.cloud.aiplatform.v1beta1.Context|Context} is @@ -3135,7 +3143,6 @@ export class MetadataServiceClient { * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. * @param {boolean} request.allowMissing * If set to true, and the * {@link google.cloud.aiplatform.v1beta1.Execution|Execution} is not found, a new @@ -3686,6 +3693,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * Each of the above supported filter types can be combined together using * logical operators (`AND` & `OR`). Maximum nested expression depth allowed @@ -5213,6 +5223,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5356,6 +5369,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5447,6 +5463,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Artifacts based on the contexts to which they belong, use the * function operator with the full resource name @@ -5537,6 +5556,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5684,6 +5706,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5779,6 +5804,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..`. * For example: `metadata.field_1.number_value = 10.0`. + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Parent Child filtering**: * To filter Contexts based on parent-child relationship use the HAS * operator as follows: @@ -5873,6 +5901,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: @@ -6016,6 +6047,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: @@ -6107,6 +6141,9 @@ export class MetadataServiceClient { * To filter on metadata fields use traversal operation as follows: * `metadata..` * For example: `metadata.field_1.number_value = 10.0` + * In case the field name contains special characters (such as colon), one + * can embed it inside double quote. + * For example: `metadata."field:1".number_value = 10.0` * * **Context based filtering**: * To filter Executions based on the contexts to which they belong use * the function operator with the full resource name: diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts index 337ac1c796a6..91cfcbec1883 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts @@ -872,6 +872,10 @@ export class MigrationServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1077,6 +1081,9 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1261,6 +1268,9 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts index 110829a675cb..eeed88a68aa4 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts @@ -886,6 +886,10 @@ export class ModelServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1091,6 +1095,9 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1275,6 +1282,9 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts index fd0069d45163..821d5c246614 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts @@ -878,6 +878,10 @@ export class PipelineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1083,6 +1087,9 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1267,6 +1274,9 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts index dce336071af0..523aac1bd94b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts @@ -673,8 +673,7 @@ export class PredictionServiceClient { * {@link google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id|deployed_model_id} * is not specified, all DeployedModels must have * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} - * populated. Only deployed AutoML tabular Models have - * explanation_spec. + * populated. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts index 02a04fe264c6..7472c2467c5f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts @@ -872,6 +872,10 @@ export class ScheduleServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1077,6 +1081,9 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1261,6 +1268,9 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts index fce96fb397c4..b884a55a6147 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts @@ -877,6 +877,10 @@ export class SpecialistPoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1082,6 +1086,9 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1266,6 +1273,9 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts index 9c2c11ed13fa..429c11a3f812 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts @@ -903,6 +903,10 @@ export class TensorboardServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1108,6 +1112,9 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1292,6 +1299,9 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts index 1b1da09025e8..a2c316fec16e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts @@ -880,6 +880,10 @@ export class VizierServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1085,6 +1089,9 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', }, @@ -1269,6 +1276,9 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', }, @@ -2753,7 +2763,8 @@ export class VizierServiceClient { * suggested by Vertex AI Vizier. Returns a long-running * operation associated with the generation of Trial suggestions. * When this long-running operation succeeds, it will contain - * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. + * a + * {@link google.cloud.aiplatform.v1beta1.SuggestTrialsResponse|SuggestTrialsResponse}. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js index 6aced5b57ed9..c260f42662a6 100644 --- a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js @@ -29,8 +29,10 @@ function main() { new aiplatform.IndexEndpointServiceClient(); const indexServiceClient = new aiplatform.IndexServiceClient(); const jobServiceClient = new aiplatform.JobServiceClient(); + const matchServiceClient = new aiplatform.MatchServiceClient(); const metadataServiceClient = new aiplatform.MetadataServiceClient(); const migrationServiceClient = new aiplatform.MigrationServiceClient(); + const modelGardenServiceClient = new aiplatform.ModelGardenServiceClient(); const modelServiceClient = new aiplatform.ModelServiceClient(); const pipelineServiceClient = new aiplatform.PipelineServiceClient(); const predictionServiceClient = new aiplatform.PredictionServiceClient(); diff --git a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts index 68aa7cc1424e..e8fee7c77c28 100644 --- a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts @@ -24,8 +24,10 @@ import { IndexEndpointServiceClient, IndexServiceClient, JobServiceClient, + MatchServiceClient, MetadataServiceClient, MigrationServiceClient, + ModelGardenServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, @@ -62,12 +64,18 @@ function doStuffWithIndexServiceClient(client: IndexServiceClient) { function doStuffWithJobServiceClient(client: JobServiceClient) { client.close(); } +function doStuffWithMatchServiceClient(client: MatchServiceClient) { + client.close(); +} function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { client.close(); } function doStuffWithMigrationServiceClient(client: MigrationServiceClient) { client.close(); } +function doStuffWithModelGardenServiceClient(client: ModelGardenServiceClient) { + client.close(); +} function doStuffWithModelServiceClient(client: ModelServiceClient) { client.close(); } @@ -115,12 +123,18 @@ function main() { const jobServiceClient = new JobServiceClient(); doStuffWithJobServiceClient(jobServiceClient); // check that the client instance can be created + const matchServiceClient = new MatchServiceClient(); + doStuffWithMatchServiceClient(matchServiceClient); + // check that the client instance can be created const metadataServiceClient = new MetadataServiceClient(); doStuffWithMetadataServiceClient(metadataServiceClient); // check that the client instance can be created const migrationServiceClient = new MigrationServiceClient(); doStuffWithMigrationServiceClient(migrationServiceClient); // check that the client instance can be created + const modelGardenServiceClient = new ModelGardenServiceClient(); + doStuffWithModelGardenServiceClient(modelGardenServiceClient); + // check that the client instance can be created const modelServiceClient = new ModelServiceClient(); doStuffWithModelServiceClient(modelServiceClient); // check that the client instance can be created diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts index 935abc36ee18..eda80a3e9b8f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts @@ -5906,6 +5906,58 @@ describe('v1.DatasetServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts index b81e66a21ecf..be5086d6be37 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts @@ -4696,6 +4696,58 @@ describe('v1.EndpointServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts index 053335f5e70b..888b91870747 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts @@ -3328,6 +3328,61 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts index c6b4b994014c..48f48a0d21a5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts @@ -7811,6 +7811,60 @@ describe('v1.FeaturestoreServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts index 20f777b1f5f0..aa724fe6eabd 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts @@ -4829,6 +4829,59 @@ describe('v1.IndexEndpointServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts index 85cb1ccb91f0..cd5e8bb3a63e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts @@ -4429,6 +4429,58 @@ describe('v1.IndexServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts index 973c1aaea860..8f4eb0049cc8 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts @@ -9976,6 +9976,58 @@ describe('v1.JobServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts new file mode 100644 index 000000000000..2658d322796b --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts @@ -0,0 +1,3769 @@ +// 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 matchserviceModule from '../src'; + +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 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.MatchServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = matchserviceModule.v1.MatchServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = matchserviceModule.v1.MatchServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = matchserviceModule.v1.MatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new matchserviceModule.v1.MatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.matchServiceStub, undefined); + await client.initialize(); + assert(client.matchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.matchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.matchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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('findNeighbors', () => { + it('invokes findNeighbors without error', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.FindNeighborsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsResponse() + ); + client.innerApiCalls.findNeighbors = stubSimpleCall(expectedResponse); + const [response] = await client.findNeighbors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors without error using callback', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.FindNeighborsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsResponse() + ); + client.innerApiCalls.findNeighbors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.findNeighbors( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IFindNeighborsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors with error', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.FindNeighborsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.findNeighbors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.findNeighbors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.findNeighbors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes findNeighbors with closed client', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.FindNeighborsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.FindNeighborsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.findNeighbors(request), expectedError); + }); + }); + + describe('readIndexDatapoints', () => { + it('invokes readIndexDatapoints without error', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse() + ); + client.innerApiCalls.readIndexDatapoints = + stubSimpleCall(expectedResponse); + const [response] = await client.readIndexDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints without error using callback', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse() + ); + client.innerApiCalls.readIndexDatapoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readIndexDatapoints( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IReadIndexDatapointsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints with error', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readIndexDatapoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.readIndexDatapoints(request), expectedError); + const actualRequest = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readIndexDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes readIndexDatapoints with closed client', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ReadIndexDatapointsRequest', + ['indexEndpoint'] + ); + request.indexEndpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readIndexDatapoints(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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 matchserviceModule.v1.MatchServiceClient({ + 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('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('feature', () => { + const fakePath = '/rendered/path/feature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, 'featureValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts index 44c43d7fa639..37d63d39af2b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts @@ -8860,6 +8860,58 @@ describe('v1.MetadataServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts index 784842921550..8ebf2bed6737 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts @@ -3717,6 +3717,58 @@ describe('v1.MigrationServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts new file mode 100644 index 000000000000..12c59502a706 --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts @@ -0,0 +1,3640 @@ +// 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 modelgardenserviceModule from '../src'; + +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 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.ModelGardenServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + modelgardenserviceModule.v1.ModelGardenServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + modelgardenserviceModule.v1.ModelGardenServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = modelgardenserviceModule.v1.ModelGardenServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelGardenServiceStub, undefined); + await client.initialize(); + assert(client.modelGardenServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.modelGardenServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelGardenServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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('getPublisherModel', () => { + it('invokes getPublisherModel without error', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetPublisherModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.PublisherModel() + ); + client.innerApiCalls.getPublisherModel = stubSimpleCall(expectedResponse); + const [response] = await client.getPublisherModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPublisherModel without error using callback', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetPublisherModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.PublisherModel() + ); + client.innerApiCalls.getPublisherModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPublisherModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IPublisherModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPublisherModel with error', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetPublisherModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPublisherModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPublisherModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPublisherModel with closed client', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetPublisherModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPublisherModel(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('feature', () => { + const fakePath = '/rendered/path/feature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, 'featureValue'); + assert( + (client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts index 9e5175b481f1..f6b1f2c518c6 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts @@ -6483,6 +6483,58 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts index 520fea06206e..3a6cbf4fcefe 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts @@ -5031,6 +5031,58 @@ describe('v1.PipelineServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts index af8a1d803cf3..a2888a3ed87a 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts @@ -3114,6 +3114,58 @@ describe('v1.PredictionServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts index 27904dca5755..d2cc2b369dc5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts @@ -4300,6 +4300,59 @@ describe('v1.SpecialistPoolServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts index 919a5710c6ee..3c8d5305369e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts @@ -8570,6 +8570,58 @@ describe('v1.TensorboardServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts index c88ccccb384a..54ee79a9cde7 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts @@ -5589,6 +5589,58 @@ describe('v1.VizierServiceClient', () => { }); }); + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { From b2c4f4670643d8e5a727c80fb668d5b8ab0cf2b1 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Mon, 5 Jun 2023 23:04:14 -0700 Subject: [PATCH 22/46] fix: [ai-platform] update typings for helpers, updated docstrings; removed stale comment (#4312) This PR clarifies the usage of the helpers. --- packages/google-cloud-aiplatform/src/helpers.ts | 6 +++--- packages/google-cloud-aiplatform/src/value-converter.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-aiplatform/src/helpers.ts b/packages/google-cloud-aiplatform/src/helpers.ts index 0b6d284ed3d8..10273429a250 100644 --- a/packages/google-cloud-aiplatform/src/helpers.ts +++ b/packages/google-cloud-aiplatform/src/helpers.ts @@ -37,12 +37,12 @@ export function addToValue() { } /** - * Converts a protobuf.Message to a protobuf.Value object. - * @param message Message to convert + * Converts an object or protobuf.Message to a protobuf.Value object. + * @param message Object or protobuf.Message to convert * @returns a Value-formatted object */ export function toValue( - message: protobuf.Message + message: protobuf.Message | object ): null | object | undefined | protobuf.common.IValue { if (message === undefined) { return undefined; diff --git a/packages/google-cloud-aiplatform/src/value-converter.ts b/packages/google-cloud-aiplatform/src/value-converter.ts index 7e0cd5b151cd..ccb28dd7b67b 100644 --- a/packages/google-cloud-aiplatform/src/value-converter.ts +++ b/packages/google-cloud-aiplatform/src/value-converter.ts @@ -13,7 +13,6 @@ // limitations under the License. // -// TODO(): Remove this file once https://github.com/protobufjs/protobuf.js/pull/1495 is submitted. export interface ValueType { [index: string]: | null From 5c99df6328f6bd0cfc83a6a294377b47228c0943 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:18:13 +0000 Subject: [PATCH 23/46] feat: [mapsplatformdatasets] Add client libraries for v1 (#4314) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 537411864 Source-Link: https://togithub.com/googleapis/googleapis/commit/99ae68a164dd3f721a30d6a0a924c175f040a881 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/2d89867010dffb9db7a9c420cdb67da8d428d621 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6IjJkODk4NjcwMTBkZmZiOWRiN2E5YzQyMGNkYjY3ZGE4ZDQyOGQ2MjEifQ== --- .../README.md | 26 +- .../mapsplatformdatasets/v1/data_source.proto | 59 + .../mapsplatformdatasets/v1/dataset.proto | 146 + .../v1/maps_platform_datasets.proto | 111 + .../v1/maps_platform_datasets_service.proto | 81 + .../protos/protos.d.ts | 1253 +++++++ .../protos/protos.js | 3017 +++++++++++++++++ .../protos/protos.json | 355 ++ .../samples/README.md | 108 +- .../maps_platform_datasets.create_dataset.js | 67 + .../maps_platform_datasets.delete_dataset.js | 61 + .../v1/maps_platform_datasets.get_dataset.js | 61 + .../maps_platform_datasets.list_datasets.js | 73 + ...atform_datasets.update_dataset_metadata.js | 68 + ...a.google.maps.mapsplatformdatasets.v1.json | 231 ++ ...gle.maps.mapsplatformdatasets.v1alpha.json | 2 +- .../src/index.ts | 5 +- .../src/v1/gapic_metadata.json | 77 + .../src/v1/index.ts | 19 + .../src/v1/maps_platform_datasets_client.ts | 977 ++++++ .../maps_platform_datasets_client_config.json | 63 + .../v1/maps_platform_datasets_proto_list.json | 6 + .../test/gapic_maps_platform_datasets_v1.ts | 1176 +++++++ .../webpack.config.js | 2 +- 24 files changed, 8011 insertions(+), 33 deletions(-) create mode 100644 packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/data_source.proto create mode 100644 packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/dataset.proto create mode 100644 packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto create mode 100644 packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js create mode 100644 packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json create mode 100644 packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json create mode 100644 packages/google-maps-mapsplatformdatasets/src/v1/index.ts create mode 100644 packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts create mode 100644 packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json create mode 100644 packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_proto_list.json create mode 100644 packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts diff --git a/packages/google-maps-mapsplatformdatasets/README.md b/packages/google-maps-mapsplatformdatasets/README.md index f8e272e70c10..7824a7d70ffe 100644 --- a/packages/google-maps-mapsplatformdatasets/README.md +++ b/packages/google-maps-mapsplatformdatasets/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Maps Platform Datasets API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Maps Platform Datasets API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-mapsplatformdatasets) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@googlemaps/maps-platform-datasets.svg)](https://www.npmjs.org/package/@googlemaps/maps-platform-datasets) @@ -110,19 +110,23 @@ callListDataset(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-mapsplatformdatasets/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Maps_platform_datasets_v1_alpha.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.create_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.create_dataset.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.delete_dataset_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset_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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset_version.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.get_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.get_dataset.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.list_dataset_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_dataset_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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_dataset_versions.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_datasets.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_datasets.js,samples/README.md) | -| Maps_platform_datasets_v1_alpha.update_dataset_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.update_dataset_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.update_dataset_metadata.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/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-maps-mapsplatformdatasets/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/test/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-maps-mapsplatformdatasets/samples/test/quickstart.js,samples/README.md) | +| Maps_platform_datasets.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets.update_dataset_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.create_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.create_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.delete_dataset_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset_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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.delete_dataset_version.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.get_dataset.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.get_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.list_dataset_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_dataset_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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_dataset_versions.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_datasets.js) | [![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.list_datasets.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets_v1_alpha.update_dataset_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.update_dataset_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.update_dataset_metadata.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/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-maps-mapsplatformdatasets/samples/quickstart.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/data_source.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/data_source.proto new file mode 100644 index 000000000000..fc92a0c83a09 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/data_source.proto @@ -0,0 +1,59 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1"; +option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1"; +option objc_class_prefix = "MDV1"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1"; + +// The details about the data source when it is a local file. +message LocalFileSource { + // The file name of the uploaded file. + string filename = 1; + + // The format of the file that is being uploaded. + FileFormat file_format = 2; +} + +// The details about the data source when it is in Google Cloud Storage. +message GcsSource { + // Source data URI. For example, `gs://my_bucket/my_object`. + string input_uri = 1; + + // The file format of the Google Cloud Storage object. This is used mainly for + // validation. + FileFormat file_format = 2; +} + +// The format of the file being uploaded. +enum FileFormat { + // Unspecified file format. + FILE_FORMAT_UNSPECIFIED = 0; + + // GeoJson file. + FILE_FORMAT_GEOJSON = 1; + + // KML file. + FILE_FORMAT_KML = 2; + + // CSV file. + FILE_FORMAT_CSV = 3; +} diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/dataset.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/dataset.proto new file mode 100644 index 000000000000..0c9bda178229 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/dataset.proto @@ -0,0 +1,146 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/maps/mapsplatformdatasets/v1/data_source.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1"; +option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb"; +option java_multiple_files = true; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1"; +option objc_class_prefix = "MDV1"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1"; + +// A representation of a Maps Dataset resource. +message Dataset { + option (google.api.resource) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" + }; + + // Resource name, + // projects/{project}/datasets/{dataset_id} + string name = 1; + + // Human readable name, shown in the console UI . + string display_name = 2; + + // A description of this dataset . + string description = 3; + + // The version ID of the dataset. + string version_id = 4; + + // Specified use case for this dataset. + repeated Usage usage = 5; + + // Details about the source of the data for the dataset. + oneof data_source { + // A local file source for the dataset for a single upload. + LocalFileSource local_file_source = 6; + + // A Google Cloud Storage file source for the dataset for a single upload. + GcsSource gcs_source = 7; + } + + // Output only. The status of this dataset version. + Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the dataset was first created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the dataset metadata was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the data was uploaded. + google.protobuf.Timestamp version_create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description for this version of dataset. It is provided + // when importing data to the dataset. + string version_description = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Status of the dataset. +message Status { + // A list of states for the dataset. + enum State { + // The state of this dataset is not set. + STATE_UNSPECIFIED = 0; + + // Data is being imported to a dataset. + STATE_IMPORTING = 1; + + // Importing data to a dataset succeeded. + STATE_IMPORT_SUCCEEDED = 2; + + // Importing data to a dataset failed. + STATE_IMPORT_FAILED = 3; + + // The dataset is in the process of getting deleted. + STATE_DELETING = 4; + + // The deletion failed state. This state represents that dataset deletion + // has failed. Deletion may be retried. + STATE_DELETION_FAILED = 5; + + // Data is being processed. + STATE_PROCESSING = 6; + + // The processing failed state. This state represents that processing has + // failed and may report errors. + STATE_PROCESSING_FAILED = 7; + + // This state is currently not used. + STATE_NEEDS_REVIEW = 8; + + // The publishing state. This state represents the publishing is in + // progress. + STATE_PUBLISHING = 9; + + // The publishing failed states. This state represents that the + // publishing failed. Publishing may be retried. + STATE_PUBLISHING_FAILED = 10; + + // The completed state. This state represents the dataset being + // available for its specific usage. + STATE_COMPLETED = 11; + } + + // State enum for status. + State state = 1; + + // Error message indicating reason of failure. It is empty if the datasets is + // not in a failed state. + string error_message = 2; +} + +// Usage specifies where the data is intended to be used to inform how to +// process the data. +enum Usage { + // The usage of this dataset is not set. + USAGE_UNSPECIFIED = 0; + + // This dataset will be used for data driven styling. + USAGE_DATA_DRIVEN_STYLING = 1; +} diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto new file mode 100644 index 000000000000..4202decb0c21 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto @@ -0,0 +1,111 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/maps/mapsplatformdatasets/v1/data_source.proto"; +import "google/maps/mapsplatformdatasets/v1/dataset.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1"; +option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb"; +option java_multiple_files = true; +option java_outer_classname = "MapsPlatformDatasetsProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1"; +option objc_class_prefix = "MDV1"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1"; + +// Request to create a maps dataset. +message CreateDatasetRequest { + // Required. Parent project that will own the dataset. + // Format: projects/{$project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The dataset version to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update the metadata fields of the dataset. +message UpdateDatasetMetadataRequest { + // Required. The dataset to update. The dataset's name is used to identify the + // dataset to be updated. The name has the format: + // projects/{project}/datasets/{dataset_id} + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. Support the value "*" for full + // replacement. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to get the specified dataset. +message GetDatasetRequest { + // Required. Resource name. projects/{project}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; +} + +// Request to list datasets for the project. +message ListDatasetsRequest { + // Required. The name of the project to list all the datasets for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of versions to return per page. + // If unspecified (or zero), all datasets will be returned. + int32 page_size = 2; + + // The page token, received from a previous ListDatasets call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response to list datasets for the project. +message ListDatasetsResponse { + // All the datasets for the project. + repeated Dataset datasets = 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 to delete a dataset. +// +// The dataset to be deleted. +message DeleteDatasetRequest { + // Required. Format: projects/${project}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; +} diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto new file mode 100644 index 000000000000..1ae92a7c4b4f --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto @@ -0,0 +1,81 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/maps/mapsplatformdatasets/v1/dataset.proto"; +import "google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto"; +import "google/protobuf/empty.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1"; +option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb"; +option java_multiple_files = true; +option java_outer_classname = "MapsPlatformDatasetsServiceProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1"; +option objc_class_prefix = "MDV1"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1"; + +// Service definition for the Maps Platform Datasets API. +service MapsPlatformDatasets { + option (google.api.default_host) = "mapsplatformdatasets.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new dataset for the specified project. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + } + + // Update the metadata for the dataset. + rpc UpdateDatasetMetadata(UpdateDatasetMetadataRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1/{dataset.name=projects/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Get the dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all the datasets for the specified project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete the specified dataset . + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts b/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts index a8c5d211fdca..2a32d4b3ee87 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts @@ -23,6 +23,1259 @@ export namespace google { /** Namespace mapsplatformdatasets. */ namespace mapsplatformdatasets { + /** Namespace v1. */ + namespace v1 { + + /** Properties of a LocalFileSource. */ + interface ILocalFileSource { + + /** LocalFileSource filename */ + filename?: (string|null); + + /** LocalFileSource fileFormat */ + fileFormat?: (google.maps.mapsplatformdatasets.v1.FileFormat|keyof typeof google.maps.mapsplatformdatasets.v1.FileFormat|null); + } + + /** Represents a LocalFileSource. */ + class LocalFileSource implements ILocalFileSource { + + /** + * Constructs a new LocalFileSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.ILocalFileSource); + + /** LocalFileSource filename. */ + public filename: string; + + /** LocalFileSource fileFormat. */ + public fileFormat: (google.maps.mapsplatformdatasets.v1.FileFormat|keyof typeof google.maps.mapsplatformdatasets.v1.FileFormat); + + /** + * Creates a new LocalFileSource instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalFileSource instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.ILocalFileSource): google.maps.mapsplatformdatasets.v1.LocalFileSource; + + /** + * Encodes the specified LocalFileSource message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.LocalFileSource.verify|verify} messages. + * @param message LocalFileSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.ILocalFileSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalFileSource message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.LocalFileSource.verify|verify} messages. + * @param message LocalFileSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.ILocalFileSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalFileSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalFileSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.LocalFileSource; + + /** + * Decodes a LocalFileSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalFileSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.LocalFileSource; + + /** + * Verifies a LocalFileSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalFileSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalFileSource + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.LocalFileSource; + + /** + * Creates a plain object from a LocalFileSource message. Also converts values to other types if specified. + * @param message LocalFileSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.LocalFileSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalFileSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalFileSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUri */ + inputUri?: (string|null); + + /** GcsSource fileFormat */ + fileFormat?: (google.maps.mapsplatformdatasets.v1.FileFormat|keyof typeof google.maps.mapsplatformdatasets.v1.FileFormat|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IGcsSource); + + /** GcsSource inputUri. */ + public inputUri: string; + + /** GcsSource fileFormat. */ + public fileFormat: (google.maps.mapsplatformdatasets.v1.FileFormat|keyof typeof google.maps.mapsplatformdatasets.v1.FileFormat); + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IGcsSource): google.maps.mapsplatformdatasets.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FileFormat enum. */ + enum FileFormat { + FILE_FORMAT_UNSPECIFIED = 0, + FILE_FORMAT_GEOJSON = 1, + FILE_FORMAT_KML = 2, + FILE_FORMAT_CSV = 3 + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset versionId */ + versionId?: (string|null); + + /** Dataset usage */ + usage?: (google.maps.mapsplatformdatasets.v1.Usage[]|null); + + /** Dataset localFileSource */ + localFileSource?: (google.maps.mapsplatformdatasets.v1.ILocalFileSource|null); + + /** Dataset gcsSource */ + gcsSource?: (google.maps.mapsplatformdatasets.v1.IGcsSource|null); + + /** Dataset status */ + status?: (google.maps.mapsplatformdatasets.v1.IStatus|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Dataset versionCreateTime */ + versionCreateTime?: (google.protobuf.ITimestamp|null); + + /** Dataset versionDescription */ + versionDescription?: (string|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IDataset); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset versionId. */ + public versionId: string; + + /** Dataset usage. */ + public usage: google.maps.mapsplatformdatasets.v1.Usage[]; + + /** Dataset localFileSource. */ + public localFileSource?: (google.maps.mapsplatformdatasets.v1.ILocalFileSource|null); + + /** Dataset gcsSource. */ + public gcsSource?: (google.maps.mapsplatformdatasets.v1.IGcsSource|null); + + /** Dataset status. */ + public status?: (google.maps.mapsplatformdatasets.v1.IStatus|null); + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Dataset versionCreateTime. */ + public versionCreateTime?: (google.protobuf.ITimestamp|null); + + /** Dataset versionDescription. */ + public versionDescription: string; + + /** Dataset dataSource. */ + public dataSource?: ("localFileSource"|"gcsSource"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IDataset): google.maps.mapsplatformdatasets.v1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Status. */ + interface IStatus { + + /** Status state */ + state?: (google.maps.mapsplatformdatasets.v1.Status.State|keyof typeof google.maps.mapsplatformdatasets.v1.Status.State|null); + + /** Status errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IStatus); + + /** Status state. */ + public state: (google.maps.mapsplatformdatasets.v1.Status.State|keyof typeof google.maps.mapsplatformdatasets.v1.Status.State); + + /** Status errorMessage. */ + public errorMessage: string; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IStatus): google.maps.mapsplatformdatasets.v1.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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; + } + + namespace Status { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STATE_IMPORTING = 1, + STATE_IMPORT_SUCCEEDED = 2, + STATE_IMPORT_FAILED = 3, + STATE_DELETING = 4, + STATE_DELETION_FAILED = 5, + STATE_PROCESSING = 6, + STATE_PROCESSING_FAILED = 7, + STATE_NEEDS_REVIEW = 8, + STATE_PUBLISHING = 9, + STATE_PUBLISHING_FAILED = 10, + STATE_COMPLETED = 11 + } + } + + /** Usage enum. */ + enum Usage { + USAGE_UNSPECIFIED = 0, + USAGE_DATA_DRIVEN_STYLING = 1 + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.maps.mapsplatformdatasets.v1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.maps.mapsplatformdatasets.v1.IDataset|null); + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest): google.maps.mapsplatformdatasets.v1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.CreateDatasetRequest; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.CreateDatasetRequest; + + /** + * Verifies a CreateDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.CreateDatasetRequest; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @param message CreateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatasetMetadataRequest. */ + interface IUpdateDatasetMetadataRequest { + + /** UpdateDatasetMetadataRequest dataset */ + dataset?: (google.maps.mapsplatformdatasets.v1.IDataset|null); + + /** UpdateDatasetMetadataRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetMetadataRequest. */ + class UpdateDatasetMetadataRequest implements IUpdateDatasetMetadataRequest { + + /** + * Constructs a new UpdateDatasetMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest); + + /** UpdateDatasetMetadataRequest dataset. */ + public dataset?: (google.maps.mapsplatformdatasets.v1.IDataset|null); + + /** UpdateDatasetMetadataRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetMetadataRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest): google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest; + + /** + * Encodes the specified UpdateDatasetMetadataRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.verify|verify} messages. + * @param message UpdateDatasetMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetMetadataRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.verify|verify} messages. + * @param message UpdateDatasetMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest; + + /** + * Decodes an UpdateDatasetMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest; + + /** + * Verifies an UpdateDatasetMetadataRequest message. + * @param message Plain 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 UpdateDatasetMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest; + + /** + * Creates a plain object from an UpdateDatasetMetadataRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { + + /** GetDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { + + /** + * Constructs a new GetDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest); + + /** GetDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest): google.maps.mapsplatformdatasets.v1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.GetDatasetRequest; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.GetDatasetRequest; + + /** + * Verifies a GetDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.GetDatasetRequest; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { + + /** ListDatasetsRequest parent */ + parent?: (string|null); + + /** ListDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { + + /** + * Constructs a new ListDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest); + + /** ListDatasetsRequest parent. */ + public parent: string; + + /** ListDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest): google.maps.mapsplatformdatasets.v1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.ListDatasetsRequest; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.ListDatasetsRequest; + + /** + * Verifies a ListDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.ListDatasetsRequest; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsResponse. */ + interface IListDatasetsResponse { + + /** ListDatasetsResponse datasets */ + datasets?: (google.maps.mapsplatformdatasets.v1.IDataset[]|null); + + /** ListDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatasetsResponse. */ + class ListDatasetsResponse implements IListDatasetsResponse { + + /** + * Constructs a new ListDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.maps.mapsplatformdatasets.v1.IDataset[]; + + /** ListDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsResponse instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IListDatasetsResponse): google.maps.mapsplatformdatasets.v1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.ListDatasetsResponse; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.ListDatasetsResponse; + + /** + * Verifies a ListDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.ListDatasetsResponse; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @param message ListDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { + + /** DeleteDatasetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { + + /** + * Constructs a new DeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest); + + /** DeleteDatasetRequest name. */ + public name: string; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatasetRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest): google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest; + + /** + * Verifies a DeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a MapsPlatformDatasets */ + class MapsPlatformDatasets extends $protobuf.rpc.Service { + + /** + * Constructs a new MapsPlatformDatasets 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 MapsPlatformDatasets 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): MapsPlatformDatasets; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public createDataset(request: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest): Promise; + + /** + * Calls UpdateDatasetMetadata. + * @param request UpdateDatasetMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDatasetMetadata(request: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.UpdateDatasetMetadataCallback): void; + + /** + * Calls UpdateDatasetMetadata. + * @param request UpdateDatasetMetadataRequest message or plain object + * @returns Promise + */ + public updateDatasetMetadata(request: google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest): Promise; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + */ + public listDatasets(request: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.maps.mapsplatformdatasets.v1.IListDatasetsRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataset(request: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest): Promise; + } + + namespace MapsPlatformDatasets { + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|createDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.Dataset) => void; + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|updateDatasetMetadata}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetMetadataCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.Dataset) => void; + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.Dataset) => void; + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|deleteDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + } + /** Namespace v1alpha. */ namespace v1alpha { diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.js b/packages/google-maps-mapsplatformdatasets/protos/protos.js index a1bcc9b214c8..4d1d72c2c746 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.js +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.js @@ -57,6 +57,3023 @@ */ var mapsplatformdatasets = {}; + mapsplatformdatasets.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.maps.mapsplatformdatasets + * @namespace + */ + var v1 = {}; + + v1.LocalFileSource = (function() { + + /** + * Properties of a LocalFileSource. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface ILocalFileSource + * @property {string|null} [filename] LocalFileSource filename + * @property {google.maps.mapsplatformdatasets.v1.FileFormat|null} [fileFormat] LocalFileSource fileFormat + */ + + /** + * Constructs a new LocalFileSource. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a LocalFileSource. + * @implements ILocalFileSource + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.ILocalFileSource=} [properties] Properties to set + */ + function LocalFileSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalFileSource filename. + * @member {string} filename + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @instance + */ + LocalFileSource.prototype.filename = ""; + + /** + * LocalFileSource fileFormat. + * @member {google.maps.mapsplatformdatasets.v1.FileFormat} fileFormat + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @instance + */ + LocalFileSource.prototype.fileFormat = 0; + + /** + * Creates a new LocalFileSource instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.ILocalFileSource=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.LocalFileSource} LocalFileSource instance + */ + LocalFileSource.create = function create(properties) { + return new LocalFileSource(properties); + }; + + /** + * Encodes the specified LocalFileSource message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.LocalFileSource.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.ILocalFileSource} message LocalFileSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalFileSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filename); + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.fileFormat); + return writer; + }; + + /** + * Encodes the specified LocalFileSource message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.LocalFileSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.ILocalFileSource} message LocalFileSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalFileSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalFileSource message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.LocalFileSource} LocalFileSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalFileSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.LocalFileSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filename = reader.string(); + break; + } + case 2: { + message.fileFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalFileSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.LocalFileSource} LocalFileSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalFileSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalFileSource message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalFileSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + switch (message.fileFormat) { + default: + return "fileFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a LocalFileSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.LocalFileSource} LocalFileSource + */ + LocalFileSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.LocalFileSource) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.LocalFileSource(); + if (object.filename != null) + message.filename = String(object.filename); + switch (object.fileFormat) { + default: + if (typeof object.fileFormat === "number") { + message.fileFormat = object.fileFormat; + break; + } + break; + case "FILE_FORMAT_UNSPECIFIED": + case 0: + message.fileFormat = 0; + break; + case "FILE_FORMAT_GEOJSON": + case 1: + message.fileFormat = 1; + break; + case "FILE_FORMAT_KML": + case 2: + message.fileFormat = 2; + break; + case "FILE_FORMAT_CSV": + case 3: + message.fileFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a LocalFileSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.LocalFileSource} message LocalFileSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalFileSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filename = ""; + object.fileFormat = options.enums === String ? "FILE_FORMAT_UNSPECIFIED" : 0; + } + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + object.fileFormat = options.enums === String ? $root.google.maps.mapsplatformdatasets.v1.FileFormat[message.fileFormat] === undefined ? message.fileFormat : $root.google.maps.mapsplatformdatasets.v1.FileFormat[message.fileFormat] : message.fileFormat; + return object; + }; + + /** + * Converts this LocalFileSource to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @instance + * @returns {Object.} JSON object + */ + LocalFileSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalFileSource + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.LocalFileSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalFileSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.LocalFileSource"; + }; + + return LocalFileSource; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IGcsSource + * @property {string|null} [inputUri] GcsSource inputUri + * @property {google.maps.mapsplatformdatasets.v1.FileFormat|null} [fileFormat] GcsSource fileFormat + */ + + /** + * Constructs a new GcsSource. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUri. + * @member {string} inputUri + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @instance + */ + GcsSource.prototype.inputUri = ""; + + /** + * GcsSource fileFormat. + * @member {google.maps.mapsplatformdatasets.v1.FileFormat} fileFormat + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @instance + */ + GcsSource.prototype.fileFormat = 0; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGcsSource=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.fileFormat); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.fileFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + switch (message.fileFormat) { + default: + return "fileFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.GcsSource) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.GcsSource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + switch (object.fileFormat) { + default: + if (typeof object.fileFormat === "number") { + message.fileFormat = object.fileFormat; + break; + } + break; + case "FILE_FORMAT_UNSPECIFIED": + case 0: + message.fileFormat = 0; + break; + case "FILE_FORMAT_GEOJSON": + case 1: + message.fileFormat = 1; + break; + case "FILE_FORMAT_KML": + case 2: + message.fileFormat = 2; + break; + case "FILE_FORMAT_CSV": + case 3: + message.fileFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {google.maps.mapsplatformdatasets.v1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.fileFormat = options.enums === String ? "FILE_FORMAT_UNSPECIFIED" : 0; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + object.fileFormat = options.enums === String ? $root.google.maps.mapsplatformdatasets.v1.FileFormat[message.fileFormat] === undefined ? message.fileFormat : $root.google.maps.mapsplatformdatasets.v1.FileFormat[message.fileFormat] : message.fileFormat; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.GcsSource"; + }; + + return GcsSource; + })(); + + /** + * FileFormat enum. + * @name google.maps.mapsplatformdatasets.v1.FileFormat + * @enum {number} + * @property {number} FILE_FORMAT_UNSPECIFIED=0 FILE_FORMAT_UNSPECIFIED value + * @property {number} FILE_FORMAT_GEOJSON=1 FILE_FORMAT_GEOJSON value + * @property {number} FILE_FORMAT_KML=2 FILE_FORMAT_KML value + * @property {number} FILE_FORMAT_CSV=3 FILE_FORMAT_CSV value + */ + v1.FileFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "FILE_FORMAT_GEOJSON"] = 1; + values[valuesById[2] = "FILE_FORMAT_KML"] = 2; + values[valuesById[3] = "FILE_FORMAT_CSV"] = 3; + return values; + })(); + + v1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IDataset + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {string|null} [versionId] Dataset versionId + * @property {Array.|null} [usage] Dataset usage + * @property {google.maps.mapsplatformdatasets.v1.ILocalFileSource|null} [localFileSource] Dataset localFileSource + * @property {google.maps.mapsplatformdatasets.v1.IGcsSource|null} [gcsSource] Dataset gcsSource + * @property {google.maps.mapsplatformdatasets.v1.IStatus|null} [status] Dataset status + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Dataset updateTime + * @property {google.protobuf.ITimestamp|null} [versionCreateTime] Dataset versionCreateTime + * @property {string|null} [versionDescription] Dataset versionDescription + */ + + /** + * Constructs a new Dataset. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + this.usage = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset name. + * @member {string} name + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset versionId. + * @member {string} versionId + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.versionId = ""; + + /** + * Dataset usage. + * @member {Array.} usage + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.usage = $util.emptyArray; + + /** + * Dataset localFileSource. + * @member {google.maps.mapsplatformdatasets.v1.ILocalFileSource|null|undefined} localFileSource + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.localFileSource = null; + + /** + * Dataset gcsSource. + * @member {google.maps.mapsplatformdatasets.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.gcsSource = null; + + /** + * Dataset status. + * @member {google.maps.mapsplatformdatasets.v1.IStatus|null|undefined} status + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.status = null; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.updateTime = null; + + /** + * Dataset versionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} versionCreateTime + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.versionCreateTime = null; + + /** + * Dataset versionDescription. + * @member {string} versionDescription + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Dataset.prototype.versionDescription = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset dataSource. + * @member {"localFileSource"|"gcsSource"|undefined} dataSource + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["localFileSource", "gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDataset=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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.versionId != null && Object.hasOwnProperty.call(message, "versionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.versionId); + if (message.usage != null && message.usage.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.usage.length; ++i) + writer.int32(message.usage[i]); + writer.ldelim(); + } + if (message.localFileSource != null && Object.hasOwnProperty.call(message, "localFileSource")) + $root.google.maps.mapsplatformdatasets.v1.LocalFileSource.encode(message.localFileSource, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.maps.mapsplatformdatasets.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.versionCreateTime != null && Object.hasOwnProperty.call(message, "versionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.versionCreateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.versionDescription != null && Object.hasOwnProperty.call(message, "versionDescription")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.versionDescription); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.maps.mapsplatformdatasets.v1.Status.encode(message.status, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.Dataset(); + 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.versionId = reader.string(); + break; + } + case 5: { + if (!(message.usage && message.usage.length)) + message.usage = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.usage.push(reader.int32()); + } else + message.usage.push(reader.int32()); + break; + } + case 6: { + message.localFileSource = $root.google.maps.mapsplatformdatasets.v1.LocalFileSource.decode(reader, reader.uint32()); + break; + } + case 7: { + message.gcsSource = $root.google.maps.mapsplatformdatasets.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 12: { + message.status = $root.google.maps.mapsplatformdatasets.v1.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.versionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.versionDescription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.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.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.versionId != null && message.hasOwnProperty("versionId")) + if (!$util.isString(message.versionId)) + return "versionId: string expected"; + if (message.usage != null && message.hasOwnProperty("usage")) { + if (!Array.isArray(message.usage)) + return "usage: array expected"; + for (var i = 0; i < message.usage.length; ++i) + switch (message.usage[i]) { + default: + return "usage: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.localFileSource != null && message.hasOwnProperty("localFileSource")) { + properties.dataSource = 1; + { + var error = $root.google.maps.mapsplatformdatasets.v1.LocalFileSource.verify(message.localFileSource); + if (error) + return "localFileSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.maps.mapsplatformdatasets.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.maps.mapsplatformdatasets.v1.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.versionCreateTime != null && message.hasOwnProperty("versionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.versionCreateTime); + if (error) + return "versionCreateTime." + error; + } + if (message.versionDescription != null && message.hasOwnProperty("versionDescription")) + if (!$util.isString(message.versionDescription)) + return "versionDescription: string expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.Dataset) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.Dataset(); + 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.versionId != null) + message.versionId = String(object.versionId); + if (object.usage) { + if (!Array.isArray(object.usage)) + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.usage: array expected"); + message.usage = []; + for (var i = 0; i < object.usage.length; ++i) + switch (object.usage[i]) { + default: + if (typeof object.usage[i] === "number") { + message.usage[i] = object.usage[i]; + break; + } + case "USAGE_UNSPECIFIED": + case 0: + message.usage[i] = 0; + break; + case "USAGE_DATA_DRIVEN_STYLING": + case 1: + message.usage[i] = 1; + break; + } + } + if (object.localFileSource != null) { + if (typeof object.localFileSource !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.localFileSource: object expected"); + message.localFileSource = $root.google.maps.mapsplatformdatasets.v1.LocalFileSource.fromObject(object.localFileSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.gcsSource: object expected"); + message.gcsSource = $root.google.maps.mapsplatformdatasets.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.status: object expected"); + message.status = $root.google.maps.mapsplatformdatasets.v1.Status.fromObject(object.status); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.versionCreateTime != null) { + if (typeof object.versionCreateTime !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.Dataset.versionCreateTime: object expected"); + message.versionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.versionCreateTime); + } + if (object.versionDescription != null) + message.versionDescription = String(object.versionDescription); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {google.maps.mapsplatformdatasets.v1.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.usage = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.versionId = ""; + object.createTime = null; + object.updateTime = null; + object.versionCreateTime = null; + object.versionDescription = ""; + object.status = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.versionId != null && message.hasOwnProperty("versionId")) + object.versionId = message.versionId; + if (message.usage && message.usage.length) { + object.usage = []; + for (var j = 0; j < message.usage.length; ++j) + object.usage[j] = options.enums === String ? $root.google.maps.mapsplatformdatasets.v1.Usage[message.usage[j]] === undefined ? message.usage[j] : $root.google.maps.mapsplatformdatasets.v1.Usage[message.usage[j]] : message.usage[j]; + } + if (message.localFileSource != null && message.hasOwnProperty("localFileSource")) { + object.localFileSource = $root.google.maps.mapsplatformdatasets.v1.LocalFileSource.toObject(message.localFileSource, options); + if (options.oneofs) + object.dataSource = "localFileSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.maps.mapsplatformdatasets.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.dataSource = "gcsSource"; + } + 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.versionCreateTime != null && message.hasOwnProperty("versionCreateTime")) + object.versionCreateTime = $root.google.protobuf.Timestamp.toObject(message.versionCreateTime, options); + if (message.versionDescription != null && message.hasOwnProperty("versionDescription")) + object.versionDescription = message.versionDescription; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.maps.mapsplatformdatasets.v1.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.Dataset"; + }; + + return Dataset; + })(); + + v1.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IStatus + * @property {google.maps.mapsplatformdatasets.v1.Status.State|null} [state] Status state + * @property {string|null} [errorMessage] Status errorMessage + */ + + /** + * Constructs a new Status. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IStatus=} [properties] Properties to set + */ + function Status(properties) { + if (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 state. + * @member {google.maps.mapsplatformdatasets.v1.Status.State} state + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @instance + */ + Status.prototype.state = 0; + + /** + * Status errorMessage. + * @member {string} errorMessage + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @instance + */ + Status.prototype.errorMessage = ""; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @static + * @param {google.maps.mapsplatformdatasets.v1.IStatus=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Status.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @static + * @param {google.maps.mapsplatformdatasets.v1.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @static + * @param {google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + 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.maps.mapsplatformdatasets.v1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.Status) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.Status(); + 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 "STATE_IMPORTING": + case 1: + message.state = 1; + break; + case "STATE_IMPORT_SUCCEEDED": + case 2: + message.state = 2; + break; + case "STATE_IMPORT_FAILED": + case 3: + message.state = 3; + break; + case "STATE_DELETING": + case 4: + message.state = 4; + break; + case "STATE_DELETION_FAILED": + case 5: + message.state = 5; + break; + case "STATE_PROCESSING": + case 6: + message.state = 6; + break; + case "STATE_PROCESSING_FAILED": + case 7: + message.state = 7; + break; + case "STATE_NEEDS_REVIEW": + case 8: + message.state = 8; + break; + case "STATE_PUBLISHING": + case 9: + message.state = 9; + break; + case "STATE_PUBLISHING_FAILED": + case 10: + message.state = 10; + break; + case "STATE_COMPLETED": + case 11: + message.state = 11; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.Status + * @static + * @param {google.maps.mapsplatformdatasets.v1.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.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.maps.mapsplatformdatasets.v1.Status.State[message.state] === undefined ? message.state : $root.google.maps.mapsplatformdatasets.v1.Status.State[message.state] : message.state; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.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.maps.mapsplatformdatasets.v1.Status"; + }; + + /** + * State enum. + * @name google.maps.mapsplatformdatasets.v1.Status.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STATE_IMPORTING=1 STATE_IMPORTING value + * @property {number} STATE_IMPORT_SUCCEEDED=2 STATE_IMPORT_SUCCEEDED value + * @property {number} STATE_IMPORT_FAILED=3 STATE_IMPORT_FAILED value + * @property {number} STATE_DELETING=4 STATE_DELETING value + * @property {number} STATE_DELETION_FAILED=5 STATE_DELETION_FAILED value + * @property {number} STATE_PROCESSING=6 STATE_PROCESSING value + * @property {number} STATE_PROCESSING_FAILED=7 STATE_PROCESSING_FAILED value + * @property {number} STATE_NEEDS_REVIEW=8 STATE_NEEDS_REVIEW value + * @property {number} STATE_PUBLISHING=9 STATE_PUBLISHING value + * @property {number} STATE_PUBLISHING_FAILED=10 STATE_PUBLISHING_FAILED value + * @property {number} STATE_COMPLETED=11 STATE_COMPLETED value + */ + Status.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_IMPORTING"] = 1; + values[valuesById[2] = "STATE_IMPORT_SUCCEEDED"] = 2; + values[valuesById[3] = "STATE_IMPORT_FAILED"] = 3; + values[valuesById[4] = "STATE_DELETING"] = 4; + values[valuesById[5] = "STATE_DELETION_FAILED"] = 5; + values[valuesById[6] = "STATE_PROCESSING"] = 6; + values[valuesById[7] = "STATE_PROCESSING_FAILED"] = 7; + values[valuesById[8] = "STATE_NEEDS_REVIEW"] = 8; + values[valuesById[9] = "STATE_PUBLISHING"] = 9; + values[valuesById[10] = "STATE_PUBLISHING_FAILED"] = 10; + values[valuesById[11] = "STATE_COMPLETED"] = 11; + return values; + })(); + + return Status; + })(); + + /** + * Usage enum. + * @name google.maps.mapsplatformdatasets.v1.Usage + * @enum {number} + * @property {number} USAGE_UNSPECIFIED=0 USAGE_UNSPECIFIED value + * @property {number} USAGE_DATA_DRIVEN_STYLING=1 USAGE_DATA_DRIVEN_STYLING value + */ + v1.Usage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USAGE_DATA_DRIVEN_STYLING"] = 1; + return values; + })(); + + v1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.maps.mapsplatformdatasets.v1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest=} [properties] Properties to set + */ + function CreateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatasetRequest parent. + * @member {string} parent + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.maps.mapsplatformdatasets.v1.IDataset|null|undefined} dataset + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.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.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.maps.mapsplatformdatasets.v1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetRequest.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.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.maps.mapsplatformdatasets.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + return null; + }; + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.fromObject(object.dataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.CreateDatasetRequest} message CreateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.CreateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1.UpdateDatasetMetadataRequest = (function() { + + /** + * Properties of an UpdateDatasetMetadataRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IUpdateDatasetMetadataRequest + * @property {google.maps.mapsplatformdatasets.v1.IDataset|null} [dataset] UpdateDatasetMetadataRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetMetadataRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetMetadataRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents an UpdateDatasetMetadataRequest. + * @implements IUpdateDatasetMetadataRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest=} [properties] Properties to set + */ + function UpdateDatasetMetadataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetMetadataRequest dataset. + * @member {google.maps.mapsplatformdatasets.v1.IDataset|null|undefined} dataset + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @instance + */ + UpdateDatasetMetadataRequest.prototype.dataset = null; + + /** + * UpdateDatasetMetadataRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @instance + */ + UpdateDatasetMetadataRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetMetadataRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest} UpdateDatasetMetadataRequest instance + */ + UpdateDatasetMetadataRequest.create = function create(properties) { + return new UpdateDatasetMetadataRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetMetadataRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest} message UpdateDatasetMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetMetadataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.maps.mapsplatformdatasets.v1.Dataset.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatasetMetadataRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest} message UpdateDatasetMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest} UpdateDatasetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatasetMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest} UpdateDatasetMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetMetadataRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetMetadataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.maps.mapsplatformdatasets.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDatasetMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest} UpdateDatasetMetadataRequest + */ + UpdateDatasetMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.dataset: object expected"); + message.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest} message UpdateDatasetMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetMetadataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.maps.mapsplatformdatasets.v1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetMetadataRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetMetadataRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest"; + }; + + return UpdateDatasetMetadataRequest; + })(); + + v1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest=} [properties] Properties to set + */ + function GetDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetRequest name. + * @member {string} name + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.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 GetDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.GetDatasetRequest(); + 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 GetDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetRequest.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 GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.GetDatasetRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.GetDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.GetDatasetRequest} message GetDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetRequest.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 GetDatasetRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.GetDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IListDatasetsRequest + * @property {string|null} [parent] ListDatasetsRequest parent + * @property {number|null} [pageSize] ListDatasetsRequest pageSize + * @property {string|null} [pageToken] ListDatasetsRequest pageToken + */ + + /** + * Constructs a new ListDatasetsRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest=} [properties] Properties to set + */ + function ListDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsRequest parent. + * @member {string} parent + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.ListDatasetsRequest} message ListDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsResponse=} [properties] Properties to set + */ + function ListDatasetsResponse(properties) { + this.datasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsResponse datasets. + * @member {Array.} datasets + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.maps.mapsplatformdatasets.v1.Dataset.encode(message.datasets[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 ListDatasetsResponse message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.ListDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.maps.mapsplatformdatasets.v1.Dataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsResponse message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.maps.mapsplatformdatasets.v1.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.ListDatasetsResponse) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.maps.mapsplatformdatasets.v1.Dataset.fromObject(object.datasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} message ListDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.datasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.maps.mapsplatformdatasets.v1.Dataset.toObject(message.datasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsResponse + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.ListDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest=} [properties] Properties to set + */ + function DeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatasetRequest name. + * @member {string} name + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest(); + 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 DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatasetRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatasetRequest.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 DeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1.MapsPlatformDatasets = (function() { + + /** + * Constructs a new MapsPlatformDatasets service. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a MapsPlatformDatasets + * @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 MapsPlatformDatasets(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MapsPlatformDatasets.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MapsPlatformDatasets; + + /** + * Creates new MapsPlatformDatasets service using the specified rpc implementation. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @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 {MapsPlatformDatasets} RPC service. Useful where requests and/or responses are streamed. + */ + MapsPlatformDatasets.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|createDataset}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.mapsplatformdatasets.v1.Dataset} [response] Dataset + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest, $root.google.maps.mapsplatformdatasets.v1.Dataset, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|updateDatasetMetadata}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef UpdateDatasetMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.mapsplatformdatasets.v1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDatasetMetadata. + * @function updateDatasetMetadata + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest} request UpdateDatasetMetadataRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.UpdateDatasetMetadataCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.updateDatasetMetadata = function updateDatasetMetadata(request, callback) { + return this.rpcCall(updateDatasetMetadata, $root.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest, $root.google.maps.mapsplatformdatasets.v1.Dataset, request, callback); + }, "name", { value: "UpdateDatasetMetadata" }); + + /** + * Calls UpdateDatasetMetadata. + * @function updateDatasetMetadata + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest} request UpdateDatasetMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|getDataset}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.mapsplatformdatasets.v1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.maps.mapsplatformdatasets.v1.GetDatasetRequest, $root.google.maps.mapsplatformdatasets.v1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|listDatasets}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.mapsplatformdatasets.v1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest, $root.google.maps.mapsplatformdatasets.v1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|deleteDataset}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MapsPlatformDatasets; + })(); + + return v1; + })(); + mapsplatformdatasets.v1alpha = (function() { /** diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.json b/packages/google-maps-mapsplatformdatasets/protos/protos.json index 2e9f5e03b527..232218e4e0e1 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.json +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.json @@ -6,6 +6,361 @@ "nested": { "mapsplatformdatasets": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Maps.MapsPlatformDatasets.V1", + "go_package": "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb", + "java_multiple_files": true, + "java_outer_classname": "MapsPlatformDatasetsServiceProto", + "java_package": "com.google.maps.mapsplatformdatasets.v1", + "objc_class_prefix": "MDV1", + "php_namespace": "Google\\Maps\\MapsPlatformDatasets\\V1", + "cc_enable_arenas": true + }, + "nested": { + "LocalFileSource": { + "fields": { + "filename": { + "type": "string", + "id": 1 + }, + "fileFormat": { + "type": "FileFormat", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "fileFormat": { + "type": "FileFormat", + "id": 2 + } + } + }, + "FileFormat": { + "values": { + "FILE_FORMAT_UNSPECIFIED": 0, + "FILE_FORMAT_GEOJSON": 1, + "FILE_FORMAT_KML": 2, + "FILE_FORMAT_CSV": 3 + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "mapsplatformdatasets.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}" + }, + "oneofs": { + "dataSource": { + "oneof": [ + "localFileSource", + "gcsSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "versionId": { + "type": "string", + "id": 4 + }, + "usage": { + "rule": "repeated", + "type": "Usage", + "id": 5 + }, + "localFileSource": { + "type": "LocalFileSource", + "id": 6 + }, + "gcsSource": { + "type": "GcsSource", + "id": 7 + }, + "status": { + "type": "Status", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionDescription": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Status": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STATE_IMPORTING": 1, + "STATE_IMPORT_SUCCEEDED": 2, + "STATE_IMPORT_FAILED": 3, + "STATE_DELETING": 4, + "STATE_DELETION_FAILED": 5, + "STATE_PROCESSING": 6, + "STATE_PROCESSING_FAILED": 7, + "STATE_NEEDS_REVIEW": 8, + "STATE_PUBLISHING": 9, + "STATE_PUBLISHING_FAILED": 10, + "STATE_COMPLETED": 11 + } + } + } + }, + "Usage": { + "values": { + "USAGE_UNSPECIFIED": 0, + "USAGE_DATA_DRIVEN_STYLING": 1 + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "dataset": { + "type": "Dataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDatasetMetadataRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "mapsplatformdatasets.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "mapsplatformdatasets.googleapis.com/Dataset" + } + } + } + }, + "MapsPlatformDatasets": { + "options": { + "(google.api.default_host)": "mapsplatformdatasets.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataset": { + "requestType": "CreateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/datasets", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "parent,dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/datasets", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + } + ] + }, + "UpdateDatasetMetadata": { + "requestType": "UpdateDatasetMetadataRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/v1/{dataset.name=projects/*/datasets/*}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dataset.name=projects/*/datasets/*}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset,update_mask" + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/datasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + } + } + }, "v1alpha": { "options": { "csharp_namespace": "Google.Maps.MapsPlatformDatasets.V1Alpha", diff --git a/packages/google-maps-mapsplatformdatasets/samples/README.md b/packages/google-maps-mapsplatformdatasets/samples/README.md index 0a67c9c0e070..8e326879cbb9 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/README.md +++ b/packages/google-maps-mapsplatformdatasets/samples/README.md @@ -12,6 +12,11 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Maps_platform_datasets.create_dataset](#maps_platform_datasets.create_dataset) + * [Maps_platform_datasets.delete_dataset](#maps_platform_datasets.delete_dataset) + * [Maps_platform_datasets.get_dataset](#maps_platform_datasets.get_dataset) + * [Maps_platform_datasets.list_datasets](#maps_platform_datasets.list_datasets) + * [Maps_platform_datasets.update_dataset_metadata](#maps_platform_datasets.update_dataset_metadata) * [Maps_platform_datasets_v1_alpha.create_dataset](#maps_platform_datasets_v1_alpha.create_dataset) * [Maps_platform_datasets_v1_alpha.delete_dataset](#maps_platform_datasets_v1_alpha.delete_dataset) * [Maps_platform_datasets_v1_alpha.delete_dataset_version](#maps_platform_datasets_v1_alpha.delete_dataset_version) @@ -20,7 +25,6 @@ * [Maps_platform_datasets_v1_alpha.list_datasets](#maps_platform_datasets_v1_alpha.list_datasets) * [Maps_platform_datasets_v1_alpha.update_dataset_metadata](#maps_platform_datasets_v1_alpha.update_dataset_metadata) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -37,6 +41,91 @@ Before running the samples, make sure you've followed the steps outlined in +### Maps_platform_datasets.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js). + +[![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js` + + +----- + + + + +### Maps_platform_datasets.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js). + +[![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js` + + +----- + + + + +### Maps_platform_datasets.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js). + +[![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js` + + +----- + + + + +### Maps_platform_datasets.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js). + +[![Open in Cloud 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-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js` + + +----- + + + + +### Maps_platform_datasets.update_dataset_metadata + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js` + + +----- + + + + ### Maps_platform_datasets_v1_alpha.create_dataset View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/maps_platform_datasets_v1_alpha.create_dataset.js). @@ -168,23 +257,6 @@ __Usage:__ `node packages/google-maps-mapsplatformdatasets/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/test/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-maps-mapsplatformdatasets/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-maps-mapsplatformdatasets/samples/test/quickstart.js` - - diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js new file mode 100644 index 000000000000..405dc8815ae1 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.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(parent, dataset) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_CreateDataset_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 project that will own the dataset. + * Format: projects/{$project} + */ + // const parent = 'abc123' + /** + * Required. The dataset version to create. + */ + // const dataset = {} + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const response = await mapsplatformdatasetsClient.createDataset(request); + console.log(response); + } + + callCreateDataset(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js new file mode 100644 index 000000000000..675a4cda2f35 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_DeleteDataset_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. Format: projects/${project}/datasets/{dataset_id} + */ + // const name = 'abc123' + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await mapsplatformdatasetsClient.deleteDataset(request); + console.log(response); + } + + callDeleteDataset(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js new file mode 100644 index 000000000000..c683f41ae3e8 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_GetDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name. projects/{project}/datasets/{dataset_id} + */ + // const name = 'abc123' + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await mapsplatformdatasetsClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js new file mode 100644 index 000000000000..5edb73b066af --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_ListDatasets_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 project to list all the datasets for. + */ + // const parent = 'abc123' + /** + * The maximum number of versions to return per page. + * If unspecified (or zero), all datasets will be returned. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListDatasets call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await mapsplatformdatasetsClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js new file mode 100644 index 000000000000..5b914f7e63cb --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.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(dataset) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_UpdateDatasetMetadata_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 dataset to update. The dataset's name is used to identify the + * dataset to be updated. The name has the format: + * projects/{project}/datasets/{dataset_id} + */ + // const dataset = {} + /** + * The list of fields to be updated. Support the value "*" for full + * replacement. + */ + // const updateMask = {} + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callUpdateDatasetMetadata() { + // Construct request + const request = { + dataset, + }; + + // Run request + const response = await mapsplatformdatasetsClient.updateDatasetMetadata(request); + console.log(response); + } + + callUpdateDatasetMetadata(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_UpdateDatasetMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json new file mode 100644 index 000000000000..dea97741d642 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json @@ -0,0 +1,231 @@ +{ + "clientLibrary": { + "name": "nodejs-mapsplatformdatasets", + "version": "0.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.maps.mapsplatformdatasets.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_CreateDataset_async", + "title": "MapsPlatformDatasets createDataset Sample", + "origin": "API_DEFINITION", + "description": " Create a new dataset for the specified project.", + "canonical": true, + "file": "maps_platform_datasets.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.maps.mapsplatformdatasets.v1.Dataset" + } + ], + "resultType": ".google.maps.mapsplatformdatasets.v1.Dataset", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.CreateDataset", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + }, + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_UpdateDatasetMetadata_async", + "title": "MapsPlatformDatasets updateDatasetMetadata Sample", + "origin": "API_DEFINITION", + "description": " Update the metadata for the dataset.", + "canonical": true, + "file": "maps_platform_datasets.update_dataset_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDatasetMetadata", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.UpdateDatasetMetadata", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.maps.mapsplatformdatasets.v1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.maps.mapsplatformdatasets.v1.Dataset", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "UpdateDatasetMetadata", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.UpdateDatasetMetadata", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + }, + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_GetDataset_async", + "title": "MapsPlatformDatasets getDataset Sample", + "origin": "API_DEFINITION", + "description": " Get the dataset.", + "canonical": true, + "file": "maps_platform_datasets.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.maps.mapsplatformdatasets.v1.Dataset", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.GetDataset", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + }, + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_ListDatasets_async", + "title": "MapsPlatformDatasets listDatasets Sample", + "origin": "API_DEFINITION", + "description": " List all the datasets for the specified project.", + "canonical": true, + "file": "maps_platform_datasets.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.maps.mapsplatformdatasets.v1.ListDatasetsResponse", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.ListDatasets", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + }, + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_DeleteDataset_async", + "title": "MapsPlatformDatasets deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Delete the specified dataset .", + "canonical": true, + "file": "maps_platform_datasets.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.DeleteDataset", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json b/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json index 8702d4bf1317..ccda06a94f5a 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mapsplatformdatasets", - "version": "0.1.1", + "version": "0.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-mapsplatformdatasets/src/index.ts b/packages/google-maps-mapsplatformdatasets/src/index.ts index d0a943d87732..246f24a0a6a2 100644 --- a/packages/google-maps-mapsplatformdatasets/src/index.ts +++ b/packages/google-maps-mapsplatformdatasets/src/index.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1alpha from './v1alpha'; const MapsPlatformDatasetsV1AlphaClient = @@ -23,7 +24,7 @@ const MapsPlatformDatasetsV1AlphaClient = type MapsPlatformDatasetsV1AlphaClient = v1alpha.MapsPlatformDatasetsV1AlphaClient; -export {v1alpha, MapsPlatformDatasetsV1AlphaClient}; -export default {v1alpha, MapsPlatformDatasetsV1AlphaClient}; +export {v1, v1alpha, MapsPlatformDatasetsV1AlphaClient}; +export default {v1, v1alpha, MapsPlatformDatasetsV1AlphaClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..d193c81887d3 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.maps.mapsplatformdatasets.v1", + "libraryPackage": "@google-cloud/mapsplatformdatasets", + "services": { + "MapsPlatformDatasets": { + "clients": { + "grpc": { + "libraryClient": "MapsPlatformDatasetsClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "UpdateDatasetMetadata": { + "methods": [ + "updateDatasetMetadata" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MapsPlatformDatasetsClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "UpdateDatasetMetadata": { + "methods": [ + "updateDatasetMetadata" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/index.ts b/packages/google-maps-mapsplatformdatasets/src/v1/index.ts new file mode 100644 index 000000000000..ca0c9566b162 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {MapsPlatformDatasetsClient} from './maps_platform_datasets_client'; diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts new file mode 100644 index 000000000000..ccdc41438244 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts @@ -0,0 +1,977 @@ +// 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, +} 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/maps_platform_datasets_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './maps_platform_datasets_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service definition for the Maps Platform Datasets API. + * @class + * @memberof v1 + */ +export class MapsPlatformDatasetsClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + mapsPlatformDatasetsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MapsPlatformDatasetsClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 MapsPlatformDatasetsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MapsPlatformDatasetsClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}' + ), + }; + + // 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 = { + listDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datasets' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets', + 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.mapsPlatformDatasetsStub) { + return this.mapsPlatformDatasetsStub; + } + + // Put together the "service stub" for + // google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets. + this.mapsPlatformDatasetsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.maps.mapsplatformdatasets.v1 + .MapsPlatformDatasets, + 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 mapsPlatformDatasetsStubMethods = [ + 'createDataset', + 'updateDatasetMetadata', + 'getDataset', + 'listDatasets', + 'deleteDataset', + ]; + for (const methodName of mapsPlatformDatasetsStubMethods) { + const callPromise = this.mapsPlatformDatasetsStub.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.mapsPlatformDatasetsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'mapsplatformdatasets.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 'mapsplatformdatasets.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 -- + // ------------------- + /** + * Create a new dataset for the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent project that will own the dataset. + * Format: projects/{$project} + * @param {google.maps.mapsplatformdatasets.v1.Dataset} request.dataset + * Required. The dataset version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.maps.mapsplatformdatasets.v1.Dataset | Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/maps_platform_datasets.create_dataset.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_CreateDataset_async + */ + createDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + ( + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | undefined + ), + {} | undefined + ] + >; + createDataset( + request: protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + ( + | protos.google.maps.mapsplatformdatasets.v1.ICreateDatasetRequest + | 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.createDataset(request, options, callback); + } + /** + * Update the metadata for the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.maps.mapsplatformdatasets.v1.Dataset} request.dataset + * Required. The dataset to update. The dataset's name is used to identify the + * dataset to be updated. The name has the format: + * projects/{project}/datasets/{dataset_id} + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. Support the value "*" for full + * replacement. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.maps.mapsplatformdatasets.v1.Dataset | Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_UpdateDatasetMetadata_async + */ + updateDatasetMetadata( + request?: protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + ( + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | undefined + ), + {} | undefined + ] + >; + updateDatasetMetadata( + request: protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDatasetMetadata( + request: protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDatasetMetadata( + request?: protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + ( + | protos.google.maps.mapsplatformdatasets.v1.IUpdateDatasetMetadataRequest + | 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({ + 'dataset.name': request.dataset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDatasetMetadata(request, options, callback); + } + /** + * Get the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name. projects/{project}/datasets/{dataset_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.maps.mapsplatformdatasets.v1.Dataset | Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/maps_platform_datasets.get_dataset.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_GetDataset_async + */ + getDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest | undefined, + {} | undefined + ] + >; + getDataset( + request: protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, + callback: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.maps.mapsplatformdatasets.v1.IDataset, + | protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset, + protos.google.maps.mapsplatformdatasets.v1.IGetDatasetRequest | 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.getDataset(request, options, callback); + } + /** + * Delete the specified dataset . + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: projects/${project}/datasets/{dataset_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/maps_platform_datasets.delete_dataset.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | undefined + ), + {} | undefined + ] + >; + deleteDataset( + request: protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.maps.mapsplatformdatasets.v1.IDeleteDatasetRequest + | 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.deleteDataset(request, options, callback); + } + + /** + * List all the datasets for the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project to list all the datasets for. + * @param {number} request.pageSize + * The maximum number of versions to return per page. + * If unspecified (or zero), all datasets will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasets 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 google.maps.mapsplatformdatasets.v1.Dataset | Dataset}. + * 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 `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasets( + request?: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset[], + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest | null, + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + ] + >; + listDatasets( + request: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + | null + | undefined, + protos.google.maps.mapsplatformdatasets.v1.IDataset + > + ): void; + listDatasets( + request: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + | null + | undefined, + protos.google.maps.mapsplatformdatasets.v1.IDataset + > + ): void; + listDatasets( + request?: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + | null + | undefined, + protos.google.maps.mapsplatformdatasets.v1.IDataset + >, + callback?: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + | null + | undefined, + protos.google.maps.mapsplatformdatasets.v1.IDataset + > + ): Promise< + [ + protos.google.maps.mapsplatformdatasets.v1.IDataset[], + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest | null, + protos.google.maps.mapsplatformdatasets.v1.IListDatasetsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listDatasets(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project to list all the datasets for. + * @param {number} request.pageSize + * The maximum number of versions to return per page. + * If unspecified (or zero), all datasets will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasets 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 google.maps.mapsplatformdatasets.v1.Dataset | Dataset} 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 `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project to list all the datasets for. + * @param {number} request.pageSize + * The maximum number of versions to return per page. + * If unspecified (or zero), all datasets will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasets 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.maps.mapsplatformdatasets.v1.Dataset | Dataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/maps_platform_datasets.list_datasets.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.maps.mapsplatformdatasets.v1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * 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.mapsPlatformDatasetsStub && !this._terminated) { + return this.mapsPlatformDatasetsStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json new file mode 100644 index 000000000000..9a072527d2fa --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDatasetMetadata": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDatasets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDataset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_proto_list.json b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_proto_list.json new file mode 100644 index 000000000000..9a8bc9fc147f --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_proto_list.json @@ -0,0 +1,6 @@ +[ + "../../protos/google/maps/mapsplatformdatasets/v1/data_source.proto", + "../../protos/google/maps/mapsplatformdatasets/v1/dataset.proto", + "../../protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto", + "../../protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto" +] diff --git a/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts b/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts new file mode 100644 index 000000000000..412ab81f0e43 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts @@ -0,0 +1,1176 @@ +// 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 mapsplatformdatasetsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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.MapsPlatformDatasetsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.mapsPlatformDatasetsStub, undefined); + await client.initialize(); + assert(client.mapsPlatformDatasetsStub); + }); + + it('has close method for the initialized client', done => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.mapsPlatformDatasetsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.mapsPlatformDatasetsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + 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 mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + 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('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.createDataset = stubSimpleCall(expectedResponse); + const [response] = await client.createDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.createDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: protos.google.maps.mapsplatformdatasets.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with closed client', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataset(request), expectedError); + }); + }); + + describe('updateDatasetMetadata', () => { + it('invokes updateDatasetMetadata without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.updateDatasetMetadata = + stubSimpleCall(expectedResponse); + const [response] = await client.updateDatasetMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetMetadata without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.updateDatasetMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDatasetMetadata( + request, + ( + err?: Error | null, + result?: protos.google.maps.mapsplatformdatasets.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetMetadata with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatasetMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDatasetMetadata(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatasetMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetMetadata with closed client', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateDatasetMetadata(request), + expectedError + ); + }); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.maps.mapsplatformdatasets.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with closed client', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + 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.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with closed client', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDataset(request), expectedError); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: + | protos.google.maps.mapsplatformdatasets.v1.IDataset[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.maps.mapsplatformdatasets.v1.Dataset[] = + []; + stream.on( + 'data', + (response: protos.google.maps.mapsplatformdatasets.v1.Dataset) => { + 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.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.maps.mapsplatformdatasets.v1.Dataset[] = + []; + stream.on( + 'data', + (response: protos.google.maps.mapsplatformdatasets.v1.Dataset) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.Dataset() + ), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.maps.mapsplatformdatasets.v1.IDataset[] = + []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.maps.mapsplatformdatasets.v1.IDataset[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + }; + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath('projectValue', 'datasetValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-maps-mapsplatformdatasets/webpack.config.js b/packages/google-maps-mapsplatformdatasets/webpack.config.js index d9f44f31e5a1..afe735f02762 100644 --- a/packages/google-maps-mapsplatformdatasets/webpack.config.js +++ b/packages/google-maps-mapsplatformdatasets/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2023 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 8ffd9112f3e433f4410ce6aa2664db6cf50f5175 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:28:13 +0000 Subject: [PATCH 24/46] feat: [billing-budgets] Add resource_ancestors field to support filtering by folders & organizations (#4321) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 537933008 Source-Link: https://togithub.com/googleapis/googleapis/commit/04294122e99eef013b6ee0faff7be2e5e0297041 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/82dfed01a0f18b25ac061c56555a5a066c9d3db3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmctYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiODJkZmVkMDFhMGYxOGIyNWFjMDYxYzU2NTU1YTVhMDY2YzlkM2RiMyJ9 BEGIN_NESTED_COMMIT feat: [billing-budgets] Add resource_ancestors field to support filtering by folders & organizations PiperOrigin-RevId: 537931957 Source-Link: https://togithub.com/googleapis/googleapis/commit/521a7a6acb3dc742e16a28eab0d1de258d83a23c Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/afb9a0c029dd8047950189db30b2743af177e276 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmctYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiYWZiOWEwYzAyOWRkODA0Nzk1MDE4OWRiMzBiMjc0M2FmMTc3ZTI3NiJ9 END_NESTED_COMMIT --- .../google-cloud-billing-budgets/README.md | 27 ++-- .../billing/budgets/v1/budget_model.proto | 142 +++++++++++++----- .../budgets/v1beta1/budget_model.proto | 118 +++++++++------ .../budgets/v1beta1/budget_service.proto | 3 +- .../protos/protos.d.ts | 12 ++ .../protos/protos.js | 78 ++++++++++ .../protos/protos.json | 16 ++ .../samples/README.md | 18 --- ...adata.google.cloud.billing.budgets.v1.json | 2 +- ....google.cloud.billing.budgets.v1beta1.json | 2 +- 10 files changed, 293 insertions(+), 125 deletions(-) diff --git a/packages/google-cloud-billing-budgets/README.md b/packages/google-cloud-billing-budgets/README.md index 835610da778a..58aacdc1aa6b 100644 --- a/packages/google-cloud-billing-budgets/README.md +++ b/packages/google-cloud-billing-budgets/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Billing Budgets: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Billing Budgets: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/billing-budgets.svg)](https://www.npmjs.org/package/@google-cloud/billing-budgets) @@ -82,22 +82,21 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.create_budget.js,samples/README.md) | -| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.delete_budget.js,samples/README.md) | -| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.get_budget.js,samples/README.md) | -| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.list_budgets.js,samples/README.md) | -| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.update_budget.js,samples/README.md) | -| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js,samples/README.md) | -| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js,samples/README.md) | -| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js,samples/README.md) | -| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js,samples/README.md) | -| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/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-billing-budgets/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/test/quickstart.test.js,samples/README.md) | +| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.create_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.delete_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.get_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.list_budgets.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1/budget_service.update_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js) | [![Open in Cloud 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-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js,packages/google-cloud-billing-budgets/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/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-billing-budgets/samples/quickstart.js,packages/google-cloud-billing-budgets/samples/README.md) | diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto index 43ab7b3ffdb9..8c2bbcaa4cde 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto @@ -57,6 +57,10 @@ message Budget { // Optional. Rules that trigger alerts (notifications of thresholds // being crossed) when spend exceeds the specified percentages of the budget. + // + // Optional for `pubsubTopic` notifications. + // + // Required if using email notifications. repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = OPTIONAL]; @@ -67,7 +71,7 @@ message Budget { // Optional. Etag to validate that the object is unchanged for a // read-modify-write operation. - // An empty etag will cause an update to overwrite other changes. + // An empty etag causes an update to overwrite other changes. string etag = 7 [(google.api.field_behavior) = OPTIONAL]; } @@ -95,20 +99,33 @@ message BudgetAmount { // [Filter.calendar_period][google.cloud.billing.budgets.v1.Filter.calendar_period] // spend. At this time, the amount is automatically 100% of the last calendar // period's spend; that is, there are no other options yet. -// Future configuration options will be described here (for example, configuring -// a percentage of last period's spend). // LastPeriodAmount cannot be set for a budget configured with // a // [Filter.custom_period][google.cloud.billing.budgets.v1.Filter.custom_period]. message LastPeriodAmount {} -// ThresholdRule contains a definition of a threshold which triggers -// an alert (a notification of a threshold being crossed) to be sent when -// spend goes above the specified amount. -// Alerts are automatically e-mailed to users with the Billing Account -// Administrator role or the Billing Account User role. -// The thresholds here have no effect on notifications sent to anything -// configured under `Budget.all_updates_rule`. +// ThresholdRule contains the definition of a threshold. Threshold rules define +// the triggering events used to generate a budget notification email. When a +// threshold is crossed (spend exceeds the specified percentages of the +// budget), budget alert emails are sent to the email recipients you specify +// in the +// [NotificationsRule](#notificationsrule). +// +// Threshold rules also affect the fields included in the +// [JSON data +// object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format) +// sent to a Pub/Sub topic. +// +// Threshold rules are _required_ if using email notifications. +// +// Threshold rules are _optional_ if only setting a +// [`pubsubTopic` NotificationsRule](#NotificationsRule), +// unless you want your JSON data object to include data about the thresholds +// you set. +// +// For more information, see +// [set budget threshold rules and +// actions](https://cloud.google.com/billing/docs/how-to/budgets#budget-actions). message ThresholdRule { // The type of basis used to determine if spend has passed the threshold. enum Basis { @@ -140,17 +157,32 @@ message ThresholdRule { // NotificationsRule defines notifications that are sent based on budget spend // and thresholds. message NotificationsRule { - // Optional. The name of the Pub/Sub topic where budget related messages will - // be published, in the form `projects/{project_id}/topics/{topic_id}`. - // Updates are sent at regular intervals to the topic. The topic needs to be - // created before the budget is created; see - // https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications - // for more details. - // Caller is expected to have - // `pubsub.topics.setIamPolicy` permission on the topic when it's set for a - // budget, otherwise, the API call will fail with PERMISSION_DENIED. See - // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications - // for more details on Pub/Sub roles and permissions. + // Optional. The name of the Pub/Sub topic where budget-related messages are + // published, in the form `projects/{project_id}/topics/{topic_id}`. Updates + // are sent to the topic at regular intervals; the timing of the updates is + // not dependent on the [threshold rules](#thresholdrule) you've set. + // + // Note that if you want your + // [Pub/Sub JSON + // object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format) + // to contain data for `alertThresholdExceeded`, you need at least one + // [alert threshold rule](#thresholdrule). When you set threshold rules, you + // must also enable at least one of the email notification options, either + // using the default IAM recipients or Cloud Monitoring email notification + // channels. + // + // To use Pub/Sub topics with budgets, you must do the following: + // + // 1. Create the Pub/Sub topic + // before connecting it to your budget. For guidance, see + // [Manage programmatic budget alert + // notifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications). + // + // 2. Grant the API caller the `pubsub.topics.setIamPolicy` permission on + // the Pub/Sub topic. If not set, the API call fails with PERMISSION_DENIED. + // For additional details on Pub/Sub roles and permissions, see + // [Permissions required for this + // task](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task). string pubsub_topic = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Required when @@ -161,14 +193,28 @@ message NotificationsRule { // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format. string schema_version = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Targets to send notifications to when a threshold is exceeded. - // This is in addition to default recipients who have billing account IAM - // roles. The value is the full REST resource name of a monitoring - // notification channel with the form - // `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 - // channels are allowed. See - // https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients - // for more details. + // Optional. Email targets to send notifications to when a threshold is + // exceeded. This is in addition to the `DefaultIamRecipients` who receive + // alert emails based on their billing account IAM role. The value is the full + // REST resource name of a Cloud Monitoring email notification channel with + // the form `projects/{project_id}/notificationChannels/{channel_id}`. A + // maximum of 5 email notifications are allowed. + // + // To customize budget alert email recipients with monitoring notification + // channels, you _must create the monitoring notification channels before + // you link them to a budget_. For guidance on setting up notification + // channels to use with budgets, see + // [Customize budget alert email + // recipients](https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients). + // + // For Cloud Billing budget alerts, you _must use email notification + // channels_. The other types of notification channels are _not_ + // supported, such as Slack, SMS, or PagerDuty. If you want to + // [send budget notifications to + // Slack](https://cloud.google.com/billing/docs/how-to/notify#send_notifications_to_slack), + // use a pubsubTopic and configure + // [programmatic + // notifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications). repeated string monitoring_notification_channels = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -207,11 +253,18 @@ message Filter { // Optional. A set of projects of the form `projects/{project}`, // specifying that usage from only this set of projects should be - // included in the budget. If omitted, the report will include all usage for + // included in the budget. If omitted, the report includes all usage for // the billing account, regardless of which project the usage occurred on. - // Only zero or one project can be specified currently. repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A set of folder and organization names of the form + // `folders/{folderId}` or `organizations/{organizationId}`, specifying that + // usage from only this set of folders and organizations should be included in + // the budget. If omitted, the report includes all usage for all + // organizations, regardless of which organization the usage occurred on. + repeated string resource_ancestors = 2 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. If // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment] // is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be @@ -230,7 +283,7 @@ message Filter { // Optional. A set of services of the form `services/{service_id}`, // specifying that usage from only this set of services should be - // included in the budget. If omitted, the report will include usage for + // included in the budget. If omitted, the report includes usage for // all the services. // The service names are available through the Catalog API: // https://cloud.google.com/billing/v1/how-tos/catalog-api. @@ -239,26 +292,31 @@ message Filter { // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, // specifying that usage from only this set of subaccounts should be included // in the budget. If a subaccount is set to the name of the parent account, - // usage from the parent account will be included. If the field is omitted, - // the report will include usage from the parent account and all subaccounts, + // usage from the parent account is included. If the field is omitted, + // the report includes usage from the parent account and all subaccounts, // if they exist. repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. A single label and value pair specifying that usage from only - // this set of labeled resources should be included in the budget. Currently, - // multiple entries or multiple values per entry are not allowed. If omitted, - // the report will include all labeled and unlabeled usage. + // this set of labeled resources should be included in the budget. If omitted, + // the report includes all labeled and unlabeled usage. + // + // An object containing a single `"key": value` pair. Example: `{ "name": + // "wrench" }`. + // + // _Currently, multiple entries or multiple values per entry are not + // allowed._ map labels = 6 [(google.api.field_behavior) = OPTIONAL]; // Multiple options to choose the budget's time period, specifying that only // usage that occurs during this time period should be included in the budget. - // If not set, the `usage_period` defaults to CalendarPeriod.MONTH. + // If not set, the usage_period defaults to CalendarPeriod.MONTH. oneof usage_period { // Optional. Specifies to track usage for recurring calendar period. - // For example, assume that CalendarPeriod.QUARTER is set. The budget will - // track usage from April 1 to June 30, when the current calendar month is - // April, May, June. After that, it will track usage from July 1 to + // For example, assume that CalendarPeriod.QUARTER is set. The budget + // tracks usage from April 1 to June 30, when the current calendar month is + // April, May, June. After that, it tracks usage from July 1 to // September 30 when the current calendar month is July, August, September, // so on. CalendarPeriod calendar_period = 8 [(google.api.field_behavior) = OPTIONAL]; @@ -285,6 +343,8 @@ message CustomPeriod { // `CalendarPeriod`". All calendar times begin at 12 AM US and Canadian // Pacific Time (UTC-8). enum CalendarPeriod { + // Calendar period is unset. This is the default if the budget is for a + // custom time period (CustomPeriod). CALENDAR_PERIOD_UNSPECIFIED = 0; // A month. Month starts on the first day of each month, such as January 1, diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto index 5a17d8009402..d9f2d595654c 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto @@ -46,9 +46,9 @@ message Budget { // Validation: <= 60 chars. string display_name = 2; - // Optional. Filters that define which resources are used to compute the actual spend - // against the budget amount, such as projects, services, and the budget's - // time period, as well as other filters. + // Optional. Filters that define which resources are used to compute the + // actual spend against the budget amount, such as projects, services, and the + // budget's time period, as well as other filters. Filter budget_filter = 3 [(google.api.field_behavior) = OPTIONAL]; // Required. Budgeted amount. @@ -60,9 +60,11 @@ message Budget { // Optional for `pubsubTopic` notifications. // // Required if using email notifications. - repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = OPTIONAL]; + repeated ThresholdRule threshold_rules = 5 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Rules to apply to notifications sent based on budget spend and thresholds. + // Optional. Rules to apply to notifications sent based on budget spend and + // thresholds. AllUpdatesRule all_updates_rule = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Etag to validate that the object is unchanged for a @@ -84,22 +86,23 @@ message BudgetAmount { // Use the last period's actual spend as the budget for the present period. // LastPeriodAmount can only be set when the budget's time period is a - // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. It cannot be set in combination with + // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. + // It cannot be set in combination with // [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. LastPeriodAmount last_period_amount = 2; } } -// Describes a budget amount targeted to the last [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period] +// Describes a budget amount targeted to the last +// [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period] // spend. At this time, the amount is automatically 100% of the last calendar // period's spend; that is, there are no other options yet. // Future configuration options will be described here (for example, configuring // a percentage of last period's spend). // LastPeriodAmount cannot be set for a budget configured with -// a [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. -message LastPeriodAmount { - -} +// a +// [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. +message LastPeriodAmount {} // ThresholdRule contains the definition of a threshold. Threshold rules define // the triggering events used to generate a budget notification email. When a @@ -135,7 +138,8 @@ message ThresholdRule { // Use forecasted spend for the period as the basis for comparison against // the threshold. // FORECASTED_SPEND can only be set when the budget's time period is a - // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. It cannot be set in combination with + // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. + // It cannot be set in combination with // [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. FORECASTED_SPEND = 2; } @@ -153,10 +157,10 @@ message ThresholdRule { // AllUpdatesRule defines notifications that are sent based on budget spend // and thresholds. message AllUpdatesRule { - // Optional. The name of the Pub/Sub topic where budget related messages will be - // published, in the form `projects/{project_id}/topics/{topic_id}`. Updates - // are sent at regular intervals to the topic. - // The topic needs to be created before the budget is created; see + // Optional. The name of the Pub/Sub topic where budget related messages will + // be published, in the form `projects/{project_id}/topics/{topic_id}`. + // Updates are sent at regular intervals to the topic. The topic needs to be + // created before the budget is created; see // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications // for more details. // Caller is expected to have @@ -166,26 +170,31 @@ message AllUpdatesRule { // for more details on Pub/Sub roles and permissions. string pubsub_topic = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Required when [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic] is set. The schema version of - // the notification sent to [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic]. Only "1.0" is - // accepted. It represents the JSON schema as defined in + // Optional. Required when + // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic] + // is set. The schema version of the notification sent to + // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic]. + // Only "1.0" is accepted. It represents the JSON schema as defined in // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format. string schema_version = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Targets to send notifications to when a threshold is exceeded. This is in - // addition to default recipients who have billing account IAM roles. - // The value is the full REST resource name of a monitoring notification - // channel with the form + // Optional. Targets to send notifications to when a threshold is exceeded. + // This is in addition to default recipients who have billing account IAM + // roles. The value is the full REST resource name of a monitoring + // notification channel with the form // `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 // channels are allowed. See // https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients // for more details. - repeated string monitoring_notification_channels = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When set to true, disables default notifications sent when a threshold is - // exceeded. Default notifications are sent to those with Billing Account - // Administrator and Billing Account User IAM roles for the target account. - bool disable_default_iam_recipients = 4 [(google.api.field_behavior) = OPTIONAL]; + repeated string monitoring_notification_channels = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, disables default notifications sent when a + // threshold is exceeded. Default notifications are sent to those with Billing + // Account Administrator and Billing Account User IAM roles for the target + // account. + bool disable_default_iam_recipients = 4 + [(google.api.field_behavior) = OPTIONAL]; } // A filter for a budget, limiting the scope of the cost to calculate. @@ -217,21 +226,31 @@ message Filter { // specifying that usage from only this set of projects should be // included in the budget. If omitted, the report will include all usage for // the billing account, regardless of which project the usage occurred on. - // Only zero or one project can be specified currently. repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] is INCLUDE_SPECIFIED_CREDITS, this is - // a list of credit types to be subtracted from gross cost to determine the - // spend for threshold calculations. See - // [a list of acceptable credit type + // Optional. A set of folder and organization names of the form + // `folders/{folderId}` or `organizations/{organizationId}`, specifying that + // usage from only this set of folders and organizations should be included in + // the budget. If omitted, the report includes all usage for all + // organizations, regardless of which organization the usage occurred on. + repeated string resource_ancestors = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If + // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] + // is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be + // subtracted from gross cost to determine the spend for threshold + // calculations. See [a list of acceptable credit type // values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type). // - // If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] is **not** INCLUDE_SPECIFIED_CREDITS, - // this field must be empty. + // If + // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] + // is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty. repeated string credit_types = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. - CreditTypesTreatment credit_types_treatment = 4 [(google.api.field_behavior) = OPTIONAL]; + CreditTypesTreatment credit_types_treatment = 4 + [(google.api.field_behavior) = OPTIONAL]; // Optional. A set of services of the form `services/{service_id}`, // specifying that usage from only this set of services should be @@ -241,24 +260,25 @@ message Filter { // https://cloud.google.com/billing/v1/how-tos/catalog-api. repeated string services = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying - // that usage from only this set of subaccounts should be included in the - // budget. If a subaccount is set to the name of the parent account, + // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, + // specifying that usage from only this set of subaccounts should be included + // in the budget. If a subaccount is set to the name of the parent account, // usage from the parent account will be included. If omitted, the // report will include usage from the parent account and all // subaccounts, if they exist. repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A single label and value pair specifying that usage from only this set of - // labeled resources should be included in the budget. If omitted, the - // report will include all labeled and unlabeled usage. + // Optional. A single label and value pair specifying that usage from only + // this set of labeled resources should be included in the budget. If omitted, + // the report will include all labeled and unlabeled usage. // // An object containing a single `"key": value` pair. Example: `{ "name": // "wrench" }`. // // _Currently, multiple entries or multiple values per entry are not // allowed._ - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + map labels = 6 + [(google.api.field_behavior) = OPTIONAL]; // Multiple options to choose the budget's time period, specifying that only // usage that occurs during this time period should be included in the budget. @@ -272,8 +292,8 @@ message Filter { // so on. CalendarPeriod calendar_period = 8 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Specifies to track usage from any start date (required) to any end date - // (optional). This time period is static, it does not recur. + // Optional. Specifies to track usage from any start date (required) to any + // end date (optional). This time period is static, it does not recur. CustomPeriod custom_period = 9 [(google.api.field_behavior) = OPTIONAL]; } } @@ -283,9 +303,9 @@ message CustomPeriod { // Required. The start date must be after January 1, 2017. google.type.Date start_date = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The end date of the time period. Budgets with elapsed end date won't be - // processed. If unset, specifies to track all usage - // incurred since the start_date. + // Optional. The end date of the time period. Budgets with elapsed end date + // won't be processed. If unset, specifies to track all usage incurred since + // the start_date. google.type.Date end_date = 2 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto index 674e0a39e706..fd376185da4c 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto @@ -117,7 +117,8 @@ message UpdateBudgetRequest { // updated. See // https://developers.google.com/protocol-buffers/docs/proto3#default for more // details about default values. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Request for GetBudget diff --git a/packages/google-cloud-billing-budgets/protos/protos.d.ts b/packages/google-cloud-billing-budgets/protos/protos.d.ts index df36f582aab3..e5981d55b1cd 100644 --- a/packages/google-cloud-billing-budgets/protos/protos.d.ts +++ b/packages/google-cloud-billing-budgets/protos/protos.d.ts @@ -593,6 +593,9 @@ export namespace google { /** Filter projects */ projects?: (string[]|null); + /** Filter resourceAncestors */ + resourceAncestors?: (string[]|null); + /** Filter creditTypes */ creditTypes?: (string[]|null); @@ -627,6 +630,9 @@ export namespace google { /** Filter projects. */ public projects: string[]; + /** Filter resourceAncestors. */ + public resourceAncestors: string[]; + /** Filter creditTypes. */ public creditTypes: string[]; @@ -2160,6 +2166,9 @@ export namespace google { /** Filter projects */ projects?: (string[]|null); + /** Filter resourceAncestors */ + resourceAncestors?: (string[]|null); + /** Filter creditTypes */ creditTypes?: (string[]|null); @@ -2194,6 +2203,9 @@ export namespace google { /** Filter projects. */ public projects: string[]; + /** Filter resourceAncestors. */ + public resourceAncestors: string[]; + /** Filter creditTypes. */ public creditTypes: string[]; diff --git a/packages/google-cloud-billing-budgets/protos/protos.js b/packages/google-cloud-billing-budgets/protos/protos.js index 7a57fc7819f3..d175895b4e44 100644 --- a/packages/google-cloud-billing-budgets/protos/protos.js +++ b/packages/google-cloud-billing-budgets/protos/protos.js @@ -1455,6 +1455,7 @@ * @memberof google.cloud.billing.budgets.v1 * @interface IFilter * @property {Array.|null} [projects] Filter projects + * @property {Array.|null} [resourceAncestors] Filter resourceAncestors * @property {Array.|null} [creditTypes] Filter creditTypes * @property {google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment|null} [creditTypesTreatment] Filter creditTypesTreatment * @property {Array.|null} [services] Filter services @@ -1474,6 +1475,7 @@ */ function Filter(properties) { this.projects = []; + this.resourceAncestors = []; this.creditTypes = []; this.services = []; this.subaccounts = []; @@ -1492,6 +1494,14 @@ */ Filter.prototype.projects = $util.emptyArray; + /** + * Filter resourceAncestors. + * @member {Array.} resourceAncestors + * @memberof google.cloud.billing.budgets.v1.Filter + * @instance + */ + Filter.prototype.resourceAncestors = $util.emptyArray; + /** * Filter creditTypes. * @member {Array.} creditTypes @@ -1589,6 +1599,9 @@ if (message.projects != null && message.projects.length) for (var i = 0; i < message.projects.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projects[i]); + if (message.resourceAncestors != null && message.resourceAncestors.length) + for (var i = 0; i < message.resourceAncestors.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAncestors[i]); if (message.services != null && message.services.length) for (var i = 0; i < message.services.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.services[i]); @@ -1649,6 +1662,12 @@ message.projects.push(reader.string()); break; } + case 2: { + if (!(message.resourceAncestors && message.resourceAncestors.length)) + message.resourceAncestors = []; + message.resourceAncestors.push(reader.string()); + break; + } case 7: { if (!(message.creditTypes && message.creditTypes.length)) message.creditTypes = []; @@ -1745,6 +1764,13 @@ if (!$util.isString(message.projects[i])) return "projects: string[] expected"; } + if (message.resourceAncestors != null && message.hasOwnProperty("resourceAncestors")) { + if (!Array.isArray(message.resourceAncestors)) + return "resourceAncestors: array expected"; + for (var i = 0; i < message.resourceAncestors.length; ++i) + if (!$util.isString(message.resourceAncestors[i])) + return "resourceAncestors: string[] expected"; + } if (message.creditTypes != null && message.hasOwnProperty("creditTypes")) { if (!Array.isArray(message.creditTypes)) return "creditTypes: array expected"; @@ -1830,6 +1856,13 @@ for (var i = 0; i < object.projects.length; ++i) message.projects[i] = String(object.projects[i]); } + if (object.resourceAncestors) { + if (!Array.isArray(object.resourceAncestors)) + throw TypeError(".google.cloud.billing.budgets.v1.Filter.resourceAncestors: array expected"); + message.resourceAncestors = []; + for (var i = 0; i < object.resourceAncestors.length; ++i) + message.resourceAncestors[i] = String(object.resourceAncestors[i]); + } if (object.creditTypes) { if (!Array.isArray(object.creditTypes)) throw TypeError(".google.cloud.billing.budgets.v1.Filter.creditTypes: array expected"); @@ -1932,6 +1965,7 @@ var object = {}; if (options.arrays || options.defaults) { object.projects = []; + object.resourceAncestors = []; object.services = []; object.subaccounts = []; object.creditTypes = []; @@ -1945,6 +1979,11 @@ for (var j = 0; j < message.projects.length; ++j) object.projects[j] = message.projects[j]; } + if (message.resourceAncestors && message.resourceAncestors.length) { + object.resourceAncestors = []; + for (var j = 0; j < message.resourceAncestors.length; ++j) + object.resourceAncestors[j] = message.resourceAncestors[j]; + } if (message.services && message.services.length) { object.services = []; for (var j = 0; j < message.services.length; ++j) @@ -5248,6 +5287,7 @@ * @memberof google.cloud.billing.budgets.v1beta1 * @interface IFilter * @property {Array.|null} [projects] Filter projects + * @property {Array.|null} [resourceAncestors] Filter resourceAncestors * @property {Array.|null} [creditTypes] Filter creditTypes * @property {google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment|null} [creditTypesTreatment] Filter creditTypesTreatment * @property {Array.|null} [services] Filter services @@ -5267,6 +5307,7 @@ */ function Filter(properties) { this.projects = []; + this.resourceAncestors = []; this.creditTypes = []; this.services = []; this.subaccounts = []; @@ -5285,6 +5326,14 @@ */ Filter.prototype.projects = $util.emptyArray; + /** + * Filter resourceAncestors. + * @member {Array.} resourceAncestors + * @memberof google.cloud.billing.budgets.v1beta1.Filter + * @instance + */ + Filter.prototype.resourceAncestors = $util.emptyArray; + /** * Filter creditTypes. * @member {Array.} creditTypes @@ -5382,6 +5431,9 @@ if (message.projects != null && message.projects.length) for (var i = 0; i < message.projects.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projects[i]); + if (message.resourceAncestors != null && message.resourceAncestors.length) + for (var i = 0; i < message.resourceAncestors.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAncestors[i]); if (message.services != null && message.services.length) for (var i = 0; i < message.services.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.services[i]); @@ -5442,6 +5494,12 @@ message.projects.push(reader.string()); break; } + case 2: { + if (!(message.resourceAncestors && message.resourceAncestors.length)) + message.resourceAncestors = []; + message.resourceAncestors.push(reader.string()); + break; + } case 7: { if (!(message.creditTypes && message.creditTypes.length)) message.creditTypes = []; @@ -5538,6 +5596,13 @@ if (!$util.isString(message.projects[i])) return "projects: string[] expected"; } + if (message.resourceAncestors != null && message.hasOwnProperty("resourceAncestors")) { + if (!Array.isArray(message.resourceAncestors)) + return "resourceAncestors: array expected"; + for (var i = 0; i < message.resourceAncestors.length; ++i) + if (!$util.isString(message.resourceAncestors[i])) + return "resourceAncestors: string[] expected"; + } if (message.creditTypes != null && message.hasOwnProperty("creditTypes")) { if (!Array.isArray(message.creditTypes)) return "creditTypes: array expected"; @@ -5623,6 +5688,13 @@ for (var i = 0; i < object.projects.length; ++i) message.projects[i] = String(object.projects[i]); } + if (object.resourceAncestors) { + if (!Array.isArray(object.resourceAncestors)) + throw TypeError(".google.cloud.billing.budgets.v1beta1.Filter.resourceAncestors: array expected"); + message.resourceAncestors = []; + for (var i = 0; i < object.resourceAncestors.length; ++i) + message.resourceAncestors[i] = String(object.resourceAncestors[i]); + } if (object.creditTypes) { if (!Array.isArray(object.creditTypes)) throw TypeError(".google.cloud.billing.budgets.v1beta1.Filter.creditTypes: array expected"); @@ -5725,6 +5797,7 @@ var object = {}; if (options.arrays || options.defaults) { object.projects = []; + object.resourceAncestors = []; object.services = []; object.subaccounts = []; object.creditTypes = []; @@ -5738,6 +5811,11 @@ for (var j = 0; j < message.projects.length; ++j) object.projects[j] = message.projects[j]; } + if (message.resourceAncestors && message.resourceAncestors.length) { + object.resourceAncestors = []; + for (var j = 0; j < message.resourceAncestors.length; ++j) + object.resourceAncestors[j] = message.resourceAncestors[j]; + } if (message.services && message.services.length) { object.services = []; for (var j = 0; j < message.services.length; ++j) diff --git a/packages/google-cloud-billing-budgets/protos/protos.json b/packages/google-cloud-billing-budgets/protos/protos.json index c4df91f27c26..534119db7728 100644 --- a/packages/google-cloud-billing-budgets/protos/protos.json +++ b/packages/google-cloud-billing-budgets/protos/protos.json @@ -172,6 +172,14 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "resourceAncestors": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "creditTypes": { "rule": "repeated", "type": "string", @@ -630,6 +638,14 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "resourceAncestors": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "creditTypes": { "rule": "repeated", "type": "string", diff --git a/packages/google-cloud-billing-budgets/samples/README.md b/packages/google-cloud-billing-budgets/samples/README.md index a0b7c6395014..8a486b2533c3 100644 --- a/packages/google-cloud-billing-budgets/samples/README.md +++ b/packages/google-cloud-billing-budgets/samples/README.md @@ -23,7 +23,6 @@ * [Budget_service.list_budgets](#budget_service.list_budgets) * [Budget_service.update_budget](#budget_service.update_budget) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -222,23 +221,6 @@ __Usage:__ `node packages/google-cloud-billing-budgets/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-billing-budgets/samples/test/quickstart.test.js` - - diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json index 16e159d67a9a..04fe96bb576a 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-budgets", - "version": "4.2.1", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json index 30a311c8cf43..d7b9d449e1c6 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-budgets", - "version": "4.2.1", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { From d266f1863a1fe9c58032e44cbc03aa51441442c5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:44:15 +0000 Subject: [PATCH 25/46] feat: [container] add a API field to enable FQDN Network Policy on clusters (#4319) - [ ] Regenerate this pull request now. --- feat: turn on public visibility for best effort provision --- feat: add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster PiperOrigin-RevId: 537987027 Source-Link: https://togithub.com/googleapis/googleapis/commit/5a5735972ca46dafcf70caea39aec5f2b67130fb Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8c47f208c5e704be08afcf278fb021779cb53da0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiOGM0N2YyMDhjNWU3MDRiZTA4YWZjZjI3OGZiMDIxNzc5Y2I1M2RhMCJ9 BEGIN_NESTED_COMMIT feat: [container] add a API field to enable FQDN Network Policy on clusters --- feat: turn on public visibility for best effort provision --- feat: add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster PiperOrigin-RevId: 537883922 Source-Link: https://togithub.com/googleapis/googleapis/commit/e1de7d7cfac0fe2faf265381b8d0b616c93f1d6b Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/66f4014cfe85984b171d20c6ad5d73fed27a9680 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiNjZmNDAxNGNmZTg1OTg0YjE3MWQyMGM2YWQ1ZDczZmVkMjdhOTY4MCJ9 END_NESTED_COMMIT --- packages/google-container/README.md | 2 + .../google/container/v1/cluster_service.proto | 104 + .../container/v1beta1/cluster_service.proto | 104 + packages/google-container/protos/protos.d.ts | 1202 +++++++ packages/google-container/protos/protos.js | 3020 +++++++++++++++++ packages/google-container/protos/protos.json | 274 ++ packages/google-container/samples/README.md | 36 + ...r_manager.check_autopilot_compatibility.js | 61 + .../snippet_metadata.google.container.v1.json | 40 + ...r_manager.check_autopilot_compatibility.js | 61 + ...pet_metadata.google.container.v1beta1.json | 40 + .../src/v1/cluster_manager_client.ts | 104 + .../src/v1/cluster_manager_client_config.json | 4 + .../src/v1/gapic_metadata.json | 10 + .../src/v1beta1/cluster_manager_client.ts | 104 + .../cluster_manager_client_config.json | 4 + .../src/v1beta1/gapic_metadata.json | 10 + .../test/gapic_cluster_manager_v1.ts | 137 + .../test/gapic_cluster_manager_v1beta1.ts | 137 + 19 files changed, 5454 insertions(+) create mode 100644 packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js create mode 100644 packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js diff --git a/packages/google-container/README.md b/packages/google-container/README.md index 87fce6c780b7..7e4afb261c7c 100644 --- a/packages/google-container/README.md +++ b/packages/google-container/README.md @@ -90,6 +90,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Cluster_manager.cancel_operation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-container/samples/generated/v1/cluster_manager.cancel_operation.js,packages/google-container/samples/README.md) | +| Cluster_manager.check_autopilot_compatibility | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js,packages/google-container/samples/README.md) | | Cluster_manager.complete_i_p_rotation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js,packages/google-container/samples/README.md) | | Cluster_manager.complete_node_pool_upgrade | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.complete_node_pool_upgrade.js,packages/google-container/samples/README.md) | | Cluster_manager.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.create_cluster.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.create_cluster.js,packages/google-container/samples/README.md) | @@ -123,6 +124,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cluster_manager.update_master | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.update_master.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.update_master.js,packages/google-container/samples/README.md) | | Cluster_manager.update_node_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.update_node_pool.js) | [![Open in Cloud 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-container/samples/generated/v1/cluster_manager.update_node_pool.js,packages/google-container/samples/README.md) | | Cluster_manager.cancel_operation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.cancel_operation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-container/samples/generated/v1beta1/cluster_manager.cancel_operation.js,packages/google-container/samples/README.md) | +| Cluster_manager.check_autopilot_compatibility | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js) | [![Open in Cloud 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-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js,packages/google-container/samples/README.md) | | Cluster_manager.complete_i_p_rotation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js) | [![Open in Cloud 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-container/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js,packages/google-container/samples/README.md) | | Cluster_manager.complete_node_pool_upgrade | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js) | [![Open in Cloud 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-container/samples/generated/v1beta1/cluster_manager.complete_node_pool_upgrade.js,packages/google-container/samples/README.md) | | Cluster_manager.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.create_cluster.js) | [![Open in Cloud 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-container/samples/generated/v1beta1/cluster_manager.create_cluster.js,packages/google-container/samples/README.md) | diff --git a/packages/google-container/protos/google/container/v1/cluster_service.proto b/packages/google-container/protos/google/container/v1/cluster_service.proto index 5e9f89693aa0..c987f852c737 100644 --- a/packages/google-container/protos/google/container/v1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1/cluster_service.proto @@ -505,6 +505,15 @@ service ClusterManager { get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" }; } + + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } } // Parameters that can be configured on Linux nodes. @@ -1901,6 +1910,15 @@ message Cluster { // Fleet information for the cluster. Fleet fleet = 140; + + // Beta APIs Config + K8sBetaAPIConfig enable_k8s_beta_apis = 143; +} + +// K8sBetaAPIConfig , configuration for beta APIs +message K8sBetaAPIConfig { + // Enabled k8s beta APIs. + repeated string enabled_apis = 1; } // Node pool configs that apply to all auto-provisioned node pools @@ -2123,6 +2141,15 @@ message ClusterUpdate { // The pod ranges specified here must have been specified earlier in the // 'additional_pod_ranges_config' argument. AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // Desired Beta APIs to be enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; } // AdditionalPodRangesConfig is the configuration for additional pod secondary @@ -3367,6 +3394,9 @@ message NodePool { // fields, and may be sent on update requests to ensure the client has an // up-to-date value before proceeding. string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; } // NodeManagement defines the set of node management services turned on for the @@ -3387,6 +3417,19 @@ message NodeManagement { AutoUpgradeOptions upgrade_options = 10; } +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + // AutoUpgradeOptions defines the set of options for the user to control how // the Auto Upgrades will proceed. message AutoUpgradeOptions { @@ -4096,6 +4139,9 @@ message NetworkConfig { // GatewayAPIConfig contains the desired config of Gateway API on this // cluster. GatewayAPIConfig gateway_api_config = 16; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; } // GatewayAPIConfig contains the desired config of Gateway API on this cluster. @@ -4206,6 +4252,64 @@ message GetJSONWebKeysResponse { repeated Jwk keys = 1; } +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + // ReleaseChannel indicates which release channel a cluster is // subscribed to. Release channels are arranged in order of risk. // diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index 266f507d787f..41d6237108f1 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -489,6 +489,15 @@ service ClusterManager { option (google.api.method_signature) = "parent"; } + // Checks the cluster compatibility with Autopilot mode, and returns a list of + // compatibility issues. + rpc CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest) + returns (CheckAutopilotCompatibilityResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }; + } + // Fetches locations that offer Google Kubernetes Engine. rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { option (google.api.http) = { @@ -1843,6 +1852,9 @@ message Cluster { // creation. bool enable_kubernetes_alpha = 14; + // Kubernetes open source beta apis enabled on the cluster. Only beta apis. + K8sBetaAPIConfig enable_k8s_beta_apis = 143; + // The resource labels for the cluster to use to annotate any related // Google Compute Engine resources. map resource_labels = 15; @@ -2088,6 +2100,12 @@ message Cluster { Fleet fleet = 140; } +// Kubernetes open source beta apis enabled on the cluster. +message K8sBetaAPIConfig { + // api name, e.g. storage.k8s.io/v1beta1/csistoragecapacities. + repeated string enabled_apis = 1; +} + // WorkloadConfig defines the flags to enable or disable the // workload configurations for the cluster. message WorkloadConfig { @@ -2383,6 +2401,15 @@ message ClusterUpdate { // The pod ranges specified here must have been specified earlier in the // 'additional_pod_ranges_config' argument. AdditionalPodRangesConfig removed_additional_pod_ranges_config = 121; + + // Kubernetes open source beta apis enabled on the cluster. Only beta apis + K8sBetaAPIConfig enable_k8s_beta_apis = 122; + + // Enable/Disable FQDN Network Policy for the cluster. + optional bool desired_enable_fqdn_network_policy = 126; + + // Beta APIs enabled for cluster. + K8sBetaAPIConfig desired_k8s_beta_apis = 131; } // AdditionalPodRangesConfig is the configuration for additional pod secondary @@ -3291,6 +3318,19 @@ message ServerConfig { map windows_version_maps = 10; } +// Best effort provisioning. +message BestEffortProvisioning { + // When this is enabled, cluster/node pool creations will ignore non-fatal + // errors like stockout to best provision as many nodes as possible right now + // and eventually bring up all target number of nodes + bool enabled = 1; + + // Minimum number of nodes to be provisioned to be considered as succeeded, + // and the rest of nodes will be provisioned gradually and eventually when + // stockout issue has been resolved. + int32 min_provision_nodes = 2; +} + // Windows server versions. message WindowsVersions { // Windows server version. @@ -3706,6 +3746,9 @@ message NodePool { // fields, and may be sent on update requests to ensure the client has an // up-to-date value before proceeding. string etag = 110; + + // Enable best effort provisioning for nodes + BestEffortProvisioning best_effort_provisioning = 113; } // NodeManagement defines the set of node management services turned on for the @@ -4556,6 +4599,9 @@ message NetworkConfig { // GatewayAPIConfig contains the desired config of Gateway API on this // cluster. GatewayAPIConfig gateway_api_config = 16; + + // Whether FQDN Network Policy is enabled on this cluster. + optional bool enable_fqdn_network_policy = 19; } // GatewayAPIConfig contains the desired config of Gateway API on this cluster. @@ -4953,6 +4999,64 @@ message GetJSONWebKeysResponse { repeated Jwk keys = 1; } +// CheckAutopilotCompatibilityRequest requests getting the blockers for the +// given operation in the cluster. +message CheckAutopilotCompatibilityRequest { + // The name (project, location, cluster) of the cluster to retrieve. + // Specified in the format `projects/*/locations/*/clusters/*`. + string name = 1; +} + +// AutopilotCompatibilityIssue contains information about a specific +// compatibility issue with Autopilot mode. +message AutopilotCompatibilityIssue { + // The type of the reported issue. + enum IssueType { + // Default value, should not be used. + UNSPECIFIED = 0; + + // Indicates that the issue is a known incompatibility between the + // cluster and Autopilot mode. + INCOMPATIBILITY = 1; + + // Indicates the issue is an incompatibility if customers take no further + // action to resolve. + ADDITIONAL_CONFIG_REQUIRED = 2; + + // Indicates the issue is not an incompatibility, but depending on the + // workloads business logic, there is a potential that they won't work on + // Autopilot. + PASSED_WITH_OPTIONAL_CONFIG = 3; + } + + // The last time when this issue was observed. + google.protobuf.Timestamp last_observation = 1; + + // The constraint type of the issue. + string constraint_type = 2; + + // The incompatibility type of this issue. + IssueType incompatibility_type = 3; + + // The name of the resources which are subject to this issue. + repeated string subjects = 4; + + // A URL to a public documnetation, which addresses resolving this issue. + string documentation_url = 5; + + // The description of the issue. + string description = 6; +} + +// CheckAutopilotCompatibilityResponse has a list of compatibility issues. +message CheckAutopilotCompatibilityResponse { + // The list of issues for the given operation. + repeated AutopilotCompatibilityIssue issues = 1; + + // The summary of the autopilot compatibility response. + string summary = 2; +} + // ReleaseChannel indicates which release channel a cluster is // subscribed to. Release channels are arranged in order of risk. // diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index 67f659e12ad9..f2ef51f0ed81 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -504,6 +504,20 @@ export namespace google { * @returns Promise */ public listUsableSubnetworks(request: google.container.v1.IListUsableSubnetworksRequest): Promise; + + /** + * Calls CheckAutopilotCompatibility. + * @param request CheckAutopilotCompatibilityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckAutopilotCompatibilityResponse + */ + public checkAutopilotCompatibility(request: google.container.v1.ICheckAutopilotCompatibilityRequest, callback: google.container.v1.ClusterManager.CheckAutopilotCompatibilityCallback): void; + + /** + * Calls CheckAutopilotCompatibility. + * @param request CheckAutopilotCompatibilityRequest message or plain object + * @returns Promise + */ + public checkAutopilotCompatibility(request: google.container.v1.ICheckAutopilotCompatibilityRequest): Promise; } namespace ClusterManager { @@ -738,6 +752,13 @@ export namespace google { * @param [response] ListUsableSubnetworksResponse */ type ListUsableSubnetworksCallback = (error: (Error|null), response?: google.container.v1.ListUsableSubnetworksResponse) => void; + + /** + * Callback as used by {@link google.container.v1.ClusterManager|checkAutopilotCompatibility}. + * @param error Error, if any + * @param [response] CheckAutopilotCompatibilityResponse + */ + type CheckAutopilotCompatibilityCallback = (error: (Error|null), response?: google.container.v1.CheckAutopilotCompatibilityResponse) => void; } /** Properties of a LinuxNodeConfig. */ @@ -5607,6 +5628,9 @@ export namespace google { /** Cluster fleet */ fleet?: (google.container.v1.IFleet|null); + + /** Cluster enableK8sBetaApis */ + enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); } /** Represents a Cluster. */ @@ -5810,6 +5834,9 @@ export namespace google { /** Cluster fleet. */ public fleet?: (google.container.v1.IFleet|null); + /** Cluster enableK8sBetaApis. */ + public enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + /** Cluster _nodePoolDefaults. */ public _nodePoolDefaults?: "nodePoolDefaults"; @@ -5905,6 +5932,103 @@ export namespace google { } } + /** Properties of a K8sBetaAPIConfig. */ + interface IK8sBetaAPIConfig { + + /** K8sBetaAPIConfig enabledApis */ + enabledApis?: (string[]|null); + } + + /** Represents a K8sBetaAPIConfig. */ + class K8sBetaAPIConfig implements IK8sBetaAPIConfig { + + /** + * Constructs a new K8sBetaAPIConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IK8sBetaAPIConfig); + + /** K8sBetaAPIConfig enabledApis. */ + public enabledApis: string[]; + + /** + * Creates a new K8sBetaAPIConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns K8sBetaAPIConfig instance + */ + public static create(properties?: google.container.v1.IK8sBetaAPIConfig): google.container.v1.K8sBetaAPIConfig; + + /** + * Encodes the specified K8sBetaAPIConfig message. Does not implicitly {@link google.container.v1.K8sBetaAPIConfig.verify|verify} messages. + * @param message K8sBetaAPIConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IK8sBetaAPIConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified K8sBetaAPIConfig message, length delimited. Does not implicitly {@link google.container.v1.K8sBetaAPIConfig.verify|verify} messages. + * @param message K8sBetaAPIConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IK8sBetaAPIConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.K8sBetaAPIConfig; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.K8sBetaAPIConfig; + + /** + * Verifies a K8sBetaAPIConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a K8sBetaAPIConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns K8sBetaAPIConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.K8sBetaAPIConfig; + + /** + * Creates a plain object from a K8sBetaAPIConfig message. Also converts values to other types if specified. + * @param message K8sBetaAPIConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.K8sBetaAPIConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this K8sBetaAPIConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for K8sBetaAPIConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a NodePoolAutoConfig. */ interface INodePoolAutoConfig { @@ -6333,6 +6457,15 @@ export namespace google { /** ClusterUpdate removedAdditionalPodRangesConfig */ removedAdditionalPodRangesConfig?: (google.container.v1.IAdditionalPodRangesConfig|null); + + /** ClusterUpdate enableK8sBetaApis */ + enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + + /** ClusterUpdate desiredEnableFqdnNetworkPolicy */ + desiredEnableFqdnNetworkPolicy?: (boolean|null); + + /** ClusterUpdate desiredK8sBetaApis */ + desiredK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); } /** Represents a ClusterUpdate. */ @@ -6473,9 +6606,21 @@ export namespace google { /** ClusterUpdate removedAdditionalPodRangesConfig. */ public removedAdditionalPodRangesConfig?: (google.container.v1.IAdditionalPodRangesConfig|null); + /** ClusterUpdate enableK8sBetaApis. */ + public enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + + /** ClusterUpdate desiredEnableFqdnNetworkPolicy. */ + public desiredEnableFqdnNetworkPolicy?: (boolean|null); + + /** ClusterUpdate desiredK8sBetaApis. */ + public desiredK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + /** ClusterUpdate _desiredEnablePrivateEndpoint. */ public _desiredEnablePrivateEndpoint?: "desiredEnablePrivateEndpoint"; + /** ClusterUpdate _desiredEnableFqdnNetworkPolicy. */ + public _desiredEnableFqdnNetworkPolicy?: "desiredEnableFqdnNetworkPolicy"; + /** * Creates a new ClusterUpdate instance using the specified properties. * @param [properties] Properties to set @@ -10439,6 +10584,9 @@ export namespace google { /** NodePool etag */ etag?: (string|null); + + /** NodePool bestEffortProvisioning */ + bestEffortProvisioning?: (google.container.v1.IBestEffortProvisioning|null); } /** Represents a NodePool. */ @@ -10507,6 +10655,9 @@ export namespace google { /** NodePool etag. */ public etag: string; + /** NodePool bestEffortProvisioning. */ + public bestEffortProvisioning?: (google.container.v1.IBestEffortProvisioning|null); + /** * Creates a new NodePool instance using the specified properties. * @param [properties] Properties to set @@ -11171,6 +11322,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a BestEffortProvisioning. */ + interface IBestEffortProvisioning { + + /** BestEffortProvisioning enabled */ + enabled?: (boolean|null); + + /** BestEffortProvisioning minProvisionNodes */ + minProvisionNodes?: (number|null); + } + + /** Represents a BestEffortProvisioning. */ + class BestEffortProvisioning implements IBestEffortProvisioning { + + /** + * Constructs a new BestEffortProvisioning. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IBestEffortProvisioning); + + /** BestEffortProvisioning enabled. */ + public enabled: boolean; + + /** BestEffortProvisioning minProvisionNodes. */ + public minProvisionNodes: number; + + /** + * Creates a new BestEffortProvisioning instance using the specified properties. + * @param [properties] Properties to set + * @returns BestEffortProvisioning instance + */ + public static create(properties?: google.container.v1.IBestEffortProvisioning): google.container.v1.BestEffortProvisioning; + + /** + * Encodes the specified BestEffortProvisioning message. Does not implicitly {@link google.container.v1.BestEffortProvisioning.verify|verify} messages. + * @param message BestEffortProvisioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IBestEffortProvisioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BestEffortProvisioning message, length delimited. Does not implicitly {@link google.container.v1.BestEffortProvisioning.verify|verify} messages. + * @param message BestEffortProvisioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IBestEffortProvisioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.BestEffortProvisioning; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.BestEffortProvisioning; + + /** + * Verifies a BestEffortProvisioning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BestEffortProvisioning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BestEffortProvisioning + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.BestEffortProvisioning; + + /** + * Creates a plain object from a BestEffortProvisioning message. Also converts values to other types if specified. + * @param message BestEffortProvisioning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.BestEffortProvisioning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BestEffortProvisioning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BestEffortProvisioning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AutoUpgradeOptions. */ interface IAutoUpgradeOptions { @@ -14244,6 +14498,9 @@ export namespace google { /** NetworkConfig gatewayApiConfig */ gatewayApiConfig?: (google.container.v1.IGatewayAPIConfig|null); + + /** NetworkConfig enableFqdnNetworkPolicy */ + enableFqdnNetworkPolicy?: (boolean|null); } /** Represents a NetworkConfig. */ @@ -14285,6 +14542,12 @@ export namespace google { /** NetworkConfig gatewayApiConfig. */ public gatewayApiConfig?: (google.container.v1.IGatewayAPIConfig|null); + /** NetworkConfig enableFqdnNetworkPolicy. */ + public enableFqdnNetworkPolicy?: (boolean|null); + + /** NetworkConfig _enableFqdnNetworkPolicy. */ + public _enableFqdnNetworkPolicy?: "enableFqdnNetworkPolicy"; + /** * Creates a new NetworkConfig instance using the specified properties. * @param [properties] Properties to set @@ -15137,6 +15400,344 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CheckAutopilotCompatibilityRequest. */ + interface ICheckAutopilotCompatibilityRequest { + + /** CheckAutopilotCompatibilityRequest name */ + name?: (string|null); + } + + /** Represents a CheckAutopilotCompatibilityRequest. */ + class CheckAutopilotCompatibilityRequest implements ICheckAutopilotCompatibilityRequest { + + /** + * Constructs a new CheckAutopilotCompatibilityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.ICheckAutopilotCompatibilityRequest); + + /** CheckAutopilotCompatibilityRequest name. */ + public name: string; + + /** + * Creates a new CheckAutopilotCompatibilityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAutopilotCompatibilityRequest instance + */ + public static create(properties?: google.container.v1.ICheckAutopilotCompatibilityRequest): google.container.v1.CheckAutopilotCompatibilityRequest; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @param message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.ICheckAutopilotCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message, length delimited. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @param message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.ICheckAutopilotCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.CheckAutopilotCompatibilityRequest; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.CheckAutopilotCompatibilityRequest; + + /** + * Verifies a CheckAutopilotCompatibilityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAutopilotCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAutopilotCompatibilityRequest + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.CheckAutopilotCompatibilityRequest; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityRequest message. Also converts values to other types if specified. + * @param message CheckAutopilotCompatibilityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.CheckAutopilotCompatibilityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAutopilotCompatibilityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutopilotCompatibilityIssue. */ + interface IAutopilotCompatibilityIssue { + + /** AutopilotCompatibilityIssue lastObservation */ + lastObservation?: (google.protobuf.ITimestamp|null); + + /** AutopilotCompatibilityIssue constraintType */ + constraintType?: (string|null); + + /** AutopilotCompatibilityIssue incompatibilityType */ + incompatibilityType?: (google.container.v1.AutopilotCompatibilityIssue.IssueType|keyof typeof google.container.v1.AutopilotCompatibilityIssue.IssueType|null); + + /** AutopilotCompatibilityIssue subjects */ + subjects?: (string[]|null); + + /** AutopilotCompatibilityIssue documentationUrl */ + documentationUrl?: (string|null); + + /** AutopilotCompatibilityIssue description */ + description?: (string|null); + } + + /** Represents an AutopilotCompatibilityIssue. */ + class AutopilotCompatibilityIssue implements IAutopilotCompatibilityIssue { + + /** + * Constructs a new AutopilotCompatibilityIssue. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IAutopilotCompatibilityIssue); + + /** AutopilotCompatibilityIssue lastObservation. */ + public lastObservation?: (google.protobuf.ITimestamp|null); + + /** AutopilotCompatibilityIssue constraintType. */ + public constraintType: string; + + /** AutopilotCompatibilityIssue incompatibilityType. */ + public incompatibilityType: (google.container.v1.AutopilotCompatibilityIssue.IssueType|keyof typeof google.container.v1.AutopilotCompatibilityIssue.IssueType); + + /** AutopilotCompatibilityIssue subjects. */ + public subjects: string[]; + + /** AutopilotCompatibilityIssue documentationUrl. */ + public documentationUrl: string; + + /** AutopilotCompatibilityIssue description. */ + public description: string; + + /** + * Creates a new AutopilotCompatibilityIssue instance using the specified properties. + * @param [properties] Properties to set + * @returns AutopilotCompatibilityIssue instance + */ + public static create(properties?: google.container.v1.IAutopilotCompatibilityIssue): google.container.v1.AutopilotCompatibilityIssue; + + /** + * Encodes the specified AutopilotCompatibilityIssue message. Does not implicitly {@link google.container.v1.AutopilotCompatibilityIssue.verify|verify} messages. + * @param message AutopilotCompatibilityIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IAutopilotCompatibilityIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutopilotCompatibilityIssue message, length delimited. Does not implicitly {@link google.container.v1.AutopilotCompatibilityIssue.verify|verify} messages. + * @param message AutopilotCompatibilityIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IAutopilotCompatibilityIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.AutopilotCompatibilityIssue; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.AutopilotCompatibilityIssue; + + /** + * Verifies an AutopilotCompatibilityIssue message. + * @param message Plain 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 AutopilotCompatibilityIssue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutopilotCompatibilityIssue + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.AutopilotCompatibilityIssue; + + /** + * Creates a plain object from an AutopilotCompatibilityIssue message. Also converts values to other types if specified. + * @param message AutopilotCompatibilityIssue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.AutopilotCompatibilityIssue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutopilotCompatibilityIssue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutopilotCompatibilityIssue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutopilotCompatibilityIssue { + + /** IssueType enum. */ + enum IssueType { + UNSPECIFIED = 0, + INCOMPATIBILITY = 1, + ADDITIONAL_CONFIG_REQUIRED = 2, + PASSED_WITH_OPTIONAL_CONFIG = 3 + } + } + + /** Properties of a CheckAutopilotCompatibilityResponse. */ + interface ICheckAutopilotCompatibilityResponse { + + /** CheckAutopilotCompatibilityResponse issues */ + issues?: (google.container.v1.IAutopilotCompatibilityIssue[]|null); + + /** CheckAutopilotCompatibilityResponse summary */ + summary?: (string|null); + } + + /** Represents a CheckAutopilotCompatibilityResponse. */ + class CheckAutopilotCompatibilityResponse implements ICheckAutopilotCompatibilityResponse { + + /** + * Constructs a new CheckAutopilotCompatibilityResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.ICheckAutopilotCompatibilityResponse); + + /** CheckAutopilotCompatibilityResponse issues. */ + public issues: google.container.v1.IAutopilotCompatibilityIssue[]; + + /** CheckAutopilotCompatibilityResponse summary. */ + public summary: string; + + /** + * Creates a new CheckAutopilotCompatibilityResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAutopilotCompatibilityResponse instance + */ + public static create(properties?: google.container.v1.ICheckAutopilotCompatibilityResponse): google.container.v1.CheckAutopilotCompatibilityResponse; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @param message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.ICheckAutopilotCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message, length delimited. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @param message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.ICheckAutopilotCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.CheckAutopilotCompatibilityResponse; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.CheckAutopilotCompatibilityResponse; + + /** + * Verifies a CheckAutopilotCompatibilityResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAutopilotCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAutopilotCompatibilityResponse + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.CheckAutopilotCompatibilityResponse; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityResponse message. Also converts values to other types if specified. + * @param message CheckAutopilotCompatibilityResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.CheckAutopilotCompatibilityResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAutopilotCompatibilityResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ReleaseChannel. */ interface IReleaseChannel { @@ -19867,6 +20468,20 @@ export namespace google { */ public listUsableSubnetworks(request: google.container.v1beta1.IListUsableSubnetworksRequest): Promise; + /** + * Calls CheckAutopilotCompatibility. + * @param request CheckAutopilotCompatibilityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckAutopilotCompatibilityResponse + */ + public checkAutopilotCompatibility(request: google.container.v1beta1.ICheckAutopilotCompatibilityRequest, callback: google.container.v1beta1.ClusterManager.CheckAutopilotCompatibilityCallback): void; + + /** + * Calls CheckAutopilotCompatibility. + * @param request CheckAutopilotCompatibilityRequest message or plain object + * @returns Promise + */ + public checkAutopilotCompatibility(request: google.container.v1beta1.ICheckAutopilotCompatibilityRequest): Promise; + /** * Calls ListLocations. * @param request ListLocationsRequest message or plain object @@ -20115,6 +20730,13 @@ export namespace google { */ type ListUsableSubnetworksCallback = (error: (Error|null), response?: google.container.v1beta1.ListUsableSubnetworksResponse) => void; + /** + * Callback as used by {@link google.container.v1beta1.ClusterManager|checkAutopilotCompatibility}. + * @param error Error, if any + * @param [response] CheckAutopilotCompatibilityResponse + */ + type CheckAutopilotCompatibilityCallback = (error: (Error|null), response?: google.container.v1beta1.CheckAutopilotCompatibilityResponse) => void; + /** * Callback as used by {@link google.container.v1beta1.ClusterManager|listLocations}. * @param error Error, if any @@ -25705,6 +26327,9 @@ export namespace google { /** Cluster enableKubernetesAlpha */ enableKubernetesAlpha?: (boolean|null); + /** Cluster enableK8sBetaApis */ + enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + /** Cluster resourceLabels */ resourceLabels?: ({ [k: string]: string }|null); @@ -25934,6 +26559,9 @@ export namespace google { /** Cluster enableKubernetesAlpha. */ public enableKubernetesAlpha: boolean; + /** Cluster enableK8sBetaApis. */ + public enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + /** Cluster resourceLabels. */ public resourceLabels: { [k: string]: string }; @@ -26209,6 +26837,103 @@ export namespace google { } } + /** Properties of a K8sBetaAPIConfig. */ + interface IK8sBetaAPIConfig { + + /** K8sBetaAPIConfig enabledApis */ + enabledApis?: (string[]|null); + } + + /** Represents a K8sBetaAPIConfig. */ + class K8sBetaAPIConfig implements IK8sBetaAPIConfig { + + /** + * Constructs a new K8sBetaAPIConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IK8sBetaAPIConfig); + + /** K8sBetaAPIConfig enabledApis. */ + public enabledApis: string[]; + + /** + * Creates a new K8sBetaAPIConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns K8sBetaAPIConfig instance + */ + public static create(properties?: google.container.v1beta1.IK8sBetaAPIConfig): google.container.v1beta1.K8sBetaAPIConfig; + + /** + * Encodes the specified K8sBetaAPIConfig message. Does not implicitly {@link google.container.v1beta1.K8sBetaAPIConfig.verify|verify} messages. + * @param message K8sBetaAPIConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IK8sBetaAPIConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified K8sBetaAPIConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.K8sBetaAPIConfig.verify|verify} messages. + * @param message K8sBetaAPIConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IK8sBetaAPIConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.K8sBetaAPIConfig; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.K8sBetaAPIConfig; + + /** + * Verifies a K8sBetaAPIConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a K8sBetaAPIConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns K8sBetaAPIConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.K8sBetaAPIConfig; + + /** + * Creates a plain object from a K8sBetaAPIConfig message. Also converts values to other types if specified. + * @param message K8sBetaAPIConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.K8sBetaAPIConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this K8sBetaAPIConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for K8sBetaAPIConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a WorkloadConfig. */ interface IWorkloadConfig { @@ -26889,6 +27614,15 @@ export namespace google { /** ClusterUpdate removedAdditionalPodRangesConfig */ removedAdditionalPodRangesConfig?: (google.container.v1beta1.IAdditionalPodRangesConfig|null); + + /** ClusterUpdate enableK8sBetaApis */ + enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + + /** ClusterUpdate desiredEnableFqdnNetworkPolicy */ + desiredEnableFqdnNetworkPolicy?: (boolean|null); + + /** ClusterUpdate desiredK8sBetaApis */ + desiredK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); } /** Represents a ClusterUpdate. */ @@ -27050,12 +27784,24 @@ export namespace google { /** ClusterUpdate removedAdditionalPodRangesConfig. */ public removedAdditionalPodRangesConfig?: (google.container.v1beta1.IAdditionalPodRangesConfig|null); + /** ClusterUpdate enableK8sBetaApis. */ + public enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + + /** ClusterUpdate desiredEnableFqdnNetworkPolicy. */ + public desiredEnableFqdnNetworkPolicy?: (boolean|null); + + /** ClusterUpdate desiredK8sBetaApis. */ + public desiredK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + /** ClusterUpdate _desiredEnablePrivateEndpoint. */ public _desiredEnablePrivateEndpoint?: "desiredEnablePrivateEndpoint"; /** ClusterUpdate _desiredProtectConfig. */ public _desiredProtectConfig?: "desiredProtectConfig"; + /** ClusterUpdate _desiredEnableFqdnNetworkPolicy. */ + public _desiredEnableFqdnNetworkPolicy?: "desiredEnableFqdnNetworkPolicy"; + /** * Creates a new ClusterUpdate instance using the specified properties. * @param [properties] Properties to set @@ -30373,6 +31119,109 @@ export namespace google { } } + /** Properties of a BestEffortProvisioning. */ + interface IBestEffortProvisioning { + + /** BestEffortProvisioning enabled */ + enabled?: (boolean|null); + + /** BestEffortProvisioning minProvisionNodes */ + minProvisionNodes?: (number|null); + } + + /** Represents a BestEffortProvisioning. */ + class BestEffortProvisioning implements IBestEffortProvisioning { + + /** + * Constructs a new BestEffortProvisioning. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IBestEffortProvisioning); + + /** BestEffortProvisioning enabled. */ + public enabled: boolean; + + /** BestEffortProvisioning minProvisionNodes. */ + public minProvisionNodes: number; + + /** + * Creates a new BestEffortProvisioning instance using the specified properties. + * @param [properties] Properties to set + * @returns BestEffortProvisioning instance + */ + public static create(properties?: google.container.v1beta1.IBestEffortProvisioning): google.container.v1beta1.BestEffortProvisioning; + + /** + * Encodes the specified BestEffortProvisioning message. Does not implicitly {@link google.container.v1beta1.BestEffortProvisioning.verify|verify} messages. + * @param message BestEffortProvisioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IBestEffortProvisioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BestEffortProvisioning message, length delimited. Does not implicitly {@link google.container.v1beta1.BestEffortProvisioning.verify|verify} messages. + * @param message BestEffortProvisioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IBestEffortProvisioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.BestEffortProvisioning; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.BestEffortProvisioning; + + /** + * Verifies a BestEffortProvisioning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BestEffortProvisioning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BestEffortProvisioning + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.BestEffortProvisioning; + + /** + * Creates a plain object from a BestEffortProvisioning message. Also converts values to other types if specified. + * @param message BestEffortProvisioning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.BestEffortProvisioning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BestEffortProvisioning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BestEffortProvisioning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a WindowsVersions. */ interface IWindowsVersions { @@ -31346,6 +32195,9 @@ export namespace google { /** NodePool etag */ etag?: (string|null); + + /** NodePool bestEffortProvisioning */ + bestEffortProvisioning?: (google.container.v1beta1.IBestEffortProvisioning|null); } /** Represents a NodePool. */ @@ -31414,6 +32266,9 @@ export namespace google { /** NodePool etag. */ public etag: string; + /** NodePool bestEffortProvisioning. */ + public bestEffortProvisioning?: (google.container.v1beta1.IBestEffortProvisioning|null); + /** * Creates a new NodePool instance using the specified properties. * @param [properties] Properties to set @@ -35587,6 +36442,9 @@ export namespace google { /** NetworkConfig gatewayApiConfig */ gatewayApiConfig?: (google.container.v1beta1.IGatewayAPIConfig|null); + + /** NetworkConfig enableFqdnNetworkPolicy */ + enableFqdnNetworkPolicy?: (boolean|null); } /** Represents a NetworkConfig. */ @@ -35628,6 +36486,12 @@ export namespace google { /** NetworkConfig gatewayApiConfig. */ public gatewayApiConfig?: (google.container.v1beta1.IGatewayAPIConfig|null); + /** NetworkConfig enableFqdnNetworkPolicy. */ + public enableFqdnNetworkPolicy?: (boolean|null); + + /** NetworkConfig _enableFqdnNetworkPolicy. */ + public _enableFqdnNetworkPolicy?: "enableFqdnNetworkPolicy"; + /** * Creates a new NetworkConfig instance using the specified properties. * @param [properties] Properties to set @@ -38661,6 +39525,344 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CheckAutopilotCompatibilityRequest. */ + interface ICheckAutopilotCompatibilityRequest { + + /** CheckAutopilotCompatibilityRequest name */ + name?: (string|null); + } + + /** Represents a CheckAutopilotCompatibilityRequest. */ + class CheckAutopilotCompatibilityRequest implements ICheckAutopilotCompatibilityRequest { + + /** + * Constructs a new CheckAutopilotCompatibilityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.ICheckAutopilotCompatibilityRequest); + + /** CheckAutopilotCompatibilityRequest name. */ + public name: string; + + /** + * Creates a new CheckAutopilotCompatibilityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAutopilotCompatibilityRequest instance + */ + public static create(properties?: google.container.v1beta1.ICheckAutopilotCompatibilityRequest): google.container.v1beta1.CheckAutopilotCompatibilityRequest; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @param message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.ICheckAutopilotCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message, length delimited. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @param message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.ICheckAutopilotCompatibilityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.CheckAutopilotCompatibilityRequest; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.CheckAutopilotCompatibilityRequest; + + /** + * Verifies a CheckAutopilotCompatibilityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAutopilotCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAutopilotCompatibilityRequest + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.CheckAutopilotCompatibilityRequest; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityRequest message. Also converts values to other types if specified. + * @param message CheckAutopilotCompatibilityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.CheckAutopilotCompatibilityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAutopilotCompatibilityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutopilotCompatibilityIssue. */ + interface IAutopilotCompatibilityIssue { + + /** AutopilotCompatibilityIssue lastObservation */ + lastObservation?: (google.protobuf.ITimestamp|null); + + /** AutopilotCompatibilityIssue constraintType */ + constraintType?: (string|null); + + /** AutopilotCompatibilityIssue incompatibilityType */ + incompatibilityType?: (google.container.v1beta1.AutopilotCompatibilityIssue.IssueType|keyof typeof google.container.v1beta1.AutopilotCompatibilityIssue.IssueType|null); + + /** AutopilotCompatibilityIssue subjects */ + subjects?: (string[]|null); + + /** AutopilotCompatibilityIssue documentationUrl */ + documentationUrl?: (string|null); + + /** AutopilotCompatibilityIssue description */ + description?: (string|null); + } + + /** Represents an AutopilotCompatibilityIssue. */ + class AutopilotCompatibilityIssue implements IAutopilotCompatibilityIssue { + + /** + * Constructs a new AutopilotCompatibilityIssue. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IAutopilotCompatibilityIssue); + + /** AutopilotCompatibilityIssue lastObservation. */ + public lastObservation?: (google.protobuf.ITimestamp|null); + + /** AutopilotCompatibilityIssue constraintType. */ + public constraintType: string; + + /** AutopilotCompatibilityIssue incompatibilityType. */ + public incompatibilityType: (google.container.v1beta1.AutopilotCompatibilityIssue.IssueType|keyof typeof google.container.v1beta1.AutopilotCompatibilityIssue.IssueType); + + /** AutopilotCompatibilityIssue subjects. */ + public subjects: string[]; + + /** AutopilotCompatibilityIssue documentationUrl. */ + public documentationUrl: string; + + /** AutopilotCompatibilityIssue description. */ + public description: string; + + /** + * Creates a new AutopilotCompatibilityIssue instance using the specified properties. + * @param [properties] Properties to set + * @returns AutopilotCompatibilityIssue instance + */ + public static create(properties?: google.container.v1beta1.IAutopilotCompatibilityIssue): google.container.v1beta1.AutopilotCompatibilityIssue; + + /** + * Encodes the specified AutopilotCompatibilityIssue message. Does not implicitly {@link google.container.v1beta1.AutopilotCompatibilityIssue.verify|verify} messages. + * @param message AutopilotCompatibilityIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IAutopilotCompatibilityIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutopilotCompatibilityIssue message, length delimited. Does not implicitly {@link google.container.v1beta1.AutopilotCompatibilityIssue.verify|verify} messages. + * @param message AutopilotCompatibilityIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IAutopilotCompatibilityIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.AutopilotCompatibilityIssue; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.AutopilotCompatibilityIssue; + + /** + * Verifies an AutopilotCompatibilityIssue message. + * @param message Plain 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 AutopilotCompatibilityIssue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutopilotCompatibilityIssue + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.AutopilotCompatibilityIssue; + + /** + * Creates a plain object from an AutopilotCompatibilityIssue message. Also converts values to other types if specified. + * @param message AutopilotCompatibilityIssue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.AutopilotCompatibilityIssue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutopilotCompatibilityIssue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutopilotCompatibilityIssue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutopilotCompatibilityIssue { + + /** IssueType enum. */ + enum IssueType { + UNSPECIFIED = 0, + INCOMPATIBILITY = 1, + ADDITIONAL_CONFIG_REQUIRED = 2, + PASSED_WITH_OPTIONAL_CONFIG = 3 + } + } + + /** Properties of a CheckAutopilotCompatibilityResponse. */ + interface ICheckAutopilotCompatibilityResponse { + + /** CheckAutopilotCompatibilityResponse issues */ + issues?: (google.container.v1beta1.IAutopilotCompatibilityIssue[]|null); + + /** CheckAutopilotCompatibilityResponse summary */ + summary?: (string|null); + } + + /** Represents a CheckAutopilotCompatibilityResponse. */ + class CheckAutopilotCompatibilityResponse implements ICheckAutopilotCompatibilityResponse { + + /** + * Constructs a new CheckAutopilotCompatibilityResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.ICheckAutopilotCompatibilityResponse); + + /** CheckAutopilotCompatibilityResponse issues. */ + public issues: google.container.v1beta1.IAutopilotCompatibilityIssue[]; + + /** CheckAutopilotCompatibilityResponse summary. */ + public summary: string; + + /** + * Creates a new CheckAutopilotCompatibilityResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckAutopilotCompatibilityResponse instance + */ + public static create(properties?: google.container.v1beta1.ICheckAutopilotCompatibilityResponse): google.container.v1beta1.CheckAutopilotCompatibilityResponse; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @param message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.ICheckAutopilotCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message, length delimited. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @param message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.ICheckAutopilotCompatibilityResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.CheckAutopilotCompatibilityResponse; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.CheckAutopilotCompatibilityResponse; + + /** + * Verifies a CheckAutopilotCompatibilityResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckAutopilotCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckAutopilotCompatibilityResponse + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.CheckAutopilotCompatibilityResponse; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityResponse message. Also converts values to other types if specified. + * @param message CheckAutopilotCompatibilityResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.CheckAutopilotCompatibilityResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckAutopilotCompatibilityResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ReleaseChannel. */ interface IReleaseChannel { diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index 0be180172ed7..0c1cbc25fb33 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -1178,6 +1178,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.container.v1.ClusterManager|checkAutopilotCompatibility}. + * @memberof google.container.v1.ClusterManager + * @typedef CheckAutopilotCompatibilityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.container.v1.CheckAutopilotCompatibilityResponse} [response] CheckAutopilotCompatibilityResponse + */ + + /** + * Calls CheckAutopilotCompatibility. + * @function checkAutopilotCompatibility + * @memberof google.container.v1.ClusterManager + * @instance + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest} request CheckAutopilotCompatibilityRequest message or plain object + * @param {google.container.v1.ClusterManager.CheckAutopilotCompatibilityCallback} callback Node-style callback called with the error, if any, and CheckAutopilotCompatibilityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterManager.prototype.checkAutopilotCompatibility = function checkAutopilotCompatibility(request, callback) { + return this.rpcCall(checkAutopilotCompatibility, $root.google.container.v1.CheckAutopilotCompatibilityRequest, $root.google.container.v1.CheckAutopilotCompatibilityResponse, request, callback); + }, "name", { value: "CheckAutopilotCompatibility" }); + + /** + * Calls CheckAutopilotCompatibility. + * @function checkAutopilotCompatibility + * @memberof google.container.v1.ClusterManager + * @instance + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest} request CheckAutopilotCompatibilityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return ClusterManager; })(); @@ -12916,6 +12949,7 @@ * @property {google.container.v1.INodePoolAutoConfig|null} [nodePoolAutoConfig] Cluster nodePoolAutoConfig * @property {string|null} [etag] Cluster etag * @property {google.container.v1.IFleet|null} [fleet] Cluster fleet + * @property {google.container.v1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] Cluster enableK8sBetaApis */ /** @@ -13450,6 +13484,14 @@ */ Cluster.prototype.fleet = null; + /** + * Cluster enableK8sBetaApis. + * @member {google.container.v1.IK8sBetaAPIConfig|null|undefined} enableK8sBetaApis + * @memberof google.container.v1.Cluster + * @instance + */ + Cluster.prototype.enableK8sBetaApis = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -13621,6 +13663,8 @@ writer.uint32(/* id 139, wireType 2 =*/1114).string(message.etag); if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) $root.google.container.v1.Fleet.encode(message.fleet, writer.uint32(/* id 140, wireType 2 =*/1122).fork()).ldelim(); + if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) + $root.google.container.v1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); return writer; }; @@ -13938,6 +13982,10 @@ message.fleet = $root.google.container.v1.Fleet.decode(reader, reader.uint32()); break; } + case 143: { + message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14266,6 +14314,11 @@ if (error) return "fleet." + error; } + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) { + var error = $root.google.container.v1.K8sBetaAPIConfig.verify(message.enableK8sBetaApis); + if (error) + return "enableK8sBetaApis." + error; + } return null; }; @@ -14567,6 +14620,11 @@ throw TypeError(".google.container.v1.Cluster.fleet: object expected"); message.fleet = $root.google.container.v1.Fleet.fromObject(object.fleet); } + if (object.enableK8sBetaApis != null) { + if (typeof object.enableK8sBetaApis !== "object") + throw TypeError(".google.container.v1.Cluster.enableK8sBetaApis: object expected"); + message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); + } return message; }; @@ -14650,6 +14708,7 @@ object.nodePoolAutoConfig = null; object.etag = ""; object.fleet = null; + object.enableK8sBetaApis = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14798,6 +14857,8 @@ object.etag = message.etag; if (message.fleet != null && message.hasOwnProperty("fleet")) object.fleet = $root.google.container.v1.Fleet.toObject(message.fleet, options); + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) + object.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); return object; }; @@ -14854,6 +14915,225 @@ return Cluster; })(); + v1.K8sBetaAPIConfig = (function() { + + /** + * Properties of a K8sBetaAPIConfig. + * @memberof google.container.v1 + * @interface IK8sBetaAPIConfig + * @property {Array.|null} [enabledApis] K8sBetaAPIConfig enabledApis + */ + + /** + * Constructs a new K8sBetaAPIConfig. + * @memberof google.container.v1 + * @classdesc Represents a K8sBetaAPIConfig. + * @implements IK8sBetaAPIConfig + * @constructor + * @param {google.container.v1.IK8sBetaAPIConfig=} [properties] Properties to set + */ + function K8sBetaAPIConfig(properties) { + this.enabledApis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * K8sBetaAPIConfig enabledApis. + * @member {Array.} enabledApis + * @memberof google.container.v1.K8sBetaAPIConfig + * @instance + */ + K8sBetaAPIConfig.prototype.enabledApis = $util.emptyArray; + + /** + * Creates a new K8sBetaAPIConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {google.container.v1.IK8sBetaAPIConfig=} [properties] Properties to set + * @returns {google.container.v1.K8sBetaAPIConfig} K8sBetaAPIConfig instance + */ + K8sBetaAPIConfig.create = function create(properties) { + return new K8sBetaAPIConfig(properties); + }; + + /** + * Encodes the specified K8sBetaAPIConfig message. Does not implicitly {@link google.container.v1.K8sBetaAPIConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {google.container.v1.IK8sBetaAPIConfig} message K8sBetaAPIConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + K8sBetaAPIConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabledApis != null && message.enabledApis.length) + for (var i = 0; i < message.enabledApis.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.enabledApis[i]); + return writer; + }; + + /** + * Encodes the specified K8sBetaAPIConfig message, length delimited. Does not implicitly {@link google.container.v1.K8sBetaAPIConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {google.container.v1.IK8sBetaAPIConfig} message K8sBetaAPIConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + K8sBetaAPIConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.K8sBetaAPIConfig} K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + K8sBetaAPIConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.K8sBetaAPIConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.enabledApis && message.enabledApis.length)) + message.enabledApis = []; + message.enabledApis.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.K8sBetaAPIConfig} K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + K8sBetaAPIConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a K8sBetaAPIConfig message. + * @function verify + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + K8sBetaAPIConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabledApis != null && message.hasOwnProperty("enabledApis")) { + if (!Array.isArray(message.enabledApis)) + return "enabledApis: array expected"; + for (var i = 0; i < message.enabledApis.length; ++i) + if (!$util.isString(message.enabledApis[i])) + return "enabledApis: string[] expected"; + } + return null; + }; + + /** + * Creates a K8sBetaAPIConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.K8sBetaAPIConfig} K8sBetaAPIConfig + */ + K8sBetaAPIConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.K8sBetaAPIConfig) + return object; + var message = new $root.google.container.v1.K8sBetaAPIConfig(); + if (object.enabledApis) { + if (!Array.isArray(object.enabledApis)) + throw TypeError(".google.container.v1.K8sBetaAPIConfig.enabledApis: array expected"); + message.enabledApis = []; + for (var i = 0; i < object.enabledApis.length; ++i) + message.enabledApis[i] = String(object.enabledApis[i]); + } + return message; + }; + + /** + * Creates a plain object from a K8sBetaAPIConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {google.container.v1.K8sBetaAPIConfig} message K8sBetaAPIConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + K8sBetaAPIConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.enabledApis = []; + if (message.enabledApis && message.enabledApis.length) { + object.enabledApis = []; + for (var j = 0; j < message.enabledApis.length; ++j) + object.enabledApis[j] = message.enabledApis[j]; + } + return object; + }; + + /** + * Converts this K8sBetaAPIConfig to JSON. + * @function toJSON + * @memberof google.container.v1.K8sBetaAPIConfig + * @instance + * @returns {Object.} JSON object + */ + K8sBetaAPIConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for K8sBetaAPIConfig + * @function getTypeUrl + * @memberof google.container.v1.K8sBetaAPIConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + K8sBetaAPIConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.K8sBetaAPIConfig"; + }; + + return K8sBetaAPIConfig; + })(); + v1.NodePoolAutoConfig = (function() { /** @@ -15556,6 +15836,9 @@ * @property {google.container.v1.StackType|null} [desiredStackType] ClusterUpdate desiredStackType * @property {google.container.v1.IAdditionalPodRangesConfig|null} [additionalPodRangesConfig] ClusterUpdate additionalPodRangesConfig * @property {google.container.v1.IAdditionalPodRangesConfig|null} [removedAdditionalPodRangesConfig] ClusterUpdate removedAdditionalPodRangesConfig + * @property {google.container.v1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] ClusterUpdate enableK8sBetaApis + * @property {boolean|null} [desiredEnableFqdnNetworkPolicy] ClusterUpdate desiredEnableFqdnNetworkPolicy + * @property {google.container.v1.IK8sBetaAPIConfig|null} [desiredK8sBetaApis] ClusterUpdate desiredK8sBetaApis */ /** @@ -15918,6 +16201,30 @@ */ ClusterUpdate.prototype.removedAdditionalPodRangesConfig = null; + /** + * ClusterUpdate enableK8sBetaApis. + * @member {google.container.v1.IK8sBetaAPIConfig|null|undefined} enableK8sBetaApis + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.enableK8sBetaApis = null; + + /** + * ClusterUpdate desiredEnableFqdnNetworkPolicy. + * @member {boolean|null|undefined} desiredEnableFqdnNetworkPolicy + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredEnableFqdnNetworkPolicy = null; + + /** + * ClusterUpdate desiredK8sBetaApis. + * @member {google.container.v1.IK8sBetaAPIConfig|null|undefined} desiredK8sBetaApis + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredK8sBetaApis = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -15932,6 +16239,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * ClusterUpdate _desiredEnableFqdnNetworkPolicy. + * @member {"desiredEnableFqdnNetworkPolicy"|undefined} _desiredEnableFqdnNetworkPolicy + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + Object.defineProperty(ClusterUpdate.prototype, "_desiredEnableFqdnNetworkPolicy", { + get: $util.oneOfGetter($oneOfFields = ["desiredEnableFqdnNetworkPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ClusterUpdate instance using the specified properties. * @function create @@ -16043,6 +16361,12 @@ $root.google.container.v1.AdditionalPodRangesConfig.encode(message.additionalPodRangesConfig, writer.uint32(/* id 120, wireType 2 =*/962).fork()).ldelim(); if (message.removedAdditionalPodRangesConfig != null && Object.hasOwnProperty.call(message, "removedAdditionalPodRangesConfig")) $root.google.container.v1.AdditionalPodRangesConfig.encode(message.removedAdditionalPodRangesConfig, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); + if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) + $root.google.container.v1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.desiredEnableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "desiredEnableFqdnNetworkPolicy")) + writer.uint32(/* id 126, wireType 0 =*/1008).bool(message.desiredEnableFqdnNetworkPolicy); + if (message.desiredK8sBetaApis != null && Object.hasOwnProperty.call(message, "desiredK8sBetaApis")) + $root.google.container.v1.K8sBetaAPIConfig.encode(message.desiredK8sBetaApis, writer.uint32(/* id 131, wireType 2 =*/1050).fork()).ldelim(); return writer; }; @@ -16251,6 +16575,18 @@ message.removedAdditionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.decode(reader, reader.uint32()); break; } + case 122: { + message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } + case 126: { + message.desiredEnableFqdnNetworkPolicy = reader.bool(); + break; + } + case 131: { + message.desiredK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16503,6 +16839,21 @@ if (error) return "removedAdditionalPodRangesConfig." + error; } + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) { + var error = $root.google.container.v1.K8sBetaAPIConfig.verify(message.enableK8sBetaApis); + if (error) + return "enableK8sBetaApis." + error; + } + if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { + properties._desiredEnableFqdnNetworkPolicy = 1; + if (typeof message.desiredEnableFqdnNetworkPolicy !== "boolean") + return "desiredEnableFqdnNetworkPolicy: boolean expected"; + } + if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) { + var error = $root.google.container.v1.K8sBetaAPIConfig.verify(message.desiredK8sBetaApis); + if (error) + return "desiredK8sBetaApis." + error; + } return null; }; @@ -16760,6 +17111,18 @@ throw TypeError(".google.container.v1.ClusterUpdate.removedAdditionalPodRangesConfig: object expected"); message.removedAdditionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.fromObject(object.removedAdditionalPodRangesConfig); } + if (object.enableK8sBetaApis != null) { + if (typeof object.enableK8sBetaApis !== "object") + throw TypeError(".google.container.v1.ClusterUpdate.enableK8sBetaApis: object expected"); + message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); + } + if (object.desiredEnableFqdnNetworkPolicy != null) + message.desiredEnableFqdnNetworkPolicy = Boolean(object.desiredEnableFqdnNetworkPolicy); + if (object.desiredK8sBetaApis != null) { + if (typeof object.desiredK8sBetaApis !== "object") + throw TypeError(".google.container.v1.ClusterUpdate.desiredK8sBetaApis: object expected"); + message.desiredK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.fromObject(object.desiredK8sBetaApis); + } return message; }; @@ -16820,6 +17183,8 @@ object.desiredStackType = options.enums === String ? "STACK_TYPE_UNSPECIFIED" : 0; object.additionalPodRangesConfig = null; object.removedAdditionalPodRangesConfig = null; + object.enableK8sBetaApis = null; + object.desiredK8sBetaApis = null; } if (message.desiredNodeVersion != null && message.hasOwnProperty("desiredNodeVersion")) object.desiredNodeVersion = message.desiredNodeVersion; @@ -16913,6 +17278,15 @@ object.additionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.toObject(message.additionalPodRangesConfig, options); if (message.removedAdditionalPodRangesConfig != null && message.hasOwnProperty("removedAdditionalPodRangesConfig")) object.removedAdditionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.toObject(message.removedAdditionalPodRangesConfig, options); + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) + object.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { + object.desiredEnableFqdnNetworkPolicy = message.desiredEnableFqdnNetworkPolicy; + if (options.oneofs) + object._desiredEnableFqdnNetworkPolicy = "desiredEnableFqdnNetworkPolicy"; + } + if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) + object.desiredK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.desiredK8sBetaApis, options); return object; }; @@ -27020,6 +27394,7 @@ * @property {google.container.v1.NodePool.IPlacementPolicy|null} [placementPolicy] NodePool placementPolicy * @property {google.container.v1.NodePool.IUpdateInfo|null} [updateInfo] NodePool updateInfo * @property {string|null} [etag] NodePool etag + * @property {google.container.v1.IBestEffortProvisioning|null} [bestEffortProvisioning] NodePool bestEffortProvisioning */ /** @@ -27192,6 +27567,14 @@ */ NodePool.prototype.etag = ""; + /** + * NodePool bestEffortProvisioning. + * @member {google.container.v1.IBestEffortProvisioning|null|undefined} bestEffortProvisioning + * @memberof google.container.v1.NodePool + * @instance + */ + NodePool.prototype.bestEffortProvisioning = null; + /** * Creates a new NodePool instance using the specified properties. * @function create @@ -27257,6 +27640,8 @@ $root.google.container.v1.NodePool.UpdateInfo.encode(message.updateInfo, writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 110, wireType 2 =*/882).string(message.etag); + if (message.bestEffortProvisioning != null && Object.hasOwnProperty.call(message, "bestEffortProvisioning")) + $root.google.container.v1.BestEffortProvisioning.encode(message.bestEffortProvisioning, writer.uint32(/* id 113, wireType 2 =*/906).fork()).ldelim(); return writer; }; @@ -27373,6 +27758,10 @@ message.etag = reader.string(); break; } + case 113: { + message.bestEffortProvisioning = $root.google.container.v1.BestEffortProvisioning.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27505,6 +27894,11 @@ if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; + if (message.bestEffortProvisioning != null && message.hasOwnProperty("bestEffortProvisioning")) { + var error = $root.google.container.v1.BestEffortProvisioning.verify(message.bestEffortProvisioning); + if (error) + return "bestEffortProvisioning." + error; + } return null; }; @@ -27634,6 +28028,11 @@ } if (object.etag != null) message.etag = String(object.etag); + if (object.bestEffortProvisioning != null) { + if (typeof object.bestEffortProvisioning !== "object") + throw TypeError(".google.container.v1.NodePool.bestEffortProvisioning: object expected"); + message.bestEffortProvisioning = $root.google.container.v1.BestEffortProvisioning.fromObject(object.bestEffortProvisioning); + } return message; }; @@ -27672,6 +28071,7 @@ object.placementPolicy = null; object.updateInfo = null; object.etag = ""; + object.bestEffortProvisioning = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -27720,6 +28120,8 @@ object.updateInfo = $root.google.container.v1.NodePool.UpdateInfo.toObject(message.updateInfo, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; + if (message.bestEffortProvisioning != null && message.hasOwnProperty("bestEffortProvisioning")) + object.bestEffortProvisioning = $root.google.container.v1.BestEffortProvisioning.toObject(message.bestEffortProvisioning, options); return object; }; @@ -29217,6 +29619,233 @@ return NodeManagement; })(); + v1.BestEffortProvisioning = (function() { + + /** + * Properties of a BestEffortProvisioning. + * @memberof google.container.v1 + * @interface IBestEffortProvisioning + * @property {boolean|null} [enabled] BestEffortProvisioning enabled + * @property {number|null} [minProvisionNodes] BestEffortProvisioning minProvisionNodes + */ + + /** + * Constructs a new BestEffortProvisioning. + * @memberof google.container.v1 + * @classdesc Represents a BestEffortProvisioning. + * @implements IBestEffortProvisioning + * @constructor + * @param {google.container.v1.IBestEffortProvisioning=} [properties] Properties to set + */ + function BestEffortProvisioning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BestEffortProvisioning enabled. + * @member {boolean} enabled + * @memberof google.container.v1.BestEffortProvisioning + * @instance + */ + BestEffortProvisioning.prototype.enabled = false; + + /** + * BestEffortProvisioning minProvisionNodes. + * @member {number} minProvisionNodes + * @memberof google.container.v1.BestEffortProvisioning + * @instance + */ + BestEffortProvisioning.prototype.minProvisionNodes = 0; + + /** + * Creates a new BestEffortProvisioning instance using the specified properties. + * @function create + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {google.container.v1.IBestEffortProvisioning=} [properties] Properties to set + * @returns {google.container.v1.BestEffortProvisioning} BestEffortProvisioning instance + */ + BestEffortProvisioning.create = function create(properties) { + return new BestEffortProvisioning(properties); + }; + + /** + * Encodes the specified BestEffortProvisioning message. Does not implicitly {@link google.container.v1.BestEffortProvisioning.verify|verify} messages. + * @function encode + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {google.container.v1.IBestEffortProvisioning} message BestEffortProvisioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestEffortProvisioning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.minProvisionNodes != null && Object.hasOwnProperty.call(message, "minProvisionNodes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProvisionNodes); + return writer; + }; + + /** + * Encodes the specified BestEffortProvisioning message, length delimited. Does not implicitly {@link google.container.v1.BestEffortProvisioning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {google.container.v1.IBestEffortProvisioning} message BestEffortProvisioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestEffortProvisioning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.BestEffortProvisioning} BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestEffortProvisioning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.BestEffortProvisioning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.minProvisionNodes = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.BestEffortProvisioning} BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestEffortProvisioning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BestEffortProvisioning message. + * @function verify + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BestEffortProvisioning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.minProvisionNodes != null && message.hasOwnProperty("minProvisionNodes")) + if (!$util.isInteger(message.minProvisionNodes)) + return "minProvisionNodes: integer expected"; + return null; + }; + + /** + * Creates a BestEffortProvisioning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.BestEffortProvisioning} BestEffortProvisioning + */ + BestEffortProvisioning.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.BestEffortProvisioning) + return object; + var message = new $root.google.container.v1.BestEffortProvisioning(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.minProvisionNodes != null) + message.minProvisionNodes = object.minProvisionNodes | 0; + return message; + }; + + /** + * Creates a plain object from a BestEffortProvisioning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {google.container.v1.BestEffortProvisioning} message BestEffortProvisioning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BestEffortProvisioning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.minProvisionNodes = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.minProvisionNodes != null && message.hasOwnProperty("minProvisionNodes")) + object.minProvisionNodes = message.minProvisionNodes; + return object; + }; + + /** + * Converts this BestEffortProvisioning to JSON. + * @function toJSON + * @memberof google.container.v1.BestEffortProvisioning + * @instance + * @returns {Object.} JSON object + */ + BestEffortProvisioning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BestEffortProvisioning + * @function getTypeUrl + * @memberof google.container.v1.BestEffortProvisioning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BestEffortProvisioning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.BestEffortProvisioning"; + }; + + return BestEffortProvisioning; + })(); + v1.AutoUpgradeOptions = (function() { /** @@ -36960,6 +37589,7 @@ * @property {google.container.v1.IDNSConfig|null} [dnsConfig] NetworkConfig dnsConfig * @property {google.container.v1.IServiceExternalIPsConfig|null} [serviceExternalIpsConfig] NetworkConfig serviceExternalIpsConfig * @property {google.container.v1.IGatewayAPIConfig|null} [gatewayApiConfig] NetworkConfig gatewayApiConfig + * @property {boolean|null} [enableFqdnNetworkPolicy] NetworkConfig enableFqdnNetworkPolicy */ /** @@ -37057,6 +37687,28 @@ */ NetworkConfig.prototype.gatewayApiConfig = null; + /** + * NetworkConfig enableFqdnNetworkPolicy. + * @member {boolean|null|undefined} enableFqdnNetworkPolicy + * @memberof google.container.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.enableFqdnNetworkPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkConfig _enableFqdnNetworkPolicy. + * @member {"enableFqdnNetworkPolicy"|undefined} _enableFqdnNetworkPolicy + * @memberof google.container.v1.NetworkConfig + * @instance + */ + Object.defineProperty(NetworkConfig.prototype, "_enableFqdnNetworkPolicy", { + get: $util.oneOfGetter($oneOfFields = ["enableFqdnNetworkPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new NetworkConfig instance using the specified properties. * @function create @@ -37101,6 +37753,8 @@ $root.google.container.v1.ServiceExternalIPsConfig.encode(message.serviceExternalIpsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.gatewayApiConfig != null && Object.hasOwnProperty.call(message, "gatewayApiConfig")) $root.google.container.v1.GatewayAPIConfig.encode(message.gatewayApiConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.enableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "enableFqdnNetworkPolicy")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableFqdnNetworkPolicy); return writer; }; @@ -37175,6 +37829,10 @@ message.gatewayApiConfig = $root.google.container.v1.GatewayAPIConfig.decode(reader, reader.uint32()); break; } + case 19: { + message.enableFqdnNetworkPolicy = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -37210,6 +37868,7 @@ NetworkConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.network != null && message.hasOwnProperty("network")) if (!$util.isString(message.network)) return "network: string expected"; @@ -37261,6 +37920,11 @@ if (error) return "gatewayApiConfig." + error; } + if (message.enableFqdnNetworkPolicy != null && message.hasOwnProperty("enableFqdnNetworkPolicy")) { + properties._enableFqdnNetworkPolicy = 1; + if (typeof message.enableFqdnNetworkPolicy !== "boolean") + return "enableFqdnNetworkPolicy: boolean expected"; + } return null; }; @@ -37348,6 +38012,8 @@ throw TypeError(".google.container.v1.NetworkConfig.gatewayApiConfig: object expected"); message.gatewayApiConfig = $root.google.container.v1.GatewayAPIConfig.fromObject(object.gatewayApiConfig); } + if (object.enableFqdnNetworkPolicy != null) + message.enableFqdnNetworkPolicy = Boolean(object.enableFqdnNetworkPolicy); return message; }; @@ -37396,6 +38062,11 @@ object.serviceExternalIpsConfig = $root.google.container.v1.ServiceExternalIPsConfig.toObject(message.serviceExternalIpsConfig, options); if (message.gatewayApiConfig != null && message.hasOwnProperty("gatewayApiConfig")) object.gatewayApiConfig = $root.google.container.v1.GatewayAPIConfig.toObject(message.gatewayApiConfig, options); + if (message.enableFqdnNetworkPolicy != null && message.hasOwnProperty("enableFqdnNetworkPolicy")) { + object.enableFqdnNetworkPolicy = message.enableFqdnNetworkPolicy; + if (options.oneofs) + object._enableFqdnNetworkPolicy = "enableFqdnNetworkPolicy"; + } return object; }; @@ -39323,6 +39994,845 @@ return GetJSONWebKeysResponse; })(); + v1.CheckAutopilotCompatibilityRequest = (function() { + + /** + * Properties of a CheckAutopilotCompatibilityRequest. + * @memberof google.container.v1 + * @interface ICheckAutopilotCompatibilityRequest + * @property {string|null} [name] CheckAutopilotCompatibilityRequest name + */ + + /** + * Constructs a new CheckAutopilotCompatibilityRequest. + * @memberof google.container.v1 + * @classdesc Represents a CheckAutopilotCompatibilityRequest. + * @implements ICheckAutopilotCompatibilityRequest + * @constructor + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest=} [properties] Properties to set + */ + function CheckAutopilotCompatibilityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAutopilotCompatibilityRequest name. + * @member {string} name + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @instance + */ + CheckAutopilotCompatibilityRequest.prototype.name = ""; + + /** + * Creates a new CheckAutopilotCompatibilityRequest instance using the specified properties. + * @function create + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest=} [properties] Properties to set + * @returns {google.container.v1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest instance + */ + CheckAutopilotCompatibilityRequest.create = function create(properties) { + return new CheckAutopilotCompatibilityRequest(properties); + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @function encode + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest message, length delimited. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.CheckAutopilotCompatibilityRequest(); + 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 CheckAutopilotCompatibilityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAutopilotCompatibilityRequest message. + * @function verify + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + */ + CheckAutopilotCompatibilityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.CheckAutopilotCompatibilityRequest) + return object; + var message = new $root.google.container.v1.CheckAutopilotCompatibilityRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1.CheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest to JSON. + * @function toJSON + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @instance + * @returns {Object.} JSON object + */ + CheckAutopilotCompatibilityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityRequest + * @function getTypeUrl + * @memberof google.container.v1.CheckAutopilotCompatibilityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAutopilotCompatibilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.CheckAutopilotCompatibilityRequest"; + }; + + return CheckAutopilotCompatibilityRequest; + })(); + + v1.AutopilotCompatibilityIssue = (function() { + + /** + * Properties of an AutopilotCompatibilityIssue. + * @memberof google.container.v1 + * @interface IAutopilotCompatibilityIssue + * @property {google.protobuf.ITimestamp|null} [lastObservation] AutopilotCompatibilityIssue lastObservation + * @property {string|null} [constraintType] AutopilotCompatibilityIssue constraintType + * @property {google.container.v1.AutopilotCompatibilityIssue.IssueType|null} [incompatibilityType] AutopilotCompatibilityIssue incompatibilityType + * @property {Array.|null} [subjects] AutopilotCompatibilityIssue subjects + * @property {string|null} [documentationUrl] AutopilotCompatibilityIssue documentationUrl + * @property {string|null} [description] AutopilotCompatibilityIssue description + */ + + /** + * Constructs a new AutopilotCompatibilityIssue. + * @memberof google.container.v1 + * @classdesc Represents an AutopilotCompatibilityIssue. + * @implements IAutopilotCompatibilityIssue + * @constructor + * @param {google.container.v1.IAutopilotCompatibilityIssue=} [properties] Properties to set + */ + function AutopilotCompatibilityIssue(properties) { + this.subjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutopilotCompatibilityIssue lastObservation. + * @member {google.protobuf.ITimestamp|null|undefined} lastObservation + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.lastObservation = null; + + /** + * AutopilotCompatibilityIssue constraintType. + * @member {string} constraintType + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.constraintType = ""; + + /** + * AutopilotCompatibilityIssue incompatibilityType. + * @member {google.container.v1.AutopilotCompatibilityIssue.IssueType} incompatibilityType + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.incompatibilityType = 0; + + /** + * AutopilotCompatibilityIssue subjects. + * @member {Array.} subjects + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.subjects = $util.emptyArray; + + /** + * AutopilotCompatibilityIssue documentationUrl. + * @member {string} documentationUrl + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.documentationUrl = ""; + + /** + * AutopilotCompatibilityIssue description. + * @member {string} description + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.description = ""; + + /** + * Creates a new AutopilotCompatibilityIssue instance using the specified properties. + * @function create + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1.IAutopilotCompatibilityIssue=} [properties] Properties to set + * @returns {google.container.v1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue instance + */ + AutopilotCompatibilityIssue.create = function create(properties) { + return new AutopilotCompatibilityIssue(properties); + }; + + /** + * Encodes the specified AutopilotCompatibilityIssue message. Does not implicitly {@link google.container.v1.AutopilotCompatibilityIssue.verify|verify} messages. + * @function encode + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1.IAutopilotCompatibilityIssue} message AutopilotCompatibilityIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutopilotCompatibilityIssue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastObservation != null && Object.hasOwnProperty.call(message, "lastObservation")) + $root.google.protobuf.Timestamp.encode(message.lastObservation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraintType != null && Object.hasOwnProperty.call(message, "constraintType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraintType); + if (message.incompatibilityType != null && Object.hasOwnProperty.call(message, "incompatibilityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.incompatibilityType); + if (message.subjects != null && message.subjects.length) + for (var i = 0; i < message.subjects.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subjects[i]); + if (message.documentationUrl != null && Object.hasOwnProperty.call(message, "documentationUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentationUrl); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified AutopilotCompatibilityIssue message, length delimited. Does not implicitly {@link google.container.v1.AutopilotCompatibilityIssue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1.IAutopilotCompatibilityIssue} message AutopilotCompatibilityIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutopilotCompatibilityIssue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutopilotCompatibilityIssue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.AutopilotCompatibilityIssue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastObservation = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.constraintType = reader.string(); + break; + } + case 3: { + message.incompatibilityType = reader.int32(); + break; + } + case 4: { + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push(reader.string()); + break; + } + case 5: { + message.documentationUrl = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutopilotCompatibilityIssue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutopilotCompatibilityIssue message. + * @function verify + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutopilotCompatibilityIssue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastObservation != null && message.hasOwnProperty("lastObservation")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastObservation); + if (error) + return "lastObservation." + error; + } + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + if (!$util.isString(message.constraintType)) + return "constraintType: string expected"; + if (message.incompatibilityType != null && message.hasOwnProperty("incompatibilityType")) + switch (message.incompatibilityType) { + default: + return "incompatibilityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.subjects != null && message.hasOwnProperty("subjects")) { + if (!Array.isArray(message.subjects)) + return "subjects: array expected"; + for (var i = 0; i < message.subjects.length; ++i) + if (!$util.isString(message.subjects[i])) + return "subjects: string[] expected"; + } + if (message.documentationUrl != null && message.hasOwnProperty("documentationUrl")) + if (!$util.isString(message.documentationUrl)) + return "documentationUrl: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AutopilotCompatibilityIssue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + */ + AutopilotCompatibilityIssue.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.AutopilotCompatibilityIssue) + return object; + var message = new $root.google.container.v1.AutopilotCompatibilityIssue(); + if (object.lastObservation != null) { + if (typeof object.lastObservation !== "object") + throw TypeError(".google.container.v1.AutopilotCompatibilityIssue.lastObservation: object expected"); + message.lastObservation = $root.google.protobuf.Timestamp.fromObject(object.lastObservation); + } + if (object.constraintType != null) + message.constraintType = String(object.constraintType); + switch (object.incompatibilityType) { + default: + if (typeof object.incompatibilityType === "number") { + message.incompatibilityType = object.incompatibilityType; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.incompatibilityType = 0; + break; + case "INCOMPATIBILITY": + case 1: + message.incompatibilityType = 1; + break; + case "ADDITIONAL_CONFIG_REQUIRED": + case 2: + message.incompatibilityType = 2; + break; + case "PASSED_WITH_OPTIONAL_CONFIG": + case 3: + message.incompatibilityType = 3; + break; + } + if (object.subjects) { + if (!Array.isArray(object.subjects)) + throw TypeError(".google.container.v1.AutopilotCompatibilityIssue.subjects: array expected"); + message.subjects = []; + for (var i = 0; i < object.subjects.length; ++i) + message.subjects[i] = String(object.subjects[i]); + } + if (object.documentationUrl != null) + message.documentationUrl = String(object.documentationUrl); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AutopilotCompatibilityIssue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1.AutopilotCompatibilityIssue} message AutopilotCompatibilityIssue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutopilotCompatibilityIssue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjects = []; + if (options.defaults) { + object.lastObservation = null; + object.constraintType = ""; + object.incompatibilityType = options.enums === String ? "UNSPECIFIED" : 0; + object.documentationUrl = ""; + object.description = ""; + } + if (message.lastObservation != null && message.hasOwnProperty("lastObservation")) + object.lastObservation = $root.google.protobuf.Timestamp.toObject(message.lastObservation, options); + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + object.constraintType = message.constraintType; + if (message.incompatibilityType != null && message.hasOwnProperty("incompatibilityType")) + object.incompatibilityType = options.enums === String ? $root.google.container.v1.AutopilotCompatibilityIssue.IssueType[message.incompatibilityType] === undefined ? message.incompatibilityType : $root.google.container.v1.AutopilotCompatibilityIssue.IssueType[message.incompatibilityType] : message.incompatibilityType; + if (message.subjects && message.subjects.length) { + object.subjects = []; + for (var j = 0; j < message.subjects.length; ++j) + object.subjects[j] = message.subjects[j]; + } + if (message.documentationUrl != null && message.hasOwnProperty("documentationUrl")) + object.documentationUrl = message.documentationUrl; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AutopilotCompatibilityIssue to JSON. + * @function toJSON + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @instance + * @returns {Object.} JSON object + */ + AutopilotCompatibilityIssue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutopilotCompatibilityIssue + * @function getTypeUrl + * @memberof google.container.v1.AutopilotCompatibilityIssue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutopilotCompatibilityIssue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.AutopilotCompatibilityIssue"; + }; + + /** + * IssueType enum. + * @name google.container.v1.AutopilotCompatibilityIssue.IssueType + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} INCOMPATIBILITY=1 INCOMPATIBILITY value + * @property {number} ADDITIONAL_CONFIG_REQUIRED=2 ADDITIONAL_CONFIG_REQUIRED value + * @property {number} PASSED_WITH_OPTIONAL_CONFIG=3 PASSED_WITH_OPTIONAL_CONFIG value + */ + AutopilotCompatibilityIssue.IssueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "INCOMPATIBILITY"] = 1; + values[valuesById[2] = "ADDITIONAL_CONFIG_REQUIRED"] = 2; + values[valuesById[3] = "PASSED_WITH_OPTIONAL_CONFIG"] = 3; + return values; + })(); + + return AutopilotCompatibilityIssue; + })(); + + v1.CheckAutopilotCompatibilityResponse = (function() { + + /** + * Properties of a CheckAutopilotCompatibilityResponse. + * @memberof google.container.v1 + * @interface ICheckAutopilotCompatibilityResponse + * @property {Array.|null} [issues] CheckAutopilotCompatibilityResponse issues + * @property {string|null} [summary] CheckAutopilotCompatibilityResponse summary + */ + + /** + * Constructs a new CheckAutopilotCompatibilityResponse. + * @memberof google.container.v1 + * @classdesc Represents a CheckAutopilotCompatibilityResponse. + * @implements ICheckAutopilotCompatibilityResponse + * @constructor + * @param {google.container.v1.ICheckAutopilotCompatibilityResponse=} [properties] Properties to set + */ + function CheckAutopilotCompatibilityResponse(properties) { + this.issues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAutopilotCompatibilityResponse issues. + * @member {Array.} issues + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @instance + */ + CheckAutopilotCompatibilityResponse.prototype.issues = $util.emptyArray; + + /** + * CheckAutopilotCompatibilityResponse summary. + * @member {string} summary + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @instance + */ + CheckAutopilotCompatibilityResponse.prototype.summary = ""; + + /** + * Creates a new CheckAutopilotCompatibilityResponse instance using the specified properties. + * @function create + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityResponse=} [properties] Properties to set + * @returns {google.container.v1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse instance + */ + CheckAutopilotCompatibilityResponse.create = function create(properties) { + return new CheckAutopilotCompatibilityResponse(properties); + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @function encode + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issues != null && message.issues.length) + for (var i = 0; i < message.issues.length; ++i) + $root.google.container.v1.AutopilotCompatibilityIssue.encode(message.issues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.summary); + return writer; + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message, length delimited. Does not implicitly {@link google.container.v1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1.ICheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.CheckAutopilotCompatibilityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.issues && message.issues.length)) + message.issues = []; + message.issues.push($root.google.container.v1.AutopilotCompatibilityIssue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.summary = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAutopilotCompatibilityResponse message. + * @function verify + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAutopilotCompatibilityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issues != null && message.hasOwnProperty("issues")) { + if (!Array.isArray(message.issues)) + return "issues: array expected"; + for (var i = 0; i < message.issues.length; ++i) { + var error = $root.google.container.v1.AutopilotCompatibilityIssue.verify(message.issues[i]); + if (error) + return "issues." + error; + } + } + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a CheckAutopilotCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + */ + CheckAutopilotCompatibilityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.CheckAutopilotCompatibilityResponse) + return object; + var message = new $root.google.container.v1.CheckAutopilotCompatibilityResponse(); + if (object.issues) { + if (!Array.isArray(object.issues)) + throw TypeError(".google.container.v1.CheckAutopilotCompatibilityResponse.issues: array expected"); + message.issues = []; + for (var i = 0; i < object.issues.length; ++i) { + if (typeof object.issues[i] !== "object") + throw TypeError(".google.container.v1.CheckAutopilotCompatibilityResponse.issues: object expected"); + message.issues[i] = $root.google.container.v1.AutopilotCompatibilityIssue.fromObject(object.issues[i]); + } + } + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1.CheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAutopilotCompatibilityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.issues = []; + if (options.defaults) + object.summary = ""; + if (message.issues && message.issues.length) { + object.issues = []; + for (var j = 0; j < message.issues.length; ++j) + object.issues[j] = $root.google.container.v1.AutopilotCompatibilityIssue.toObject(message.issues[j], options); + } + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + return object; + }; + + /** + * Converts this CheckAutopilotCompatibilityResponse to JSON. + * @function toJSON + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @instance + * @returns {Object.} JSON object + */ + CheckAutopilotCompatibilityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityResponse + * @function getTypeUrl + * @memberof google.container.v1.CheckAutopilotCompatibilityResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAutopilotCompatibilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.CheckAutopilotCompatibilityResponse"; + }; + + return CheckAutopilotCompatibilityResponse; + })(); + v1.ReleaseChannel = (function() { /** @@ -50243,6 +51753,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.container.v1beta1.ClusterManager|checkAutopilotCompatibility}. + * @memberof google.container.v1beta1.ClusterManager + * @typedef CheckAutopilotCompatibilityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.container.v1beta1.CheckAutopilotCompatibilityResponse} [response] CheckAutopilotCompatibilityResponse + */ + + /** + * Calls CheckAutopilotCompatibility. + * @function checkAutopilotCompatibility + * @memberof google.container.v1beta1.ClusterManager + * @instance + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest} request CheckAutopilotCompatibilityRequest message or plain object + * @param {google.container.v1beta1.ClusterManager.CheckAutopilotCompatibilityCallback} callback Node-style callback called with the error, if any, and CheckAutopilotCompatibilityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterManager.prototype.checkAutopilotCompatibility = function checkAutopilotCompatibility(request, callback) { + return this.rpcCall(checkAutopilotCompatibility, $root.google.container.v1beta1.CheckAutopilotCompatibilityRequest, $root.google.container.v1beta1.CheckAutopilotCompatibilityResponse, request, callback); + }, "name", { value: "CheckAutopilotCompatibility" }); + + /** + * Calls CheckAutopilotCompatibility. + * @function checkAutopilotCompatibility + * @memberof google.container.v1beta1.ClusterManager + * @instance + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest} request CheckAutopilotCompatibilityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.container.v1beta1.ClusterManager|listLocations}. * @memberof google.container.v1beta1.ClusterManager @@ -63940,6 +65483,7 @@ * @property {Array.|null} [nodePools] Cluster nodePools * @property {Array.|null} [locations] Cluster locations * @property {boolean|null} [enableKubernetesAlpha] Cluster enableKubernetesAlpha + * @property {google.container.v1beta1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] Cluster enableK8sBetaApis * @property {Object.|null} [resourceLabels] Cluster resourceLabels * @property {string|null} [labelFingerprint] Cluster labelFingerprint * @property {google.container.v1beta1.ILegacyAbac|null} [legacyAbac] Cluster legacyAbac @@ -64133,6 +65677,14 @@ */ Cluster.prototype.enableKubernetesAlpha = false; + /** + * Cluster enableK8sBetaApis. + * @member {google.container.v1beta1.IK8sBetaAPIConfig|null|undefined} enableK8sBetaApis + * @memberof google.container.v1beta1.Cluster + * @instance + */ + Cluster.prototype.enableK8sBetaApis = null; + /** * Cluster resourceLabels. * @member {Object.} resourceLabels @@ -64805,6 +66357,8 @@ writer.uint32(/* id 139, wireType 2 =*/1114).string(message.etag); if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) $root.google.container.v1beta1.Fleet.encode(message.fleet, writer.uint32(/* id 140, wireType 2 =*/1122).fork()).ldelim(); + if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) + $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); return writer; }; @@ -64899,6 +66453,10 @@ message.enableKubernetesAlpha = reader.bool(); break; } + case 143: { + message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } case 15: { if (message.resourceLabels === $util.emptyObject) message.resourceLabels = {}; @@ -65252,6 +66810,11 @@ if (message.enableKubernetesAlpha != null && message.hasOwnProperty("enableKubernetesAlpha")) if (typeof message.enableKubernetesAlpha !== "boolean") return "enableKubernetesAlpha: boolean expected"; + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) { + var error = $root.google.container.v1beta1.K8sBetaAPIConfig.verify(message.enableK8sBetaApis); + if (error) + return "enableK8sBetaApis." + error; + } if (message.resourceLabels != null && message.hasOwnProperty("resourceLabels")) { if (!$util.isObject(message.resourceLabels)) return "resourceLabels: object expected"; @@ -65595,6 +67158,11 @@ } if (object.enableKubernetesAlpha != null) message.enableKubernetesAlpha = Boolean(object.enableKubernetesAlpha); + if (object.enableK8sBetaApis != null) { + if (typeof object.enableK8sBetaApis !== "object") + throw TypeError(".google.container.v1beta1.Cluster.enableK8sBetaApis: object expected"); + message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); + } if (object.resourceLabels) { if (typeof object.resourceLabels !== "object") throw TypeError(".google.container.v1beta1.Cluster.resourceLabels: object expected"); @@ -65961,6 +67529,7 @@ object.nodePoolAutoConfig = null; object.etag = ""; object.fleet = null; + object.enableK8sBetaApis = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -66130,6 +67699,8 @@ object.etag = message.etag; if (message.fleet != null && message.hasOwnProperty("fleet")) object.fleet = $root.google.container.v1beta1.Fleet.toObject(message.fleet, options); + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) + object.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); return object; }; @@ -66186,6 +67757,225 @@ return Cluster; })(); + v1beta1.K8sBetaAPIConfig = (function() { + + /** + * Properties of a K8sBetaAPIConfig. + * @memberof google.container.v1beta1 + * @interface IK8sBetaAPIConfig + * @property {Array.|null} [enabledApis] K8sBetaAPIConfig enabledApis + */ + + /** + * Constructs a new K8sBetaAPIConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents a K8sBetaAPIConfig. + * @implements IK8sBetaAPIConfig + * @constructor + * @param {google.container.v1beta1.IK8sBetaAPIConfig=} [properties] Properties to set + */ + function K8sBetaAPIConfig(properties) { + this.enabledApis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * K8sBetaAPIConfig enabledApis. + * @member {Array.} enabledApis + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @instance + */ + K8sBetaAPIConfig.prototype.enabledApis = $util.emptyArray; + + /** + * Creates a new K8sBetaAPIConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {google.container.v1beta1.IK8sBetaAPIConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.K8sBetaAPIConfig} K8sBetaAPIConfig instance + */ + K8sBetaAPIConfig.create = function create(properties) { + return new K8sBetaAPIConfig(properties); + }; + + /** + * Encodes the specified K8sBetaAPIConfig message. Does not implicitly {@link google.container.v1beta1.K8sBetaAPIConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {google.container.v1beta1.IK8sBetaAPIConfig} message K8sBetaAPIConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + K8sBetaAPIConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabledApis != null && message.enabledApis.length) + for (var i = 0; i < message.enabledApis.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.enabledApis[i]); + return writer; + }; + + /** + * Encodes the specified K8sBetaAPIConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.K8sBetaAPIConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {google.container.v1beta1.IK8sBetaAPIConfig} message K8sBetaAPIConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + K8sBetaAPIConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.K8sBetaAPIConfig} K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + K8sBetaAPIConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.K8sBetaAPIConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.enabledApis && message.enabledApis.length)) + message.enabledApis = []; + message.enabledApis.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a K8sBetaAPIConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.K8sBetaAPIConfig} K8sBetaAPIConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + K8sBetaAPIConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a K8sBetaAPIConfig message. + * @function verify + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + K8sBetaAPIConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabledApis != null && message.hasOwnProperty("enabledApis")) { + if (!Array.isArray(message.enabledApis)) + return "enabledApis: array expected"; + for (var i = 0; i < message.enabledApis.length; ++i) + if (!$util.isString(message.enabledApis[i])) + return "enabledApis: string[] expected"; + } + return null; + }; + + /** + * Creates a K8sBetaAPIConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.K8sBetaAPIConfig} K8sBetaAPIConfig + */ + K8sBetaAPIConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.K8sBetaAPIConfig) + return object; + var message = new $root.google.container.v1beta1.K8sBetaAPIConfig(); + if (object.enabledApis) { + if (!Array.isArray(object.enabledApis)) + throw TypeError(".google.container.v1beta1.K8sBetaAPIConfig.enabledApis: array expected"); + message.enabledApis = []; + for (var i = 0; i < object.enabledApis.length; ++i) + message.enabledApis[i] = String(object.enabledApis[i]); + } + return message; + }; + + /** + * Creates a plain object from a K8sBetaAPIConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {google.container.v1beta1.K8sBetaAPIConfig} message K8sBetaAPIConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + K8sBetaAPIConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.enabledApis = []; + if (message.enabledApis && message.enabledApis.length) { + object.enabledApis = []; + for (var j = 0; j < message.enabledApis.length; ++j) + object.enabledApis[j] = message.enabledApis[j]; + } + return object; + }; + + /** + * Converts this K8sBetaAPIConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @instance + * @returns {Object.} JSON object + */ + K8sBetaAPIConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for K8sBetaAPIConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.K8sBetaAPIConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + K8sBetaAPIConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.K8sBetaAPIConfig"; + }; + + return K8sBetaAPIConfig; + })(); + v1beta1.WorkloadConfig = (function() { /** @@ -67475,6 +69265,9 @@ * @property {google.container.v1beta1.StackType|null} [desiredStackType] ClusterUpdate desiredStackType * @property {google.container.v1beta1.IAdditionalPodRangesConfig|null} [additionalPodRangesConfig] ClusterUpdate additionalPodRangesConfig * @property {google.container.v1beta1.IAdditionalPodRangesConfig|null} [removedAdditionalPodRangesConfig] ClusterUpdate removedAdditionalPodRangesConfig + * @property {google.container.v1beta1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] ClusterUpdate enableK8sBetaApis + * @property {boolean|null} [desiredEnableFqdnNetworkPolicy] ClusterUpdate desiredEnableFqdnNetworkPolicy + * @property {google.container.v1beta1.IK8sBetaAPIConfig|null} [desiredK8sBetaApis] ClusterUpdate desiredK8sBetaApis */ /** @@ -67893,6 +69686,30 @@ */ ClusterUpdate.prototype.removedAdditionalPodRangesConfig = null; + /** + * ClusterUpdate enableK8sBetaApis. + * @member {google.container.v1beta1.IK8sBetaAPIConfig|null|undefined} enableK8sBetaApis + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.enableK8sBetaApis = null; + + /** + * ClusterUpdate desiredEnableFqdnNetworkPolicy. + * @member {boolean|null|undefined} desiredEnableFqdnNetworkPolicy + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredEnableFqdnNetworkPolicy = null; + + /** + * ClusterUpdate desiredK8sBetaApis. + * @member {google.container.v1beta1.IK8sBetaAPIConfig|null|undefined} desiredK8sBetaApis + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredK8sBetaApis = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -67918,6 +69735,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * ClusterUpdate _desiredEnableFqdnNetworkPolicy. + * @member {"desiredEnableFqdnNetworkPolicy"|undefined} _desiredEnableFqdnNetworkPolicy + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + Object.defineProperty(ClusterUpdate.prototype, "_desiredEnableFqdnNetworkPolicy", { + get: $util.oneOfGetter($oneOfFields = ["desiredEnableFqdnNetworkPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ClusterUpdate instance using the specified properties. * @function create @@ -68043,6 +69871,12 @@ $root.google.container.v1beta1.AdditionalPodRangesConfig.encode(message.additionalPodRangesConfig, writer.uint32(/* id 120, wireType 2 =*/962).fork()).ldelim(); if (message.removedAdditionalPodRangesConfig != null && Object.hasOwnProperty.call(message, "removedAdditionalPodRangesConfig")) $root.google.container.v1beta1.AdditionalPodRangesConfig.encode(message.removedAdditionalPodRangesConfig, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); + if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) + $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.desiredEnableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "desiredEnableFqdnNetworkPolicy")) + writer.uint32(/* id 126, wireType 0 =*/1008).bool(message.desiredEnableFqdnNetworkPolicy); + if (message.desiredK8sBetaApis != null && Object.hasOwnProperty.call(message, "desiredK8sBetaApis")) + $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.desiredK8sBetaApis, writer.uint32(/* id 131, wireType 2 =*/1050).fork()).ldelim(); return writer; }; @@ -68279,6 +70113,18 @@ message.removedAdditionalPodRangesConfig = $root.google.container.v1beta1.AdditionalPodRangesConfig.decode(reader, reader.uint32()); break; } + case 122: { + message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } + case 126: { + message.desiredEnableFqdnNetworkPolicy = reader.bool(); + break; + } + case 131: { + message.desiredK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -68569,6 +70415,21 @@ if (error) return "removedAdditionalPodRangesConfig." + error; } + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) { + var error = $root.google.container.v1beta1.K8sBetaAPIConfig.verify(message.enableK8sBetaApis); + if (error) + return "enableK8sBetaApis." + error; + } + if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { + properties._desiredEnableFqdnNetworkPolicy = 1; + if (typeof message.desiredEnableFqdnNetworkPolicy !== "boolean") + return "desiredEnableFqdnNetworkPolicy: boolean expected"; + } + if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) { + var error = $root.google.container.v1beta1.K8sBetaAPIConfig.verify(message.desiredK8sBetaApis); + if (error) + return "desiredK8sBetaApis." + error; + } return null; }; @@ -68861,6 +70722,18 @@ throw TypeError(".google.container.v1beta1.ClusterUpdate.removedAdditionalPodRangesConfig: object expected"); message.removedAdditionalPodRangesConfig = $root.google.container.v1beta1.AdditionalPodRangesConfig.fromObject(object.removedAdditionalPodRangesConfig); } + if (object.enableK8sBetaApis != null) { + if (typeof object.enableK8sBetaApis !== "object") + throw TypeError(".google.container.v1beta1.ClusterUpdate.enableK8sBetaApis: object expected"); + message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); + } + if (object.desiredEnableFqdnNetworkPolicy != null) + message.desiredEnableFqdnNetworkPolicy = Boolean(object.desiredEnableFqdnNetworkPolicy); + if (object.desiredK8sBetaApis != null) { + if (typeof object.desiredK8sBetaApis !== "object") + throw TypeError(".google.container.v1beta1.ClusterUpdate.desiredK8sBetaApis: object expected"); + message.desiredK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.fromObject(object.desiredK8sBetaApis); + } return message; }; @@ -68927,6 +70800,8 @@ object.desiredStackType = options.enums === String ? "STACK_TYPE_UNSPECIFIED" : 0; object.additionalPodRangesConfig = null; object.removedAdditionalPodRangesConfig = null; + object.enableK8sBetaApis = null; + object.desiredK8sBetaApis = null; } if (message.desiredNodeVersion != null && message.hasOwnProperty("desiredNodeVersion")) object.desiredNodeVersion = message.desiredNodeVersion; @@ -69037,6 +70912,15 @@ object.additionalPodRangesConfig = $root.google.container.v1beta1.AdditionalPodRangesConfig.toObject(message.additionalPodRangesConfig, options); if (message.removedAdditionalPodRangesConfig != null && message.hasOwnProperty("removedAdditionalPodRangesConfig")) object.removedAdditionalPodRangesConfig = $root.google.container.v1beta1.AdditionalPodRangesConfig.toObject(message.removedAdditionalPodRangesConfig, options); + if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) + object.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { + object.desiredEnableFqdnNetworkPolicy = message.desiredEnableFqdnNetworkPolicy; + if (options.oneofs) + object._desiredEnableFqdnNetworkPolicy = "desiredEnableFqdnNetworkPolicy"; + } + if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) + object.desiredK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.desiredK8sBetaApis, options); return object; }; @@ -77726,6 +79610,233 @@ return ServerConfig; })(); + v1beta1.BestEffortProvisioning = (function() { + + /** + * Properties of a BestEffortProvisioning. + * @memberof google.container.v1beta1 + * @interface IBestEffortProvisioning + * @property {boolean|null} [enabled] BestEffortProvisioning enabled + * @property {number|null} [minProvisionNodes] BestEffortProvisioning minProvisionNodes + */ + + /** + * Constructs a new BestEffortProvisioning. + * @memberof google.container.v1beta1 + * @classdesc Represents a BestEffortProvisioning. + * @implements IBestEffortProvisioning + * @constructor + * @param {google.container.v1beta1.IBestEffortProvisioning=} [properties] Properties to set + */ + function BestEffortProvisioning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BestEffortProvisioning enabled. + * @member {boolean} enabled + * @memberof google.container.v1beta1.BestEffortProvisioning + * @instance + */ + BestEffortProvisioning.prototype.enabled = false; + + /** + * BestEffortProvisioning minProvisionNodes. + * @member {number} minProvisionNodes + * @memberof google.container.v1beta1.BestEffortProvisioning + * @instance + */ + BestEffortProvisioning.prototype.minProvisionNodes = 0; + + /** + * Creates a new BestEffortProvisioning instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {google.container.v1beta1.IBestEffortProvisioning=} [properties] Properties to set + * @returns {google.container.v1beta1.BestEffortProvisioning} BestEffortProvisioning instance + */ + BestEffortProvisioning.create = function create(properties) { + return new BestEffortProvisioning(properties); + }; + + /** + * Encodes the specified BestEffortProvisioning message. Does not implicitly {@link google.container.v1beta1.BestEffortProvisioning.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {google.container.v1beta1.IBestEffortProvisioning} message BestEffortProvisioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestEffortProvisioning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.minProvisionNodes != null && Object.hasOwnProperty.call(message, "minProvisionNodes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minProvisionNodes); + return writer; + }; + + /** + * Encodes the specified BestEffortProvisioning message, length delimited. Does not implicitly {@link google.container.v1beta1.BestEffortProvisioning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {google.container.v1beta1.IBestEffortProvisioning} message BestEffortProvisioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestEffortProvisioning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.BestEffortProvisioning} BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestEffortProvisioning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.BestEffortProvisioning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.minProvisionNodes = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BestEffortProvisioning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.BestEffortProvisioning} BestEffortProvisioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestEffortProvisioning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BestEffortProvisioning message. + * @function verify + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BestEffortProvisioning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.minProvisionNodes != null && message.hasOwnProperty("minProvisionNodes")) + if (!$util.isInteger(message.minProvisionNodes)) + return "minProvisionNodes: integer expected"; + return null; + }; + + /** + * Creates a BestEffortProvisioning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.BestEffortProvisioning} BestEffortProvisioning + */ + BestEffortProvisioning.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.BestEffortProvisioning) + return object; + var message = new $root.google.container.v1beta1.BestEffortProvisioning(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.minProvisionNodes != null) + message.minProvisionNodes = object.minProvisionNodes | 0; + return message; + }; + + /** + * Creates a plain object from a BestEffortProvisioning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {google.container.v1beta1.BestEffortProvisioning} message BestEffortProvisioning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BestEffortProvisioning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.minProvisionNodes = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.minProvisionNodes != null && message.hasOwnProperty("minProvisionNodes")) + object.minProvisionNodes = message.minProvisionNodes; + return object; + }; + + /** + * Converts this BestEffortProvisioning to JSON. + * @function toJSON + * @memberof google.container.v1beta1.BestEffortProvisioning + * @instance + * @returns {Object.} JSON object + */ + BestEffortProvisioning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BestEffortProvisioning + * @function getTypeUrl + * @memberof google.container.v1beta1.BestEffortProvisioning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BestEffortProvisioning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.BestEffortProvisioning"; + }; + + return BestEffortProvisioning; + })(); + v1beta1.WindowsVersions = (function() { /** @@ -79961,6 +82072,7 @@ * @property {google.container.v1beta1.NodePool.IPlacementPolicy|null} [placementPolicy] NodePool placementPolicy * @property {google.container.v1beta1.NodePool.IUpdateInfo|null} [updateInfo] NodePool updateInfo * @property {string|null} [etag] NodePool etag + * @property {google.container.v1beta1.IBestEffortProvisioning|null} [bestEffortProvisioning] NodePool bestEffortProvisioning */ /** @@ -80133,6 +82245,14 @@ */ NodePool.prototype.etag = ""; + /** + * NodePool bestEffortProvisioning. + * @member {google.container.v1beta1.IBestEffortProvisioning|null|undefined} bestEffortProvisioning + * @memberof google.container.v1beta1.NodePool + * @instance + */ + NodePool.prototype.bestEffortProvisioning = null; + /** * Creates a new NodePool instance using the specified properties. * @function create @@ -80198,6 +82318,8 @@ $root.google.container.v1beta1.NodePool.UpdateInfo.encode(message.updateInfo, writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 110, wireType 2 =*/882).string(message.etag); + if (message.bestEffortProvisioning != null && Object.hasOwnProperty.call(message, "bestEffortProvisioning")) + $root.google.container.v1beta1.BestEffortProvisioning.encode(message.bestEffortProvisioning, writer.uint32(/* id 113, wireType 2 =*/906).fork()).ldelim(); return writer; }; @@ -80314,6 +82436,10 @@ message.etag = reader.string(); break; } + case 113: { + message.bestEffortProvisioning = $root.google.container.v1beta1.BestEffortProvisioning.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -80446,6 +82572,11 @@ if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; + if (message.bestEffortProvisioning != null && message.hasOwnProperty("bestEffortProvisioning")) { + var error = $root.google.container.v1beta1.BestEffortProvisioning.verify(message.bestEffortProvisioning); + if (error) + return "bestEffortProvisioning." + error; + } return null; }; @@ -80575,6 +82706,11 @@ } if (object.etag != null) message.etag = String(object.etag); + if (object.bestEffortProvisioning != null) { + if (typeof object.bestEffortProvisioning !== "object") + throw TypeError(".google.container.v1beta1.NodePool.bestEffortProvisioning: object expected"); + message.bestEffortProvisioning = $root.google.container.v1beta1.BestEffortProvisioning.fromObject(object.bestEffortProvisioning); + } return message; }; @@ -80613,6 +82749,7 @@ object.placementPolicy = null; object.updateInfo = null; object.etag = ""; + object.bestEffortProvisioning = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -80661,6 +82798,8 @@ object.updateInfo = $root.google.container.v1beta1.NodePool.UpdateInfo.toObject(message.updateInfo, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; + if (message.bestEffortProvisioning != null && message.hasOwnProperty("bestEffortProvisioning")) + object.bestEffortProvisioning = $root.google.container.v1beta1.BestEffortProvisioning.toObject(message.bestEffortProvisioning, options); return object; }; @@ -90953,6 +93092,7 @@ * @property {google.container.v1beta1.IDNSConfig|null} [dnsConfig] NetworkConfig dnsConfig * @property {google.container.v1beta1.IServiceExternalIPsConfig|null} [serviceExternalIpsConfig] NetworkConfig serviceExternalIpsConfig * @property {google.container.v1beta1.IGatewayAPIConfig|null} [gatewayApiConfig] NetworkConfig gatewayApiConfig + * @property {boolean|null} [enableFqdnNetworkPolicy] NetworkConfig enableFqdnNetworkPolicy */ /** @@ -91050,6 +93190,28 @@ */ NetworkConfig.prototype.gatewayApiConfig = null; + /** + * NetworkConfig enableFqdnNetworkPolicy. + * @member {boolean|null|undefined} enableFqdnNetworkPolicy + * @memberof google.container.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.enableFqdnNetworkPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkConfig _enableFqdnNetworkPolicy. + * @member {"enableFqdnNetworkPolicy"|undefined} _enableFqdnNetworkPolicy + * @memberof google.container.v1beta1.NetworkConfig + * @instance + */ + Object.defineProperty(NetworkConfig.prototype, "_enableFqdnNetworkPolicy", { + get: $util.oneOfGetter($oneOfFields = ["enableFqdnNetworkPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new NetworkConfig instance using the specified properties. * @function create @@ -91094,6 +93256,8 @@ $root.google.container.v1beta1.ServiceExternalIPsConfig.encode(message.serviceExternalIpsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.gatewayApiConfig != null && Object.hasOwnProperty.call(message, "gatewayApiConfig")) $root.google.container.v1beta1.GatewayAPIConfig.encode(message.gatewayApiConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.enableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "enableFqdnNetworkPolicy")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableFqdnNetworkPolicy); return writer; }; @@ -91168,6 +93332,10 @@ message.gatewayApiConfig = $root.google.container.v1beta1.GatewayAPIConfig.decode(reader, reader.uint32()); break; } + case 19: { + message.enableFqdnNetworkPolicy = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -91203,6 +93371,7 @@ NetworkConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.network != null && message.hasOwnProperty("network")) if (!$util.isString(message.network)) return "network: string expected"; @@ -91254,6 +93423,11 @@ if (error) return "gatewayApiConfig." + error; } + if (message.enableFqdnNetworkPolicy != null && message.hasOwnProperty("enableFqdnNetworkPolicy")) { + properties._enableFqdnNetworkPolicy = 1; + if (typeof message.enableFqdnNetworkPolicy !== "boolean") + return "enableFqdnNetworkPolicy: boolean expected"; + } return null; }; @@ -91341,6 +93515,8 @@ throw TypeError(".google.container.v1beta1.NetworkConfig.gatewayApiConfig: object expected"); message.gatewayApiConfig = $root.google.container.v1beta1.GatewayAPIConfig.fromObject(object.gatewayApiConfig); } + if (object.enableFqdnNetworkPolicy != null) + message.enableFqdnNetworkPolicy = Boolean(object.enableFqdnNetworkPolicy); return message; }; @@ -91389,6 +93565,11 @@ object.serviceExternalIpsConfig = $root.google.container.v1beta1.ServiceExternalIPsConfig.toObject(message.serviceExternalIpsConfig, options); if (message.gatewayApiConfig != null && message.hasOwnProperty("gatewayApiConfig")) object.gatewayApiConfig = $root.google.container.v1beta1.GatewayAPIConfig.toObject(message.gatewayApiConfig, options); + if (message.enableFqdnNetworkPolicy != null && message.hasOwnProperty("enableFqdnNetworkPolicy")) { + object.enableFqdnNetworkPolicy = message.enableFqdnNetworkPolicy; + if (options.oneofs) + object._enableFqdnNetworkPolicy = "enableFqdnNetworkPolicy"; + } return object; }; @@ -98234,6 +100415,845 @@ return GetJSONWebKeysResponse; })(); + v1beta1.CheckAutopilotCompatibilityRequest = (function() { + + /** + * Properties of a CheckAutopilotCompatibilityRequest. + * @memberof google.container.v1beta1 + * @interface ICheckAutopilotCompatibilityRequest + * @property {string|null} [name] CheckAutopilotCompatibilityRequest name + */ + + /** + * Constructs a new CheckAutopilotCompatibilityRequest. + * @memberof google.container.v1beta1 + * @classdesc Represents a CheckAutopilotCompatibilityRequest. + * @implements ICheckAutopilotCompatibilityRequest + * @constructor + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest=} [properties] Properties to set + */ + function CheckAutopilotCompatibilityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAutopilotCompatibilityRequest name. + * @member {string} name + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @instance + */ + CheckAutopilotCompatibilityRequest.prototype.name = ""; + + /** + * Creates a new CheckAutopilotCompatibilityRequest instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest=} [properties] Properties to set + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest instance + */ + CheckAutopilotCompatibilityRequest.create = function create(properties) { + return new CheckAutopilotCompatibilityRequest(properties); + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityRequest message. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest message, length delimited. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAutopilotCompatibilityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.CheckAutopilotCompatibilityRequest(); + 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 CheckAutopilotCompatibilityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAutopilotCompatibilityRequest message. + * @function verify + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityRequest} CheckAutopilotCompatibilityRequest + */ + CheckAutopilotCompatibilityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.CheckAutopilotCompatibilityRequest) + return object; + var message = new $root.google.container.v1beta1.CheckAutopilotCompatibilityRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {google.container.v1beta1.CheckAutopilotCompatibilityRequest} message CheckAutopilotCompatibilityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAutopilotCompatibilityRequest.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 CheckAutopilotCompatibilityRequest to JSON. + * @function toJSON + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @instance + * @returns {Object.} JSON object + */ + CheckAutopilotCompatibilityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityRequest + * @function getTypeUrl + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAutopilotCompatibilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.CheckAutopilotCompatibilityRequest"; + }; + + return CheckAutopilotCompatibilityRequest; + })(); + + v1beta1.AutopilotCompatibilityIssue = (function() { + + /** + * Properties of an AutopilotCompatibilityIssue. + * @memberof google.container.v1beta1 + * @interface IAutopilotCompatibilityIssue + * @property {google.protobuf.ITimestamp|null} [lastObservation] AutopilotCompatibilityIssue lastObservation + * @property {string|null} [constraintType] AutopilotCompatibilityIssue constraintType + * @property {google.container.v1beta1.AutopilotCompatibilityIssue.IssueType|null} [incompatibilityType] AutopilotCompatibilityIssue incompatibilityType + * @property {Array.|null} [subjects] AutopilotCompatibilityIssue subjects + * @property {string|null} [documentationUrl] AutopilotCompatibilityIssue documentationUrl + * @property {string|null} [description] AutopilotCompatibilityIssue description + */ + + /** + * Constructs a new AutopilotCompatibilityIssue. + * @memberof google.container.v1beta1 + * @classdesc Represents an AutopilotCompatibilityIssue. + * @implements IAutopilotCompatibilityIssue + * @constructor + * @param {google.container.v1beta1.IAutopilotCompatibilityIssue=} [properties] Properties to set + */ + function AutopilotCompatibilityIssue(properties) { + this.subjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutopilotCompatibilityIssue lastObservation. + * @member {google.protobuf.ITimestamp|null|undefined} lastObservation + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.lastObservation = null; + + /** + * AutopilotCompatibilityIssue constraintType. + * @member {string} constraintType + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.constraintType = ""; + + /** + * AutopilotCompatibilityIssue incompatibilityType. + * @member {google.container.v1beta1.AutopilotCompatibilityIssue.IssueType} incompatibilityType + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.incompatibilityType = 0; + + /** + * AutopilotCompatibilityIssue subjects. + * @member {Array.} subjects + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.subjects = $util.emptyArray; + + /** + * AutopilotCompatibilityIssue documentationUrl. + * @member {string} documentationUrl + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.documentationUrl = ""; + + /** + * AutopilotCompatibilityIssue description. + * @member {string} description + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + */ + AutopilotCompatibilityIssue.prototype.description = ""; + + /** + * Creates a new AutopilotCompatibilityIssue instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1beta1.IAutopilotCompatibilityIssue=} [properties] Properties to set + * @returns {google.container.v1beta1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue instance + */ + AutopilotCompatibilityIssue.create = function create(properties) { + return new AutopilotCompatibilityIssue(properties); + }; + + /** + * Encodes the specified AutopilotCompatibilityIssue message. Does not implicitly {@link google.container.v1beta1.AutopilotCompatibilityIssue.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1beta1.IAutopilotCompatibilityIssue} message AutopilotCompatibilityIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutopilotCompatibilityIssue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastObservation != null && Object.hasOwnProperty.call(message, "lastObservation")) + $root.google.protobuf.Timestamp.encode(message.lastObservation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraintType != null && Object.hasOwnProperty.call(message, "constraintType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraintType); + if (message.incompatibilityType != null && Object.hasOwnProperty.call(message, "incompatibilityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.incompatibilityType); + if (message.subjects != null && message.subjects.length) + for (var i = 0; i < message.subjects.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subjects[i]); + if (message.documentationUrl != null && Object.hasOwnProperty.call(message, "documentationUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentationUrl); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified AutopilotCompatibilityIssue message, length delimited. Does not implicitly {@link google.container.v1beta1.AutopilotCompatibilityIssue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1beta1.IAutopilotCompatibilityIssue} message AutopilotCompatibilityIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutopilotCompatibilityIssue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutopilotCompatibilityIssue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.AutopilotCompatibilityIssue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastObservation = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.constraintType = reader.string(); + break; + } + case 3: { + message.incompatibilityType = reader.int32(); + break; + } + case 4: { + if (!(message.subjects && message.subjects.length)) + message.subjects = []; + message.subjects.push(reader.string()); + break; + } + case 5: { + message.documentationUrl = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutopilotCompatibilityIssue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutopilotCompatibilityIssue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutopilotCompatibilityIssue message. + * @function verify + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutopilotCompatibilityIssue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastObservation != null && message.hasOwnProperty("lastObservation")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastObservation); + if (error) + return "lastObservation." + error; + } + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + if (!$util.isString(message.constraintType)) + return "constraintType: string expected"; + if (message.incompatibilityType != null && message.hasOwnProperty("incompatibilityType")) + switch (message.incompatibilityType) { + default: + return "incompatibilityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.subjects != null && message.hasOwnProperty("subjects")) { + if (!Array.isArray(message.subjects)) + return "subjects: array expected"; + for (var i = 0; i < message.subjects.length; ++i) + if (!$util.isString(message.subjects[i])) + return "subjects: string[] expected"; + } + if (message.documentationUrl != null && message.hasOwnProperty("documentationUrl")) + if (!$util.isString(message.documentationUrl)) + return "documentationUrl: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AutopilotCompatibilityIssue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.AutopilotCompatibilityIssue} AutopilotCompatibilityIssue + */ + AutopilotCompatibilityIssue.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.AutopilotCompatibilityIssue) + return object; + var message = new $root.google.container.v1beta1.AutopilotCompatibilityIssue(); + if (object.lastObservation != null) { + if (typeof object.lastObservation !== "object") + throw TypeError(".google.container.v1beta1.AutopilotCompatibilityIssue.lastObservation: object expected"); + message.lastObservation = $root.google.protobuf.Timestamp.fromObject(object.lastObservation); + } + if (object.constraintType != null) + message.constraintType = String(object.constraintType); + switch (object.incompatibilityType) { + default: + if (typeof object.incompatibilityType === "number") { + message.incompatibilityType = object.incompatibilityType; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.incompatibilityType = 0; + break; + case "INCOMPATIBILITY": + case 1: + message.incompatibilityType = 1; + break; + case "ADDITIONAL_CONFIG_REQUIRED": + case 2: + message.incompatibilityType = 2; + break; + case "PASSED_WITH_OPTIONAL_CONFIG": + case 3: + message.incompatibilityType = 3; + break; + } + if (object.subjects) { + if (!Array.isArray(object.subjects)) + throw TypeError(".google.container.v1beta1.AutopilotCompatibilityIssue.subjects: array expected"); + message.subjects = []; + for (var i = 0; i < object.subjects.length; ++i) + message.subjects[i] = String(object.subjects[i]); + } + if (object.documentationUrl != null) + message.documentationUrl = String(object.documentationUrl); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AutopilotCompatibilityIssue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {google.container.v1beta1.AutopilotCompatibilityIssue} message AutopilotCompatibilityIssue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutopilotCompatibilityIssue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjects = []; + if (options.defaults) { + object.lastObservation = null; + object.constraintType = ""; + object.incompatibilityType = options.enums === String ? "UNSPECIFIED" : 0; + object.documentationUrl = ""; + object.description = ""; + } + if (message.lastObservation != null && message.hasOwnProperty("lastObservation")) + object.lastObservation = $root.google.protobuf.Timestamp.toObject(message.lastObservation, options); + if (message.constraintType != null && message.hasOwnProperty("constraintType")) + object.constraintType = message.constraintType; + if (message.incompatibilityType != null && message.hasOwnProperty("incompatibilityType")) + object.incompatibilityType = options.enums === String ? $root.google.container.v1beta1.AutopilotCompatibilityIssue.IssueType[message.incompatibilityType] === undefined ? message.incompatibilityType : $root.google.container.v1beta1.AutopilotCompatibilityIssue.IssueType[message.incompatibilityType] : message.incompatibilityType; + if (message.subjects && message.subjects.length) { + object.subjects = []; + for (var j = 0; j < message.subjects.length; ++j) + object.subjects[j] = message.subjects[j]; + } + if (message.documentationUrl != null && message.hasOwnProperty("documentationUrl")) + object.documentationUrl = message.documentationUrl; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AutopilotCompatibilityIssue to JSON. + * @function toJSON + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @instance + * @returns {Object.} JSON object + */ + AutopilotCompatibilityIssue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutopilotCompatibilityIssue + * @function getTypeUrl + * @memberof google.container.v1beta1.AutopilotCompatibilityIssue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutopilotCompatibilityIssue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.AutopilotCompatibilityIssue"; + }; + + /** + * IssueType enum. + * @name google.container.v1beta1.AutopilotCompatibilityIssue.IssueType + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} INCOMPATIBILITY=1 INCOMPATIBILITY value + * @property {number} ADDITIONAL_CONFIG_REQUIRED=2 ADDITIONAL_CONFIG_REQUIRED value + * @property {number} PASSED_WITH_OPTIONAL_CONFIG=3 PASSED_WITH_OPTIONAL_CONFIG value + */ + AutopilotCompatibilityIssue.IssueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "INCOMPATIBILITY"] = 1; + values[valuesById[2] = "ADDITIONAL_CONFIG_REQUIRED"] = 2; + values[valuesById[3] = "PASSED_WITH_OPTIONAL_CONFIG"] = 3; + return values; + })(); + + return AutopilotCompatibilityIssue; + })(); + + v1beta1.CheckAutopilotCompatibilityResponse = (function() { + + /** + * Properties of a CheckAutopilotCompatibilityResponse. + * @memberof google.container.v1beta1 + * @interface ICheckAutopilotCompatibilityResponse + * @property {Array.|null} [issues] CheckAutopilotCompatibilityResponse issues + * @property {string|null} [summary] CheckAutopilotCompatibilityResponse summary + */ + + /** + * Constructs a new CheckAutopilotCompatibilityResponse. + * @memberof google.container.v1beta1 + * @classdesc Represents a CheckAutopilotCompatibilityResponse. + * @implements ICheckAutopilotCompatibilityResponse + * @constructor + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityResponse=} [properties] Properties to set + */ + function CheckAutopilotCompatibilityResponse(properties) { + this.issues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckAutopilotCompatibilityResponse issues. + * @member {Array.} issues + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @instance + */ + CheckAutopilotCompatibilityResponse.prototype.issues = $util.emptyArray; + + /** + * CheckAutopilotCompatibilityResponse summary. + * @member {string} summary + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @instance + */ + CheckAutopilotCompatibilityResponse.prototype.summary = ""; + + /** + * Creates a new CheckAutopilotCompatibilityResponse instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityResponse=} [properties] Properties to set + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse instance + */ + CheckAutopilotCompatibilityResponse.create = function create(properties) { + return new CheckAutopilotCompatibilityResponse(properties); + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issues != null && message.issues.length) + for (var i = 0; i < message.issues.length; ++i) + $root.google.container.v1beta1.AutopilotCompatibilityIssue.encode(message.issues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.summary); + return writer; + }; + + /** + * Encodes the specified CheckAutopilotCompatibilityResponse message, length delimited. Does not implicitly {@link google.container.v1beta1.CheckAutopilotCompatibilityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1beta1.ICheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckAutopilotCompatibilityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.CheckAutopilotCompatibilityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.issues && message.issues.length)) + message.issues = []; + message.issues.push($root.google.container.v1beta1.AutopilotCompatibilityIssue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.summary = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckAutopilotCompatibilityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckAutopilotCompatibilityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckAutopilotCompatibilityResponse message. + * @function verify + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckAutopilotCompatibilityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issues != null && message.hasOwnProperty("issues")) { + if (!Array.isArray(message.issues)) + return "issues: array expected"; + for (var i = 0; i < message.issues.length; ++i) { + var error = $root.google.container.v1beta1.AutopilotCompatibilityIssue.verify(message.issues[i]); + if (error) + return "issues." + error; + } + } + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a CheckAutopilotCompatibilityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.CheckAutopilotCompatibilityResponse} CheckAutopilotCompatibilityResponse + */ + CheckAutopilotCompatibilityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.CheckAutopilotCompatibilityResponse) + return object; + var message = new $root.google.container.v1beta1.CheckAutopilotCompatibilityResponse(); + if (object.issues) { + if (!Array.isArray(object.issues)) + throw TypeError(".google.container.v1beta1.CheckAutopilotCompatibilityResponse.issues: array expected"); + message.issues = []; + for (var i = 0; i < object.issues.length; ++i) { + if (typeof object.issues[i] !== "object") + throw TypeError(".google.container.v1beta1.CheckAutopilotCompatibilityResponse.issues: object expected"); + message.issues[i] = $root.google.container.v1beta1.AutopilotCompatibilityIssue.fromObject(object.issues[i]); + } + } + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a CheckAutopilotCompatibilityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {google.container.v1beta1.CheckAutopilotCompatibilityResponse} message CheckAutopilotCompatibilityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckAutopilotCompatibilityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.issues = []; + if (options.defaults) + object.summary = ""; + if (message.issues && message.issues.length) { + object.issues = []; + for (var j = 0; j < message.issues.length; ++j) + object.issues[j] = $root.google.container.v1beta1.AutopilotCompatibilityIssue.toObject(message.issues[j], options); + } + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + return object; + }; + + /** + * Converts this CheckAutopilotCompatibilityResponse to JSON. + * @function toJSON + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @instance + * @returns {Object.} JSON object + */ + CheckAutopilotCompatibilityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckAutopilotCompatibilityResponse + * @function getTypeUrl + * @memberof google.container.v1beta1.CheckAutopilotCompatibilityResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckAutopilotCompatibilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.CheckAutopilotCompatibilityResponse"; + }; + + return CheckAutopilotCompatibilityResponse; + })(); + v1beta1.ReleaseChannel = (function() { /** diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index b7620cb3c122..a512f07fbca3 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -859,6 +859,20 @@ } } ] + }, + "CheckAutopilotCompatibility": { + "requestType": "CheckAutopilotCompatibilityRequest", + "responseType": "CheckAutopilotCompatibilityResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + } + } + ] } } }, @@ -2068,6 +2082,10 @@ "fleet": { "type": "Fleet", "id": 140 + }, + "enableK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 143 } }, "nested": { @@ -2084,6 +2102,15 @@ } } }, + "K8sBetaAPIConfig": { + "fields": { + "enabledApis": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "NodePoolAutoConfig": { "fields": { "networkTags": { @@ -2118,6 +2145,11 @@ "oneof": [ "desiredEnablePrivateEndpoint" ] + }, + "_desiredEnableFqdnNetworkPolicy": { + "oneof": [ + "desiredEnableFqdnNetworkPolicy" + ] } }, "fields": { @@ -2296,6 +2328,21 @@ "removedAdditionalPodRangesConfig": { "type": "AdditionalPodRangesConfig", "id": 121 + }, + "enableK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 122 + }, + "desiredEnableFqdnNetworkPolicy": { + "type": "bool", + "id": 126, + "options": { + "proto3_optional": true + } + }, + "desiredK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 131 } } }, @@ -3502,6 +3549,10 @@ "etag": { "type": "string", "id": 110 + }, + "bestEffortProvisioning": { + "type": "BestEffortProvisioning", + "id": 113 } }, "nested": { @@ -3638,6 +3689,18 @@ } } }, + "BestEffortProvisioning": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "minProvisionNodes": { + "type": "int32", + "id": 2 + } + } + }, "AutoUpgradeOptions": { "fields": { "autoUpgradeStartTime": { @@ -4358,6 +4421,13 @@ } }, "NetworkConfig": { + "oneofs": { + "_enableFqdnNetworkPolicy": { + "oneof": [ + "enableFqdnNetworkPolicy" + ] + } + }, "fields": { "network": { "type": "string", @@ -4398,6 +4468,13 @@ "gatewayApiConfig": { "type": "GatewayAPIConfig", "id": 16 + }, + "enableFqdnNetworkPolicy": { + "type": "bool", + "id": 19, + "options": { + "proto3_optional": true + } } } }, @@ -4529,6 +4606,66 @@ } } }, + "CheckAutopilotCompatibilityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AutopilotCompatibilityIssue": { + "fields": { + "lastObservation": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "constraintType": { + "type": "string", + "id": 2 + }, + "incompatibilityType": { + "type": "IssueType", + "id": 3 + }, + "subjects": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "documentationUrl": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + } + }, + "nested": { + "IssueType": { + "values": { + "UNSPECIFIED": 0, + "INCOMPATIBILITY": 1, + "ADDITIONAL_CONFIG_REQUIRED": 2, + "PASSED_WITH_OPTIONAL_CONFIG": 3 + } + } + } + }, + "CheckAutopilotCompatibilityResponse": { + "fields": { + "issues": { + "rule": "repeated", + "type": "AutopilotCompatibilityIssue", + "id": 1 + }, + "summary": { + "type": "string", + "id": 2 + } + } + }, "ReleaseChannel": { "fields": { "channel": { @@ -5942,6 +6079,20 @@ } ] }, + "CheckAutopilotCompatibility": { + "requestType": "CheckAutopilotCompatibilityRequest", + "responseType": "CheckAutopilotCompatibilityResponse", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/clusters/*}:checkAutopilotCompatibility" + } + } + ] + }, "ListLocations": { "requestType": "ListLocationsRequest", "responseType": "ListLocationsResponse", @@ -7106,6 +7257,10 @@ "type": "bool", "id": 14 }, + "enableK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 143 + }, "resourceLabels": { "keyType": "string", "type": "string", @@ -7390,6 +7545,15 @@ } } }, + "K8sBetaAPIConfig": { + "fields": { + "enabledApis": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "WorkloadConfig": { "oneofs": { "_auditMode": { @@ -7505,6 +7669,11 @@ "oneof": [ "desiredProtectConfig" ] + }, + "_desiredEnableFqdnNetworkPolicy": { + "oneof": [ + "desiredEnableFqdnNetworkPolicy" + ] } }, "fields": { @@ -7714,6 +7883,21 @@ "removedAdditionalPodRangesConfig": { "type": "AdditionalPodRangesConfig", "id": 121 + }, + "enableK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 122 + }, + "desiredEnableFqdnNetworkPolicy": { + "type": "bool", + "id": 126, + "options": { + "proto3_optional": true + } + }, + "desiredK8sBetaApis": { + "type": "K8sBetaAPIConfig", + "id": 131 } } }, @@ -8715,6 +8899,18 @@ } } }, + "BestEffortProvisioning": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "minProvisionNodes": { + "type": "int32", + "id": 2 + } + } + }, "WindowsVersions": { "fields": { "windowsVersions": { @@ -9040,6 +9236,10 @@ "etag": { "type": "string", "id": 110 + }, + "bestEffortProvisioning": { + "type": "BestEffortProvisioning", + "id": 113 } }, "nested": { @@ -10005,6 +10205,13 @@ } }, "NetworkConfig": { + "oneofs": { + "_enableFqdnNetworkPolicy": { + "oneof": [ + "enableFqdnNetworkPolicy" + ] + } + }, "fields": { "network": { "type": "string", @@ -10045,6 +10252,13 @@ "gatewayApiConfig": { "type": "GatewayAPIConfig", "id": 16 + }, + "enableFqdnNetworkPolicy": { + "type": "bool", + "id": 19, + "options": { + "proto3_optional": true + } } } }, @@ -10458,6 +10672,66 @@ } } }, + "CheckAutopilotCompatibilityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "AutopilotCompatibilityIssue": { + "fields": { + "lastObservation": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "constraintType": { + "type": "string", + "id": 2 + }, + "incompatibilityType": { + "type": "IssueType", + "id": 3 + }, + "subjects": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "documentationUrl": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + } + }, + "nested": { + "IssueType": { + "values": { + "UNSPECIFIED": 0, + "INCOMPATIBILITY": 1, + "ADDITIONAL_CONFIG_REQUIRED": 2, + "PASSED_WITH_OPTIONAL_CONFIG": 3 + } + } + } + }, + "CheckAutopilotCompatibilityResponse": { + "fields": { + "issues": { + "rule": "repeated", + "type": "AutopilotCompatibilityIssue", + "id": 1 + }, + "summary": { + "type": "string", + "id": 2 + } + } + }, "ReleaseChannel": { "fields": { "channel": { diff --git a/packages/google-container/samples/README.md b/packages/google-container/samples/README.md index 05c383b2f30f..7f646c58951e 100644 --- a/packages/google-container/samples/README.md +++ b/packages/google-container/samples/README.md @@ -13,6 +13,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Cluster_manager.cancel_operation](#cluster_manager.cancel_operation) + * [Cluster_manager.check_autopilot_compatibility](#cluster_manager.check_autopilot_compatibility) * [Cluster_manager.complete_i_p_rotation](#cluster_manager.complete_i_p_rotation) * [Cluster_manager.complete_node_pool_upgrade](#cluster_manager.complete_node_pool_upgrade) * [Cluster_manager.create_cluster](#cluster_manager.create_cluster) @@ -46,6 +47,7 @@ * [Cluster_manager.update_master](#cluster_manager.update_master) * [Cluster_manager.update_node_pool](#cluster_manager.update_node_pool) * [Cluster_manager.cancel_operation](#cluster_manager.cancel_operation) + * [Cluster_manager.check_autopilot_compatibility](#cluster_manager.check_autopilot_compatibility) * [Cluster_manager.complete_i_p_rotation](#cluster_manager.complete_i_p_rotation) * [Cluster_manager.complete_node_pool_upgrade](#cluster_manager.complete_node_pool_upgrade) * [Cluster_manager.create_cluster](#cluster_manager.create_cluster) @@ -113,6 +115,23 @@ __Usage:__ +### Cluster_manager.check_autopilot_compatibility + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js). + +[![Open in Cloud 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-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js,samples/README.md) + +__Usage:__ + + +`node packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js` + + +----- + + + + ### Cluster_manager.complete_i_p_rotation View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1/cluster_manager.complete_i_p_rotation.js). @@ -674,6 +693,23 @@ __Usage:__ +### Cluster_manager.check_autopilot_compatibility + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js). + +[![Open in Cloud 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-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js,samples/README.md) + +__Usage:__ + + +`node packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js` + + +----- + + + + ### Cluster_manager.complete_i_p_rotation View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-container/samples/generated/v1beta1/cluster_manager.complete_i_p_rotation.js). diff --git a/packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js b/packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 000000000000..e4d731fc2d05 --- /dev/null +++ b/packages/google-container/samples/generated/v1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_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. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index 4be286726e2d..37d7c7bd820f 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -1870,6 +1870,46 @@ } } } + }, + { + "regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1.ClusterManager" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js b/packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js new file mode 100644 index 000000000000..4511c66ce174 --- /dev/null +++ b/packages/google-container/samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_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. + */ + /** + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + */ + // const name = 'abc123' + + // Imports the Container library + const {ClusterManagerClient} = require('@google-cloud/container').v1beta1; + + // Instantiates a client + const containerClient = new ClusterManagerClient(); + + async function callCheckAutopilotCompatibility() { + // Construct request + const request = { + }; + + // Run request + const response = await containerClient.checkAutopilotCompatibility(request); + console.log(response); + } + + callCheckAutopilotCompatibility(); + // [END container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json index 228747521c5d..d1f8e38322f0 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -1871,6 +1871,46 @@ } } }, + { + "regionTag": "container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async", + "title": "ClusterManager checkAutopilotCompatibility Sample", + "origin": "API_DEFINITION", + "description": " Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.", + "canonical": true, + "file": "cluster_manager.check_autopilot_compatibility.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.container.v1beta1.CheckAutopilotCompatibilityResponse", + "client": { + "shortName": "ClusterManagerClient", + "fullName": "google.container.v1beta1.ClusterManagerClient" + }, + "method": { + "shortName": "CheckAutopilotCompatibility", + "fullName": "google.container.v1beta1.ClusterManager.CheckAutopilotCompatibility", + "service": { + "shortName": "ClusterManager", + "fullName": "google.container.v1beta1.ClusterManager" + } + } + } + }, { "regionTag": "container_v1beta1_generated_ClusterManager_ListLocations_async", "title": "ClusterManager listLocations Sample", diff --git a/packages/google-container/src/v1/cluster_manager_client.ts b/packages/google-container/src/v1/cluster_manager_client.ts index 309a17dc7678..bd870d284bf9 100644 --- a/packages/google-container/src/v1/cluster_manager_client.ts +++ b/packages/google-container/src/v1/cluster_manager_client.ts @@ -267,6 +267,7 @@ export class ClusterManagerClient { 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', + 'checkAutopilotCompatibility', ]; for (const methodName of clusterManagerStubMethods) { const callPromise = this.clusterManagerStub.then( @@ -3763,6 +3764,109 @@ export class ClusterManagerClient { this.initialize(); return this.innerApiCalls.setMaintenancePolicy(request, options, callback); } + /** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.container.v1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + ( + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | undefined + ), + {} | undefined + ] + >; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkAutopilotCompatibility( + request: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.container.v1.ICheckAutopilotCompatibilityResponse, + ( + | protos.google.container.v1.ICheckAutopilotCompatibilityRequest + | 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.checkAutopilotCompatibility( + request, + options, + callback + ); + } /** * Lists subnetworks that are usable for creating clusters in a project. diff --git a/packages/google-container/src/v1/cluster_manager_client_config.json b/packages/google-container/src/v1/cluster_manager_client_config.json index 54689f6ca3da..33fb266b6bd1 100644 --- a/packages/google-container/src/v1/cluster_manager_client_config.json +++ b/packages/google-container/src/v1/cluster_manager_client_config.json @@ -181,6 +181,10 @@ "ListUsableSubnetworks": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-container/src/v1/gapic_metadata.json b/packages/google-container/src/v1/gapic_metadata.json index bce9687e0b27..c08b06ded09e 100644 --- a/packages/google-container/src/v1/gapic_metadata.json +++ b/packages/google-container/src/v1/gapic_metadata.json @@ -170,6 +170,11 @@ "setMaintenancePolicy" ] }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, "ListUsableSubnetworks": { "methods": [ "listUsableSubnetworks", @@ -342,6 +347,11 @@ "setMaintenancePolicy" ] }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, "ListUsableSubnetworks": { "methods": [ "listUsableSubnetworks", diff --git a/packages/google-container/src/v1beta1/cluster_manager_client.ts b/packages/google-container/src/v1beta1/cluster_manager_client.ts index cad055b79c91..9a7dbfaf0d27 100644 --- a/packages/google-container/src/v1beta1/cluster_manager_client.ts +++ b/packages/google-container/src/v1beta1/cluster_manager_client.ts @@ -267,6 +267,7 @@ export class ClusterManagerClient { 'setNetworkPolicy', 'setMaintenancePolicy', 'listUsableSubnetworks', + 'checkAutopilotCompatibility', 'listLocations', ]; for (const methodName of clusterManagerStubMethods) { @@ -3872,6 +3873,109 @@ export class ClusterManagerClient { this.initialize(); return this.innerApiCalls.setMaintenancePolicy(request, options, callback); } + /** + * Checks the cluster compatibility with Autopilot mode, and returns a list of + * compatibility issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name (project, location, cluster) of the cluster to retrieve. + * Specified in the format `projects/* /locations/* /clusters/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.container.v1beta1.CheckAutopilotCompatibilityResponse | CheckAutopilotCompatibilityResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cluster_manager.check_autopilot_compatibility.js + * region_tag:container_v1beta1_generated_ClusterManager_CheckAutopilotCompatibility_async + */ + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + ( + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | undefined + ), + {} | undefined + ] + >; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + options: CallOptions, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkAutopilotCompatibility( + request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + callback: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkAutopilotCompatibility( + request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, + ( + | protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest + | 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.checkAutopilotCompatibility( + request, + options, + callback + ); + } /** * Fetches locations that offer Google Kubernetes Engine. * diff --git a/packages/google-container/src/v1beta1/cluster_manager_client_config.json b/packages/google-container/src/v1beta1/cluster_manager_client_config.json index 3b6cd441bf13..911352f93629 100644 --- a/packages/google-container/src/v1beta1/cluster_manager_client_config.json +++ b/packages/google-container/src/v1beta1/cluster_manager_client_config.json @@ -183,6 +183,10 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "CheckAutopilotCompatibility": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListLocations": { "timeout_millis": 20000, "retry_codes_name": "idempotent", diff --git a/packages/google-container/src/v1beta1/gapic_metadata.json b/packages/google-container/src/v1beta1/gapic_metadata.json index b2369e37ab49..0278af900c2e 100644 --- a/packages/google-container/src/v1beta1/gapic_metadata.json +++ b/packages/google-container/src/v1beta1/gapic_metadata.json @@ -170,6 +170,11 @@ "setMaintenancePolicy" ] }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, "ListLocations": { "methods": [ "listLocations" @@ -347,6 +352,11 @@ "setMaintenancePolicy" ] }, + "CheckAutopilotCompatibility": { + "methods": [ + "checkAutopilotCompatibility" + ] + }, "ListLocations": { "methods": [ "listLocations" diff --git a/packages/google-container/test/gapic_cluster_manager_v1.ts b/packages/google-container/test/gapic_cluster_manager_v1.ts index 9ba35b757820..d947b5231a1c 100644 --- a/packages/google-container/test/gapic_cluster_manager_v1.ts +++ b/packages/google-container/test/gapic_cluster_manager_v1.ts @@ -6283,6 +6283,143 @@ describe('v1.ClusterManagerClient', () => { }); }); + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = + stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + ( + err?: Error | null, + result?: protos.google.container.v1.ICheckAutopilotCompatibilityResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAutopilotCompatibility(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.checkAutopilotCompatibility(request), + expectedError + ); + }); + }); + describe('listUsableSubnetworks', () => { it('invokes listUsableSubnetworks without error', async () => { const client = new clustermanagerModule.v1.ClusterManagerClient({ diff --git a/packages/google-container/test/gapic_cluster_manager_v1beta1.ts b/packages/google-container/test/gapic_cluster_manager_v1beta1.ts index 824821bc7afa..4744f75e533b 100644 --- a/packages/google-container/test/gapic_cluster_manager_v1beta1.ts +++ b/packages/google-container/test/gapic_cluster_manager_v1beta1.ts @@ -6283,6 +6283,143 @@ describe('v1beta1.ClusterManagerClient', () => { }); }); + describe('checkAutopilotCompatibility', () => { + it('invokes checkAutopilotCompatibility without error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1beta1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = + stubSimpleCall(expectedResponse); + const [response] = await client.checkAutopilotCompatibility(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility without error using callback', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1beta1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityResponse() + ); + client.innerApiCalls.checkAutopilotCompatibility = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkAutopilotCompatibility( + request, + ( + err?: Error | null, + result?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with error', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1beta1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkAutopilotCompatibility = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAutopilotCompatibility(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkAutopilotCompatibility as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAutopilotCompatibility with closed client', async () => { + const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.container.v1beta1.CheckAutopilotCompatibilityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.container.v1beta1.CheckAutopilotCompatibilityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.checkAutopilotCompatibility(request), + expectedError + ); + }); + }); + describe('listLocations', () => { it('invokes listLocations without error', async () => { const client = new clustermanagerModule.v1beta1.ClusterManagerClient({ From 10bb49288c297bfd04bf48b26646e3990b454e27 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 07:02:12 +0000 Subject: [PATCH 26/46] feat: [deploy] Add support for disabling Pod overprovisioning in the progressive deployment strategy configuration for a Kubernetes Target (#4317) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 537857136 Source-Link: https://togithub.com/googleapis/googleapis/commit/a7658127bcfc80102023ed0c4474f5a5c92813c1 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/7c8cf36e390b92a2bc403b17d5fc2b59a60d8f85 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiN2M4Y2YzNmUzOTBiOTJhMmJjNDAzYjE3ZDVmYzJiNTlhNjBkOGY4NSJ9 --- packages/google-cloud-deploy/README.md | 59 +++++++++---------- .../google/cloud/deploy/v1/cloud_deploy.proto | 9 ++- .../google-cloud-deploy/protos/protos.d.ts | 6 ++ packages/google-cloud-deploy/protos/protos.js | 23 ++++++++ .../google-cloud-deploy/protos/protos.json | 7 +++ .../google-cloud-deploy/samples/README.md | 18 ------ .../v1/cloud_deploy.delete_target.js | 2 +- .../src/v1/cloud_deploy_client.ts | 2 +- 8 files changed, 75 insertions(+), 51 deletions(-) diff --git a/packages/google-cloud-deploy/README.md b/packages/google-cloud-deploy/README.md index 19eb5938974a..8bbe8199c721 100644 --- a/packages/google-cloud-deploy/README.md +++ b/packages/google-cloud-deploy/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Deploy: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Google Cloud Deploy: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-deploy) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/deploy.svg)](https://www.npmjs.org/package/@google-cloud/deploy) @@ -116,38 +116,37 @@ listDeliveryPipelines(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-deploy/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Cloud_deploy.abandon_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,samples/README.md) | -| Cloud_deploy.advance_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js,samples/README.md) | -| Cloud_deploy.approve_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,samples/README.md) | -| Cloud_deploy.cancel_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js,samples/README.md) | -| Cloud_deploy.create_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,samples/README.md) | -| Cloud_deploy.create_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_release.js,samples/README.md) | -| Cloud_deploy.create_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,samples/README.md) | -| Cloud_deploy.create_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_target.js,samples/README.md) | -| Cloud_deploy.delete_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,samples/README.md) | -| Cloud_deploy.delete_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.delete_target.js,samples/README.md) | -| Cloud_deploy.get_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,samples/README.md) | -| Cloud_deploy.get_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,samples/README.md) | -| Cloud_deploy.get_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,samples/README.md) | -| Cloud_deploy.get_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_release.js,samples/README.md) | -| Cloud_deploy.get_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,samples/README.md) | -| Cloud_deploy.get_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_target.js,samples/README.md) | -| Cloud_deploy.ignore_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.ignore_job.js,samples/README.md) | -| Cloud_deploy.list_delivery_pipelines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,samples/README.md) | -| Cloud_deploy.list_job_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,samples/README.md) | -| Cloud_deploy.list_releases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_releases.js,samples/README.md) | -| Cloud_deploy.list_rollouts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,samples/README.md) | -| Cloud_deploy.list_targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_targets.js,samples/README.md) | -| Cloud_deploy.retry_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.retry_job.js,samples/README.md) | -| Cloud_deploy.terminate_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js,samples/README.md) | -| Cloud_deploy.update_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,samples/README.md) | -| Cloud_deploy.update_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.update_target.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/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-deploy/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/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-deploy/samples/test/quickstart.js,samples/README.md) | +| Cloud_deploy.abandon_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.advance_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.approve_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.cancel_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.create_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.create_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_release.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.create_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.create_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.create_target.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.delete_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.delete_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.delete_target.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_release.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.get_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.get_target.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.ignore_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.ignore_job.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.ignore_job.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.list_delivery_pipelines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.list_job_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.list_releases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_releases.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.list_rollouts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.list_targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.list_targets.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.retry_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.retry_job.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.terminate_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.terminate_job_run.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.update_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,packages/google-cloud-deploy/samples/README.md) | +| Cloud_deploy.update_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js) | [![Open in Cloud 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-deploy/samples/generated/v1/cloud_deploy.update_target.js,packages/google-cloud-deploy/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/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-deploy/samples/quickstart.js,packages/google-cloud-deploy/samples/README.md) | diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto index 139ca4718dd7..74e47d496017 100644 --- a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto @@ -521,6 +521,13 @@ message KubernetesConfig { // Required. Name of the Kubernetes Deployment whose traffic is managed by // the specified Service. string deployment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether to disable Pod overprovisioning. If Pod + // overprovisioning is disabled then Cloud Deploy will limit the number of + // total Pods used for the deployment strategy to the number of Pods the + // Deployment has on the cluster. + bool disable_pod_overprovisioning = 3 + [(google.api.field_behavior) = OPTIONAL]; } // The service definition configuration. @@ -1175,7 +1182,7 @@ message DeleteTargetRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. If set to true, then deleting an already deleted or non-existing - // DeliveryPipeline will succeed. + // `Target` will succeed. bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. If set, validate the request and preview the review, but do not diff --git a/packages/google-cloud-deploy/protos/protos.d.ts b/packages/google-cloud-deploy/protos/protos.d.ts index e424617c800b..48b59793a50d 100644 --- a/packages/google-cloud-deploy/protos/protos.d.ts +++ b/packages/google-cloud-deploy/protos/protos.d.ts @@ -1820,6 +1820,9 @@ export namespace google { /** ServiceNetworking deployment */ deployment?: (string|null); + + /** ServiceNetworking disablePodOverprovisioning */ + disablePodOverprovisioning?: (boolean|null); } /** Represents a ServiceNetworking. */ @@ -1837,6 +1840,9 @@ export namespace google { /** ServiceNetworking deployment. */ public deployment: string; + /** ServiceNetworking disablePodOverprovisioning. */ + public disablePodOverprovisioning: boolean; + /** * Creates a new ServiceNetworking instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-deploy/protos/protos.js b/packages/google-cloud-deploy/protos/protos.js index 7227789a8b32..6ceacdfd5c36 100644 --- a/packages/google-cloud-deploy/protos/protos.js +++ b/packages/google-cloud-deploy/protos/protos.js @@ -4038,6 +4038,7 @@ * @interface IServiceNetworking * @property {string|null} [service] ServiceNetworking service * @property {string|null} [deployment] ServiceNetworking deployment + * @property {boolean|null} [disablePodOverprovisioning] ServiceNetworking disablePodOverprovisioning */ /** @@ -4071,6 +4072,14 @@ */ ServiceNetworking.prototype.deployment = ""; + /** + * ServiceNetworking disablePodOverprovisioning. + * @member {boolean} disablePodOverprovisioning + * @memberof google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking + * @instance + */ + ServiceNetworking.prototype.disablePodOverprovisioning = false; + /** * Creates a new ServiceNetworking instance using the specified properties. * @function create @@ -4099,6 +4108,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.deployment); + if (message.disablePodOverprovisioning != null && Object.hasOwnProperty.call(message, "disablePodOverprovisioning")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disablePodOverprovisioning); return writer; }; @@ -4141,6 +4152,10 @@ message.deployment = reader.string(); break; } + case 3: { + message.disablePodOverprovisioning = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -4182,6 +4197,9 @@ if (message.deployment != null && message.hasOwnProperty("deployment")) if (!$util.isString(message.deployment)) return "deployment: string expected"; + if (message.disablePodOverprovisioning != null && message.hasOwnProperty("disablePodOverprovisioning")) + if (typeof message.disablePodOverprovisioning !== "boolean") + return "disablePodOverprovisioning: boolean expected"; return null; }; @@ -4201,6 +4219,8 @@ message.service = String(object.service); if (object.deployment != null) message.deployment = String(object.deployment); + if (object.disablePodOverprovisioning != null) + message.disablePodOverprovisioning = Boolean(object.disablePodOverprovisioning); return message; }; @@ -4220,11 +4240,14 @@ if (options.defaults) { object.service = ""; object.deployment = ""; + object.disablePodOverprovisioning = false; } if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; if (message.deployment != null && message.hasOwnProperty("deployment")) object.deployment = message.deployment; + if (message.disablePodOverprovisioning != null && message.hasOwnProperty("disablePodOverprovisioning")) + object.disablePodOverprovisioning = message.disablePodOverprovisioning; return object; }; diff --git a/packages/google-cloud-deploy/protos/protos.json b/packages/google-cloud-deploy/protos/protos.json index 9aab411bbba0..95f4136ff79b 100644 --- a/packages/google-cloud-deploy/protos/protos.json +++ b/packages/google-cloud-deploy/protos/protos.json @@ -859,6 +859,13 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "disablePodOverprovisioning": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } diff --git a/packages/google-cloud-deploy/samples/README.md b/packages/google-cloud-deploy/samples/README.md index 4d52ef3ed630..7b0f0b372159 100644 --- a/packages/google-cloud-deploy/samples/README.md +++ b/packages/google-cloud-deploy/samples/README.md @@ -39,7 +39,6 @@ * [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline) * [Cloud_deploy.update_target](#cloud_deploy.update_target) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -510,23 +509,6 @@ __Usage:__ `node packages/google-cloud-deploy/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/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-deploy/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-deploy/samples/test/quickstart.js` - - diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js index f263c59c705b..b0adc8e8863e 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js @@ -49,7 +49,7 @@ function main(name) { // const requestId = 'abc123' /** * Optional. If set to true, then deleting an already deleted or non-existing - * DeliveryPipeline will succeed. + * `Target` will succeed. */ // const allowMissing = true /** diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts index bf3a9e48d7a9..55c6bc04bffd 100644 --- a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts @@ -2585,7 +2585,7 @@ export class CloudDeployClient { * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.allowMissing] * Optional. If set to true, then deleting an already deleted or non-existing - * DeliveryPipeline will succeed. + * `Target` will succeed. * @param {boolean} [request.validateOnly] * Optional. If set, validate the request and preview the review, but do not * actually post it. From cd38090eb6a9e1cfdc1b3dd8e4abc2c461c33485 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 Jun 2023 17:59:44 +0200 Subject: [PATCH 27/46] chore(deps): update gcr.io/kaniko-project/executor docker tag to v1.10.0 (#4299) Co-authored-by: danieljbruce Co-authored-by: Daniel Bankhead Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- ci/cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/cloudbuild.yaml b/ci/cloudbuild.yaml index e8e770e8fa0f..ab65cd645cd1 100644 --- a/ci/cloudbuild.yaml +++ b/ci/cloudbuild.yaml @@ -24,7 +24,7 @@ logsBucket: 'gs://${_LOGS_BUCKET}/logs/google-cloud-node/${_BUILD_TYPE}/${COMMIT timeout: 32400s steps: - - name: 'gcr.io/kaniko-project/executor:v1.9.2' + - name: 'gcr.io/kaniko-project/executor:v1.10.0' args: [ '--log-format=text', '--context=dir:///workspace/testing', From 611e115b835d6f373bc63aa74259785e3bbac3c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:40:01 -0700 Subject: [PATCH 28/46] chore: [cloudbuild] update go_package to match open source code (#4320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update go_package to match open source code PiperOrigin-RevId: 537891295 Source-Link: https://github.com/googleapis/googleapis/commit/103877e222778e5f4e10e9ed8ccfbf4f87d2549f Source-Link: https://github.com/googleapis/googleapis-gen/commit/2589dd25dc89defd2fd330814ec5c22feb76ff36 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNsb3VkYnVpbGQvLk93bEJvdC55YW1sIiwiaCI6IjI1ODlkZDI1ZGM4OWRlZmQyZmQzMzA4MTRlYzVjMjJmZWI3NmZmMzYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-devtools-cloudbuild/README.md | 69 +++++++++---------- .../devtools/cloudbuild/v1/cloudbuild.proto | 2 +- .../protos/protos.json | 2 +- .../samples/README.md | 18 ----- 4 files changed, 36 insertions(+), 55 deletions(-) diff --git a/packages/google-devtools-cloudbuild/README.md b/packages/google-devtools-cloudbuild/README.md index 459d86984d82..5a2337ccee43 100644 --- a/packages/google-devtools-cloudbuild/README.md +++ b/packages/google-devtools-cloudbuild/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Build: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Cloud Build: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudbuild) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/cloudbuild.svg)](https://www.npmjs.org/package/@google-cloud/cloudbuild) @@ -108,43 +108,42 @@ async function quickstart( ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudbuild/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Cloud_build.approve_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js,samples/README.md) | -| Cloud_build.cancel_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js,samples/README.md) | -| Cloud_build.create_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js,samples/README.md) | -| Cloud_build.create_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js,samples/README.md) | -| Cloud_build.create_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js,samples/README.md) | -| Cloud_build.delete_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js,samples/README.md) | -| Cloud_build.delete_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js,samples/README.md) | -| Cloud_build.get_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js,samples/README.md) | -| Cloud_build.get_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js,samples/README.md) | -| Cloud_build.get_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js,samples/README.md) | -| Cloud_build.list_build_triggers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js,samples/README.md) | -| Cloud_build.list_builds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js,samples/README.md) | -| Cloud_build.list_worker_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js,samples/README.md) | -| Cloud_build.receive_trigger_webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js,samples/README.md) | -| Cloud_build.retry_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js,samples/README.md) | -| Cloud_build.run_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js,samples/README.md) | -| Cloud_build.update_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js,samples/README.md) | -| Cloud_build.update_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js,samples/README.md) | -| Repository_manager.batch_create_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.batch_create_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.batch_create_repositories.js,samples/README.md) | -| Repository_manager.create_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_connection.js,samples/README.md) | -| Repository_manager.create_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.create_repository.js,samples/README.md) | -| Repository_manager.delete_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_connection.js,samples/README.md) | -| Repository_manager.delete_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_repository.js,samples/README.md) | -| Repository_manager.fetch_linkable_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_linkable_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_linkable_repositories.js,samples/README.md) | -| Repository_manager.fetch_read_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_token.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_token.js,samples/README.md) | -| Repository_manager.fetch_read_write_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_write_token.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_write_token.js,samples/README.md) | -| Repository_manager.get_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_connection.js,samples/README.md) | -| Repository_manager.get_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.get_repository.js,samples/README.md) | -| Repository_manager.list_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_connections.js,samples/README.md) | -| Repository_manager.list_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.list_repositories.js,samples/README.md) | -| Repository_manager.update_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.update_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.update_connection.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/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-devtools-cloudbuild/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/test/quickstart.test.js,samples/README.md) | +| Cloud_build.approve_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.cancel_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.create_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.create_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.create_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.delete_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.delete_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.get_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.get_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.get_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.list_build_triggers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.list_builds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.list_worker_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.receive_trigger_webhook | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.retry_build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.run_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.update_build_trigger | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Cloud_build.update_worker_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.batch_create_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.batch_create_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.batch_create_repositories.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.create_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_connection.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.create_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.create_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.create_repository.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.delete_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_connection.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.delete_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.delete_repository.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.fetch_linkable_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_linkable_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_linkable_repositories.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.fetch_read_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_token.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_token.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.fetch_read_write_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_write_token.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.fetch_read_write_token.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.get_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_connection.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.get_repository | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.get_repository.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.get_repository.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.list_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_connections.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.list_repositories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.list_repositories.js) | [![Open in Cloud 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-devtools-cloudbuild/samples/generated/v2/repository_manager.list_repositories.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Repository_manager.update_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.update_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/generated/v2/repository_manager.update_connection.js,packages/google-devtools-cloudbuild/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/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-devtools-cloudbuild/samples/quickstart.js,packages/google-devtools-cloudbuild/samples/README.md) | diff --git a/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto index 7d11dab80237..cc2b1dd56a2f 100644 --- a/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -28,7 +28,7 @@ import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.CloudBuild.V1"; -option go_package = "cloud.google.com/go/cloudbuild/apiv1/v2/apiv1pb;apiv1pb"; +option go_package = "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb;cloudbuildpb"; option java_multiple_files = true; option java_package = "com.google.cloudbuild.v1"; option objc_class_prefix = "GCB"; diff --git a/packages/google-devtools-cloudbuild/protos/protos.json b/packages/google-devtools-cloudbuild/protos/protos.json index fd4e21ce4ec2..882b0894c553 100644 --- a/packages/google-devtools-cloudbuild/protos/protos.json +++ b/packages/google-devtools-cloudbuild/protos/protos.json @@ -9,7 +9,7 @@ "v1": { "options": { "csharp_namespace": "Google.Cloud.CloudBuild.V1", - "go_package": "cloud.google.com/go/cloudbuild/apiv1/v2/apiv1pb;apiv1pb", + "go_package": "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb;cloudbuildpb", "java_multiple_files": true, "java_package": "com.google.cloudbuild.v1", "objc_class_prefix": "GCB", diff --git a/packages/google-devtools-cloudbuild/samples/README.md b/packages/google-devtools-cloudbuild/samples/README.md index b3cb328a8044..fdcd25e3131e 100644 --- a/packages/google-devtools-cloudbuild/samples/README.md +++ b/packages/google-devtools-cloudbuild/samples/README.md @@ -44,7 +44,6 @@ * [Repository_manager.list_repositories](#repository_manager.list_repositories) * [Repository_manager.update_connection](#repository_manager.update_connection) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -600,23 +599,6 @@ __Usage:__ `node packages/google-devtools-cloudbuild/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudbuild/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-devtools-cloudbuild/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-devtools-cloudbuild/samples/test/quickstart.test.js` - - From 9e736d7a58cfd87b8f7285be263edd0cf5c2157c Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:07:16 -0700 Subject: [PATCH 29/46] build: remove region tags, source-of-truth quickstart is in nodejs-docs-samples (#4318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: remove region tags, source-of-truth quickstart is in nodejs-docs-samples * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../google-cloud-videointelligence/README.md | 70 +++---------------- .../samples/README.md | 18 ----- ...ata.google.cloud.videointelligence.v1.json | 2 +- ...oogle.cloud.videointelligence.v1beta2.json | 2 +- ...gle.cloud.videointelligence.v1p1beta1.json | 2 +- ...gle.cloud.videointelligence.v1p2beta1.json | 2 +- ...gle.cloud.videointelligence.v1p3beta1.json | 2 +- .../samples/quickstart.js | 2 - 8 files changed, 15 insertions(+), 85 deletions(-) diff --git a/packages/google-cloud-videointelligence/README.md b/packages/google-cloud-videointelligence/README.md index c6c99f783906..4a6a0a81f189 100644 --- a/packages/google-cloud-videointelligence/README.md +++ b/packages/google-cloud-videointelligence/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Video Intelligence: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Google Cloud Video Intelligence: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/video-intelligence.svg)](https://www.npmjs.org/package/@google-cloud/video-intelligence) @@ -31,7 +31,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) + * [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) @@ -54,71 +54,21 @@ npm install @google-cloud/video-intelligence ``` -### Using the client library - -```javascript -// Imports the Google Cloud Video Intelligence library -const videoIntelligence = require('@google-cloud/video-intelligence'); - -// Creates a client -const client = new videoIntelligence.VideoIntelligenceServiceClient(); - -// The GCS uri of the video to analyze -const gcsUri = 'gs://cloud-samples-data/video/cat.mp4'; - -// Construct request -const request = { - inputUri: gcsUri, - features: ['LABEL_DETECTION'], -}; - -// Execute request -const [operation] = await client.annotateVideo(request); - -console.log( - 'Waiting for operation to complete... (this may take a few minutes)' -); - -const [operationResult] = await operation.promise(); - -// Gets annotations for video -const annotations = operationResult.annotationResults[0]; - -// Gets labels for video from its annotations -const labels = annotations.segmentLabelAnnotations; -labels.forEach(label => { - console.log(`Label ${label.entity.description} occurs at:`); - label.segments.forEach(segment => { - segment = segment.segment; - console.log( - `\tStart: ${segment.startTimeOffset.seconds}` + - `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` - ); - console.log( - `\tEnd: ${segment.endTimeOffset.seconds}.` + - `${(segment.endTimeOffset.nanos / 1e6).toFixed(0)}s` - ); - }); -}); - -``` - ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js,samples/README.md) | -| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js,samples/README.md) | -| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js,samples/README.md) | -| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js,samples/README.md) | -| Streaming_video_intelligence_service.streaming_annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js,samples/README.md) | -| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/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-videointelligence/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/test/quickstart.test.js,samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Streaming_video_intelligence_service.streaming_annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud 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-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js,packages/google-cloud-videointelligence/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/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-videointelligence/samples/quickstart.js,packages/google-cloud-videointelligence/samples/README.md) | diff --git a/packages/google-cloud-videointelligence/samples/README.md b/packages/google-cloud-videointelligence/samples/README.md index c4a5f850027b..b2f5455eee3c 100644 --- a/packages/google-cloud-videointelligence/samples/README.md +++ b/packages/google-cloud-videointelligence/samples/README.md @@ -19,7 +19,6 @@ * [Streaming_video_intelligence_service.streaming_annotate_video](#streaming_video_intelligence_service.streaming_annotate_video) * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -150,23 +149,6 @@ __Usage:__ `node packages/google-cloud-videointelligence/samples/quickstart.js` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-videointelligence/samples/test/quickstart.test.js` - - diff --git a/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json b/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json index 4f3e49a52edc..cd8af418edcc 100644 --- a/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json +++ b/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-videointelligence", - "version": "4.2.0", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json b/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json index 6f58c3586bdc..e557ac2b2156 100644 --- a/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json +++ b/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-videointelligence", - "version": "4.2.0", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json index 96e03ada1e6c..9f40f8f67ba5 100644 --- a/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json +++ b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-videointelligence", - "version": "4.2.0", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json index a21569b82a15..792f471eb2d6 100644 --- a/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json +++ b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-videointelligence", - "version": "4.2.0", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json index b09e79ae4663..290d1bd13247 100644 --- a/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json +++ b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-videointelligence", - "version": "4.2.0", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-videointelligence/samples/quickstart.js b/packages/google-cloud-videointelligence/samples/quickstart.js index 92ee050f9fc5..7ca978e1b416 100644 --- a/packages/google-cloud-videointelligence/samples/quickstart.js +++ b/packages/google-cloud-videointelligence/samples/quickstart.js @@ -14,7 +14,6 @@ 'use strict'; async function main() { - // [START video_quickstart] // Imports the Google Cloud Video Intelligence library const videoIntelligence = require('@google-cloud/video-intelligence'); @@ -58,7 +57,6 @@ async function main() { ); }); }); - // [END video_quickstart] } main().catch(console.error); From 5f9cbc4fb257e58105bf2ed21625f525f278e88b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 12:46:42 -0700 Subject: [PATCH 30/46] build: [mapsplatformdatasets] update maps platform datasets package name (#4323) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: update maps platform datasets package name PiperOrigin-RevId: 538211654 Source-Link: https://github.com/googleapis/googleapis/commit/23145b04a8fa9180311b6239f658ae1082415eb0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f51575f623da6addeafacf6f26a13771f75b3a9e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6ImY1MTU3NWY2MjNkYTZhZGRlYWZhY2Y2ZjI2YTEzNzcxZjc1YjNhOWUifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../generated/v1/maps_platform_datasets.create_dataset.js | 2 +- .../generated/v1/maps_platform_datasets.delete_dataset.js | 2 +- .../samples/generated/v1/maps_platform_datasets.get_dataset.js | 2 +- .../generated/v1/maps_platform_datasets.list_datasets.js | 2 +- .../v1/maps_platform_datasets.update_dataset_metadata.js | 2 +- .../google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js index 405dc8815ae1..a927ae6e9861 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js @@ -39,7 +39,7 @@ function main(parent, dataset) { // const dataset = {} // Imports the Mapsplatformdatasets library - const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; // Instantiates a client const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js index 675a4cda2f35..9f171eed615a 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js @@ -34,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Mapsplatformdatasets library - const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; // Instantiates a client const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js index c683f41ae3e8..11aa1f8f40c2 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js @@ -34,7 +34,7 @@ function main(name) { // const name = 'abc123' // Imports the Mapsplatformdatasets library - const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; // Instantiates a client const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js index 5edb73b066af..7244d3f36f53 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js @@ -44,7 +44,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Mapsplatformdatasets library - const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; // Instantiates a client const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js index 5b914f7e63cb..c7f42ea993ce 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js @@ -41,7 +41,7 @@ function main(dataset) { // const updateMask = {} // Imports the Mapsplatformdatasets library - const {MapsPlatformDatasetsClient} = require('@google-cloud/mapsplatformdatasets').v1; + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; // Instantiates a client const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json index d193c81887d3..8c6350522847 100644 --- a/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json +++ b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.maps.mapsplatformdatasets.v1", - "libraryPackage": "@google-cloud/mapsplatformdatasets", + "libraryPackage": "@googlemaps/maps-platform-datasets", "services": { "MapsPlatformDatasets": { "clients": { From 67ce45e56654cc295df11ecf7b3444832c77c48c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 13:46:47 -0700 Subject: [PATCH 31/46] chore: release main (#4313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release main * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .release-please-manifest.json | 20 +- changelog.json | 242 +++++++++++++++++- packages/google-cloud-aiplatform/CHANGELOG.md | 12 + packages/google-cloud-aiplatform/package.json | 2 +- ...t_metadata.google.cloud.aiplatform.v1.json | 2 +- ...adata.google.cloud.aiplatform.v1beta1.json | 2 +- .../samples/package.json | 2 +- .../google-cloud-billing-budgets/CHANGELOG.md | 8 + .../google-cloud-billing-budgets/package.json | 2 +- ...adata.google.cloud.billing.budgets.v1.json | 2 +- ....google.cloud.billing.budgets.v1beta1.json | 2 +- .../samples/package.json | 2 +- .../CHANGELOG.md | 7 + .../package.json | 2 +- ...google.cloud.contactcenterinsights.v1.json | 2 +- .../samples/package.json | 2 +- .../google-cloud-datacatalog/CHANGELOG.md | 10 + .../google-cloud-datacatalog/package.json | 2 +- ..._metadata.google.cloud.datacatalog.v1.json | 2 +- ...data.google.cloud.datacatalog.v1beta1.json | 2 +- .../samples/package.json | 2 +- packages/google-cloud-deploy/CHANGELOG.md | 7 + packages/google-cloud-deploy/package.json | 2 +- ...ippet_metadata.google.cloud.deploy.v1.json | 2 +- .../google-cloud-deploy/samples/package.json | 2 +- packages/google-cloud-functions/CHANGELOG.md | 7 + packages/google-cloud-functions/package.json | 2 +- ...et_metadata.google.cloud.functions.v1.json | 2 +- ...et_metadata.google.cloud.functions.v2.json | 2 +- ...tadata.google.cloud.functions.v2alpha.json | 2 +- ...etadata.google.cloud.functions.v2beta.json | 2 +- .../samples/package.json | 2 +- packages/google-cloud-tpu/CHANGELOG.md | 8 + packages/google-cloud-tpu/package.json | 2 +- .../snippet_metadata.google.cloud.tpu.v1.json | 2 +- .../snippet_metadata.google.cloud.tpu.v2.json | 2 +- ...et_metadata.google.cloud.tpu.v2alpha1.json | 2 +- .../google-cloud-tpu/samples/package.json | 2 +- .../google-cloud-video-stitcher/CHANGELOG.md | 7 + .../google-cloud-video-stitcher/package.json | 2 +- ...tadata.google.cloud.video.stitcher.v1.json | 2 +- .../samples/package.json | 2 +- packages/google-container/CHANGELOG.md | 12 + packages/google-container/package.json | 2 +- .../snippet_metadata.google.container.v1.json | 2 +- ...pet_metadata.google.container.v1beta1.json | 2 +- .../google-container/samples/package.json | 2 +- .../CHANGELOG.md | 7 + .../package.json | 2 +- ...a.google.maps.mapsplatformdatasets.v1.json | 2 +- ...gle.maps.mapsplatformdatasets.v1alpha.json | 2 +- .../samples/package.json | 2 +- 52 files changed, 376 insertions(+), 51 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index af4776d3e726..79951142b85d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -9,7 +9,7 @@ "packages/google-appengine": "2.2.2", "packages/google-area120-tables": "2.2.2", "packages/google-cloud-accessapproval": "2.2.2", - "packages/google-cloud-aiplatform": "2.14.0", + "packages/google-cloud-aiplatform": "2.15.0", "packages/google-cloud-apigateway": "2.2.2", "packages/google-cloud-apigeeconnect": "2.2.2", "packages/google-cloud-asset": "4.6.3", @@ -28,15 +28,15 @@ "packages/google-cloud-bigquery-datatransfer": "3.2.2", "packages/google-cloud-bigquery-reservation": "2.2.1", "packages/google-cloud-billing": "3.3.2", - "packages/google-cloud-billing-budgets": "4.2.2", + "packages/google-cloud-billing-budgets": "4.3.0", "packages/google-cloud-binaryauthorization": "2.5.0", "packages/google-cloud-certificatemanager": "0.7.2", "packages/google-cloud-channel": "2.7.0", "packages/google-cloud-clouddms": "2.3.0", "packages/google-cloud-compute": "3.9.1", - "packages/google-cloud-contactcenterinsights": "2.7.0", + "packages/google-cloud-contactcenterinsights": "2.8.0", "packages/google-cloud-contentwarehouse": "0.5.1", - "packages/google-cloud-datacatalog": "3.3.1", + "packages/google-cloud-datacatalog": "3.4.0", "packages/google-cloud-datacatalog-lineage": "0.1.2", "packages/google-cloud-dataform": "0.4.2", "packages/google-cloud-datafusion": "2.2.2", @@ -45,7 +45,7 @@ "packages/google-cloud-dataproc": "4.5.0", "packages/google-cloud-dataqna": "2.1.2", "packages/google-cloud-datastream": "2.3.0", - "packages/google-cloud-deploy": "2.5.0", + "packages/google-cloud-deploy": "2.6.0", "packages/google-cloud-dialogflow": "5.8.0", "packages/google-cloud-dialogflow-cx": "3.5.0", "packages/google-cloud-discoveryengine": "0.6.0", @@ -55,7 +55,7 @@ "packages/google-cloud-eventarc": "2.3.2", "packages/google-cloud-eventarc-publishing": "2.4.2", "packages/google-cloud-filestore": "2.4.1", - "packages/google-cloud-functions": "2.4.1", + "packages/google-cloud-functions": "2.5.0", "packages/google-cloud-gaming": "3.2.2", "packages/google-cloud-gkebackup": "0.3.2", "packages/google-cloud-gkeconnect-gateway": "2.1.2", @@ -103,10 +103,10 @@ "packages/google-cloud-talent": "5.1.3", "packages/google-cloud-tasks": "3.1.2", "packages/google-cloud-texttospeech": "4.2.2", - "packages/google-cloud-tpu": "2.6.1", + "packages/google-cloud-tpu": "2.7.0", "packages/google-cloud-translate": "7.2.1", "packages/google-cloud-video-livestream": "0.5.1", - "packages/google-cloud-video-stitcher": "0.3.2", + "packages/google-cloud-video-stitcher": "0.4.0", "packages/google-cloud-video-transcoder": "2.6.0", "packages/google-cloud-videointelligence": "4.2.2", "packages/google-cloud-vision": "3.1.3", @@ -116,7 +116,7 @@ "packages/google-cloud-webrisk": "3.3.0", "packages/google-cloud-websecurityscanner": "2.1.5", "packages/google-cloud-workflows-executions": "2.3.2", - "packages/google-container": "4.11.0", + "packages/google-container": "4.12.0", "packages/google-dataflow": "2.1.2", "packages/google-devtools-artifactregistry": "2.2.2", "packages/google-devtools-cloudbuild": "3.6.0", @@ -125,7 +125,7 @@ "packages/google-iam-credentials": "2.0.4", "packages/google-identity-accesscontextmanager": "2.3.2", "packages/google-maps-addressvalidation": "1.0.2", - "packages/google-maps-mapsplatformdatasets": "0.1.2", + "packages/google-maps-mapsplatformdatasets": "0.2.0", "packages/google-maps-routing": "0.5.1", "packages/google-monitoring-dashboard": "2.9.2", "packages/google-privacy-dlp": "4.4.2", diff --git a/changelog.json b/changelog.json index c8ad940301b8..3e6f05f6668d 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,246 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "5c99df6328f6bd0cfc83a6a294377b47228c0943", + "message": "[mapsplatformdatasets] Add client libraries for v1", + "issues": [ + "4314" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/maps-platform-datasets", + "id": "6a9a8aa9-87d7-4150-83d8-dfc0a44d2ffb", + "createTime": "2023-06-06T07:04:16.853Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d266f1863a1fe9c58032e44cbc03aa51441442c5", + "message": "Add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster", + "issues": [] + }, + { + "type": "feat", + "sha": "d266f1863a1fe9c58032e44cbc03aa51441442c5", + "message": "[container] add a API field to enable FQDN Network Policy on clusters", + "issues": [ + "4319" + ] + }, + { + "type": "feat", + "sha": "d266f1863a1fe9c58032e44cbc03aa51441442c5", + "message": "Add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster", + "issues": [] + }, + { + "type": "feat", + "sha": "d266f1863a1fe9c58032e44cbc03aa51441442c5", + "message": "[container] add a API field to enable FQDN Network Policy on clusters", + "issues": [] + }, + { + "type": "feat", + "sha": "12cc0d9c6d17614b5e1a9b5eb189258279f4cee2", + "message": "[container] add SoleTenantConfig API", + "issues": [ + "4306" + ] + }, + { + "type": "feat", + "sha": "12cc0d9c6d17614b5e1a9b5eb189258279f4cee2", + "message": "[container] add SoleTenantConfig API", + "issues": [] + } + ], + "version": "4.12.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "358e24bb-2818-47d7-8062-1f8b27ed4b35", + "createTime": "2023-06-06T07:04:16.849Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b73a87f4f1c8d84da66ea81b88a3f2cc6704aa6b", + "message": "[video-stitcher] introduce GAM settings for GAM related configs and support ListOperations", + "issues": [ + "4130" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-stitcher", + "id": "a8ebce79-7330-4c82-af6a-1d4ba1d312ed", + "createTime": "2023-06-06T07:04:16.846Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "47ab1c3ee106fce357950245318129d2be723dd2", + "message": "Enable Force on DeleteQueuedResource", + "issues": [] + }, + { + "type": "feat", + "sha": "47ab1c3ee106fce357950245318129d2be723dd2", + "message": "[tpu] Add MultisliceNode", + "issues": [ + "4308" + ] + } + ], + "version": "2.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "ee642693-0b50-4400-b423-5bba395d9f27", + "createTime": "2023-06-06T07:04:16.841Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b6d8778f06458c3f701c8c0099de71dfb3b0b59d", + "message": "[functions] ListFunctions now include metadata which indicates whether a function is a GEN_1 or GEN_2 function", + "issues": [ + "4262" + ] + } + ], + "version": "2.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/functions", + "id": "38d24d7e-aec8-4325-9204-0d116982caa9", + "createTime": "2023-06-06T07:04:16.838Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "10bb49288c297bfd04bf48b26646e3990b454e27", + "message": "[deploy] Add support for disabling Pod overprovisioning in the progressive deployment strategy configuration for a Kubernetes Target", + "issues": [ + "4317" + ] + } + ], + "version": "2.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/deploy", + "id": "bd662fb0-4e8b-423c-a808-4c9f01dc63b7", + "createTime": "2023-06-06T07:04:16.835Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702", + "message": "Expand SearchCatalogResponse with totalSize", + "issues": [] + }, + { + "type": "feat", + "sha": "89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702", + "message": "Modify documentation for FQN support", + "issues": [] + }, + { + "type": "feat", + "sha": "89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702", + "message": "Extend ImportApiRequest with jobId parameter", + "issues": [] + }, + { + "type": "feat", + "sha": "89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702", + "message": "[datacatalog] add support for entries associated with Spanner and ClougBigTable", + "issues": [ + "4302" + ] + } + ], + "version": "3.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datacatalog", + "id": "194abcf3-faaf-46d8-a19b-bbdb973114f3", + "createTime": "2023-06-06T07:04:16.832Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "02f2346643a61ebed9c25a60e6229a1996be727c", + "message": "[contactcenterinsights] Add the resource definition of a STT recognizer", + "issues": [ + "4310" + ] + } + ], + "version": "2.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contact-center-insights", + "id": "964fb9a9-5893-4de2-a624-aaa9e75fd485", + "createTime": "2023-06-06T07:04:16.828Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8ffd9112f3e433f4410ce6aa2664db6cf50f5175", + "message": "[billing-budgets] Add resource_ancestors field to support filtering by folders & organizations", + "issues": [ + "4321" + ] + }, + { + "type": "feat", + "sha": "8ffd9112f3e433f4410ce6aa2664db6cf50f5175", + "message": "[billing-budgets] Add resource_ancestors field to support filtering by folders & organizations", + "issues": [] + } + ], + "version": "4.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/billing-budgets", + "id": "e4c24fb6-c712-4209-8ea2-317b883d40ab", + "createTime": "2023-06-06T07:04:16.825Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "b2c4f4670643d8e5a727c80fb668d5b8ab0cf2b1", + "message": "[ai-platform] update typings for helpers, updated docstrings; removed stale comment", + "issues": [ + "4312" + ] + }, + { + "type": "feat", + "sha": "99736a9b9ac01b9673280eddc2f57a8722646ecd", + "message": "[ai-platform] add blocking_operation_ids to ImportFeatureValuesOperationMetadata", + "issues": [ + "4284" + ] + } + ], + "version": "2.15.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "f9683817-5b83-4cab-b15c-8298982338b8", + "createTime": "2023-06-06T07:04:16.819Z" + }, { "changes": [ { @@ -9737,5 +9977,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2023-05-26T10:59:12.347Z" + "updateTime": "2023-06-06T07:04:16.853Z" } \ No newline at end of file diff --git a/packages/google-cloud-aiplatform/CHANGELOG.md b/packages/google-cloud-aiplatform/CHANGELOG.md index 1729f103050c..2e439e441482 100644 --- a/packages/google-cloud-aiplatform/CHANGELOG.md +++ b/packages/google-cloud-aiplatform/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.15.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v2.14.0...aiplatform-v2.15.0) (2023-06-06) + + +### Features + +* [ai-platform] add blocking_operation_ids to ImportFeatureValuesOperationMetadata ([#4284](https://github.com/googleapis/google-cloud-node/issues/4284)) ([99736a9](https://github.com/googleapis/google-cloud-node/commit/99736a9b9ac01b9673280eddc2f57a8722646ecd)) + + +### Bug Fixes + +* [ai-platform] update typings for helpers, updated docstrings; removed stale comment ([#4312](https://github.com/googleapis/google-cloud-node/issues/4312)) ([b2c4f46](https://github.com/googleapis/google-cloud-node/commit/b2c4f4670643d8e5a727c80fb668d5b8ab0cf2b1)) + ## [2.14.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v2.13.0...aiplatform-v2.14.0) (2023-05-20) diff --git a/packages/google-cloud-aiplatform/package.json b/packages/google-cloud-aiplatform/package.json index 43a4c6483f7a..491a6ac15df9 100644 --- a/packages/google-cloud-aiplatform/package.json +++ b/packages/google-cloud-aiplatform/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/aiplatform", - "version": "2.14.0", + "version": "2.15.0", "description": "Vertex AI client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index f7976bea243b..bab650854e35 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "2.14.0", + "version": "2.15.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index 95a235e0d515..c88f927ec5b8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "2.14.0", + "version": "2.15.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/package.json b/packages/google-cloud-aiplatform/samples/package.json index b2bdcf25c7a2..3e54b5f94428 100644 --- a/packages/google-cloud-aiplatform/samples/package.json +++ b/packages/google-cloud-aiplatform/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 1200000 test/*.js" }, "dependencies": { - "@google-cloud/aiplatform": "^2.14.0" + "@google-cloud/aiplatform": "^2.15.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-billing-budgets/CHANGELOG.md b/packages/google-cloud-billing-budgets/CHANGELOG.md index a7c5d2733e2c..b694cff5cf2d 100644 --- a/packages/google-cloud-billing-budgets/CHANGELOG.md +++ b/packages/google-cloud-billing-budgets/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [4.3.0](https://github.com/googleapis/google-cloud-node/compare/billing-budgets-v4.2.2...billing-budgets-v4.3.0) (2023-06-06) + + +### Features + +* [billing-budgets] Add resource_ancestors field to support filtering by folders & organizations ([8ffd911](https://github.com/googleapis/google-cloud-node/commit/8ffd9112f3e433f4410ce6aa2664db6cf50f5175)) +* [billing-budgets] Add resource_ancestors field to support filtering by folders & organizations ([#4321](https://github.com/googleapis/google-cloud-node/issues/4321)) ([8ffd911](https://github.com/googleapis/google-cloud-node/commit/8ffd9112f3e433f4410ce6aa2664db6cf50f5175)) + ## [4.2.2](https://github.com/googleapis/google-cloud-node/compare/billing-budgets-v4.2.1...billing-budgets-v4.2.2) (2023-04-13) diff --git a/packages/google-cloud-billing-budgets/package.json b/packages/google-cloud-billing-budgets/package.json index 6031adbe7f05..03f64481132c 100644 --- a/packages/google-cloud-billing-budgets/package.json +++ b/packages/google-cloud-billing-budgets/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/googleapis/google-cloud-node.git" }, "name": "@google-cloud/billing-budgets", - "version": "4.2.2", + "version": "4.3.0", "author": "Google LLC", "description": "Budgets client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json index 04fe96bb576a..2573a03d81b9 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-budgets", - "version": "4.2.2", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json index d7b9d449e1c6..9f41ea983931 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-budgets", - "version": "4.2.2", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-billing-budgets/samples/package.json b/packages/google-cloud-billing-budgets/samples/package.json index 8993c690610c..12e2ad9c8f10 100644 --- a/packages/google-cloud-billing-budgets/samples/package.json +++ b/packages/google-cloud-billing-budgets/samples/package.json @@ -15,7 +15,7 @@ "test": "c8 mocha test --timeout=800000" }, "dependencies": { - "@google-cloud/billing-budgets": "^4.2.2" + "@google-cloud/billing-budgets": "^4.3.0" }, "devDependencies": { "c8": "^7.0.0", diff --git a/packages/google-cloud-contactcenterinsights/CHANGELOG.md b/packages/google-cloud-contactcenterinsights/CHANGELOG.md index 3fe2ec9fdfc1..9fda2cdbef6c 100644 --- a/packages/google-cloud-contactcenterinsights/CHANGELOG.md +++ b/packages/google-cloud-contactcenterinsights/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.8.0](https://github.com/googleapis/google-cloud-node/compare/contact-center-insights-v2.7.0...contact-center-insights-v2.8.0) (2023-06-06) + + +### Features + +* [contactcenterinsights] Add the resource definition of a STT recognizer ([#4310](https://github.com/googleapis/google-cloud-node/issues/4310)) ([02f2346](https://github.com/googleapis/google-cloud-node/commit/02f2346643a61ebed9c25a60e6229a1996be727c)) + ## [2.7.0](https://github.com/googleapis/google-cloud-node/compare/contact-center-insights-v2.6.0...contact-center-insights-v2.7.0) (2023-05-02) diff --git a/packages/google-cloud-contactcenterinsights/package.json b/packages/google-cloud-contactcenterinsights/package.json index 39a2efdf09bf..b17bf26fc64b 100644 --- a/packages/google-cloud-contactcenterinsights/package.json +++ b/packages/google-cloud-contactcenterinsights/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/contact-center-insights", - "version": "2.7.0", + "version": "2.8.0", "description": "contactcenterinsights client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json index bd4c8d8aa56e..3567bcc32061 100644 --- a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json +++ b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-contactcenterinsights", - "version": "2.7.0", + "version": "2.8.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-contactcenterinsights/samples/package.json b/packages/google-cloud-contactcenterinsights/samples/package.json index 278752146cdf..13b7da0c369b 100644 --- a/packages/google-cloud-contactcenterinsights/samples/package.json +++ b/packages/google-cloud-contactcenterinsights/samples/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@google-cloud/bigquery": "^6.0.0", - "@google-cloud/contact-center-insights": "^2.7.0", + "@google-cloud/contact-center-insights": "^2.8.0", "@google-cloud/pubsub": "^3.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-datacatalog/CHANGELOG.md b/packages/google-cloud-datacatalog/CHANGELOG.md index d31c2ffe3488..8a3ce38321f0 100644 --- a/packages/google-cloud-datacatalog/CHANGELOG.md +++ b/packages/google-cloud-datacatalog/CHANGELOG.md @@ -4,6 +4,16 @@ [1]: https://www.npmjs.com/package/@google-cloud/datacatalog?activeTab=versions +## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/datacatalog-v3.3.1...datacatalog-v3.4.0) (2023-06-06) + + +### Features + +* [datacatalog] add support for entries associated with Spanner and ClougBigTable ([#4302](https://github.com/googleapis/google-cloud-node/issues/4302)) ([89c2be8](https://github.com/googleapis/google-cloud-node/commit/89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702)) +* Expand SearchCatalogResponse with totalSize ([89c2be8](https://github.com/googleapis/google-cloud-node/commit/89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702)) +* Extend ImportApiRequest with jobId parameter ([89c2be8](https://github.com/googleapis/google-cloud-node/commit/89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702)) +* Modify documentation for FQN support ([89c2be8](https://github.com/googleapis/google-cloud-node/commit/89c2be86f483b14ebf0f0ff3d1b2c7741c5f7702)) + ## [3.3.1](https://github.com/googleapis/google-cloud-node/compare/datacatalog-v3.3.0...datacatalog-v3.3.1) (2023-04-13) diff --git a/packages/google-cloud-datacatalog/package.json b/packages/google-cloud-datacatalog/package.json index 8135b841c109..061caf8041f4 100644 --- a/packages/google-cloud-datacatalog/package.json +++ b/packages/google-cloud-datacatalog/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/googleapis/google-cloud-node.git" }, "name": "@google-cloud/datacatalog", - "version": "3.3.1", + "version": "3.4.0", "author": "Google LLC", "description": "Google Cloud Data Catalog API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json b/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json index 8e3bfe02c314..2bd659ea7659 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json +++ b/packages/google-cloud-datacatalog/samples/generated/v1/snippet_metadata.google.cloud.datacatalog.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datacatalog", - "version": "3.3.1", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json b/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json index 8e1e1050ab4c..7374bddaf631 100644 --- a/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json +++ b/packages/google-cloud-datacatalog/samples/generated/v1beta1/snippet_metadata.google.cloud.datacatalog.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datacatalog", - "version": "3.3.1", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datacatalog/samples/package.json b/packages/google-cloud-datacatalog/samples/package.json index 34fb4c446752..eec753f4ba4d 100644 --- a/packages/google-cloud-datacatalog/samples/package.json +++ b/packages/google-cloud-datacatalog/samples/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/bigquery": "^6.0.0", - "@google-cloud/datacatalog": "^3.3.1", + "@google-cloud/datacatalog": "^3.4.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-deploy/CHANGELOG.md b/packages/google-cloud-deploy/CHANGELOG.md index 4caea32f3fb0..9d5518468213 100644 --- a/packages/google-cloud-deploy/CHANGELOG.md +++ b/packages/google-cloud-deploy/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.6.0](https://github.com/googleapis/google-cloud-node/compare/deploy-v2.5.0...deploy-v2.6.0) (2023-06-06) + + +### Features + +* [deploy] Add support for disabling Pod overprovisioning in the progressive deployment strategy configuration for a Kubernetes Target ([#4317](https://github.com/googleapis/google-cloud-node/issues/4317)) ([10bb492](https://github.com/googleapis/google-cloud-node/commit/10bb49288c297bfd04bf48b26646e3990b454e27)) + ## [2.5.0](https://github.com/googleapis/google-cloud-node/compare/deploy-v2.4.1...deploy-v2.5.0) (2023-05-04) diff --git a/packages/google-cloud-deploy/package.json b/packages/google-cloud-deploy/package.json index bbf203e4861d..d57153f737a9 100644 --- a/packages/google-cloud-deploy/package.json +++ b/packages/google-cloud-deploy/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/deploy", - "version": "2.5.0", + "version": "2.6.0", "description": "clouddeploy client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json index 4f3cd8063f1e..0394f75abe1b 100644 --- a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json +++ b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-deploy", - "version": "2.5.0", + "version": "2.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-deploy/samples/package.json b/packages/google-cloud-deploy/samples/package.json index ff7bb9287d32..33af6feb4f93 100644 --- a/packages/google-cloud-deploy/samples/package.json +++ b/packages/google-cloud-deploy/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/deploy": "^2.5.0" + "@google-cloud/deploy": "^2.6.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-functions/CHANGELOG.md b/packages/google-cloud-functions/CHANGELOG.md index 934fcccaa669..cded6b992446 100644 --- a/packages/google-cloud-functions/CHANGELOG.md +++ b/packages/google-cloud-functions/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.5.0](https://github.com/googleapis/google-cloud-node/compare/functions-v2.4.1...functions-v2.5.0) (2023-06-06) + + +### Features + +* [functions] ListFunctions now include metadata which indicates whether a function is a GEN_1 or GEN_2 function ([#4262](https://github.com/googleapis/google-cloud-node/issues/4262)) ([b6d8778](https://github.com/googleapis/google-cloud-node/commit/b6d8778f06458c3f701c8c0099de71dfb3b0b59d)) + ## [2.4.1](https://github.com/googleapis/google-cloud-node/compare/functions-v2.4.0...functions-v2.4.1) (2023-04-13) diff --git a/packages/google-cloud-functions/package.json b/packages/google-cloud-functions/package.json index 7590744b5156..d9658a6aaffb 100644 --- a/packages/google-cloud-functions/package.json +++ b/packages/google-cloud-functions/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/functions", - "version": "2.4.1", + "version": "2.5.0", "description": "Functions client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json index 41cafa9ca8ef..47f7747b1839 100644 --- a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json +++ b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.1", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json index 2a095dc4e6df..cfdadc5ec71b 100644 --- a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json +++ b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.1", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json index 7ecda0aa5929..f79e3b04e3a1 100644 --- a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json +++ b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.1", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json index a487e445633d..6ca4c94eede8 100644 --- a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json +++ b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-functions", - "version": "2.4.1", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-functions/samples/package.json b/packages/google-cloud-functions/samples/package.json index 3e5423e60c96..68d4c257dc3b 100644 --- a/packages/google-cloud-functions/samples/package.json +++ b/packages/google-cloud-functions/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/functions": "^2.4.1" + "@google-cloud/functions": "^2.5.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-tpu/CHANGELOG.md b/packages/google-cloud-tpu/CHANGELOG.md index 1075de1227e6..897092440f8f 100644 --- a/packages/google-cloud-tpu/CHANGELOG.md +++ b/packages/google-cloud-tpu/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.7.0](https://github.com/googleapis/google-cloud-node/compare/tpu-v2.6.1...tpu-v2.7.0) (2023-06-06) + + +### Features + +* [tpu] Add MultisliceNode ([#4308](https://github.com/googleapis/google-cloud-node/issues/4308)) ([47ab1c3](https://github.com/googleapis/google-cloud-node/commit/47ab1c3ee106fce357950245318129d2be723dd2)) +* Enable Force on DeleteQueuedResource ([47ab1c3](https://github.com/googleapis/google-cloud-node/commit/47ab1c3ee106fce357950245318129d2be723dd2)) + ## [2.6.1](https://github.com/googleapis/google-cloud-node/compare/tpu-v2.6.0...tpu-v2.6.1) (2023-05-04) diff --git a/packages/google-cloud-tpu/package.json b/packages/google-cloud-tpu/package.json index c1103550dc6a..a15030b5f4f2 100644 --- a/packages/google-cloud-tpu/package.json +++ b/packages/google-cloud-tpu/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/tpu", - "version": "2.6.1", + "version": "2.7.0", "description": "tpu client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json index 5ba5fc2b04e6..106b13da641e 100644 --- a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json +++ b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "2.6.1", + "version": "2.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json index e308d01cecd8..611f5017278f 100644 --- a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json +++ b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "2.6.1", + "version": "2.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json index d658562d92f1..9b925df519dd 100644 --- a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json +++ b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "2.6.1", + "version": "2.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/package.json b/packages/google-cloud-tpu/samples/package.json index 332cc0457bb8..fb696b853faf 100644 --- a/packages/google-cloud-tpu/samples/package.json +++ b/packages/google-cloud-tpu/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/tpu": "^2.6.1" + "@google-cloud/tpu": "^2.7.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-video-stitcher/CHANGELOG.md b/packages/google-cloud-video-stitcher/CHANGELOG.md index 1eb37f834e95..9ee05f4c2a2d 100644 --- a/packages/google-cloud-video-stitcher/CHANGELOG.md +++ b/packages/google-cloud-video-stitcher/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/video-stitcher-v0.3.2...video-stitcher-v0.4.0) (2023-06-06) + + +### Features + +* [video-stitcher] introduce GAM settings for GAM related configs and support ListOperations ([#4130](https://github.com/googleapis/google-cloud-node/issues/4130)) ([b73a87f](https://github.com/googleapis/google-cloud-node/commit/b73a87f4f1c8d84da66ea81b88a3f2cc6704aa6b)) + ## [0.3.2](https://github.com/googleapis/google-cloud-node/compare/video-stitcher-v0.3.1...video-stitcher-v0.3.2) (2023-04-13) diff --git a/packages/google-cloud-video-stitcher/package.json b/packages/google-cloud-video-stitcher/package.json index b09fc54bf61b..2f76dcf07ade 100644 --- a/packages/google-cloud-video-stitcher/package.json +++ b/packages/google-cloud-video-stitcher/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/video-stitcher", - "version": "0.3.2", + "version": "0.4.0", "description": "stitcher client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json b/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json index db58fb876d59..84c838525106 100644 --- a/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json +++ b/packages/google-cloud-video-stitcher/samples/generated/v1/snippet_metadata.google.cloud.video.stitcher.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-stitcher", - "version": "0.3.2", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-video-stitcher/samples/package.json b/packages/google-cloud-video-stitcher/samples/package.json index d83eaaca65a2..bbaaa7cc1032 100644 --- a/packages/google-cloud-video-stitcher/samples/package.json +++ b/packages/google-cloud-video-stitcher/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/video-stitcher": "^0.3.2" + "@google-cloud/video-stitcher": "^0.4.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-container/CHANGELOG.md b/packages/google-container/CHANGELOG.md index 49812b304ea1..7664f23d4fc4 100644 --- a/packages/google-container/CHANGELOG.md +++ b/packages/google-container/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/container?activeTab=versions +## [4.12.0](https://github.com/googleapis/google-cloud-node/compare/container-v4.11.0...container-v4.12.0) (2023-06-06) + + +### Features + +* [container] add a API field to enable FQDN Network Policy on clusters ([d266f18](https://github.com/googleapis/google-cloud-node/commit/d266f1863a1fe9c58032e44cbc03aa51441442c5)) +* [container] add a API field to enable FQDN Network Policy on clusters ([#4319](https://github.com/googleapis/google-cloud-node/issues/4319)) ([d266f18](https://github.com/googleapis/google-cloud-node/commit/d266f1863a1fe9c58032e44cbc03aa51441442c5)) +* [container] add SoleTenantConfig API ([12cc0d9](https://github.com/googleapis/google-cloud-node/commit/12cc0d9c6d17614b5e1a9b5eb189258279f4cee2)) +* [container] add SoleTenantConfig API ([#4306](https://github.com/googleapis/google-cloud-node/issues/4306)) ([12cc0d9](https://github.com/googleapis/google-cloud-node/commit/12cc0d9c6d17614b5e1a9b5eb189258279f4cee2)) +* Add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster ([d266f18](https://github.com/googleapis/google-cloud-node/commit/d266f1863a1fe9c58032e44cbc03aa51441442c5)) +* Add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster ([d266f18](https://github.com/googleapis/google-cloud-node/commit/d266f1863a1fe9c58032e44cbc03aa51441442c5)) + ## [4.11.0](https://github.com/googleapis/google-cloud-node/compare/container-v4.10.0...container-v4.11.0) (2023-05-06) diff --git a/packages/google-container/package.json b/packages/google-container/package.json index 63d032d9652f..1aadb01a5398 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/container", "description": "Google Container Engine API client for Node.js", - "version": "4.11.0", + "version": "4.12.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index 37d7c7bd820f..6535953f67bc 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "4.11.0", + "version": "4.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json index d1f8e38322f0..3b791d163491 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "4.11.0", + "version": "4.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/package.json b/packages/google-container/samples/package.json index 447303465a27..5ba3e341de41 100644 --- a/packages/google-container/samples/package.json +++ b/packages/google-container/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1000000" }, "dependencies": { - "@google-cloud/container": "^4.11.0", + "@google-cloud/container": "^4.12.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/google-maps-mapsplatformdatasets/CHANGELOG.md b/packages/google-maps-mapsplatformdatasets/CHANGELOG.md index 4933df2a53e5..72aefa747618 100644 --- a/packages/google-maps-mapsplatformdatasets/CHANGELOG.md +++ b/packages/google-maps-mapsplatformdatasets/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/maps-platform-datasets-v0.1.2...maps-platform-datasets-v0.2.0) (2023-06-06) + + +### Features + +* [mapsplatformdatasets] Add client libraries for v1 ([#4314](https://github.com/googleapis/google-cloud-node/issues/4314)) ([5c99df6](https://github.com/googleapis/google-cloud-node/commit/5c99df6328f6bd0cfc83a6a294377b47228c0943)) + ## [0.1.2](https://github.com/googleapis/google-cloud-node/compare/maps-platform-datasets-v0.1.1...maps-platform-datasets-v0.1.2) (2023-04-13) diff --git a/packages/google-maps-mapsplatformdatasets/package.json b/packages/google-maps-mapsplatformdatasets/package.json index 721de918f982..22b22be51ddb 100644 --- a/packages/google-maps-mapsplatformdatasets/package.json +++ b/packages/google-maps-mapsplatformdatasets/package.json @@ -1,6 +1,6 @@ { "name": "@googlemaps/maps-platform-datasets", - "version": "0.1.2", + "version": "0.2.0", "description": "Maps Platform Datasets API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json index dea97741d642..7eff25fe84ce 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata.google.maps.mapsplatformdatasets.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mapsplatformdatasets", - "version": "0.1.2", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json b/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json index ccda06a94f5a..4a8f59afbd42 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1alpha/snippet_metadata.google.maps.mapsplatformdatasets.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-mapsplatformdatasets", - "version": "0.1.2", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-maps-mapsplatformdatasets/samples/package.json b/packages/google-maps-mapsplatformdatasets/samples/package.json index 064c3e73e690..501918511d77 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/package.json +++ b/packages/google-maps-mapsplatformdatasets/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@googlemaps/maps-platform-datasets": "^0.1.2" + "@googlemaps/maps-platform-datasets": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", From 0b9c928a45e5de78dd13894dc537b351f90a9d56 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 14:23:17 -0700 Subject: [PATCH 32/46] fix!: [discoveryengine] remove the summarization feature from v1 version (#4273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: remove the summarization feature from v1 version PiperOrigin-RevId: 538214109 Source-Link: https://github.com/googleapis/googleapis/commit/f07f71c150f00f91dfe8ae36792598b179495cc6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e548ad009418263ce5449e1a14e840886828a09 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiM2U1NDhhZDAwOTQxODI2M2NlNTQ0OWUxYTE0ZTg0MDg4NjgyOGEwOSJ9 feat: add discovery engine v1 library for enterprise search PiperOrigin-RevId: 534896621 Source-Link: https://github.com/googleapis/googleapis/commit/5f29cc976e3f8bdb891e94ccc6f996f1bb1c7f21 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d908deb556e40cb8ee3983ca12ffb4a82401a3c1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiZDkwOGRlYjU1NmU0MGNiOGVlMzk4M2NhMTJmZmI0YTgyNDAxYTNjMSJ9 feat: allow users to specify id field in documents gcs import feat: add LRO API for schema service docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 534894398 Source-Link: https://github.com/googleapis/googleapis/commit/eb5ac9d38c63f1530d00b9c6ceae6a90d76961e4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/81e8aa76b7e432a95e65c140ab11d0ac7481092b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiODFlOGFhNzZiN2U0MzJhOTVlNjVjMTQwYWIxMWQwYWM3NDgxMDkyYiJ9 fix: fix the field name typo for search service user_labels Note: this might be a breaking change for libraries that already released the previous change. Since it's a beta API, we will make it a minor version bump. PiperOrigin-RevId: 532522130 Source-Link: https://github.com/googleapis/googleapis/commit/11b9e3940fd8e379fb40c979d94893721632a162 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3a58021b188ff7ede193a7b3fe6ad0f13ff30f9a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiM2E1ODAyMWIxODhmZjdlZGUxOTNhN2IzZmU2YWQwZjEzZmYzMGY5YSJ9 feat: enable safe search feature for site search feat: allow users to provide user info in search feat: allow users to provide additional labels in search PiperOrigin-RevId: 530991570 Source-Link: https://github.com/googleapis/googleapis/commit/1392f67054909b0f852c7c6ae957a7c8d67d300d Source-Link: https://github.com/googleapis/googleapis-gen/commit/9d08d41d747cdf0577a25d43e9193e751ee610c6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiOWQwOGQ0MWQ3NDdjZGYwNTc3YTI1ZDQzZTkxOTNlNzUxZWU2MTBjNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Release-As: v0.7.0 --- .../google-cloud-discoveryengine/README.md | 60 +- .../cloud/discoveryengine/v1/common.proto | 100 + .../v1/completion_service.proto | 116 + .../cloud/discoveryengine/v1/document.proto | 118 + .../discoveryengine/v1/document_service.proto | 313 + .../discoveryengine/v1/import_config.proto | 334 + .../discoveryengine/v1/purge_config.proto | 86 + .../cloud/discoveryengine/v1/schema.proto | 58 + .../discoveryengine/v1/schema_service.proto | 256 + .../discoveryengine/v1/search_service.proto | 289 + .../cloud/discoveryengine/v1/user_event.proto | 458 + .../v1/user_event_service.proto | 133 + .../v1beta/import_config.proto | 54 + .../v1beta/search_service.proto | 33 +- .../protos/protos.d.ts | 6589 +++++++ .../protos/protos.js | 16051 +++++++++++++++- .../protos/protos.json | 1807 ++ .../samples/README.md | 324 +- .../v1/completion_service.complete_query.js | 99 + .../v1/document_service.create_document.js | 86 + .../v1/document_service.delete_document.js | 68 + .../v1/document_service.get_document.js | 68 + .../v1/document_service.import_documents.js | 133 + .../v1/document_service.list_documents.js | 88 + .../v1/document_service.purge_documents.js | 75 + .../v1/document_service.update_document.js | 74 + .../v1/schema_service.create_schema.js | 79 + .../v1/schema_service.delete_schema.js | 63 + .../generated/v1/schema_service.get_schema.js | 62 + .../v1/schema_service.list_schemas.js | 81 + .../v1/schema_service.update_schema.js | 68 + .../generated/v1/search_service.search.js | 172 + ...adata.google.cloud.discoveryengine.v1.json | 867 + .../user_event_service.collect_user_event.js | 81 + .../user_event_service.import_user_events.js | 83 + .../v1/user_event_service.write_user_event.js | 67 + .../document_service.import_documents.js | 50 + .../generated/v1beta/search_service.search.js | 34 +- ...a.google.cloud.discoveryengine.v1beta.json | 24 +- .../google-cloud-discoveryengine/src/index.ts | 3 + .../src/v1/completion_service_client.ts | 1047 + .../v1/completion_service_client_config.json | 43 + .../src/v1/completion_service_proto_list.json | 13 + .../src/v1/document_service_client.ts | 2297 +++ .../v1/document_service_client_config.json | 82 + .../src/v1/document_service_proto_list.json | 13 + .../src/v1/gapic_metadata.json | 261 + .../src/v1/index.ts | 23 + .../src/v1/schema_service_client.ts | 1983 ++ .../src/v1/schema_service_client_config.json | 63 + .../src/v1/schema_service_proto_list.json | 13 + .../src/v1/search_service_client.ts | 1619 ++ .../src/v1/search_service_client_config.json | 43 + .../src/v1/search_service_proto_list.json | 13 + .../src/v1/user_event_service_client.ts | 1555 ++ .../v1/user_event_service_client_config.json | 62 + .../src/v1/user_event_service_proto_list.json | 13 + .../src/v1beta/document_service_client.ts | 58 + .../src/v1beta/schema_service_client.ts | 6 + .../src/v1beta/search_service_client.ts | 90 +- .../src/v1beta/user_event_service_client.ts | 6 + .../test/gapic_completion_service_v1.ts | 968 + .../test/gapic_document_service_v1.ts | 2515 +++ .../test/gapic_schema_service_v1.ts | 2268 +++ .../test/gapic_search_service_v1.ts | 1507 ++ .../test/gapic_user_event_service_v1.ts | 1649 ++ 66 files changed, 47751 insertions(+), 63 deletions(-) create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/common.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/completion_service.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document_service.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/import_config.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/purge_config.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema_service.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/search_service.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event.proto create mode 100644 packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event_service.proto create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js create mode 100644 packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js create mode 100644 packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/completion_service_client_config.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/completion_service_proto_list.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/document_service_client.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/document_service_client_config.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/document_service_proto_list.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/index.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/schema_service_client_config.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/schema_service_proto_list.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/search_service_client.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/search_service_client_config.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/search_service_proto_list.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts create mode 100644 packages/google-cloud-discoveryengine/src/v1/user_event_service_client_config.json create mode 100644 packages/google-cloud-discoveryengine/src/v1/user_event_service_proto_list.json create mode 100644 packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts create mode 100644 packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts create mode 100644 packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts create mode 100644 packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts create mode 100644 packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts diff --git a/packages/google-cloud-discoveryengine/README.md b/packages/google-cloud-discoveryengine/README.md index 9e98b73b46c8..562d8cd56836 100644 --- a/packages/google-cloud-discoveryengine/README.md +++ b/packages/google-cloud-discoveryengine/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Discovery Engine API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Discovery Engine API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-discoveryengine) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/discoveryengine.svg)](https://www.npmjs.org/package/@google-cloud/discoveryengine) @@ -121,30 +121,46 @@ callListDocuments(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-discoveryengine/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Completion_service.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js,samples/README.md) | -| Document_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.create_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.create_document.js,samples/README.md) | -| Document_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.delete_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.delete_document.js,samples/README.md) | -| Document_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.get_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.get_document.js,samples/README.md) | -| Document_service.import_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.import_documents.js,samples/README.md) | -| Document_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.list_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.list_documents.js,samples/README.md) | -| Document_service.purge_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js,samples/README.md) | -| Document_service.update_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.update_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.update_document.js,samples/README.md) | -| Recommendation_service.recommend | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js,samples/README.md) | -| Schema_service.create_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js,samples/README.md) | -| Schema_service.delete_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js,samples/README.md) | -| Schema_service.get_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js,samples/README.md) | -| Schema_service.list_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js,samples/README.md) | -| Schema_service.update_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js,samples/README.md) | -| Search_service.search | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/search_service.search.js,samples/README.md) | -| User_event_service.collect_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js,samples/README.md) | -| User_event_service.import_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js,samples/README.md) | -| User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/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-discoveryengine/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/test/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-discoveryengine/samples/test/quickstart.js,samples/README.md) | +| Completion_service.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/completion_service.complete_query.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.create_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.delete_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.get_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.import_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.import_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.list_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.purge_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.purge_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.update_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.update_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.create_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.create_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.delete_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.delete_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.get_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.get_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.list_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.update_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.update_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Search_service.search | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/search_service.search.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.collect_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.import_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Completion_service.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.create_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.create_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.delete_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.delete_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.get_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.get_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.import_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.import_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.list_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.list_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.purge_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.update_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.update_document.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/document_service.update_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Recommendation_service.recommend | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.create_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.delete_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.get_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.list_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Schema_service.update_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Search_service.search | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/search_service.search.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.collect_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.import_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js,packages/google-cloud-discoveryengine/samples/README.md) | +| User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js) | [![Open in Cloud 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-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/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-discoveryengine/samples/quickstart.js,packages/google-cloud-discoveryengine/samples/README.md) | diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/common.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/common.proto new file mode 100644 index 000000000000..b6f887c33cdc --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/common.proto @@ -0,0 +1,100 @@ +// 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.discoveryengine.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/Branch" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/DataStore" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/ServingConfig" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}" +}; + +// A custom attribute that is not explicitly modeled in a resource, e.g. +// [UserEvent][google.cloud.discoveryengine.v1.UserEvent]. +message CustomAttribute { + // The textual values of this custom attribute. For example, `["yellow", + // "green"]` when the key is "color". + // + // Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is + // returned. + // + // Exactly one of + // [CustomAttribute.text][google.cloud.discoveryengine.v1.CustomAttribute.text] + // or + // [CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers] + // should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. + repeated string text = 1; + + // The numerical values of this custom attribute. For example, `[2.3, 15.4]` + // when the key is "lengths_cm". + // + // Exactly one of + // [CustomAttribute.text][google.cloud.discoveryengine.v1.CustomAttribute.text] + // or + // [CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers] + // should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. + repeated double numbers = 2; +} + +// Information of an end user. +message UserInfo { + // Highly recommended for logged-in users. Unique identifier for logged-in + // user, such as a user name. Don't set for anonymous users. + // + // Always use a hashed value for this ID. + // + // Don't set the field to the same fixed ID for different users. This mixes + // the event history of those users together, which results in degraded + // model quality. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + string user_id = 1; + + // User agent as included in the HTTP header. Required for getting + // [SearchResponse.sponsored_results][]. + // + // The field must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + // + // This should not be set when using the client side event reporting with + // GTM or JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent] + // or if + // [UserEvent.direct_user_request][google.cloud.discoveryengine.v1.UserEvent.direct_user_request] + // is set. + string user_agent = 2; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/completion_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/completion_service.proto new file mode 100644 index 000000000000..29ba6317dc1a --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/completion_service.proto @@ -0,0 +1,116 @@ +// 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.discoveryengine.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "CompletionServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Service for Auto-Completion. +service CompletionService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Completes the specified user input with keyword suggestions. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQuery" + additional_bindings { + get: "/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery" + } + }; + } +} + +// Request message for +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] +// method. +message CompleteQueryRequest { + // Required. The parent data store resource name for which the completion is + // performed, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + string data_store = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The typeahead input used to fetch suggestions. Maximum length is + // 128 characters. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Selects data model of query suggestions for serving. Currently supported + // values: + // + // * `document` - Using suggestions generated from user-imported documents. + // * `search-history` - Using suggestions generated from the past history of + // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] + // API calls. Do not use it when there is no traffic for Search API. + // * `user-event` - Using suggestions generated from user-imported search + // events. + // + // Default values: + // + // * `document` is the default model for regular dataStores. + // * `search-history` is the default model for + // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] + // dataStores. + string query_model = 3; + + // A unique identifier for tracking visitors. For example, this could be + // implemented with an HTTP cookie, which should be able to uniquely identify + // a visitor on a single device. This unique identifier should not change if + // the visitor logs in or out of the website. + // + // This field should NOT have a fixed value such as `unknown_visitor`. + // + // This should be the same identifier as + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] + // and + // [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id]. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + string user_pseudo_id = 4; +} + +// Response message for +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] +// method. +message CompleteQueryResponse { + // Suggestions as search queries. + message QuerySuggestion { + // The suggestion for the query. + string suggestion = 1; + } + + // Results of the matched query suggestions. The result list is ordered and + // the first result is a top suggestion. + repeated QuerySuggestion query_suggestions = 1; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document.proto new file mode 100644 index 000000000000..2935f206b8ba --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document.proto @@ -0,0 +1,118 @@ +// 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.discoveryengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Document captures all raw metadata information of items to be recommended or +// searched. +message Document { + option (google.api.resource) = { + type: "discoveryengine.googleapis.com/Document" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}" + }; + + // Unstructured data linked to this document. + message Content { + oneof content { + // The content represented as a stream of bytes. The maximum length is + // 1,000,000 bytes (1 MB / ~0.95 MiB). + // + // Note: As with all `bytes` fields, this field is represented as pure + // binary in Protocol Buffers and base64-encoded string in JSON. For + // example, `abc123!?$*&()'-=@~` should be represented as + // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + bytes raw_bytes = 2; + + // The URI of the content. Only Cloud Storage URIs (e.g. + // `gs://bucket-name/path/to/file`) are supported. The maximum file size + // is 100 MB. + string uri = 3; + } + + // The MIME type of the content. Supported types: + // + // * `application/pdf` (PDF) + // * `text/html` (HTML) + // + // See https://www.iana.org/assignments/media-types/media-types.xhtml. + string mime_type = 1; + } + + // Data representation. One of + // [struct_data][google.cloud.discoveryengine.v1.Document.struct_data] or + // [json_data][google.cloud.discoveryengine.v1.Document.json_data] should be + // provided otherwise an `INVALID_ARGUMENT` error is thrown. + oneof data { + // The structured JSON data for the document. It should conform to the + // registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema] + // or an `INVALID_ARGUMENT` error is thrown. + google.protobuf.Struct struct_data = 4; + + // The JSON string representation of the document. It should conform to the + // registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema] + // or an `INVALID_ARGUMENT` error is thrown. + string json_data = 5; + } + + // Immutable. The full resource name of the document. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. + // + // This field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The identifier of the document. + // + // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. + string id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // The identifier of the schema located in the same data store. + string schema_id = 3; + + // The unstructured data linked to this document. Content must be set if this + // document is under a + // `CONTENT_REQUIRED` data store. + Content content = 10; + + // The identifier of the parent document. Currently supports at most two level + // document hierarchy. + // + // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. + string parent_document_id = 7; + + // Output only. This field is OUTPUT_ONLY. + // It contains derived data that are not in the original input document. + google.protobuf.Struct derived_struct_data = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document_service.proto new file mode 100644 index 000000000000..b46cd918f4c4 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/document_service.proto @@ -0,0 +1,313 @@ +// 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.discoveryengine.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1/document.proto"; +import "google/cloud/discoveryengine/v1/import_config.proto"; +import "google/cloud/discoveryengine/v1/purge_config.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Service for ingesting [Document][google.cloud.discoveryengine.v1.Document] +// information of the customer's website. +service DocumentService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a [Document][google.cloud.discoveryengine.v1.Document]. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a [Document][google.cloud.discoveryengine.v1.Document]. + rpc CreateDocument(CreateDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" + body: "document" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" + body: "document" + } + }; + option (google.api.method_signature) = "parent,document,document_id"; + } + + // Updates a [Document][google.cloud.discoveryengine.v1.Document]. + rpc UpdateDocument(UpdateDocumentRequest) returns (Document) { + option (google.api.http) = { + patch: "/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + body: "document" + additional_bindings { + patch: "/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + body: "document" + } + }; + } + + // Deletes a [Document][google.cloud.discoveryengine.v1.Document]. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Bulk import of multiple + // [Document][google.cloud.discoveryengine.v1.Document]s. Request processing + // may be synchronous. Non-existing items will be created. + // + // Note: It is possible for a subset of the + // [Document][google.cloud.discoveryengine.v1.Document]s to be successfully + // updated. + rpc ImportDocuments(ImportDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1.ImportDocumentsResponse" + metadata_type: "google.cloud.discoveryengine.v1.ImportDocumentsMetadata" + }; + } + + // Permanently deletes all selected + // [Document][google.cloud.discoveryengine.v1.Document]s in a branch. + // + // This process is asynchronous. Depending on the number of + // [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this + // operation can take hours to complete. Before the delete operation + // completes, some [Document][google.cloud.discoveryengine.v1.Document]s might + // still be returned by + // [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument] + // or + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]. + // + // To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s + // to be deleted, set + // [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force] + // to false. + rpc PurgeDocuments(PurgeDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1.PurgeDocumentsResponse" + metadata_type: "google.cloud.discoveryengine.v1.PurgeDocumentsMetadata" + }; + } +} + +// Request message for +// [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument] +// method. +message GetDocumentRequest { + // Required. Full resource name of + // [Document][google.cloud.discoveryengine.v1.Document], such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + // + // If the caller does not have permission to access the + // [Document][google.cloud.discoveryengine.v1.Document], regardless of whether + // or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the requested [Document][google.cloud.discoveryengine.v1.Document] does + // not exist, a `NOT_FOUND` error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; +} + +// Request message for +// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments] +// method. +message ListDocumentsRequest { + // Required. The parent branch resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + // Use `default_branch` as the branch ID, to list documents under the default + // branch. + // + // If the caller does not have permission to list [Documents][]s under this + // branch, regardless of whether or not this branch exists, a + // `PERMISSION_DENIED` error is returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to + // return. If unspecified, defaults to 100. The maximum allowed value is 1000. + // Values above 1000 will be coerced to 1000. + // + // If this field is negative, an `INVALID_ARGUMENT` error is returned. + int32 page_size = 2; + + // A page token + // [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token], + // received from a previous + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments] + // must match the call that provided the page token. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string page_token = 3; +} + +// Response message for +// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments] +// method. +message ListDocumentsResponse { + // The [Document][google.cloud.discoveryengine.v1.Document]s. + repeated Document documents = 1; + + // A token that can be sent as + // [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1.ListDocumentsRequest.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 +// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1.DocumentService.CreateDocument] +// method. +message CreateDocumentRequest { + // Required. The parent resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Required. The [Document][google.cloud.discoveryengine.v1.Document] to + // create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Document][google.cloud.discoveryengine.v1.Document], which will become the + // final component of the + // [Document.name][google.cloud.discoveryengine.v1.Document.name]. + // + // If the caller does not have permission to create the + // [Document][google.cloud.discoveryengine.v1.Document], regardless of whether + // or not it exists, a `PERMISSION_DENIED` error is returned. + // + // This field must be unique among all + // [Document][google.cloud.discoveryengine.v1.Document]s with the same + // [parent][google.cloud.discoveryengine.v1.CreateDocumentRequest.parent]. + // Otherwise, an `ALREADY_EXISTS` error is returned. + // + // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string document_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1.DocumentService.UpdateDocument] +// method. +message UpdateDocumentRequest { + // Required. The document to update/create. + // + // If the caller does not have permission to update the + // [Document][google.cloud.discoveryengine.v1.Document], regardless of whether + // or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the [Document][google.cloud.discoveryengine.v1.Document] to update does + // not exist and + // [allow_missing][google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing] + // is not set, a `NOT_FOUND` error is returned. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, and the + // [Document][google.cloud.discoveryengine.v1.Document] is not found, a new + // [Document][google.cloud.discoveryengine.v1.Document] will be created. + bool allow_missing = 2; +} + +// Request message for +// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1.DocumentService.DeleteDocument] +// method. +message DeleteDocumentRequest { + // Required. Full resource name of + // [Document][google.cloud.discoveryengine.v1.Document], such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + // + // If the caller does not have permission to delete the + // [Document][google.cloud.discoveryengine.v1.Document], regardless of whether + // or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the [Document][google.cloud.discoveryengine.v1.Document] to delete does + // not exist, a `NOT_FOUND` error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/import_config.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/import_config.proto new file mode 100644 index 000000000000..4680ebafde21 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/import_config.proto @@ -0,0 +1,334 @@ +// 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.discoveryengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1/document.proto"; +import "google/cloud/discoveryengine/v1/user_event.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "ImportConfigProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Cloud Storage location for input content. +message GcsSource { + // Required. Cloud Storage URIs to input files. URI can be up to + // 2000 characters long. URIs can match the full object path (for example, + // `gs://bucket/directory/object.json`) or a pattern matching one or more + // files, such as `gs://bucket/directory/*.json`. + // + // A request can contain at most 100 files (or 100,000 files if `data_schema` + // is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is + // `content`). + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; + + // The schema to use when parsing the data from the source. + // + // Supported values for document imports: + // + // * `document` (default): One JSON + // [Document][google.cloud.discoveryengine.v1.Document] per line. Each + // document must + // have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. + // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by + // `input_uris` will become a document, with the ID set to the first 128 + // bits of SHA256(URI) encoded as a hex string. + // * `custom`: One custom data JSON per row in arbitrary format that conforms + // the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + // store. This can only be used by the GENERIC Data Store vertical. + // + // Supported values for user even imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line. + string data_schema = 2; +} + +// BigQuery source import data from. +message BigQuerySource { + // BigQuery table partition info. Leave this empty if the BigQuery table + // is not partitioned. + oneof partition { + // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + google.type.Date partition_date = 5; + } + + // The project ID (can be project # or ID) that the BigQuery source is in with + // a length limit of 128 characters. If not specified, inherits the project + // ID from the parent request. + string project_id = 1; + + // Required. The BigQuery data set to copy the data from with a length limit + // of 1,024 characters. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to copy the data from with a length limit of + // 1,024 characters. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // BigQuery export to a specific Cloud Storage directory. + string gcs_staging_dir = 4; + + // The schema to use when parsing the data from the source. + // + // Supported values for user event imports: + // + // * `user_event` (default): One + // [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per row. + // + // Supported values for document imports: + // + // * `document` (default): One + // [Document][google.cloud.discoveryengine.v1.Document] format per + // row. Each document must have a valid + // [Document.id][google.cloud.discoveryengine.v1.Document.id] and one of + // [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data] + // or + // [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data]. + // * `custom`: One custom data per row in arbitrary format that conforms the + // defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data + // store. This can only be used by the GENERIC Data Store vertical. + string data_schema = 6; +} + +// Configuration of destination for Import related errors. +message ImportErrorConfig { + // Required. Errors destination. + oneof destination { + // Cloud Storage prefix for import errors. This must be an empty, + // existing Cloud Storage directory. Import errors will be written to + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Request message for the ImportUserEvents request. +message ImportUserEventsRequest { + // The inline source for the input config for ImportUserEvents method. + message InlineSource { + // Required. A list of user events to import. Recommended max of 10k items. + repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The desired input source of the user event data. + oneof source { + // Required. The Inline source for the input content for UserEvents. + InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Cloud Storage location for the input content. + GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. BigQuery input source. + BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Parent DataStore resource name, of the form + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // The desired location of errors incurred during the Import. Cannot be set + // for inline user event imports. + ImportErrorConfig error_config = 5; +} + +// Response of the ImportUserEventsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportUserEventsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors if this field was set in + // the request. + ImportErrorConfig error_config = 2; + + // Count of user events imported with complete existing Documents. + int64 joined_events_count = 3; + + // Count of user events imported, but with Document information not found + // in the existing Branch. + int64 unjoined_events_count = 4; +} + +// Metadata related to the progress of the Import operation. This will be +// returned by the google.longrunning.Operation.metadata field. +message ImportUserEventsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were processed successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} + +// Metadata related to the progress of the ImportDocuments operation. This will +// be returned by the google.longrunning.Operation.metadata field. +message ImportDocumentsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were processed successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} + +// Request message for Import methods. +message ImportDocumentsRequest { + // The inline source for the input config for ImportDocuments method. + message InlineSource { + // Required. A list of documents to update/create. Each document must have a + // valid [Document.id][google.cloud.discoveryengine.v1.Document.id]. + // Recommended max of 100 items. + repeated Document documents = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Indicates how imported documents are reconciled with the existing documents + // created or imported before. + enum ReconciliationMode { + // Defaults to INCREMENTAL. + RECONCILIATION_MODE_UNSPECIFIED = 0; + + // Inserts new documents or updates existing documents. + INCREMENTAL = 1; + + // Calculates diff and replaces the entire document dataset. Existing + // documents may be deleted if they are not present in the source location. + FULL = 2; + } + + // Required. The source of the input. + oneof source { + // The Inline source for the input content for documents. + InlineSource inline_source = 2; + + // Cloud Storage location for the input content. + GcsSource gcs_source = 3; + + // BigQuery input source. + BigQuerySource bigquery_source = 4; + } + + // Required. The parent branch resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + // Requires create/update permission. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // The desired location of errors incurred during the Import. + ImportErrorConfig error_config = 5; + + // The mode of reconciliation between existing documents and the documents to + // be imported. Defaults to + // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL]. + ReconciliationMode reconciliation_mode = 6; + + // Whether to automatically generate IDs for the documents if absent. + // + // If set to `true`, + // [Document.id][google.cloud.discoveryengine.v1.Document.id]s are + // automatically generated based on the hash of the payload, where IDs may not + // be consistent during multiple imports. In which case + // [ReconciliationMode.FULL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL] + // is highly recommended to avoid duplicate contents. If unset or set to + // `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have + // to be specified using + // [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field], + // otherwises, documents without IDs will fail to be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] + // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + bool auto_generate_ids = 8; + + // The field in the Cloud Storage and BigQuery sources that indicates the + // unique IDs of the documents. + // + // For [GcsSource][google.cloud.discoveryengine.v1.GcsSource] it is the key of + // the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + // For [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource] it is + // the column name of the BigQuery table where the unique ids are stored. + // + // The values of the JSON field or the BigQuery column will be used as the + // [Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field + // or the BigQuery column must be of string type, and the values must be set + // as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // with 1-63 characters. Otherwise, documents without valid IDs will fail to + // be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema] + // is `custom`. And only set this field when + // [auto_generate_ids][google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids] + // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + // + // If it is unset, a default value `_id` is used when importing from the + // allowed data sources. + string id_field = 9; +} + +// Response of the +// [ImportDocumentsRequest][google.cloud.discoveryengine.v1.ImportDocumentsRequest]. +// If the long running operation is done, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ImportDocumentsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Echoes the destination for the complete errors in the request if set. + ImportErrorConfig error_config = 2; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/purge_config.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/purge_config.proto new file mode 100644 index 000000000000..8c0173b12c84 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/purge_config.proto @@ -0,0 +1,86 @@ +// 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.discoveryengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "PurgeConfigProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Request message for +// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments] +// method. +message PurgeDocumentsRequest { + // Required. The parent resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Required. Filter matching documents to purge. Only currently supported + // value is + // `*` (all items). + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually performs the purge. If `force` is set to false, return the + // expected purge count without deleting any documents. + bool force = 3; +} + +// Response message for +// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments] +// method. If the long running operation is successfully done, then this message +// is returned by the google.longrunning.Operations.response field. +message PurgeDocumentsResponse { + // The total count of documents purged as a result of the operation. + int64 purge_count = 1; + + // A sample of document names that will be deleted. Only populated if `force` + // is set to false. A max of 100 names will be returned and the names are + // chosen at random. + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + }]; +} + +// Metadata related to the progress of the PurgeDocuments operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeDocumentsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were deleted successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema.proto new file mode 100644 index 000000000000..1d8709acb126 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema.proto @@ -0,0 +1,58 @@ +// 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.discoveryengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Defines the structure and layout of a type of document data. +message Schema { + option (google.api.resource) = { + type: "discoveryengine.googleapis.com/Schema" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}" + }; + + // Schema representation. One of + // [struct_schema][google.cloud.discoveryengine.v1.Schema.struct_schema] or + // [json_schema][google.cloud.discoveryengine.v1.Schema.json_schema] should be + // provided otherwise an INVALID_ARGUMENT error is thrown. + oneof schema { + // The structured representation of the schema. + google.protobuf.Struct struct_schema = 2; + + // The JSON representation of the schema. + string json_schema = 3; + } + + // Immutable. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + // + // This field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema_service.proto new file mode 100644 index 000000000000..74ac7f70f5c4 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/schema_service.proto @@ -0,0 +1,256 @@ +// 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.discoveryengine.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1/schema.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Service for managing [Schema][google.cloud.discoveryengine.v1.Schema]s. +service SchemaService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a [Schema][google.cloud.discoveryengine.v1.Schema]. + rpc GetSchema(GetSchemaRequest) returns (Schema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s. + rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a [Schema][google.cloud.discoveryengine.v1.Schema]. + rpc CreateSchema(CreateSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas" + body: "schema" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" + body: "schema" + } + }; + option (google.api.method_signature) = "parent,schema,schema_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1.Schema" + metadata_type: "google.cloud.discoveryengine.v1.CreateSchemaMetadata" + }; + } + + // Updates a [Schema][google.cloud.discoveryengine.v1.Schema]. + rpc UpdateSchema(UpdateSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}" + body: "schema" + additional_bindings { + patch: "/v1/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + body: "schema" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1.Schema" + metadata_type: "google.cloud.discoveryengine.v1.UpdateSchemaMetadata" + }; + } + + // Deletes a [Schema][google.cloud.discoveryengine.v1.Schema]. + rpc DeleteSchema(DeleteSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.discoveryengine.v1.DeleteSchemaMetadata" + }; + } +} + +// Request message for +// [SchemaService.GetSchema][google.cloud.discoveryengine.v1.SchemaService.GetSchema] +// method. +message GetSchemaRequest { + // Required. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Schema" + } + ]; +} + +// Request message for +// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas] +// method. +message ListSchemasRequest { + // Required. The parent data store resource name, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to + // return. The service may return fewer than this value. + // + // If unspecified, at most 100 + // [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned. + // + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous + // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas] + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for +// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas] +// method. +message ListSchemasResponse { + // The [Schema][google.cloud.discoveryengine.v1.Schema]s. + repeated Schema schemas = 1; + + // A token that can be sent as + // [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1.ListSchemasRequest.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 +// [SchemaService.CreateSchema][google.cloud.discoveryengine.v1.SchemaService.CreateSchema] +// method. +message CreateSchemaRequest { + // Required. The parent data store resource name, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Schema][google.cloud.discoveryengine.v1.Schema], which will become the + // final component of the + // [Schema.name][google.cloud.discoveryengine.v1.Schema.name]. + // + // This field should conform to + // [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + string schema_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1.SchemaService.UpdateSchema] +// method. +message UpdateSchemaRequest { + // Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to update. + Schema schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is + // not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for +// [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1.SchemaService.DeleteSchema] +// method. +message DeleteSchemaRequest { + // Required. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Schema" + } + ]; +} + +// Metadata for Create Schema LRO. +message CreateSchemaMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} + +// Metadata for UpdateSchema LRO. +message UpdateSchemaMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} + +// Metadata for DeleteSchema LRO. +message DeleteSchemaMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/search_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/search_service.proto new file mode 100644 index 000000000000..6062d593cae2 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/search_service.proto @@ -0,0 +1,289 @@ +// 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.discoveryengine.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1/common.proto"; +import "google/cloud/discoveryengine/v1/document.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SearchServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Service for search. +service SearchService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs a search. + rpc Search(SearchRequest) returns (SearchResponse) { + option (google.api.http) = { + post: "/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search" + body: "*" + additional_bindings { + post: "/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search" + body: "*" + } + }; + } +} + +// Request message for +// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] +// method. +message SearchRequest { + // Specification to determine under which conditions query expansion should + // occur. + message QueryExpansionSpec { + // Enum describing under which condition query expansion should occur. + enum Condition { + // Unspecified query expansion condition. In this case, server behavior + // defaults to + // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + CONDITION_UNSPECIFIED = 0; + + // Disabled query expansion. Only the exact search query is used, even if + // [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size] + // is zero. + DISABLED = 1; + + // Automatic query expansion built by the Search API. + AUTO = 2; + } + + // The condition under which query expansion should occur. Default to + // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + Condition condition = 1; + } + + // The specification for query spell correction. + message SpellCorrectionSpec { + // Enum describing under which mode spell correction should occur. + enum Mode { + // Unspecified spell correction mode. In this case, server behavior + // defaults to + // [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Search API will try to find a spell suggestion if there + // is any and put in the + // [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query]. + // The spell suggestion will not be used as the search query. + SUGGESTION_ONLY = 1; + + // Automatic spell correction built by the Search API. Search will + // be based on the corrected query if found. + AUTO = 2; + } + + // The mode under which spell correction should take effect to + // replace the original search query. Default to + // [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + Mode mode = 1; + } + + // The specification that configs the desired behavior of the UCS content + // search. + message ContentSearchSpec { + // The specification that configs the snippet in the search results. + message SnippetSpec { + // Max number of snippets returned in each search result. + // If the matching snippets is less than the max_snippet_count, return all + // of the snippets; otherwise, return the max_snippet_count. + // + // At most 5 snippets will be returned for each SearchResult. + int32 max_snippet_count = 1; + + // if true, only snippet reference is returned. + bool reference_only = 2; + } + + // If there is no snippet spec provided, there will be no snippet in the + // search result. + SnippetSpec snippet_spec = 1; + } + + // Required. The resource name of the Search serving config, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + // This field is used to identify the serving configuration name, set + // of models used to make the search. + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/ServingConfig" + } + ]; + + // The branch resource name, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + // + // Use `default_branch` as the branch ID or leave this field empty, to search + // documents under the default branch. + string branch = 2 [(google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + }]; + + // Raw search query. + string query = 3; + + // Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to + // return. If unspecified, defaults to a reasonable value. The maximum allowed + // value is 100. Values above 100 will be coerced to 100. + // + // If this field is negative, an `INVALID_ARGUMENT` is returned. + int32 page_size = 4; + + // A page token received from a previous + // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] + // must match the call that provided the page token. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string page_token = 5; + + // A 0-indexed integer that specifies the current offset (that is, starting + // result location, amongst the + // [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as + // relevant) in search results. This field is only considered if + // [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is + // unset. + // + // If this field is negative, an `INVALID_ARGUMENT` is returned. + int32 offset = 6; + + // Information about the end user. + // Highly recommended for analytics. The user_agent string in UserInfo will + // be used to deduce device_type for analytics. + UserInfo user_info = 21; + + // Additional search parameters. + // + // For public website search only, supported values are: + // + // * `user_country_code`: string. Default empty. If set to non-empty, results + // are restricted or boosted based on the location provided. + // * `search_type`: double. Default empty. Enables non-webpage searching + // depending on the value. The only valid non-default value is 1, + // which enables image searching. + map params = 11; + + // The query expansion specification that specifies the conditions under which + // query expansion will occur. + QueryExpansionSpec query_expansion_spec = 13; + + // The spell correction specification that specifies the mode under + // which spell correction will take effect. + SpellCorrectionSpec spell_correction_spec = 14; + + // A unique identifier for tracking visitors. For example, this could be + // implemented with an HTTP cookie, which should be able to uniquely identify + // a visitor on a single device. This unique identifier should not change if + // the visitor logs in or out of the website. + // + // This field should NOT have a fixed value such as `unknown_visitor`. + // + // This should be the same identifier as + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] + // and + // [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id] + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + string user_pseudo_id = 15; + + // The content search spec that configs the desired behavior of content + // search. + ContentSearchSpec content_search_spec = 24; + + // Whether to turn on safe search. This is only supported for + // [ContentConfig.PUBLIC_WEBSITE][]. + bool safe_search = 20; + + // The user labels applied to a resource must meet the following requirements: + // + // * Each resource can have multiple labels, up to a maximum of 64. + // * Each label must be a key-value pair. + // * Keys have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a maximum + // length of 63 characters. + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. All characters must use UTF-8 encoding, and + // international characters are allowed. + // * The key portion of a label must be unique. However, you can use the same + // key with multiple resources. + // * Keys must start with a lowercase letter or international character. + // + // See [Google Cloud + // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map user_labels = 22; +} + +// Response message for +// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] +// method. +message SearchResponse { + // Represents the search results. + message SearchResult { + // [Document.id][google.cloud.discoveryengine.v1.Document.id] of the + // searched [Document][google.cloud.discoveryengine.v1.Document]. + string id = 1; + + // The document data snippet in the search response. Only fields that are + // marked as retrievable are populated. + Document document = 2; + } + + // A list of matched documents. The order represents the ranking. + repeated SearchResult results = 1; + + // The estimated total count of matched items irrespective of pagination. The + // count of [results][google.cloud.discoveryengine.v1.SearchResponse.results] + // returned by pagination may be less than the + // [total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size] + // that matches. + int32 total_size = 3; + + // A unique search token. This should be included in the + // [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from + // this search, which enables accurate attribution of search model + // performance. + string attribution_token = 4; + + // A token that can be sent as + // [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 5; + + // Contains the spell corrected query, if found. If the spell correction type + // is AUTOMATIC, then the search results are based on corrected_query. + // Otherwise the original query is used for search. + string corrected_query = 7; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event.proto new file mode 100644 index 000000000000..f141a2911e44 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event.proto @@ -0,0 +1,458 @@ +// 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.discoveryengine.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1/common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "UserEventProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// UserEvent captures all metadata information Discovery Engine API needs to +// know about how end users interact with customers' website. +message UserEvent { + // Required. User event type. Allowed values are: + // + // Generic values: + // + // * `search`: Search for Documents. + // * `view-item`: Detailed page view of a Document. + // * `view-item-list`: View of a panel or ordered list of Documents. + // * `view-home-page`: View of the home page. + // * `view-category-page`: View of a category page, e.g. Home > Men > Jeans + // + // Retail-related values: + // + // * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping + // * `purchase`: Purchase an item(s) + // + // Media-related values: + // + // * `media-play`: Start/resume watching a video, playing a song, etc. + // * `media-complete`: Finished or stopped midway through a video, song, etc. + string event_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A unique identifier for tracking visitors. + // + // For example, this could be implemented with an HTTP cookie, which should be + // able to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor log in/out of the website. + // + // Do not set the field to the same fixed ID for different users. This mixes + // the event history of those users together, which results in degraded model + // quality. + // + // The field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // The field should not contain PII or user-data. We recommend to use Google + // Analytics [Client + // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + string user_pseudo_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Only required for + // [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents] + // method. Timestamp of when the user event happened. + google.protobuf.Timestamp event_time = 3; + + // Information about the end user. + UserInfo user_info = 4; + + // Should set to true if the request is made directly from the end user, in + // which case the + // [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1.UserInfo.user_agent] + // can be populated from the HTTP request. + // + // This flag should be set only if the API request is made directly from the + // end user such as a mobile app (and not if a gateway or a server is + // processing and pushing the user events). + // + // This should not be set when using the JavaScript tag in + // [UserEventService.CollectUserEvent][google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent]. + bool direct_user_request = 5; + + // A unique identifier for tracking a visitor session with a length limit of + // 128 bytes. A session is an aggregation of an end user behavior in a time + // span. + // + // A general guideline to populate the session_id: + // + // 1. If user has no activity for 30 min, a new session_id should be assigned. + // 2. The session_id should be unique across users, suggest use uuid or add + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] + // as prefix. + string session_id = 6; + + // Page metadata such as categories and other critical information for certain + // event types such as `view-category-page`. + PageInfo page_info = 7; + + // Token to attribute an API response to user action(s) to trigger the event. + // + // Highly recommended for user events that are the result of + // [RecommendationService.Recommend][]. This field enables accurate + // attribution of recommendation model performance. + // + // The value must be one of: + // + // * [PredictResponse.attribution_token][] for events that are the result of + // [RecommendationService.Recommend][]. + // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of + // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]. + // * [CompleteQueryResponse.attribution_token][] for events that are the + // result of + // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]. + // + // This token enables us to accurately attribute page view or conversion + // completion back to the event and the particular predict response containing + // this clicked/purchased product. If user clicks on product K in the + // recommendation results, pass [PredictResponse.attribution_token][] as a URL + // parameter to product K's page. When recording events on product K's page, + // log the [PredictResponse.attribution_token][] to this field. + string attribution_token = 8; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the documents being filtered. + // + // One example is for `search` events, the associated + // [SearchRequest][google.cloud.discoveryengine.v1.SearchRequest] may contain + // a filter expression in [SearchRequest.filter][] conforming to + // https://google.aip.dev/160#filtering. + // + // Similarly, for `view-item-list` events that are generated from a + // [RecommendationService.RecommendRequest][], this field may be populated + // directly from [RecommendationService.RecommendRequest.filter][] conforming + // to https://google.aip.dev/160#filtering. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + string filter = 9; + + // List of Documents associated with this user event. + // + // This field is optional except for the following event types: + // + // * `view-item` + // * `add-to-cart` + // * `purchase` + // * `media-play` + // * `media-complete` + // + // In a `search` event, this field represents the documents returned to the + // end user on the current page (the end user may have not finished browsing + // the whole page yet). When a new page is returned to the end user, after + // pagination/filtering/ordering even for the same query, a new `search` event + // with different + // [UserEvent.documents][google.cloud.discoveryengine.v1.UserEvent.documents] + // is desired. + repeated DocumentInfo documents = 10; + + // Panel metadata associated with this user event. + PanelInfo panel = 11; + + // Search API details related to the event. + // + // This field should be set for `search` event. + SearchInfo search_info = 12; + + // CompleteQuery API details related to the event. + // + // This field should be set for `search` event when autocomplete function is + // enabled and the user clicks a suggestion for search. + CompletionInfo completion_info = 13; + + // The transaction metadata (if any) associated with this user event. + TransactionInfo transaction_info = 14; + + // A list of identifiers for the independent experiment groups this user event + // belongs to. This is used to distinguish between user events associated with + // different experiment setups on the customer end. + repeated string tag_ids = 15; + + // The promotion IDs if this is an event associated with promotions. + // Currently, this field is restricted to at most one ID. + repeated string promotion_ids = 16; + + // Extra user event features to include in the recommendation model. + // These attributes must NOT contain data that needs to be parsed or processed + // further, e.g. JSON or other encodings. + // + // If you provide custom attributes for ingested user events, also include + // them in the user events that you associate with prediction requests. Custom + // attribute formatting must be consistent between imported events and events + // provided with prediction requests. This lets the Discovery Engine API use + // those custom attributes when training models and serving predictions, which + // helps improve recommendation quality. + // + // This field needs to pass all below criteria, otherwise an + // `INVALID_ARGUMENT` error is returned: + // + // * The key must be a UTF-8 encoded string with a length limit of 5,000 + // characters. + // * For text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length limit of + // 256 characters. + // * For number attributes, at most 400 values are allowed. + // + // For product recommendations, an example of extra user information is + // ` traffic_channel`, which is how a user arrives at the site. Users can + // arrive + // at the site by coming to the site directly, coming through Google + // search, or in other ways. + map attributes = 17; + + // Media-specific info. + MediaInfo media_info = 18; +} + +// Detailed page information. +message PageInfo { + // A unique ID of a web page view. + // + // This should be kept the same for all user events triggered from the same + // pageview. For example, an item detail page view could trigger multiple + // events as the user is browsing the page. The `pageViewId` property should + // be kept the same for all these events so that they can be grouped together + // properly. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. + string pageview_id = 1; + + // The most specific category associated with a category page. + // + // To represent full path of category, use '>' sign to separate different + // hierarchies. If '>' is part of the category name, please replace it with + // other character(s). + // + // Category pages include special pages such as sales or promotions. For + // instance, a special sale page may have the category hierarchy: + // "pageCategory" : "Sales > 2017 Black Friday Deals". + // + // Required for `view-category-page` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + string page_category = 2; + + // Complete URL (window.location.href) of the user's current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. Maximum length 5,000 + // characters. + string uri = 3; + + // The referrer URL of the current page. + // + // When using the client side event reporting with JavaScript pixel and Google + // Tag Manager, this value is filled in automatically. However, some browser + // privacy restrictions may cause this field to be empty. + string referrer_uri = 4; +} + +// Detailed search information. +message SearchInfo { + // The user's search query. + // + // See + // [SearchRequest.query][google.cloud.discoveryengine.v1.SearchRequest.query] + // for definition. + // + // The value must be a UTF-8 encoded string with a length limit of 5,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // At least one of + // [search_query][google.cloud.discoveryengine.v1.SearchInfo.search_query] or + // [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category] + // is required for `search` events. Other event types should not set this + // field. Otherwise, an INVALID_ARGUMENT error is returned. + string search_query = 1; + + // The order in which products are returned, if applicable. + // + // See [SearchRequest.order_by][] for definition and syntax. + // + // The value must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + string order_by = 2; + + // An integer that specifies the current offset for pagination (the 0-indexed + // starting location, amongst the products deemed by the API as relevant). + // + // See + // [SearchRequest.offset][google.cloud.discoveryengine.v1.SearchRequest.offset] + // for definition. + // + // If this field is negative, an INVALID_ARGUMENT is returned. + // + // This can only be set for `search` events. Other event types should not set + // this field. Otherwise, an INVALID_ARGUMENT error is returned. + optional int32 offset = 3; +} + +// Detailed completion information including completion attribution token and +// clicked completion info. +message CompletionInfo { + // End user selected [CompleteQueryResponse.CompletionResult.suggestion][]. + string selected_suggestion = 1; + + // End user selected [CompleteQueryResponse.CompletionResult.suggestion][] + // position, starting from 0. + int32 selected_position = 2; +} + +// A transaction represents the entire purchase transaction. +message TransactionInfo { + // Required. Total non-zero value associated with the transaction. This value + // may include shipping, tax, or other adjustments to the total value that you + // want to include. + optional float value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Currency code. Use three-character ISO-4217 code. + string currency = 2 [(google.api.field_behavior) = REQUIRED]; + + // The transaction ID with a length limit of 128 characters. + string transaction_id = 3; + + // All the taxes associated with the transaction. + optional float tax = 4; + + // All the costs associated with the products. These can be manufacturing + // costs, shipping expenses not borne by the end user, or any other costs, + // such that: + // + // * Profit = [value][google.cloud.discoveryengine.v1.TransactionInfo.value] - + // [tax][google.cloud.discoveryengine.v1.TransactionInfo.tax] - + // [cost][google.cloud.discoveryengine.v1.TransactionInfo.cost] + optional float cost = 5; + + // The total discount(s) value applied to this transaction. + // This figure should be excluded from + // [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value] + // + // For example, if a user paid + // [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value] + // amount, then nominal (pre-discount) value of the transaction is the sum of + // [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value] + // and + // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1.TransactionInfo.discount_value] + // + // This means that profit is calculated the same way, regardless of the + // discount value, and that + // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1.TransactionInfo.discount_value] + // can be larger than + // [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value]: + // + // * Profit = [value][google.cloud.discoveryengine.v1.TransactionInfo.value] - + // [tax][google.cloud.discoveryengine.v1.TransactionInfo.tax] - + // [cost][google.cloud.discoveryengine.v1.TransactionInfo.cost] + optional float discount_value = 6; +} + +// Detailed document information associated with a user event. +message DocumentInfo { + // A required descriptor of the associated + // [Document][google.cloud.discoveryengine.v1.Document]. + // + // * If [id][google.cloud.discoveryengine.v1.DocumentInfo.id] is specified, + // then the default values for + // `{location}`, `{collection_id}`, `{data_store_id}`, and `{branch_id}` are + // used when annotating with the stored Document. + // + // * If [name][google.cloud.discoveryengine.v1.DocumentInfo.name] is + // specified, then the provided values (default values allowed) for + // `{location}`, `{collection_id}`, `{data_store_id}`, and + // `{branch_id}` are used when annotating with the stored Document. + oneof document_descriptor { + // Required. The Document resource ID. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Document resource full name, of the form: + // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; + } + + // Quantity of the Document associated with the user event. Defaults to 1. + // + // For example, this field will be 2 if two quantities of the same Document + // are involved in a `add-to-cart` event. + // + // Required for events of the following event types: + // + // * `add-to-cart` + // * `purchase` + optional int32 quantity = 3; + + // The promotion IDs associated with this Document. + // Currently, this field is restricted to at most one ID. + repeated string promotion_ids = 4; +} + +// Detailed panel information associated with a user event. +message PanelInfo { + // Required. The panel ID. + string panel_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the panel. + string display_name = 3; + + // The ordered position of the panel, if shown to the user with other panels. + // If set, then + // [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must + // also be set. + optional int32 panel_position = 4; + + // The total number of panels, including this one, shown to the user. + // Must be set if + // [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position] + // is set. + optional int32 total_panels = 5; +} + +// Media-specific user event information. +message MediaInfo { + // The media progress time in seconds, if applicable. + // For example, if the end user has finished 90 seconds of a playback video, + // then [MediaInfo.media_progress_duration.seconds][Duration.seconds] should + // be set to 90. + google.protobuf.Duration media_progress_duration = 1; + + // Media progress should be computed using only the media_progress_duration + // relative to the media total length. + // + // This value must be between `[0, 1.0]` inclusive. + // + // If this is not a playback or the progress cannot be computed (e.g. ongoing + // livestream), this field should be unset. + optional float media_progress_percentage = 2; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event_service.proto new file mode 100644 index 000000000000..4dbeea46c583 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1/user_event_service.proto @@ -0,0 +1,133 @@ +// 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.discoveryengine.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/discoveryengine/v1/import_config.proto"; +import "google/cloud/discoveryengine/v1/user_event.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "UserEventServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; + +// Service for ingesting end user actions on a website to Discovery Engine API. +service UserEventService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Writes a single user event. + rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write" + body: "user_event" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write" + body: "user_event" + } + }; + } + + // Writes a single user event from the browser. This uses a GET request to + // due to browser restriction of POST-ing to a 3rd party domain. + // + // This method is used only by the Discovery Engine API JavaScript pixel and + // Google Tag Manager. Users should not call this method directly. + rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect" + } + }; + } + + // Bulk import of User events. Request processing might be + // synchronous. Events that already exist are skipped. + // Use this method for backfilling historical user events. + // + // Operation.response is of type ImportResponse. Note that it is + // possible for a subset of the items to be successfully inserted. + // Operation.metadata is of type ImportMetadata. + rpc ImportUserEvents(ImportUserEventsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1.ImportUserEventsResponse" + metadata_type: "google.cloud.discoveryengine.v1.ImportUserEventsMetadata" + }; + } +} + +// Request message for WriteUserEvent method. +message WriteUserEventRequest { + // Required. The parent DataStore resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. User event to write. + optional UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CollectUserEvent method. +message CollectUserEventRequest { + // Required. The parent DataStore resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. URL encoded UserEvent proto with a length limit of 2,000,000 + // characters. + string user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // The URL including cgi-parameters but excluding the hash fragment with a + // length limit of 5,000 characters. This is often more useful than the + // referer URL, because many browsers only send the domain for 3rd party + // requests. + optional string uri = 3; + + // The event timestamp in milliseconds. This prevents browser caching of + // otherwise identical get requests. The name is abbreviated to reduce the + // payload bytes. + optional int64 ets = 4; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto index faf02e1d0253..9a901c90b8ef 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/import_config.proto @@ -269,6 +269,60 @@ message ImportDocumentsRequest { // be imported. Defaults to // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL]. ReconciliationMode reconciliation_mode = 6; + + // Whether to automatically generate IDs for the documents if absent. + // + // If set to `true`, + // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are + // automatically generated based on the hash of the payload, where IDs may not + // be consistent during multiple imports. In which case + // [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL] + // is highly recommended to avoid duplicate contents. If unset or set to + // `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s + // have to be specified using + // [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field], + // otherwises, documents without IDs will fail to be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and + // when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema] + // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + bool auto_generate_ids = 8; + + // The field in the Cloud Storage and BigQuery sources that indicates the + // unique IDs of the documents. + // + // For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the + // key of the JSON field. For instance, `my_id` for JSON `{"my_id": + // "some_uuid"}`. For + // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource] it is + // the column name of the BigQuery table where the unique ids are stored. + // + // The values of the JSON field or the BigQuery column will be used as the + // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. The JSON + // field or the BigQuery column must be of string type, and the values must be + // set as valid strings conform to + // [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters. + // Otherwise, documents without valid IDs will fail to be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and + // when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema] + // is `custom`. And only set this field when + // [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids] + // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + // + // If it is unset, a default value `_id` is used when importing from the + // allowed data sources. + string id_field = 9; } // Response of the diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto index a62973935547..393f2313a34c 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1beta/search_service.proto @@ -382,6 +382,11 @@ message SearchRequest { // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. string order_by = 8; + // Information about the end user. + // Highly recommended for analytics. The user_agent string in UserInfo will + // be used to deduce device_type for analytics. + UserInfo user_info = 21; + // Facet specifications for faceted search. If empty, no facets are returned. // // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` @@ -393,16 +398,13 @@ message SearchRequest { // Additional search parameters. // - // For - // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH] - // vertical, supported values are: + // For public website search only, supported values are: // // * `user_country_code`: string. Default empty. If set to non-empty, results // are restricted or boosted based on the location provided. // * `search_type`: double. Default empty. Enables non-webpage searching // depending on the value. The only valid non-default value is 1, // which enables image searching. - // This field is ignored for other verticals. map params = 11; // The query expansion specification that specifies the conditions under which @@ -432,6 +434,29 @@ message SearchRequest { // The content search spec that configs the desired behavior of content // search. ContentSearchSpec content_search_spec = 24; + + // Whether to turn on safe search. This is only supported for + // [ContentConfig.PUBLIC_WEBSITE][]. + bool safe_search = 20; + + // The user labels applied to a resource must meet the following requirements: + // + // * Each resource can have multiple labels, up to a maximum of 64. + // * Each label must be a key-value pair. + // * Keys have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a maximum + // length of 63 characters. + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. All characters must use UTF-8 encoding, and + // international characters are allowed. + // * The key portion of a label must be unique. However, you can use the same + // key with multiple resources. + // * Keys must start with a lowercase letter or international character. + // + // See [Google Cloud + // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map user_labels = 22; } // Response message for diff --git a/packages/google-cloud-discoveryengine/protos/protos.d.ts b/packages/google-cloud-discoveryengine/protos/protos.d.ts index ad0ff94c2a56..4c76f6c18a17 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.d.ts +++ b/packages/google-cloud-discoveryengine/protos/protos.d.ts @@ -23,6 +23,6565 @@ export namespace google { /** Namespace discoveryengine. */ namespace discoveryengine { + /** Namespace v1. */ + namespace v1 { + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute text */ + text?: (string[]|null); + + /** CustomAttribute numbers */ + numbers?: (number[]|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICustomAttribute); + + /** CustomAttribute text. */ + public text: string[]; + + /** CustomAttribute numbers. */ + public numbers: number[]; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICustomAttribute): google.cloud.discoveryengine.v1.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.discoveryengine.v1.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CustomAttribute; + + /** + * Verifies a CustomAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo userId */ + userId?: (string|null); + + /** UserInfo userAgent */ + userAgent?: (string|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IUserInfo); + + /** UserInfo userId. */ + public userId: string; + + /** UserInfo userAgent. */ + public userAgent: string; + + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IUserInfo): google.cloud.discoveryengine.v1.UserInfo; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.UserInfo; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.UserInfo; + + /** + * Verifies a UserInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.UserInfo; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CompletionService */ + class CompletionService extends $protobuf.rpc.Service { + + /** + * Constructs a new CompletionService 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 CompletionService 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): CompletionService; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse + */ + public completeQuery(request: google.cloud.discoveryengine.v1.ICompleteQueryRequest, callback: google.cloud.discoveryengine.v1.CompletionService.CompleteQueryCallback): void; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise + */ + public completeQuery(request: google.cloud.discoveryengine.v1.ICompleteQueryRequest): Promise; + } + + namespace CompletionService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.CompletionService|completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse + */ + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.CompleteQueryResponse) => void; + } + + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { + + /** CompleteQueryRequest dataStore */ + dataStore?: (string|null); + + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest queryModel */ + queryModel?: (string|null); + + /** CompleteQueryRequest userPseudoId */ + userPseudoId?: (string|null); + } + + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { + + /** + * Constructs a new CompleteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICompleteQueryRequest); + + /** CompleteQueryRequest dataStore. */ + public dataStore: string; + + /** CompleteQueryRequest query. */ + public query: string; + + /** CompleteQueryRequest queryModel. */ + public queryModel: string; + + /** CompleteQueryRequest userPseudoId. */ + public userPseudoId: string; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICompleteQueryRequest): google.cloud.discoveryengine.v1.CompleteQueryRequest; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CompleteQueryRequest; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CompleteQueryRequest; + + /** + * Verifies a CompleteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CompleteQueryRequest; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { + + /** CompleteQueryResponse querySuggestions */ + querySuggestions?: (google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion[]|null); + } + + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { + + /** + * Constructs a new CompleteQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICompleteQueryResponse); + + /** CompleteQueryResponse querySuggestions. */ + public querySuggestions: google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion[]; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICompleteQueryResponse): google.cloud.discoveryengine.v1.CompleteQueryResponse; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CompleteQueryResponse; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CompleteQueryResponse; + + /** + * Verifies a CompleteQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CompleteQueryResponse; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompleteQueryResponse { + + /** Properties of a QuerySuggestion. */ + interface IQuerySuggestion { + + /** QuerySuggestion suggestion */ + suggestion?: (string|null); + } + + /** Represents a QuerySuggestion. */ + class QuerySuggestion implements IQuerySuggestion { + + /** + * Constructs a new QuerySuggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion); + + /** QuerySuggestion suggestion. */ + public suggestion: string; + + /** + * Creates a new QuerySuggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns QuerySuggestion instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion): google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion; + + /** + * Encodes the specified QuerySuggestion message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.verify|verify} messages. + * @param message QuerySuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuerySuggestion message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.verify|verify} messages. + * @param message QuerySuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuerySuggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuerySuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion; + + /** + * Decodes a QuerySuggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuerySuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion; + + /** + * Verifies a QuerySuggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuerySuggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuerySuggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion; + + /** + * Creates a plain object from a QuerySuggestion message. Also converts values to other types if specified. + * @param message QuerySuggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuerySuggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuerySuggestion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document structData */ + structData?: (google.protobuf.IStruct|null); + + /** Document jsonData */ + jsonData?: (string|null); + + /** Document name */ + name?: (string|null); + + /** Document id */ + id?: (string|null); + + /** Document schemaId */ + schemaId?: (string|null); + + /** Document content */ + content?: (google.cloud.discoveryengine.v1.Document.IContent|null); + + /** Document parentDocumentId */ + parentDocumentId?: (string|null); + + /** Document derivedStructData */ + derivedStructData?: (google.protobuf.IStruct|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IDocument); + + /** Document structData. */ + public structData?: (google.protobuf.IStruct|null); + + /** Document jsonData. */ + public jsonData?: (string|null); + + /** Document name. */ + public name: string; + + /** Document id. */ + public id: string; + + /** Document schemaId. */ + public schemaId: string; + + /** Document content. */ + public content?: (google.cloud.discoveryengine.v1.Document.IContent|null); + + /** Document parentDocumentId. */ + public parentDocumentId: string; + + /** Document derivedStructData. */ + public derivedStructData?: (google.protobuf.IStruct|null); + + /** Document data. */ + public data?: ("structData"|"jsonData"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IDocument): google.cloud.discoveryengine.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a Content. */ + interface IContent { + + /** Content rawBytes */ + rawBytes?: (Uint8Array|string|null); + + /** Content uri */ + uri?: (string|null); + + /** Content mimeType */ + mimeType?: (string|null); + } + + /** Represents a Content. */ + class Content implements IContent { + + /** + * Constructs a new Content. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.Document.IContent); + + /** Content rawBytes. */ + public rawBytes?: (Uint8Array|string|null); + + /** Content uri. */ + public uri?: (string|null); + + /** Content mimeType. */ + public mimeType: string; + + /** Content content. */ + public content?: ("rawBytes"|"uri"); + + /** + * Creates a new Content instance using the specified properties. + * @param [properties] Properties to set + * @returns Content instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.Document.IContent): google.cloud.discoveryengine.v1.Document.Content; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.Document.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.Document.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Content message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.Document.Content; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.Document.Content; + + /** + * Verifies a Content message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Content + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.Document.Content; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @param message Content + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.Document.Content, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Content to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Content + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a DocumentService */ + class DocumentService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentService 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 DocumentService 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): DocumentService; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public getDocument(request: google.cloud.discoveryengine.v1.IGetDocumentRequest, callback: google.cloud.discoveryengine.v1.DocumentService.GetDocumentCallback): void; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @returns Promise + */ + public getDocument(request: google.cloud.discoveryengine.v1.IGetDocumentRequest): Promise; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse + */ + public listDocuments(request: google.cloud.discoveryengine.v1.IListDocumentsRequest, callback: google.cloud.discoveryengine.v1.DocumentService.ListDocumentsCallback): void; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @returns Promise + */ + public listDocuments(request: google.cloud.discoveryengine.v1.IListDocumentsRequest): Promise; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public createDocument(request: google.cloud.discoveryengine.v1.ICreateDocumentRequest, callback: google.cloud.discoveryengine.v1.DocumentService.CreateDocumentCallback): void; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @returns Promise + */ + public createDocument(request: google.cloud.discoveryengine.v1.ICreateDocumentRequest): Promise; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public updateDocument(request: google.cloud.discoveryengine.v1.IUpdateDocumentRequest, callback: google.cloud.discoveryengine.v1.DocumentService.UpdateDocumentCallback): void; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @returns Promise + */ + public updateDocument(request: google.cloud.discoveryengine.v1.IUpdateDocumentRequest): Promise; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDocument(request: google.cloud.discoveryengine.v1.IDeleteDocumentRequest, callback: google.cloud.discoveryengine.v1.DocumentService.DeleteDocumentCallback): void; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @returns Promise + */ + public deleteDocument(request: google.cloud.discoveryengine.v1.IDeleteDocumentRequest): Promise; + + /** + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importDocuments(request: google.cloud.discoveryengine.v1.IImportDocumentsRequest, callback: google.cloud.discoveryengine.v1.DocumentService.ImportDocumentsCallback): void; + + /** + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @returns Promise + */ + public importDocuments(request: google.cloud.discoveryengine.v1.IImportDocumentsRequest): Promise; + + /** + * Calls PurgeDocuments. + * @param request PurgeDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public purgeDocuments(request: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, callback: google.cloud.discoveryengine.v1.DocumentService.PurgeDocumentsCallback): void; + + /** + * Calls PurgeDocuments. + * @param request PurgeDocumentsRequest message or plain object + * @returns Promise + */ + public purgeDocuments(request: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest): Promise; + } + + namespace DocumentService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|getDocument}. + * @param error Error, if any + * @param [response] Document + */ + type GetDocumentCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.Document) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|listDocuments}. + * @param error Error, if any + * @param [response] ListDocumentsResponse + */ + type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.ListDocumentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|createDocument}. + * @param error Error, if any + * @param [response] Document + */ + type CreateDocumentCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.Document) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|updateDocument}. + * @param error Error, if any + * @param [response] Document + */ + type UpdateDocumentCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.Document) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|deleteDocument}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|importDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|purgeDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type PurgeDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a GetDocumentRequest. */ + interface IGetDocumentRequest { + + /** GetDocumentRequest name */ + name?: (string|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { + + /** + * Constructs a new GetDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IGetDocumentRequest); + + /** GetDocumentRequest name. */ + public name: string; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IGetDocumentRequest): google.cloud.discoveryengine.v1.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.GetDocumentRequest; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.GetDocumentRequest; + + /** + * Verifies a GetDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.GetDocumentRequest; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @param message GetDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsRequest. */ + interface IListDocumentsRequest { + + /** ListDocumentsRequest parent */ + parent?: (string|null); + + /** ListDocumentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDocumentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDocumentsRequest. */ + class ListDocumentsRequest implements IListDocumentsRequest { + + /** + * Constructs a new ListDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IListDocumentsRequest); + + /** ListDocumentsRequest parent. */ + public parent: string; + + /** ListDocumentsRequest pageSize. */ + public pageSize: number; + + /** ListDocumentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IListDocumentsRequest): google.cloud.discoveryengine.v1.ListDocumentsRequest; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ListDocumentsRequest; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ListDocumentsRequest; + + /** + * Verifies a ListDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ListDocumentsRequest; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @param message ListDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsResponse. */ + interface IListDocumentsResponse { + + /** ListDocumentsResponse documents */ + documents?: (google.cloud.discoveryengine.v1.IDocument[]|null); + + /** ListDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDocumentsResponse. */ + class ListDocumentsResponse implements IListDocumentsResponse { + + /** + * Constructs a new ListDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IListDocumentsResponse); + + /** ListDocumentsResponse documents. */ + public documents: google.cloud.discoveryengine.v1.IDocument[]; + + /** ListDocumentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IListDocumentsResponse): google.cloud.discoveryengine.v1.ListDocumentsResponse; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ListDocumentsResponse; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ListDocumentsResponse; + + /** + * Verifies a ListDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ListDocumentsResponse; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @param message ListDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDocumentRequest. */ + interface ICreateDocumentRequest { + + /** CreateDocumentRequest parent */ + parent?: (string|null); + + /** CreateDocumentRequest document */ + document?: (google.cloud.discoveryengine.v1.IDocument|null); + + /** CreateDocumentRequest documentId */ + documentId?: (string|null); + } + + /** Represents a CreateDocumentRequest. */ + class CreateDocumentRequest implements ICreateDocumentRequest { + + /** + * Constructs a new CreateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICreateDocumentRequest); + + /** CreateDocumentRequest parent. */ + public parent: string; + + /** CreateDocumentRequest document. */ + public document?: (google.cloud.discoveryengine.v1.IDocument|null); + + /** CreateDocumentRequest documentId. */ + public documentId: string; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICreateDocumentRequest): google.cloud.discoveryengine.v1.CreateDocumentRequest; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CreateDocumentRequest; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CreateDocumentRequest; + + /** + * Verifies a CreateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CreateDocumentRequest; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @param message CreateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentRequest. */ + interface IUpdateDocumentRequest { + + /** UpdateDocumentRequest document */ + document?: (google.cloud.discoveryengine.v1.IDocument|null); + + /** UpdateDocumentRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateDocumentRequest. */ + class UpdateDocumentRequest implements IUpdateDocumentRequest { + + /** + * Constructs a new UpdateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IUpdateDocumentRequest); + + /** UpdateDocumentRequest document. */ + public document?: (google.cloud.discoveryengine.v1.IDocument|null); + + /** UpdateDocumentRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IUpdateDocumentRequest): google.cloud.discoveryengine.v1.UpdateDocumentRequest; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.UpdateDocumentRequest; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.UpdateDocumentRequest; + + /** + * Verifies an UpdateDocumentRequest message. + * @param message Plain 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 UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.UpdateDocumentRequest; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentRequest. */ + interface IDeleteDocumentRequest { + + /** DeleteDocumentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDocumentRequest. */ + class DeleteDocumentRequest implements IDeleteDocumentRequest { + + /** + * Constructs a new DeleteDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IDeleteDocumentRequest); + + /** DeleteDocumentRequest name. */ + public name: string; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IDeleteDocumentRequest): google.cloud.discoveryengine.v1.DeleteDocumentRequest; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.DeleteDocumentRequest; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.DeleteDocumentRequest; + + /** + * Verifies a DeleteDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.DeleteDocumentRequest; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUris */ + inputUris?: (string[]|null); + + /** GcsSource dataSchema */ + dataSchema?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** GcsSource dataSchema. */ + public dataSchema: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IGcsSource): google.cloud.discoveryengine.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { + + /** BigQuerySource partitionDate */ + partitionDate?: (google.type.IDate|null); + + /** BigQuerySource projectId */ + projectId?: (string|null); + + /** BigQuerySource datasetId */ + datasetId?: (string|null); + + /** BigQuerySource tableId */ + tableId?: (string|null); + + /** BigQuerySource gcsStagingDir */ + gcsStagingDir?: (string|null); + + /** BigQuerySource dataSchema */ + dataSchema?: (string|null); + } + + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { + + /** + * Constructs a new BigQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IBigQuerySource); + + /** BigQuerySource partitionDate. */ + public partitionDate?: (google.type.IDate|null); + + /** BigQuerySource projectId. */ + public projectId: string; + + /** BigQuerySource datasetId. */ + public datasetId: string; + + /** BigQuerySource tableId. */ + public tableId: string; + + /** BigQuerySource gcsStagingDir. */ + public gcsStagingDir: string; + + /** BigQuerySource dataSchema. */ + public dataSchema: string; + + /** BigQuerySource partition. */ + public partition?: "partitionDate"; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQuerySource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IBigQuerySource): google.cloud.discoveryengine.v1.BigQuerySource; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.discoveryengine.v1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.BigQuerySource; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.BigQuerySource; + + /** + * Verifies a BigQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.BigQuerySource; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @param message BigQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQuerySource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportErrorConfig. */ + interface IImportErrorConfig { + + /** ImportErrorConfig gcsPrefix */ + gcsPrefix?: (string|null); + } + + /** Represents an ImportErrorConfig. */ + class ImportErrorConfig implements IImportErrorConfig { + + /** + * Constructs a new ImportErrorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportErrorConfig); + + /** ImportErrorConfig gcsPrefix. */ + public gcsPrefix?: (string|null); + + /** ImportErrorConfig destination. */ + public destination?: "gcsPrefix"; + + /** + * Creates a new ImportErrorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportErrorConfig instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportErrorConfig): google.cloud.discoveryengine.v1.ImportErrorConfig; + + /** + * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportErrorConfig.verify|verify} messages. + * @param message ImportErrorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportErrorConfig.verify|verify} messages. + * @param message ImportErrorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportErrorConfig; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportErrorConfig; + + /** + * Verifies an ImportErrorConfig message. + * @param message Plain 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 ImportErrorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportErrorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportErrorConfig; + + /** + * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. + * @param message ImportErrorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportErrorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportErrorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportErrorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportUserEventsRequest. */ + interface IImportUserEventsRequest { + + /** ImportUserEventsRequest inlineSource */ + inlineSource?: (google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource|null); + + /** ImportUserEventsRequest gcsSource */ + gcsSource?: (google.cloud.discoveryengine.v1.IGcsSource|null); + + /** ImportUserEventsRequest bigquerySource */ + bigquerySource?: (google.cloud.discoveryengine.v1.IBigQuerySource|null); + + /** ImportUserEventsRequest parent */ + parent?: (string|null); + + /** ImportUserEventsRequest errorConfig */ + errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + } + + /** Represents an ImportUserEventsRequest. */ + class ImportUserEventsRequest implements IImportUserEventsRequest { + + /** + * Constructs a new ImportUserEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportUserEventsRequest); + + /** ImportUserEventsRequest inlineSource. */ + public inlineSource?: (google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource|null); + + /** ImportUserEventsRequest gcsSource. */ + public gcsSource?: (google.cloud.discoveryengine.v1.IGcsSource|null); + + /** ImportUserEventsRequest bigquerySource. */ + public bigquerySource?: (google.cloud.discoveryengine.v1.IBigQuerySource|null); + + /** ImportUserEventsRequest parent. */ + public parent: string; + + /** ImportUserEventsRequest errorConfig. */ + public errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** ImportUserEventsRequest source. */ + public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportUserEventsRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportUserEventsRequest): google.cloud.discoveryengine.v1.ImportUserEventsRequest; + + /** + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportUserEventsRequest; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportUserEventsRequest; + + /** + * Verifies an ImportUserEventsRequest message. + * @param message Plain 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 ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportUserEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportUserEventsRequest; + + /** + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @param message ImportUserEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportUserEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportUserEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportUserEventsRequest { + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource userEvents */ + userEvents?: (google.cloud.discoveryengine.v1.IUserEvent[]|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource); + + /** InlineSource userEvents. */ + public userEvents: google.cloud.discoveryengine.v1.IUserEvent[]; + + /** + * Creates a new InlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource): google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource; + + /** + * Verifies an InlineSource message. + * @param message Plain 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 InlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @param message InlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportUserEventsResponse. */ + interface IImportUserEventsResponse { + + /** ImportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ImportUserEventsResponse errorConfig */ + errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** ImportUserEventsResponse joinedEventsCount */ + joinedEventsCount?: (number|Long|string|null); + + /** ImportUserEventsResponse unjoinedEventsCount */ + unjoinedEventsCount?: (number|Long|string|null); + } + + /** Represents an ImportUserEventsResponse. */ + class ImportUserEventsResponse implements IImportUserEventsResponse { + + /** + * Constructs a new ImportUserEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportUserEventsResponse); + + /** ImportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ImportUserEventsResponse errorConfig. */ + public errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** ImportUserEventsResponse joinedEventsCount. */ + public joinedEventsCount: (number|Long|string); + + /** ImportUserEventsResponse unjoinedEventsCount. */ + public unjoinedEventsCount: (number|Long|string); + + /** + * Creates a new ImportUserEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportUserEventsResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportUserEventsResponse): google.cloud.discoveryengine.v1.ImportUserEventsResponse; + + /** + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportUserEventsResponse; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportUserEventsResponse; + + /** + * Verifies an ImportUserEventsResponse message. + * @param message Plain 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 ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportUserEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportUserEventsResponse; + + /** + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @param message ImportUserEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportUserEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportUserEventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportUserEventsMetadata. */ + interface IImportUserEventsMetadata { + + /** ImportUserEventsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportUserEventsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportUserEventsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** ImportUserEventsMetadata failureCount */ + failureCount?: (number|Long|string|null); + } + + /** Represents an ImportUserEventsMetadata. */ + class ImportUserEventsMetadata implements IImportUserEventsMetadata { + + /** + * Constructs a new ImportUserEventsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportUserEventsMetadata); + + /** ImportUserEventsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportUserEventsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportUserEventsMetadata successCount. */ + public successCount: (number|Long|string); + + /** ImportUserEventsMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** + * Creates a new ImportUserEventsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportUserEventsMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportUserEventsMetadata): google.cloud.discoveryengine.v1.ImportUserEventsMetadata; + + /** + * Encodes the specified ImportUserEventsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsMetadata.verify|verify} messages. + * @param message ImportUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsMetadata.verify|verify} messages. + * @param message ImportUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportUserEventsMetadata; + + /** + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportUserEventsMetadata; + + /** + * Verifies an ImportUserEventsMetadata message. + * @param message Plain 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 ImportUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportUserEventsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportUserEventsMetadata; + + /** + * Creates a plain object from an ImportUserEventsMetadata message. Also converts values to other types if specified. + * @param message ImportUserEventsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportUserEventsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportUserEventsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDocumentsMetadata. */ + interface IImportDocumentsMetadata { + + /** ImportDocumentsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportDocumentsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportDocumentsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** ImportDocumentsMetadata failureCount */ + failureCount?: (number|Long|string|null); + } + + /** Represents an ImportDocumentsMetadata. */ + class ImportDocumentsMetadata implements IImportDocumentsMetadata { + + /** + * Constructs a new ImportDocumentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportDocumentsMetadata); + + /** ImportDocumentsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportDocumentsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ImportDocumentsMetadata successCount. */ + public successCount: (number|Long|string); + + /** ImportDocumentsMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** + * Creates a new ImportDocumentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportDocumentsMetadata): google.cloud.discoveryengine.v1.ImportDocumentsMetadata; + + /** + * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsMetadata.verify|verify} messages. + * @param message ImportDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsMetadata.verify|verify} messages. + * @param message ImportDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportDocumentsMetadata; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportDocumentsMetadata; + + /** + * Verifies an ImportDocumentsMetadata message. + * @param message Plain 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 ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportDocumentsMetadata; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @param message ImportDocumentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDocumentsRequest. */ + interface IImportDocumentsRequest { + + /** ImportDocumentsRequest inlineSource */ + inlineSource?: (google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource|null); + + /** ImportDocumentsRequest gcsSource */ + gcsSource?: (google.cloud.discoveryengine.v1.IGcsSource|null); + + /** ImportDocumentsRequest bigquerySource */ + bigquerySource?: (google.cloud.discoveryengine.v1.IBigQuerySource|null); + + /** ImportDocumentsRequest parent */ + parent?: (string|null); + + /** ImportDocumentsRequest errorConfig */ + errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** ImportDocumentsRequest reconciliationMode */ + reconciliationMode?: (google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode|null); + + /** ImportDocumentsRequest autoGenerateIds */ + autoGenerateIds?: (boolean|null); + + /** ImportDocumentsRequest idField */ + idField?: (string|null); + } + + /** Represents an ImportDocumentsRequest. */ + class ImportDocumentsRequest implements IImportDocumentsRequest { + + /** + * Constructs a new ImportDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportDocumentsRequest); + + /** ImportDocumentsRequest inlineSource. */ + public inlineSource?: (google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource|null); + + /** ImportDocumentsRequest gcsSource. */ + public gcsSource?: (google.cloud.discoveryengine.v1.IGcsSource|null); + + /** ImportDocumentsRequest bigquerySource. */ + public bigquerySource?: (google.cloud.discoveryengine.v1.IBigQuerySource|null); + + /** ImportDocumentsRequest parent. */ + public parent: string; + + /** ImportDocumentsRequest errorConfig. */ + public errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** ImportDocumentsRequest reconciliationMode. */ + public reconciliationMode: (google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode); + + /** ImportDocumentsRequest autoGenerateIds. */ + public autoGenerateIds: boolean; + + /** ImportDocumentsRequest idField. */ + public idField: string; + + /** ImportDocumentsRequest source. */ + public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); + + /** + * Creates a new ImportDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportDocumentsRequest): google.cloud.discoveryengine.v1.ImportDocumentsRequest; + + /** + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportDocumentsRequest; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportDocumentsRequest; + + /** + * Verifies an ImportDocumentsRequest message. + * @param message Plain 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 ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportDocumentsRequest; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @param message ImportDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportDocumentsRequest { + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource documents */ + documents?: (google.cloud.discoveryengine.v1.IDocument[]|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource); + + /** InlineSource documents. */ + public documents: google.cloud.discoveryengine.v1.IDocument[]; + + /** + * Creates a new InlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource): google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource; + + /** + * Verifies an InlineSource message. + * @param message Plain 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 InlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @param message InlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ReconciliationMode enum. */ + enum ReconciliationMode { + RECONCILIATION_MODE_UNSPECIFIED = 0, + INCREMENTAL = 1, + FULL = 2 + } + } + + /** Properties of an ImportDocumentsResponse. */ + interface IImportDocumentsResponse { + + /** ImportDocumentsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ImportDocumentsResponse errorConfig */ + errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + } + + /** Represents an ImportDocumentsResponse. */ + class ImportDocumentsResponse implements IImportDocumentsResponse { + + /** + * Constructs a new ImportDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IImportDocumentsResponse); + + /** ImportDocumentsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ImportDocumentsResponse errorConfig. */ + public errorConfig?: (google.cloud.discoveryengine.v1.IImportErrorConfig|null); + + /** + * Creates a new ImportDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IImportDocumentsResponse): google.cloud.discoveryengine.v1.ImportDocumentsResponse; + + /** + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ImportDocumentsResponse; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ImportDocumentsResponse; + + /** + * Verifies an ImportDocumentsResponse message. + * @param message Plain 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 ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ImportDocumentsResponse; + + /** + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @param message ImportDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ImportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserEvent. */ + interface IUserEvent { + + /** UserEvent eventType */ + eventType?: (string|null); + + /** UserEvent userPseudoId */ + userPseudoId?: (string|null); + + /** UserEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** UserEvent userInfo */ + userInfo?: (google.cloud.discoveryengine.v1.IUserInfo|null); + + /** UserEvent directUserRequest */ + directUserRequest?: (boolean|null); + + /** UserEvent sessionId */ + sessionId?: (string|null); + + /** UserEvent pageInfo */ + pageInfo?: (google.cloud.discoveryengine.v1.IPageInfo|null); + + /** UserEvent attributionToken */ + attributionToken?: (string|null); + + /** UserEvent filter */ + filter?: (string|null); + + /** UserEvent documents */ + documents?: (google.cloud.discoveryengine.v1.IDocumentInfo[]|null); + + /** UserEvent panel */ + panel?: (google.cloud.discoveryengine.v1.IPanelInfo|null); + + /** UserEvent searchInfo */ + searchInfo?: (google.cloud.discoveryengine.v1.ISearchInfo|null); + + /** UserEvent completionInfo */ + completionInfo?: (google.cloud.discoveryengine.v1.ICompletionInfo|null); + + /** UserEvent transactionInfo */ + transactionInfo?: (google.cloud.discoveryengine.v1.ITransactionInfo|null); + + /** UserEvent tagIds */ + tagIds?: (string[]|null); + + /** UserEvent promotionIds */ + promotionIds?: (string[]|null); + + /** UserEvent attributes */ + attributes?: ({ [k: string]: google.cloud.discoveryengine.v1.ICustomAttribute }|null); + + /** UserEvent mediaInfo */ + mediaInfo?: (google.cloud.discoveryengine.v1.IMediaInfo|null); + } + + /** Represents a UserEvent. */ + class UserEvent implements IUserEvent { + + /** + * Constructs a new UserEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IUserEvent); + + /** UserEvent eventType. */ + public eventType: string; + + /** UserEvent userPseudoId. */ + public userPseudoId: string; + + /** UserEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** UserEvent userInfo. */ + public userInfo?: (google.cloud.discoveryengine.v1.IUserInfo|null); + + /** UserEvent directUserRequest. */ + public directUserRequest: boolean; + + /** UserEvent sessionId. */ + public sessionId: string; + + /** UserEvent pageInfo. */ + public pageInfo?: (google.cloud.discoveryengine.v1.IPageInfo|null); + + /** UserEvent attributionToken. */ + public attributionToken: string; + + /** UserEvent filter. */ + public filter: string; + + /** UserEvent documents. */ + public documents: google.cloud.discoveryengine.v1.IDocumentInfo[]; + + /** UserEvent panel. */ + public panel?: (google.cloud.discoveryengine.v1.IPanelInfo|null); + + /** UserEvent searchInfo. */ + public searchInfo?: (google.cloud.discoveryengine.v1.ISearchInfo|null); + + /** UserEvent completionInfo. */ + public completionInfo?: (google.cloud.discoveryengine.v1.ICompletionInfo|null); + + /** UserEvent transactionInfo. */ + public transactionInfo?: (google.cloud.discoveryengine.v1.ITransactionInfo|null); + + /** UserEvent tagIds. */ + public tagIds: string[]; + + /** UserEvent promotionIds. */ + public promotionIds: string[]; + + /** UserEvent attributes. */ + public attributes: { [k: string]: google.cloud.discoveryengine.v1.ICustomAttribute }; + + /** UserEvent mediaInfo. */ + public mediaInfo?: (google.cloud.discoveryengine.v1.IMediaInfo|null); + + /** + * Creates a new UserEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEvent instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IUserEvent): google.cloud.discoveryengine.v1.UserEvent; + + /** + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.discoveryengine.v1.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.UserEvent; + + /** + * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.UserEvent; + + /** + * Verifies a UserEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.UserEvent; + + /** + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @param message UserEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PageInfo. */ + interface IPageInfo { + + /** PageInfo pageviewId */ + pageviewId?: (string|null); + + /** PageInfo pageCategory */ + pageCategory?: (string|null); + + /** PageInfo uri */ + uri?: (string|null); + + /** PageInfo referrerUri */ + referrerUri?: (string|null); + } + + /** Represents a PageInfo. */ + class PageInfo implements IPageInfo { + + /** + * Constructs a new PageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IPageInfo); + + /** PageInfo pageviewId. */ + public pageviewId: string; + + /** PageInfo pageCategory. */ + public pageCategory: string; + + /** PageInfo uri. */ + public uri: string; + + /** PageInfo referrerUri. */ + public referrerUri: string; + + /** + * Creates a new PageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PageInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IPageInfo): google.cloud.discoveryengine.v1.PageInfo; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PageInfo.verify|verify} messages. + * @param message PageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IPageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.PageInfo; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.PageInfo; + + /** + * Verifies a PageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.PageInfo; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @param message PageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.PageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchInfo. */ + interface ISearchInfo { + + /** SearchInfo searchQuery */ + searchQuery?: (string|null); + + /** SearchInfo orderBy */ + orderBy?: (string|null); + + /** SearchInfo offset */ + offset?: (number|null); + } + + /** Represents a SearchInfo. */ + class SearchInfo implements ISearchInfo { + + /** + * Constructs a new SearchInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ISearchInfo); + + /** SearchInfo searchQuery. */ + public searchQuery: string; + + /** SearchInfo orderBy. */ + public orderBy: string; + + /** SearchInfo offset. */ + public offset?: (number|null); + + /** SearchInfo _offset. */ + public _offset?: "offset"; + + /** + * Creates a new SearchInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ISearchInfo): google.cloud.discoveryengine.v1.SearchInfo; + + /** + * Encodes the specified SearchInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchInfo.verify|verify} messages. + * @param message SearchInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ISearchInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchInfo.verify|verify} messages. + * @param message SearchInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ISearchInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchInfo; + + /** + * Decodes a SearchInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchInfo; + + /** + * Verifies a SearchInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchInfo; + + /** + * Creates a plain object from a SearchInfo message. Also converts values to other types if specified. + * @param message SearchInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompletionInfo. */ + interface ICompletionInfo { + + /** CompletionInfo selectedSuggestion */ + selectedSuggestion?: (string|null); + + /** CompletionInfo selectedPosition */ + selectedPosition?: (number|null); + } + + /** Represents a CompletionInfo. */ + class CompletionInfo implements ICompletionInfo { + + /** + * Constructs a new CompletionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICompletionInfo); + + /** CompletionInfo selectedSuggestion. */ + public selectedSuggestion: string; + + /** CompletionInfo selectedPosition. */ + public selectedPosition: number; + + /** + * Creates a new CompletionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICompletionInfo): google.cloud.discoveryengine.v1.CompletionInfo; + + /** + * Encodes the specified CompletionInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompletionInfo.verify|verify} messages. + * @param message CompletionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICompletionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompletionInfo.verify|verify} messages. + * @param message CompletionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICompletionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CompletionInfo; + + /** + * Decodes a CompletionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CompletionInfo; + + /** + * Verifies a CompletionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompletionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CompletionInfo; + + /** + * Creates a plain object from a CompletionInfo message. Also converts values to other types if specified. + * @param message CompletionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CompletionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompletionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionInfo. */ + interface ITransactionInfo { + + /** TransactionInfo value */ + value?: (number|null); + + /** TransactionInfo currency */ + currency?: (string|null); + + /** TransactionInfo transactionId */ + transactionId?: (string|null); + + /** TransactionInfo tax */ + tax?: (number|null); + + /** TransactionInfo cost */ + cost?: (number|null); + + /** TransactionInfo discountValue */ + discountValue?: (number|null); + } + + /** Represents a TransactionInfo. */ + class TransactionInfo implements ITransactionInfo { + + /** + * Constructs a new TransactionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ITransactionInfo); + + /** TransactionInfo value. */ + public value?: (number|null); + + /** TransactionInfo currency. */ + public currency: string; + + /** TransactionInfo transactionId. */ + public transactionId: string; + + /** TransactionInfo tax. */ + public tax?: (number|null); + + /** TransactionInfo cost. */ + public cost?: (number|null); + + /** TransactionInfo discountValue. */ + public discountValue?: (number|null); + + /** TransactionInfo _value. */ + public _value?: "value"; + + /** TransactionInfo _tax. */ + public _tax?: "tax"; + + /** TransactionInfo _cost. */ + public _cost?: "cost"; + + /** TransactionInfo _discountValue. */ + public _discountValue?: "discountValue"; + + /** + * Creates a new TransactionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ITransactionInfo): google.cloud.discoveryengine.v1.TransactionInfo; + + /** + * Encodes the specified TransactionInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.TransactionInfo.verify|verify} messages. + * @param message TransactionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ITransactionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.TransactionInfo.verify|verify} messages. + * @param message TransactionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ITransactionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.TransactionInfo; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.TransactionInfo; + + /** + * Verifies a TransactionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.TransactionInfo; + + /** + * Creates a plain object from a TransactionInfo message. Also converts values to other types if specified. + * @param message TransactionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.TransactionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentInfo. */ + interface IDocumentInfo { + + /** DocumentInfo id */ + id?: (string|null); + + /** DocumentInfo name */ + name?: (string|null); + + /** DocumentInfo quantity */ + quantity?: (number|null); + + /** DocumentInfo promotionIds */ + promotionIds?: (string[]|null); + } + + /** Represents a DocumentInfo. */ + class DocumentInfo implements IDocumentInfo { + + /** + * Constructs a new DocumentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IDocumentInfo); + + /** DocumentInfo id. */ + public id?: (string|null); + + /** DocumentInfo name. */ + public name?: (string|null); + + /** DocumentInfo quantity. */ + public quantity?: (number|null); + + /** DocumentInfo promotionIds. */ + public promotionIds: string[]; + + /** DocumentInfo documentDescriptor. */ + public documentDescriptor?: ("id"|"name"); + + /** DocumentInfo _quantity. */ + public _quantity?: "quantity"; + + /** + * Creates a new DocumentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IDocumentInfo): google.cloud.discoveryengine.v1.DocumentInfo; + + /** + * Encodes the specified DocumentInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.DocumentInfo.verify|verify} messages. + * @param message DocumentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IDocumentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DocumentInfo.verify|verify} messages. + * @param message DocumentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IDocumentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.DocumentInfo; + + /** + * Decodes a DocumentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.DocumentInfo; + + /** + * Verifies a DocumentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.DocumentInfo; + + /** + * Creates a plain object from a DocumentInfo message. Also converts values to other types if specified. + * @param message DocumentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.DocumentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PanelInfo. */ + interface IPanelInfo { + + /** PanelInfo panelId */ + panelId?: (string|null); + + /** PanelInfo displayName */ + displayName?: (string|null); + + /** PanelInfo panelPosition */ + panelPosition?: (number|null); + + /** PanelInfo totalPanels */ + totalPanels?: (number|null); + } + + /** Represents a PanelInfo. */ + class PanelInfo implements IPanelInfo { + + /** + * Constructs a new PanelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IPanelInfo); + + /** PanelInfo panelId. */ + public panelId: string; + + /** PanelInfo displayName. */ + public displayName: string; + + /** PanelInfo panelPosition. */ + public panelPosition?: (number|null); + + /** PanelInfo totalPanels. */ + public totalPanels?: (number|null); + + /** PanelInfo _panelPosition. */ + public _panelPosition?: "panelPosition"; + + /** PanelInfo _totalPanels. */ + public _totalPanels?: "totalPanels"; + + /** + * Creates a new PanelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PanelInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IPanelInfo): google.cloud.discoveryengine.v1.PanelInfo; + + /** + * Encodes the specified PanelInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.PanelInfo.verify|verify} messages. + * @param message PanelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IPanelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PanelInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PanelInfo.verify|verify} messages. + * @param message PanelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IPanelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PanelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PanelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.PanelInfo; + + /** + * Decodes a PanelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PanelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.PanelInfo; + + /** + * Verifies a PanelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PanelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PanelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.PanelInfo; + + /** + * Creates a plain object from a PanelInfo message. Also converts values to other types if specified. + * @param message PanelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.PanelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PanelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PanelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MediaInfo. */ + interface IMediaInfo { + + /** MediaInfo mediaProgressDuration */ + mediaProgressDuration?: (google.protobuf.IDuration|null); + + /** MediaInfo mediaProgressPercentage */ + mediaProgressPercentage?: (number|null); + } + + /** Represents a MediaInfo. */ + class MediaInfo implements IMediaInfo { + + /** + * Constructs a new MediaInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IMediaInfo); + + /** MediaInfo mediaProgressDuration. */ + public mediaProgressDuration?: (google.protobuf.IDuration|null); + + /** MediaInfo mediaProgressPercentage. */ + public mediaProgressPercentage?: (number|null); + + /** MediaInfo _mediaProgressPercentage. */ + public _mediaProgressPercentage?: "mediaProgressPercentage"; + + /** + * Creates a new MediaInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MediaInfo instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IMediaInfo): google.cloud.discoveryengine.v1.MediaInfo; + + /** + * Encodes the specified MediaInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.MediaInfo.verify|verify} messages. + * @param message MediaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IMediaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MediaInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.MediaInfo.verify|verify} messages. + * @param message MediaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IMediaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MediaInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MediaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.MediaInfo; + + /** + * Decodes a MediaInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MediaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.MediaInfo; + + /** + * Verifies a MediaInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MediaInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MediaInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.MediaInfo; + + /** + * Creates a plain object from a MediaInfo message. Also converts values to other types if specified. + * @param message MediaInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.MediaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MediaInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MediaInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeDocumentsRequest. */ + interface IPurgeDocumentsRequest { + + /** PurgeDocumentsRequest parent */ + parent?: (string|null); + + /** PurgeDocumentsRequest filter */ + filter?: (string|null); + + /** PurgeDocumentsRequest force */ + force?: (boolean|null); + } + + /** Represents a PurgeDocumentsRequest. */ + class PurgeDocumentsRequest implements IPurgeDocumentsRequest { + + /** + * Constructs a new PurgeDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest); + + /** PurgeDocumentsRequest parent. */ + public parent: string; + + /** PurgeDocumentsRequest filter. */ + public filter: string; + + /** PurgeDocumentsRequest force. */ + public force: boolean; + + /** + * Creates a new PurgeDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeDocumentsRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest): google.cloud.discoveryengine.v1.PurgeDocumentsRequest; + + /** + * Encodes the specified PurgeDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsRequest.verify|verify} messages. + * @param message PurgeDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsRequest.verify|verify} messages. + * @param message PurgeDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.PurgeDocumentsRequest; + + /** + * Decodes a PurgeDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.PurgeDocumentsRequest; + + /** + * Verifies a PurgeDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.PurgeDocumentsRequest; + + /** + * Creates a plain object from a PurgeDocumentsRequest message. Also converts values to other types if specified. + * @param message PurgeDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.PurgeDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeDocumentsResponse. */ + interface IPurgeDocumentsResponse { + + /** PurgeDocumentsResponse purgeCount */ + purgeCount?: (number|Long|string|null); + + /** PurgeDocumentsResponse purgeSample */ + purgeSample?: (string[]|null); + } + + /** Represents a PurgeDocumentsResponse. */ + class PurgeDocumentsResponse implements IPurgeDocumentsResponse { + + /** + * Constructs a new PurgeDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsResponse); + + /** PurgeDocumentsResponse purgeCount. */ + public purgeCount: (number|Long|string); + + /** PurgeDocumentsResponse purgeSample. */ + public purgeSample: string[]; + + /** + * Creates a new PurgeDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeDocumentsResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsResponse): google.cloud.discoveryengine.v1.PurgeDocumentsResponse; + + /** + * Encodes the specified PurgeDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsResponse.verify|verify} messages. + * @param message PurgeDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsResponse.verify|verify} messages. + * @param message PurgeDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.PurgeDocumentsResponse; + + /** + * Decodes a PurgeDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.PurgeDocumentsResponse; + + /** + * Verifies a PurgeDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.PurgeDocumentsResponse; + + /** + * Creates a plain object from a PurgeDocumentsResponse message. Also converts values to other types if specified. + * @param message PurgeDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.PurgeDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeDocumentsMetadata. */ + interface IPurgeDocumentsMetadata { + + /** PurgeDocumentsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeDocumentsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeDocumentsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** PurgeDocumentsMetadata failureCount */ + failureCount?: (number|Long|string|null); + } + + /** Represents a PurgeDocumentsMetadata. */ + class PurgeDocumentsMetadata implements IPurgeDocumentsMetadata { + + /** + * Constructs a new PurgeDocumentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata); + + /** PurgeDocumentsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeDocumentsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeDocumentsMetadata successCount. */ + public successCount: (number|Long|string); + + /** PurgeDocumentsMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** + * Creates a new PurgeDocumentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeDocumentsMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata): google.cloud.discoveryengine.v1.PurgeDocumentsMetadata; + + /** + * Encodes the specified PurgeDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsMetadata.verify|verify} messages. + * @param message PurgeDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsMetadata.verify|verify} messages. + * @param message PurgeDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeDocumentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.PurgeDocumentsMetadata; + + /** + * Decodes a PurgeDocumentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.PurgeDocumentsMetadata; + + /** + * Verifies a PurgeDocumentsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeDocumentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.PurgeDocumentsMetadata; + + /** + * Creates a plain object from a PurgeDocumentsMetadata message. Also converts values to other types if specified. + * @param message PurgeDocumentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.PurgeDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeDocumentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeDocumentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema structSchema */ + structSchema?: (google.protobuf.IStruct|null); + + /** Schema jsonSchema */ + jsonSchema?: (string|null); + + /** Schema name */ + name?: (string|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ISchema); + + /** Schema structSchema. */ + public structSchema?: (google.protobuf.IStruct|null); + + /** Schema jsonSchema. */ + public jsonSchema?: (string|null); + + /** Schema name. */ + public name: string; + + /** Schema schema. */ + public schema?: ("structSchema"|"jsonSchema"); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ISchema): google.cloud.discoveryengine.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.discoveryengine.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SchemaService */ + class SchemaService extends $protobuf.rpc.Service { + + /** + * Constructs a new SchemaService 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 SchemaService 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): SchemaService; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schema + */ + public getSchema(request: google.cloud.discoveryengine.v1.IGetSchemaRequest, callback: google.cloud.discoveryengine.v1.SchemaService.GetSchemaCallback): void; + + /** + * Calls GetSchema. + * @param request GetSchemaRequest message or plain object + * @returns Promise + */ + public getSchema(request: google.cloud.discoveryengine.v1.IGetSchemaRequest): Promise; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchemasResponse + */ + public listSchemas(request: google.cloud.discoveryengine.v1.IListSchemasRequest, callback: google.cloud.discoveryengine.v1.SchemaService.ListSchemasCallback): void; + + /** + * Calls ListSchemas. + * @param request ListSchemasRequest message or plain object + * @returns Promise + */ + public listSchemas(request: google.cloud.discoveryengine.v1.IListSchemasRequest): Promise; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSchema(request: google.cloud.discoveryengine.v1.ICreateSchemaRequest, callback: google.cloud.discoveryengine.v1.SchemaService.CreateSchemaCallback): void; + + /** + * Calls CreateSchema. + * @param request CreateSchemaRequest message or plain object + * @returns Promise + */ + public createSchema(request: google.cloud.discoveryengine.v1.ICreateSchemaRequest): Promise; + + /** + * Calls UpdateSchema. + * @param request UpdateSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSchema(request: google.cloud.discoveryengine.v1.IUpdateSchemaRequest, callback: google.cloud.discoveryengine.v1.SchemaService.UpdateSchemaCallback): void; + + /** + * Calls UpdateSchema. + * @param request UpdateSchemaRequest message or plain object + * @returns Promise + */ + public updateSchema(request: google.cloud.discoveryengine.v1.IUpdateSchemaRequest): Promise; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSchema(request: google.cloud.discoveryengine.v1.IDeleteSchemaRequest, callback: google.cloud.discoveryengine.v1.SchemaService.DeleteSchemaCallback): void; + + /** + * Calls DeleteSchema. + * @param request DeleteSchemaRequest message or plain object + * @returns Promise + */ + public deleteSchema(request: google.cloud.discoveryengine.v1.IDeleteSchemaRequest): Promise; + } + + namespace SchemaService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|getSchema}. + * @param error Error, if any + * @param [response] Schema + */ + type GetSchemaCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.Schema) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|listSchemas}. + * @param error Error, if any + * @param [response] ListSchemasResponse + */ + type ListSchemasCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.ListSchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|createSchema}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSchemaCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|updateSchema}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSchemaCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|deleteSchema}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSchemaCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a GetSchemaRequest. */ + interface IGetSchemaRequest { + + /** GetSchemaRequest name */ + name?: (string|null); + } + + /** Represents a GetSchemaRequest. */ + class GetSchemaRequest implements IGetSchemaRequest { + + /** + * Constructs a new GetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IGetSchemaRequest); + + /** GetSchemaRequest name. */ + public name: string; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IGetSchemaRequest): google.cloud.discoveryengine.v1.GetSchemaRequest; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.GetSchemaRequest; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.GetSchemaRequest; + + /** + * Verifies a GetSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.GetSchemaRequest; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @param message GetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.GetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasRequest. */ + interface IListSchemasRequest { + + /** ListSchemasRequest parent */ + parent?: (string|null); + + /** ListSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListSchemasRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSchemasRequest. */ + class ListSchemasRequest implements IListSchemasRequest { + + /** + * Constructs a new ListSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IListSchemasRequest); + + /** ListSchemasRequest parent. */ + public parent: string; + + /** ListSchemasRequest pageSize. */ + public pageSize: number; + + /** ListSchemasRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IListSchemasRequest): google.cloud.discoveryengine.v1.ListSchemasRequest; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasRequest.verify|verify} messages. + * @param message ListSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IListSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ListSchemasRequest; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ListSchemasRequest; + + /** + * Verifies a ListSchemasRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ListSchemasRequest; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @param message ListSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ListSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchemasResponse. */ + interface IListSchemasResponse { + + /** ListSchemasResponse schemas */ + schemas?: (google.cloud.discoveryengine.v1.ISchema[]|null); + + /** ListSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchemasResponse. */ + class ListSchemasResponse implements IListSchemasResponse { + + /** + * Constructs a new ListSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IListSchemasResponse); + + /** ListSchemasResponse schemas. */ + public schemas: google.cloud.discoveryengine.v1.ISchema[]; + + /** ListSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchemasResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IListSchemasResponse): google.cloud.discoveryengine.v1.ListSchemasResponse; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasResponse.verify|verify} messages. + * @param message ListSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IListSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.ListSchemasResponse; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.ListSchemasResponse; + + /** + * Verifies a ListSchemasResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.ListSchemasResponse; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @param message ListSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.ListSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaRequest. */ + interface ICreateSchemaRequest { + + /** CreateSchemaRequest parent */ + parent?: (string|null); + + /** CreateSchemaRequest schema */ + schema?: (google.cloud.discoveryengine.v1.ISchema|null); + + /** CreateSchemaRequest schemaId */ + schemaId?: (string|null); + } + + /** Represents a CreateSchemaRequest. */ + class CreateSchemaRequest implements ICreateSchemaRequest { + + /** + * Constructs a new CreateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICreateSchemaRequest); + + /** CreateSchemaRequest parent. */ + public parent: string; + + /** CreateSchemaRequest schema. */ + public schema?: (google.cloud.discoveryengine.v1.ISchema|null); + + /** CreateSchemaRequest schemaId. */ + public schemaId: string; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICreateSchemaRequest): google.cloud.discoveryengine.v1.CreateSchemaRequest; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaRequest.verify|verify} messages. + * @param message CreateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICreateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CreateSchemaRequest; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CreateSchemaRequest; + + /** + * Verifies a CreateSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CreateSchemaRequest; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @param message CreateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CreateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaRequest. */ + interface IUpdateSchemaRequest { + + /** UpdateSchemaRequest schema */ + schema?: (google.cloud.discoveryengine.v1.ISchema|null); + + /** UpdateSchemaRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateSchemaRequest. */ + class UpdateSchemaRequest implements IUpdateSchemaRequest { + + /** + * Constructs a new UpdateSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IUpdateSchemaRequest); + + /** UpdateSchemaRequest schema. */ + public schema?: (google.cloud.discoveryengine.v1.ISchema|null); + + /** UpdateSchemaRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IUpdateSchemaRequest): google.cloud.discoveryengine.v1.UpdateSchemaRequest; + + /** + * Encodes the specified UpdateSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaRequest.verify|verify} messages. + * @param message UpdateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IUpdateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaRequest.verify|verify} messages. + * @param message UpdateSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IUpdateSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.UpdateSchemaRequest; + + /** + * Decodes an UpdateSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.UpdateSchemaRequest; + + /** + * Verifies an UpdateSchemaRequest message. + * @param message Plain 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 UpdateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.UpdateSchemaRequest; + + /** + * Creates a plain object from an UpdateSchemaRequest message. Also converts values to other types if specified. + * @param message UpdateSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.UpdateSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaRequest. */ + interface IDeleteSchemaRequest { + + /** DeleteSchemaRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSchemaRequest. */ + class DeleteSchemaRequest implements IDeleteSchemaRequest { + + /** + * Constructs a new DeleteSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IDeleteSchemaRequest); + + /** DeleteSchemaRequest name. */ + public name: string; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IDeleteSchemaRequest): google.cloud.discoveryengine.v1.DeleteSchemaRequest; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaRequest.verify|verify} messages. + * @param message DeleteSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IDeleteSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.DeleteSchemaRequest; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.DeleteSchemaRequest; + + /** + * Verifies a DeleteSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.DeleteSchemaRequest; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @param message DeleteSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.DeleteSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSchemaMetadata. */ + interface ICreateSchemaMetadata { + + /** CreateSchemaMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateSchemaMetadata. */ + class CreateSchemaMetadata implements ICreateSchemaMetadata { + + /** + * Constructs a new CreateSchemaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICreateSchemaMetadata); + + /** CreateSchemaMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateSchemaMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateSchemaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSchemaMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICreateSchemaMetadata): google.cloud.discoveryengine.v1.CreateSchemaMetadata; + + /** + * Encodes the specified CreateSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaMetadata.verify|verify} messages. + * @param message CreateSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICreateSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaMetadata.verify|verify} messages. + * @param message CreateSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICreateSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSchemaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CreateSchemaMetadata; + + /** + * Decodes a CreateSchemaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CreateSchemaMetadata; + + /** + * Verifies a CreateSchemaMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSchemaMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CreateSchemaMetadata; + + /** + * Creates a plain object from a CreateSchemaMetadata message. Also converts values to other types if specified. + * @param message CreateSchemaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CreateSchemaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSchemaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSchemaMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSchemaMetadata. */ + interface IUpdateSchemaMetadata { + + /** UpdateSchemaMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateSchemaMetadata. */ + class UpdateSchemaMetadata implements IUpdateSchemaMetadata { + + /** + * Constructs a new UpdateSchemaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IUpdateSchemaMetadata); + + /** UpdateSchemaMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateSchemaMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateSchemaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSchemaMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IUpdateSchemaMetadata): google.cloud.discoveryengine.v1.UpdateSchemaMetadata; + + /** + * Encodes the specified UpdateSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaMetadata.verify|verify} messages. + * @param message UpdateSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IUpdateSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaMetadata.verify|verify} messages. + * @param message UpdateSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IUpdateSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSchemaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.UpdateSchemaMetadata; + + /** + * Decodes an UpdateSchemaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.UpdateSchemaMetadata; + + /** + * Verifies an UpdateSchemaMetadata message. + * @param message Plain 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 UpdateSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSchemaMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.UpdateSchemaMetadata; + + /** + * Creates a plain object from an UpdateSchemaMetadata message. Also converts values to other types if specified. + * @param message UpdateSchemaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.UpdateSchemaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSchemaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSchemaMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSchemaMetadata. */ + interface IDeleteSchemaMetadata { + + /** DeleteSchemaMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteSchemaMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteSchemaMetadata. */ + class DeleteSchemaMetadata implements IDeleteSchemaMetadata { + + /** + * Constructs a new DeleteSchemaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IDeleteSchemaMetadata); + + /** DeleteSchemaMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteSchemaMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteSchemaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSchemaMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IDeleteSchemaMetadata): google.cloud.discoveryengine.v1.DeleteSchemaMetadata; + + /** + * Encodes the specified DeleteSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaMetadata.verify|verify} messages. + * @param message DeleteSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IDeleteSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaMetadata.verify|verify} messages. + * @param message DeleteSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IDeleteSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSchemaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.DeleteSchemaMetadata; + + /** + * Decodes a DeleteSchemaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.DeleteSchemaMetadata; + + /** + * Verifies a DeleteSchemaMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSchemaMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.DeleteSchemaMetadata; + + /** + * Creates a plain object from a DeleteSchemaMetadata message. Also converts values to other types if specified. + * @param message DeleteSchemaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.DeleteSchemaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSchemaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSchemaMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SearchService */ + class SearchService extends $protobuf.rpc.Service { + + /** + * Constructs a new SearchService 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 SearchService 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): SearchService; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResponse + */ + public search(request: google.cloud.discoveryengine.v1.ISearchRequest, callback: google.cloud.discoveryengine.v1.SearchService.SearchCallback): void; + + /** + * Calls Search. + * @param request SearchRequest message or plain object + * @returns Promise + */ + public search(request: google.cloud.discoveryengine.v1.ISearchRequest): Promise; + } + + namespace SearchService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SearchService|search}. + * @param error Error, if any + * @param [response] SearchResponse + */ + type SearchCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.SearchResponse) => void; + } + + /** Properties of a SearchRequest. */ + interface ISearchRequest { + + /** SearchRequest servingConfig */ + servingConfig?: (string|null); + + /** SearchRequest branch */ + branch?: (string|null); + + /** SearchRequest query */ + query?: (string|null); + + /** SearchRequest pageSize */ + pageSize?: (number|null); + + /** SearchRequest pageToken */ + pageToken?: (string|null); + + /** SearchRequest offset */ + offset?: (number|null); + + /** SearchRequest userInfo */ + userInfo?: (google.cloud.discoveryengine.v1.IUserInfo|null); + + /** SearchRequest params */ + params?: ({ [k: string]: google.protobuf.IValue }|null); + + /** SearchRequest queryExpansionSpec */ + queryExpansionSpec?: (google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest spellCorrectionSpec */ + spellCorrectionSpec?: (google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec|null); + + /** SearchRequest userPseudoId */ + userPseudoId?: (string|null); + + /** SearchRequest contentSearchSpec */ + contentSearchSpec?: (google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec|null); + + /** SearchRequest safeSearch */ + safeSearch?: (boolean|null); + + /** SearchRequest userLabels */ + userLabels?: ({ [k: string]: string }|null); + } + + /** Represents a SearchRequest. */ + class SearchRequest implements ISearchRequest { + + /** + * Constructs a new SearchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ISearchRequest); + + /** SearchRequest servingConfig. */ + public servingConfig: string; + + /** SearchRequest branch. */ + public branch: string; + + /** SearchRequest query. */ + public query: string; + + /** SearchRequest pageSize. */ + public pageSize: number; + + /** SearchRequest pageToken. */ + public pageToken: string; + + /** SearchRequest offset. */ + public offset: number; + + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.discoveryengine.v1.IUserInfo|null); + + /** SearchRequest params. */ + public params: { [k: string]: google.protobuf.IValue }; + + /** SearchRequest queryExpansionSpec. */ + public queryExpansionSpec?: (google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec|null); + + /** SearchRequest spellCorrectionSpec. */ + public spellCorrectionSpec?: (google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec|null); + + /** SearchRequest userPseudoId. */ + public userPseudoId: string; + + /** SearchRequest contentSearchSpec. */ + public contentSearchSpec?: (google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec|null); + + /** SearchRequest safeSearch. */ + public safeSearch: boolean; + + /** SearchRequest userLabels. */ + public userLabels: { [k: string]: string }; + + /** + * Creates a new SearchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ISearchRequest): google.cloud.discoveryengine.v1.SearchRequest; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchRequest; + + /** + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchRequest; + + /** + * Verifies a SearchRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchRequest; + + /** + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @param message SearchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchRequest { + + /** Properties of a QueryExpansionSpec. */ + interface IQueryExpansionSpec { + + /** QueryExpansionSpec condition */ + condition?: (google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition|null); + } + + /** Represents a QueryExpansionSpec. */ + class QueryExpansionSpec implements IQueryExpansionSpec { + + /** + * Constructs a new QueryExpansionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec); + + /** QueryExpansionSpec condition. */ + public condition: (google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition); + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec): google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec; + + /** + * Verifies a QueryExpansionSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec; + + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @param message QueryExpansionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryExpansionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryExpansionSpec { + + /** Condition enum. */ + enum Condition { + CONDITION_UNSPECIFIED = 0, + DISABLED = 1, + AUTO = 2 + } + } + + /** Properties of a SpellCorrectionSpec. */ + interface ISpellCorrectionSpec { + + /** SpellCorrectionSpec mode */ + mode?: (google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode|null); + } + + /** Represents a SpellCorrectionSpec. */ + class SpellCorrectionSpec implements ISpellCorrectionSpec { + + /** + * Constructs a new SpellCorrectionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec); + + /** SpellCorrectionSpec mode. */ + public mode: (google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode); + + /** + * Creates a new SpellCorrectionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns SpellCorrectionSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec): google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec; + + /** + * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @param message SpellCorrectionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @param message SpellCorrectionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec; + + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec; + + /** + * Verifies a SpellCorrectionSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpellCorrectionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec; + + /** + * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. + * @param message SpellCorrectionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpellCorrectionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpellCorrectionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpellCorrectionSpec { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + SUGGESTION_ONLY = 1, + AUTO = 2 + } + } + + /** Properties of a ContentSearchSpec. */ + interface IContentSearchSpec { + + /** ContentSearchSpec snippetSpec */ + snippetSpec?: (google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec|null); + } + + /** Represents a ContentSearchSpec. */ + class ContentSearchSpec implements IContentSearchSpec { + + /** + * Constructs a new ContentSearchSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec); + + /** ContentSearchSpec snippetSpec. */ + public snippetSpec?: (google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec|null); + + /** + * Creates a new ContentSearchSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentSearchSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec; + + /** + * Encodes the specified ContentSearchSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.verify|verify} messages. + * @param message ContentSearchSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentSearchSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.verify|verify} messages. + * @param message ContentSearchSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentSearchSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentSearchSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec; + + /** + * Decodes a ContentSearchSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentSearchSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec; + + /** + * Verifies a ContentSearchSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentSearchSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentSearchSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec; + + /** + * Creates a plain object from a ContentSearchSpec message. Also converts values to other types if specified. + * @param message ContentSearchSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentSearchSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentSearchSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentSearchSpec { + + /** Properties of a SnippetSpec. */ + interface ISnippetSpec { + + /** SnippetSpec maxSnippetCount */ + maxSnippetCount?: (number|null); + + /** SnippetSpec referenceOnly */ + referenceOnly?: (boolean|null); + } + + /** Represents a SnippetSpec. */ + class SnippetSpec implements ISnippetSpec { + + /** + * Constructs a new SnippetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec); + + /** SnippetSpec maxSnippetCount. */ + public maxSnippetCount: number; + + /** SnippetSpec referenceOnly. */ + public referenceOnly: boolean; + + /** + * Creates a new SnippetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns SnippetSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec; + + /** + * Encodes the specified SnippetSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.verify|verify} messages. + * @param message SnippetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnippetSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.verify|verify} messages. + * @param message SnippetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnippetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnippetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec; + + /** + * Decodes a SnippetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnippetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec; + + /** + * Verifies a SnippetSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnippetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnippetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec; + + /** + * Creates a plain object from a SnippetSpec message. Also converts values to other types if specified. + * @param message SnippetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnippetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnippetSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a SearchResponse. */ + interface ISearchResponse { + + /** SearchResponse results */ + results?: (google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[]|null); + + /** SearchResponse totalSize */ + totalSize?: (number|null); + + /** SearchResponse attributionToken */ + attributionToken?: (string|null); + + /** SearchResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchResponse correctedQuery */ + correctedQuery?: (string|null); + } + + /** Represents a SearchResponse. */ + class SearchResponse implements ISearchResponse { + + /** + * Constructs a new SearchResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ISearchResponse); + + /** SearchResponse results. */ + public results: google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[]; + + /** SearchResponse totalSize. */ + public totalSize: number; + + /** SearchResponse attributionToken. */ + public attributionToken: string; + + /** SearchResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchResponse correctedQuery. */ + public correctedQuery: string; + + /** + * Creates a new SearchResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ISearchResponse): google.cloud.discoveryengine.v1.SearchResponse; + + /** + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchResponse; + + /** + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchResponse; + + /** + * Verifies a SearchResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchResponse; + + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @param message SearchResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchResponse { + + /** Properties of a SearchResult. */ + interface ISearchResult { + + /** SearchResult id */ + id?: (string|null); + + /** SearchResult document */ + document?: (google.cloud.discoveryengine.v1.IDocument|null); + } + + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { + + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.SearchResponse.ISearchResult); + + /** SearchResult id. */ + public id: string; + + /** SearchResult document. */ + public document?: (google.cloud.discoveryengine.v1.IDocument|null); + + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.SearchResponse.ISearchResult): google.cloud.discoveryengine.v1.SearchResponse.SearchResult; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.SearchResponse.SearchResult; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.SearchResponse.SearchResult; + + /** + * Verifies a SearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.SearchResponse.SearchResult; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a UserEventService */ + class UserEventService extends $protobuf.rpc.Service { + + /** + * Constructs a new UserEventService 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 UserEventService 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): UserEventService; + + /** + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UserEvent + */ + public writeUserEvent(request: google.cloud.discoveryengine.v1.IWriteUserEventRequest, callback: google.cloud.discoveryengine.v1.UserEventService.WriteUserEventCallback): void; + + /** + * Calls WriteUserEvent. + * @param request WriteUserEventRequest message or plain object + * @returns Promise + */ + public writeUserEvent(request: google.cloud.discoveryengine.v1.IWriteUserEventRequest): Promise; + + /** + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public collectUserEvent(request: google.cloud.discoveryengine.v1.ICollectUserEventRequest, callback: google.cloud.discoveryengine.v1.UserEventService.CollectUserEventCallback): void; + + /** + * Calls CollectUserEvent. + * @param request CollectUserEventRequest message or plain object + * @returns Promise + */ + public collectUserEvent(request: google.cloud.discoveryengine.v1.ICollectUserEventRequest): Promise; + + /** + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importUserEvents(request: google.cloud.discoveryengine.v1.IImportUserEventsRequest, callback: google.cloud.discoveryengine.v1.UserEventService.ImportUserEventsCallback): void; + + /** + * Calls ImportUserEvents. + * @param request ImportUserEventsRequest message or plain object + * @returns Promise + */ + public importUserEvents(request: google.cloud.discoveryengine.v1.IImportUserEventsRequest): Promise; + } + + namespace UserEventService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|writeUserEvent}. + * @param error Error, if any + * @param [response] UserEvent + */ + type WriteUserEventCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1.UserEvent) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|collectUserEvent}. + * @param error Error, if any + * @param [response] HttpBody + */ + type CollectUserEventCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|importUserEvents}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportUserEventsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a WriteUserEventRequest. */ + interface IWriteUserEventRequest { + + /** WriteUserEventRequest parent */ + parent?: (string|null); + + /** WriteUserEventRequest userEvent */ + userEvent?: (google.cloud.discoveryengine.v1.IUserEvent|null); + } + + /** Represents a WriteUserEventRequest. */ + class WriteUserEventRequest implements IWriteUserEventRequest { + + /** + * Constructs a new WriteUserEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.IWriteUserEventRequest); + + /** WriteUserEventRequest parent. */ + public parent: string; + + /** WriteUserEventRequest userEvent. */ + public userEvent?: (google.cloud.discoveryengine.v1.IUserEvent|null); + + /** WriteUserEventRequest _userEvent. */ + public _userEvent?: "userEvent"; + + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteUserEventRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.IWriteUserEventRequest): google.cloud.discoveryengine.v1.WriteUserEventRequest; + + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.WriteUserEventRequest.verify|verify} messages. + * @param message WriteUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.IWriteUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.WriteUserEventRequest; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.WriteUserEventRequest; + + /** + * Verifies a WriteUserEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteUserEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.WriteUserEventRequest; + + /** + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * @param message WriteUserEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.WriteUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteUserEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteUserEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CollectUserEventRequest. */ + interface ICollectUserEventRequest { + + /** CollectUserEventRequest parent */ + parent?: (string|null); + + /** CollectUserEventRequest userEvent */ + userEvent?: (string|null); + + /** CollectUserEventRequest uri */ + uri?: (string|null); + + /** CollectUserEventRequest ets */ + ets?: (number|Long|string|null); + } + + /** Represents a CollectUserEventRequest. */ + class CollectUserEventRequest implements ICollectUserEventRequest { + + /** + * Constructs a new CollectUserEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1.ICollectUserEventRequest); + + /** CollectUserEventRequest parent. */ + public parent: string; + + /** CollectUserEventRequest userEvent. */ + public userEvent: string; + + /** CollectUserEventRequest uri. */ + public uri?: (string|null); + + /** CollectUserEventRequest ets. */ + public ets?: (number|Long|string|null); + + /** CollectUserEventRequest _uri. */ + public _uri?: "uri"; + + /** CollectUserEventRequest _ets. */ + public _ets?: "ets"; + + /** + * Creates a new CollectUserEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CollectUserEventRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1.ICollectUserEventRequest): google.cloud.discoveryengine.v1.CollectUserEventRequest; + + /** + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CollectUserEventRequest.verify|verify} messages. + * @param message CollectUserEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1.ICollectUserEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1.CollectUserEventRequest; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1.CollectUserEventRequest; + + /** + * Verifies a CollectUserEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CollectUserEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1.CollectUserEventRequest; + + /** + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. + * @param message CollectUserEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1.CollectUserEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CollectUserEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CollectUserEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace v1beta. */ namespace v1beta { @@ -2678,6 +9237,12 @@ export namespace google { /** ImportDocumentsRequest reconciliationMode */ reconciliationMode?: (google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode|null); + + /** ImportDocumentsRequest autoGenerateIds */ + autoGenerateIds?: (boolean|null); + + /** ImportDocumentsRequest idField */ + idField?: (string|null); } /** Represents an ImportDocumentsRequest. */ @@ -2707,6 +9272,12 @@ export namespace google { /** ImportDocumentsRequest reconciliationMode. */ public reconciliationMode: (google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode); + /** ImportDocumentsRequest autoGenerateIds. */ + public autoGenerateIds: boolean; + + /** ImportDocumentsRequest idField. */ + public idField: string; + /** ImportDocumentsRequest source. */ public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); @@ -5986,6 +12557,9 @@ export namespace google { /** SearchRequest orderBy */ orderBy?: (string|null); + /** SearchRequest userInfo */ + userInfo?: (google.cloud.discoveryengine.v1beta.IUserInfo|null); + /** SearchRequest facetSpecs */ facetSpecs?: (google.cloud.discoveryengine.v1beta.SearchRequest.IFacetSpec[]|null); @@ -6006,6 +12580,12 @@ export namespace google { /** SearchRequest contentSearchSpec */ contentSearchSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.IContentSearchSpec|null); + + /** SearchRequest safeSearch */ + safeSearch?: (boolean|null); + + /** SearchRequest userLabels */ + userLabels?: ({ [k: string]: string }|null); } /** Represents a SearchRequest. */ @@ -6041,6 +12621,9 @@ export namespace google { /** SearchRequest orderBy. */ public orderBy: string; + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.discoveryengine.v1beta.IUserInfo|null); + /** SearchRequest facetSpecs. */ public facetSpecs: google.cloud.discoveryengine.v1beta.SearchRequest.IFacetSpec[]; @@ -6062,6 +12645,12 @@ export namespace google { /** SearchRequest contentSearchSpec. */ public contentSearchSpec?: (google.cloud.discoveryengine.v1beta.SearchRequest.IContentSearchSpec|null); + /** SearchRequest safeSearch. */ + public safeSearch: boolean; + + /** SearchRequest userLabels. */ + public userLabels: { [k: string]: string }; + /** * Creates a new SearchRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-discoveryengine/protos/protos.js b/packages/google-cloud-discoveryengine/protos/protos.js index 429ecb93d6e1..ef84e523ed48 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.js +++ b/packages/google-cloud-discoveryengine/protos/protos.js @@ -57,6 +57,15900 @@ */ var discoveryengine = {}; + discoveryengine.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.discoveryengine + * @namespace + */ + var v1 = {}; + + v1.CustomAttribute = (function() { + + /** + * Properties of a CustomAttribute. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICustomAttribute + * @property {Array.|null} [text] CustomAttribute text + * @property {Array.|null} [numbers] CustomAttribute numbers + */ + + /** + * Constructs a new CustomAttribute. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute + * @constructor + * @param {google.cloud.discoveryengine.v1.ICustomAttribute=} [properties] Properties to set + */ + function CustomAttribute(properties) { + this.text = []; + this.numbers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAttribute text. + * @member {Array.} text + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.text = $util.emptyArray; + + /** + * CustomAttribute numbers. + * @member {Array.} numbers + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.numbers = $util.emptyArray; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {google.cloud.discoveryengine.v1.ICustomAttribute=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CustomAttribute} CustomAttribute instance + */ + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); + }; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.discoveryengine.v1.CustomAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {google.cloud.discoveryengine.v1.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + if (message.numbers != null && message.numbers.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.numbers.length; ++i) + writer.double(message.numbers[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CustomAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {google.cloud.discoveryengine.v1.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CustomAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + } + case 2: { + if (!(message.numbers && message.numbers.length)) + message.numbers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.numbers.push(reader.double()); + } else + message.numbers.push(reader.double()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAttribute message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + if (message.numbers != null && message.hasOwnProperty("numbers")) { + if (!Array.isArray(message.numbers)) + return "numbers: array expected"; + for (var i = 0; i < message.numbers.length; ++i) + if (typeof message.numbers[i] !== "number") + return "numbers: number[] expected"; + } + return null; + }; + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CustomAttribute} CustomAttribute + */ + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CustomAttribute) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CustomAttribute(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.discoveryengine.v1.CustomAttribute.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + if (object.numbers) { + if (!Array.isArray(object.numbers)) + throw TypeError(".google.cloud.discoveryengine.v1.CustomAttribute.numbers: array expected"); + message.numbers = []; + for (var i = 0; i < object.numbers.length; ++i) + message.numbers[i] = Number(object.numbers[i]); + } + return message; + }; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {google.cloud.discoveryengine.v1.CustomAttribute} message CustomAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.text = []; + object.numbers = []; + } + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + if (message.numbers && message.numbers.length) { + object.numbers = []; + for (var j = 0; j < message.numbers.length; ++j) + object.numbers[j] = options.json && !isFinite(message.numbers[j]) ? String(message.numbers[j]) : message.numbers[j]; + } + return object; + }; + + /** + * Converts this CustomAttribute to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @instance + * @returns {Object.} JSON object + */ + CustomAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAttribute + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CustomAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CustomAttribute"; + }; + + return CustomAttribute; + })(); + + v1.UserInfo = (function() { + + /** + * Properties of a UserInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface IUserInfo + * @property {string|null} [userId] UserInfo userId + * @property {string|null} [userAgent] UserInfo userAgent + */ + + /** + * Constructs a new UserInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a UserInfo. + * @implements IUserInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.IUserInfo=} [properties] Properties to set + */ + function UserInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserInfo userId. + * @member {string} userId + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @instance + */ + UserInfo.prototype.userId = ""; + + /** + * UserInfo userAgent. + * @member {string} userAgent + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @instance + */ + UserInfo.prototype.userAgent = ""; + + /** + * Creates a new UserInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {google.cloud.discoveryengine.v1.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.UserInfo} UserInfo instance + */ + UserInfo.create = function create(properties) { + return new UserInfo(properties); + }; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.UserInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {google.cloud.discoveryengine.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userId); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userAgent); + return writer; + }; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UserInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {google.cloud.discoveryengine.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.UserInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userId = reader.string(); + break; + } + case 2: { + message.userAgent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + return null; + }; + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.UserInfo} UserInfo + */ + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.UserInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.UserInfo(); + if (object.userId != null) + message.userId = String(object.userId); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + return message; + }; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {google.cloud.discoveryengine.v1.UserInfo} message UserInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userId = ""; + object.userAgent = ""; + } + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + return object; + }; + + /** + * Converts this UserInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @instance + * @returns {Object.} JSON object + */ + UserInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.UserInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.UserInfo"; + }; + + return UserInfo; + })(); + + v1.CompletionService = (function() { + + /** + * Constructs a new CompletionService service. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CompletionService + * @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 CompletionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; + + /** + * Creates new CompletionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1.CompletionService + * @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 {CompletionService} RPC service. Useful where requests and/or responses are streamed. + */ + CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.CompletionService|completeQuery}. + * @memberof google.cloud.discoveryengine.v1.CompletionService + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse} [response] CompleteQueryResponse + */ + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.discoveryengine.v1.CompletionService + * @instance + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.discoveryengine.v1.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.discoveryengine.v1.CompleteQueryRequest, $root.google.cloud.discoveryengine.v1.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.discoveryengine.v1.CompletionService + * @instance + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompletionService; + })(); + + v1.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICompleteQueryRequest + * @property {string|null} [dataStore] CompleteQueryRequest dataStore + * @property {string|null} [query] CompleteQueryRequest query + * @property {string|null} [queryModel] CompleteQueryRequest queryModel + * @property {string|null} [userPseudoId] CompleteQueryRequest userPseudoId + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryRequest dataStore. + * @member {string} dataStore + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.dataStore = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest queryModel. + * @member {string} queryModel + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.queryModel = ""; + + /** + * CompleteQueryRequest userPseudoId. + * @member {string} userPseudoId + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.userPseudoId = ""; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStore != null && Object.hasOwnProperty.call(message, "dataStore")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStore); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.queryModel != null && Object.hasOwnProperty.call(message, "queryModel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryModel); + if (message.userPseudoId != null && Object.hasOwnProperty.call(message, "userPseudoId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userPseudoId); + return writer; + }; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CompleteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataStore = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.queryModel = reader.string(); + break; + } + case 4: { + message.userPseudoId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + if (!$util.isString(message.dataStore)) + return "dataStore: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.queryModel != null && message.hasOwnProperty("queryModel")) + if (!$util.isString(message.queryModel)) + return "queryModel: string expected"; + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + if (!$util.isString(message.userPseudoId)) + return "userPseudoId: string expected"; + return null; + }; + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CompleteQueryRequest} CompleteQueryRequest + */ + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CompleteQueryRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CompleteQueryRequest(); + if (object.dataStore != null) + message.dataStore = String(object.dataStore); + if (object.query != null) + message.query = String(object.query); + if (object.queryModel != null) + message.queryModel = String(object.queryModel); + if (object.userPseudoId != null) + message.userPseudoId = String(object.userPseudoId); + return message; + }; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryRequest} message CompleteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataStore = ""; + object.query = ""; + object.queryModel = ""; + object.userPseudoId = ""; + } + if (message.dataStore != null && message.hasOwnProperty("dataStore")) + object.dataStore = message.dataStore; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.queryModel != null && message.hasOwnProperty("queryModel")) + object.queryModel = message.queryModel; + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + object.userPseudoId = message.userPseudoId; + return object; + }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CompleteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CompleteQueryRequest"; + }; + + return CompleteQueryRequest; + })(); + + v1.CompleteQueryResponse = (function() { + + /** + * Properties of a CompleteQueryResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICompleteQueryResponse + * @property {Array.|null} [querySuggestions] CompleteQueryResponse querySuggestions + */ + + /** + * Constructs a new CompleteQueryResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.ICompleteQueryResponse=} [properties] Properties to set + */ + function CompleteQueryResponse(properties) { + this.querySuggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryResponse querySuggestions. + * @member {Array.} querySuggestions + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.querySuggestions = $util.emptyArray; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse} CompleteQueryResponse instance + */ + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); + }; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.querySuggestions != null && message.querySuggestions.length) + for (var i = 0; i < message.querySuggestions.length; ++i) + $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.encode(message.querySuggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {google.cloud.discoveryengine.v1.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CompleteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.querySuggestions && message.querySuggestions.length)) + message.querySuggestions = []; + message.querySuggestions.push($root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.querySuggestions != null && message.hasOwnProperty("querySuggestions")) { + if (!Array.isArray(message.querySuggestions)) + return "querySuggestions: array expected"; + for (var i = 0; i < message.querySuggestions.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.verify(message.querySuggestions[i]); + if (error) + return "querySuggestions." + error; + } + } + return null; + }; + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse} CompleteQueryResponse + */ + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CompleteQueryResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CompleteQueryResponse(); + if (object.querySuggestions) { + if (!Array.isArray(object.querySuggestions)) + throw TypeError(".google.cloud.discoveryengine.v1.CompleteQueryResponse.querySuggestions: array expected"); + message.querySuggestions = []; + for (var i = 0; i < object.querySuggestions.length; ++i) { + if (typeof object.querySuggestions[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.CompleteQueryResponse.querySuggestions: object expected"); + message.querySuggestions[i] = $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.fromObject(object.querySuggestions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse} message CompleteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.querySuggestions = []; + if (message.querySuggestions && message.querySuggestions.length) { + object.querySuggestions = []; + for (var j = 0; j < message.querySuggestions.length; ++j) + object.querySuggestions[j] = $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.toObject(message.querySuggestions[j], options); + } + return object; + }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CompleteQueryResponse"; + }; + + CompleteQueryResponse.QuerySuggestion = (function() { + + /** + * Properties of a QuerySuggestion. + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @interface IQuerySuggestion + * @property {string|null} [suggestion] QuerySuggestion suggestion + */ + + /** + * Constructs a new QuerySuggestion. + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse + * @classdesc Represents a QuerySuggestion. + * @implements IQuerySuggestion + * @constructor + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion=} [properties] Properties to set + */ + function QuerySuggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuerySuggestion suggestion. + * @member {string} suggestion + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @instance + */ + QuerySuggestion.prototype.suggestion = ""; + + /** + * Creates a new QuerySuggestion instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion} QuerySuggestion instance + */ + QuerySuggestion.create = function create(properties) { + return new QuerySuggestion(properties); + }; + + /** + * Encodes the specified QuerySuggestion message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion} message QuerySuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySuggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + return writer; + }; + + /** + * Encodes the specified QuerySuggestion message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse.IQuerySuggestion} message QuerySuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuerySuggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuerySuggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion} QuerySuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySuggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuerySuggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion} QuerySuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuerySuggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuerySuggestion message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuerySuggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + return null; + }; + + /** + * Creates a QuerySuggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion} QuerySuggestion + */ + QuerySuggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + return message; + }; + + /** + * Creates a plain object from a QuerySuggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion} message QuerySuggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuerySuggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.suggestion = ""; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + return object; + }; + + /** + * Converts this QuerySuggestion to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @instance + * @returns {Object.} JSON object + */ + QuerySuggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuerySuggestion + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuerySuggestion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion"; + }; + + return QuerySuggestion; + })(); + + return CompleteQueryResponse; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.discoveryengine.v1 + * @interface IDocument + * @property {google.protobuf.IStruct|null} [structData] Document structData + * @property {string|null} [jsonData] Document jsonData + * @property {string|null} [name] Document name + * @property {string|null} [id] Document id + * @property {string|null} [schemaId] Document schemaId + * @property {google.cloud.discoveryengine.v1.Document.IContent|null} [content] Document content + * @property {string|null} [parentDocumentId] Document parentDocumentId + * @property {google.protobuf.IStruct|null} [derivedStructData] Document derivedStructData + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.discoveryengine.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document structData. + * @member {google.protobuf.IStruct|null|undefined} structData + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.structData = null; + + /** + * Document jsonData. + * @member {string|null|undefined} jsonData + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.jsonData = null; + + /** + * Document name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document id. + * @member {string} id + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.id = ""; + + /** + * Document schemaId. + * @member {string} schemaId + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.schemaId = ""; + + /** + * Document content. + * @member {google.cloud.discoveryengine.v1.Document.IContent|null|undefined} content + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document parentDocumentId. + * @member {string} parentDocumentId + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.parentDocumentId = ""; + + /** + * Document derivedStructData. + * @member {google.protobuf.IStruct|null|undefined} derivedStructData + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Document.prototype.derivedStructData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document data. + * @member {"structData"|"jsonData"|undefined} data + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["structData", "jsonData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {google.cloud.discoveryengine.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {google.cloud.discoveryengine.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); + if (message.structData != null && Object.hasOwnProperty.call(message, "structData")) + $root.google.protobuf.Struct.encode(message.structData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.jsonData); + if (message.derivedStructData != null && Object.hasOwnProperty.call(message, "derivedStructData")) + $root.google.protobuf.Struct.encode(message.derivedStructData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parentDocumentId != null && Object.hasOwnProperty.call(message, "parentDocumentId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.parentDocumentId); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.discoveryengine.v1.Document.Content.encode(message.content, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {google.cloud.discoveryengine.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.structData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jsonData = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.schemaId = reader.string(); + break; + } + case 10: { + message.content = $root.google.cloud.discoveryengine.v1.Document.Content.decode(reader, reader.uint32()); + break; + } + case 7: { + message.parentDocumentId = reader.string(); + break; + } + case 6: { + message.derivedStructData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.structData != null && message.hasOwnProperty("structData")) { + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structData); + if (error) + return "structData." + error; + } + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.jsonData)) + return "jsonData: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + if (!$util.isString(message.schemaId)) + return "schemaId: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.discoveryengine.v1.Document.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) + if (!$util.isString(message.parentDocumentId)) + return "parentDocumentId: string expected"; + if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) { + var error = $root.google.protobuf.Struct.verify(message.derivedStructData); + if (error) + return "derivedStructData." + error; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.Document) + return object; + var message = new $root.google.cloud.discoveryengine.v1.Document(); + if (object.structData != null) { + if (typeof object.structData !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.Document.structData: object expected"); + message.structData = $root.google.protobuf.Struct.fromObject(object.structData); + } + if (object.jsonData != null) + message.jsonData = String(object.jsonData); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.schemaId != null) + message.schemaId = String(object.schemaId); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.Document.content: object expected"); + message.content = $root.google.cloud.discoveryengine.v1.Document.Content.fromObject(object.content); + } + if (object.parentDocumentId != null) + message.parentDocumentId = String(object.parentDocumentId); + if (object.derivedStructData != null) { + if (typeof object.derivedStructData !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.Document.derivedStructData: object expected"); + message.derivedStructData = $root.google.protobuf.Struct.fromObject(object.derivedStructData); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {google.cloud.discoveryengine.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.schemaId = ""; + object.derivedStructData = null; + object.parentDocumentId = ""; + object.content = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + object.schemaId = message.schemaId; + if (message.structData != null && message.hasOwnProperty("structData")) { + object.structData = $root.google.protobuf.Struct.toObject(message.structData, options); + if (options.oneofs) + object.data = "structData"; + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + object.jsonData = message.jsonData; + if (options.oneofs) + object.data = "jsonData"; + } + if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) + object.derivedStructData = $root.google.protobuf.Struct.toObject(message.derivedStructData, options); + if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) + object.parentDocumentId = message.parentDocumentId; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.discoveryengine.v1.Document.Content.toObject(message.content, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.Document"; + }; + + Document.Content = (function() { + + /** + * Properties of a Content. + * @memberof google.cloud.discoveryengine.v1.Document + * @interface IContent + * @property {Uint8Array|null} [rawBytes] Content rawBytes + * @property {string|null} [uri] Content uri + * @property {string|null} [mimeType] Content mimeType + */ + + /** + * Constructs a new Content. + * @memberof google.cloud.discoveryengine.v1.Document + * @classdesc Represents a Content. + * @implements IContent + * @constructor + * @param {google.cloud.discoveryengine.v1.Document.IContent=} [properties] Properties to set + */ + function Content(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Content rawBytes. + * @member {Uint8Array|null|undefined} rawBytes + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @instance + */ + Content.prototype.rawBytes = null; + + /** + * Content uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @instance + */ + Content.prototype.uri = null; + + /** + * Content mimeType. + * @member {string} mimeType + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @instance + */ + Content.prototype.mimeType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Content content. + * @member {"rawBytes"|"uri"|undefined} content + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @instance + */ + Object.defineProperty(Content.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["rawBytes", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Content instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1.Document.IContent=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.Document.Content} Content instance + */ + Content.create = function create(properties) { + return new Content(properties); + }; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.Content.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1.Document.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.rawBytes != null && Object.hasOwnProperty.call(message, "rawBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawBytes); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + return writer; + }; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Document.Content.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1.Document.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Content message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.Document.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.Document.Content(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.rawBytes = reader.bytes(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 1: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.Document.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Content message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Content.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawBytes != null && message.hasOwnProperty("rawBytes")) { + properties.content = 1; + if (!(message.rawBytes && typeof message.rawBytes.length === "number" || $util.isString(message.rawBytes))) + return "rawBytes: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.Document.Content} Content + */ + Content.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.Document.Content) + return object; + var message = new $root.google.cloud.discoveryengine.v1.Document.Content(); + if (object.rawBytes != null) + if (typeof object.rawBytes === "string") + $util.base64.decode(object.rawBytes, message.rawBytes = $util.newBuffer($util.base64.length(object.rawBytes)), 0); + else if (object.rawBytes.length >= 0) + message.rawBytes = object.rawBytes; + if (object.uri != null) + message.uri = String(object.uri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1.Document.Content} message Content + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Content.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mimeType = ""; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.rawBytes != null && message.hasOwnProperty("rawBytes")) { + object.rawBytes = options.bytes === String ? $util.base64.encode(message.rawBytes, 0, message.rawBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawBytes) : message.rawBytes; + if (options.oneofs) + object.content = "rawBytes"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.content = "uri"; + } + return object; + }; + + /** + * Converts this Content to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @instance + * @returns {Object.} JSON object + */ + Content.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Content + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.Document.Content + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.Document.Content"; + }; + + return Content; + })(); + + return Document; + })(); + + v1.DocumentService = (function() { + + /** + * Constructs a new DocumentService service. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a DocumentService + * @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 DocumentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentService; + + /** + * Creates new DocumentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @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 {DocumentService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|getDocument}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.Document} [response] Document + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.cloud.discoveryengine.v1.GetDocumentRequest, $root.google.cloud.discoveryengine.v1.Document, request, callback); + }, "name", { value: "GetDocument" }); + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|listDocuments}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef ListDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.ListDocumentsResponse} [response] ListDocumentsResponse + */ + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.listDocuments = function listDocuments(request, callback) { + return this.rpcCall(listDocuments, $root.google.cloud.discoveryengine.v1.ListDocumentsRequest, $root.google.cloud.discoveryengine.v1.ListDocumentsResponse, request, callback); + }, "name", { value: "ListDocuments" }); + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|createDocument}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef CreateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.Document} [response] Document + */ + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.createDocument = function createDocument(request, callback) { + return this.rpcCall(createDocument, $root.google.cloud.discoveryengine.v1.CreateDocumentRequest, $root.google.cloud.discoveryengine.v1.Document, request, callback); + }, "name", { value: "CreateDocument" }); + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|updateDocument}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef UpdateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.Document} [response] Document + */ + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.updateDocument = function updateDocument(request, callback) { + return this.rpcCall(updateDocument, $root.google.cloud.discoveryengine.v1.UpdateDocumentRequest, $root.google.cloud.discoveryengine.v1.Document, request, callback); + }, "name", { value: "UpdateDocument" }); + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|deleteDocument}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef DeleteDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.deleteDocument = function deleteDocument(request, callback) { + return this.rpcCall(deleteDocument, $root.google.cloud.discoveryengine.v1.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDocument" }); + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|importDocuments}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef ImportDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.ImportDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.importDocuments = function importDocuments(request, callback) { + return this.rpcCall(importDocuments, $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportDocuments" }); + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.DocumentService|purgeDocuments}. + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @typedef PurgeDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeDocuments. + * @function purgeDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest} request PurgeDocumentsRequest message or plain object + * @param {google.cloud.discoveryengine.v1.DocumentService.PurgeDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.purgeDocuments = function purgeDocuments(request, callback) { + return this.rpcCall(purgeDocuments, $root.google.cloud.discoveryengine.v1.PurgeDocumentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeDocuments" }); + + /** + * Calls PurgeDocuments. + * @function purgeDocuments + * @memberof google.cloud.discoveryengine.v1.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest} request PurgeDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentService; + })(); + + v1.GetDocumentRequest = (function() { + + /** + * Properties of a GetDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IGetDocumentRequest + * @property {string|null} [name] GetDocumentRequest name + */ + + /** + * Constructs a new GetDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest=} [properties] Properties to set + */ + function GetDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.name = ""; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.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 GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.GetDocumentRequest(); + 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 GetDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentRequest.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 GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.GetDocumentRequest} GetDocumentRequest + */ + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.GetDocumentRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.GetDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.GetDocumentRequest} message GetDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentRequest.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 GetDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.GetDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.GetDocumentRequest"; + }; + + return GetDocumentRequest; + })(); + + v1.ListDocumentsRequest = (function() { + + /** + * Properties of a ListDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IListDocumentsRequest + * @property {string|null} [parent] ListDocumentsRequest parent + * @property {number|null} [pageSize] ListDocumentsRequest pageSize + * @property {string|null} [pageToken] ListDocumentsRequest pageToken + */ + + /** + * Constructs a new ListDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a ListDocumentsRequest. + * @implements IListDocumentsRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest=} [properties] Properties to set + */ + function ListDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.parent = ""; + + /** + * ListDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageSize = 0; + + /** + * ListDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ListDocumentsRequest} ListDocumentsRequest instance + */ + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ListDocumentsRequest} ListDocumentsRequest + */ + ListDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ListDocumentsRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ListDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.ListDocumentsRequest} message ListDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ListDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ListDocumentsRequest"; + }; + + return ListDocumentsRequest; + })(); + + v1.ListDocumentsResponse = (function() { + + /** + * Properties of a ListDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface IListDocumentsResponse + * @property {Array.|null} [documents] ListDocumentsResponse documents + * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken + */ + + /** + * Constructs a new ListDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a ListDocumentsResponse. + * @implements IListDocumentsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.IListDocumentsResponse=} [properties] Properties to set + */ + function ListDocumentsResponse(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsResponse documents. + * @member {Array.} documents + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.documents = $util.emptyArray; + + /** + * ListDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ListDocumentsResponse} ListDocumentsResponse instance + */ + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); + }; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.discoveryengine.v1.Document.encode(message.documents[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 ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ListDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.discoveryengine.v1.Document.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ListDocumentsResponse} ListDocumentsResponse + */ + ListDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ListDocumentsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ListDocumentsResponse(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.discoveryengine.v1.ListDocumentsResponse.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ListDocumentsResponse.documents: object expected"); + message.documents[i] = $root.google.cloud.discoveryengine.v1.Document.fromObject(object.documents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.ListDocumentsResponse} message ListDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.discoveryengine.v1.Document.toObject(message.documents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ListDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ListDocumentsResponse"; + }; + + return ListDocumentsResponse; + })(); + + v1.CreateDocumentRequest = (function() { + + /** + * Properties of a CreateDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICreateDocumentRequest + * @property {string|null} [parent] CreateDocumentRequest parent + * @property {google.cloud.discoveryengine.v1.IDocument|null} [document] CreateDocumentRequest document + * @property {string|null} [documentId] CreateDocumentRequest documentId + */ + + /** + * Constructs a new CreateDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CreateDocumentRequest. + * @implements ICreateDocumentRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest=} [properties] Properties to set + */ + function CreateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.parent = ""; + + /** + * CreateDocumentRequest document. + * @member {google.cloud.discoveryengine.v1.IDocument|null|undefined} document + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.document = null; + + /** + * CreateDocumentRequest documentId. + * @member {string} documentId + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.documentId = ""; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CreateDocumentRequest} CreateDocumentRequest instance + */ + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.discoveryengine.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentId); + return writer; + }; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CreateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.discoveryengine.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.documentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.discoveryengine.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + if (!$util.isString(message.documentId)) + return "documentId: string expected"; + return null; + }; + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CreateDocumentRequest} CreateDocumentRequest + */ + CreateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CreateDocumentRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CreateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.CreateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.discoveryengine.v1.Document.fromObject(object.document); + } + if (object.documentId != null) + message.documentId = String(object.documentId); + return message; + }; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.CreateDocumentRequest} message CreateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.document = null; + object.documentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.discoveryengine.v1.Document.toObject(message.document, options); + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = message.documentId; + return object; + }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CreateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CreateDocumentRequest"; + }; + + return CreateDocumentRequest; + })(); + + v1.UpdateDocumentRequest = (function() { + + /** + * Properties of an UpdateDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IUpdateDocumentRequest + * @property {google.cloud.discoveryengine.v1.IDocument|null} [document] UpdateDocumentRequest document + * @property {boolean|null} [allowMissing] UpdateDocumentRequest allowMissing + */ + + /** + * Constructs a new UpdateDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an UpdateDocumentRequest. + * @implements IUpdateDocumentRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest=} [properties] Properties to set + */ + function UpdateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDocumentRequest document. + * @member {google.cloud.discoveryengine.v1.IDocument|null|undefined} document + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.document = null; + + /** + * UpdateDocumentRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.UpdateDocumentRequest} UpdateDocumentRequest instance + */ + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.discoveryengine.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.UpdateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.discoveryengine.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.discoveryengine.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.UpdateDocumentRequest} UpdateDocumentRequest + */ + UpdateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.UpdateDocumentRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.UpdateDocumentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UpdateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.discoveryengine.v1.Document.fromObject(object.document); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.UpdateDocumentRequest} message UpdateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.allowMissing = false; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.discoveryengine.v1.Document.toObject(message.document, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.UpdateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.UpdateDocumentRequest"; + }; + + return UpdateDocumentRequest; + })(); + + v1.DeleteDocumentRequest = (function() { + + /** + * Properties of a DeleteDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IDeleteDocumentRequest + * @property {string|null} [name] DeleteDocumentRequest name + */ + + /** + * Constructs a new DeleteDocumentRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a DeleteDocumentRequest. + * @implements IDeleteDocumentRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest=} [properties] Properties to set + */ + function DeleteDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDocumentRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.name = ""; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.DeleteDocumentRequest} DeleteDocumentRequest instance + */ + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.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 DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.DeleteDocumentRequest(); + 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 DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentRequest.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 DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.DeleteDocumentRequest} DeleteDocumentRequest + */ + DeleteDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.DeleteDocumentRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.DeleteDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1.DeleteDocumentRequest} message DeleteDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentRequest.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 DeleteDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.DeleteDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.DeleteDocumentRequest"; + }; + + return DeleteDocumentRequest; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.discoveryengine.v1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + * @property {string|null} [dataSchema] GcsSource dataSchema + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.discoveryengine.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * GcsSource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @instance + */ + GcsSource.prototype.dataSchema = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {google.cloud.discoveryengine.v1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {google.cloud.discoveryengine.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {google.cloud.discoveryengine.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); + break; + } + case 2: { + message.dataSchema = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: string[] expected"; + } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.GcsSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.discoveryengine.v1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {google.cloud.discoveryengine.v1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputUris = []; + if (options.defaults) + object.dataSchema = ""; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.GcsSource"; + }; + + return GcsSource; + })(); + + v1.BigQuerySource = (function() { + + /** + * Properties of a BigQuerySource. + * @memberof google.cloud.discoveryengine.v1 + * @interface IBigQuerySource + * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate + * @property {string|null} [projectId] BigQuerySource projectId + * @property {string|null} [datasetId] BigQuerySource datasetId + * @property {string|null} [tableId] BigQuerySource tableId + * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir + * @property {string|null} [dataSchema] BigQuerySource dataSchema + */ + + /** + * Constructs a new BigQuerySource. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource + * @constructor + * @param {google.cloud.discoveryengine.v1.IBigQuerySource=} [properties] Properties to set + */ + function BigQuerySource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQuerySource partitionDate. + * @member {google.type.IDate|null|undefined} partitionDate + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.partitionDate = null; + + /** + * BigQuerySource projectId. + * @member {string} projectId + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.projectId = ""; + + /** + * BigQuerySource datasetId. + * @member {string} datasetId + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.datasetId = ""; + + /** + * BigQuerySource tableId. + * @member {string} tableId + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.tableId = ""; + + /** + * BigQuerySource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.gcsStagingDir = ""; + + /** + * BigQuerySource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.dataSchema = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BigQuerySource partition. + * @member {"partitionDate"|undefined} partition + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + */ + Object.defineProperty(BigQuerySource.prototype, "partition", { + get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {google.cloud.discoveryengine.v1.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.BigQuerySource} BigQuerySource instance + */ + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); + }; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.discoveryengine.v1.BigQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {google.cloud.discoveryengine.v1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsStagingDir); + if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) + $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataSchema); + return writer; + }; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.BigQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {google.cloud.discoveryengine.v1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.BigQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.gcsStagingDir = reader.string(); + break; + } + case 6: { + message.dataSchema = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQuerySource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + properties.partition = 1; + { + var error = $root.google.type.Date.verify(message.partitionDate); + if (error) + return "partitionDate." + error; + } + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; + return null; + }; + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.BigQuerySource} BigQuerySource + */ + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.BigQuerySource) + return object; + var message = new $root.google.cloud.discoveryengine.v1.BigQuerySource(); + if (object.partitionDate != null) { + if (typeof object.partitionDate !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.BigQuerySource.partitionDate: object expected"); + message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); + return message; + }; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {google.cloud.discoveryengine.v1.BigQuerySource} message BigQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.gcsStagingDir = ""; + object.dataSchema = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); + if (options.oneofs) + object.partition = "partitionDate"; + } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; + return object; + }; + + /** + * Converts this BigQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @instance + * @returns {Object.} JSON object + */ + BigQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQuerySource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.BigQuerySource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQuerySource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.BigQuerySource"; + }; + + return BigQuerySource; + })(); + + v1.ImportErrorConfig = (function() { + + /** + * Properties of an ImportErrorConfig. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportErrorConfig + * @property {string|null} [gcsPrefix] ImportErrorConfig gcsPrefix + */ + + /** + * Constructs a new ImportErrorConfig. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportErrorConfig. + * @implements IImportErrorConfig + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportErrorConfig=} [properties] Properties to set + */ + function ImportErrorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportErrorConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @instance + */ + ImportErrorConfig.prototype.gcsPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportErrorConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @instance + */ + Object.defineProperty(ImportErrorConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportErrorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {google.cloud.discoveryengine.v1.IImportErrorConfig=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportErrorConfig} ImportErrorConfig instance + */ + ImportErrorConfig.create = function create(properties) { + return new ImportErrorConfig(properties); + }; + + /** + * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportErrorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {google.cloud.discoveryengine.v1.IImportErrorConfig} message ImportErrorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportErrorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + return writer; + }; + + /** + * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportErrorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {google.cloud.discoveryengine.v1.IImportErrorConfig} message ImportErrorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportErrorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportErrorConfig} ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportErrorConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportErrorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportErrorConfig} ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportErrorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportErrorConfig message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportErrorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; + } + return null; + }; + + /** + * Creates an ImportErrorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportErrorConfig} ImportErrorConfig + */ + ImportErrorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportErrorConfig) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportErrorConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); + return message; + }; + + /** + * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {google.cloud.discoveryengine.v1.ImportErrorConfig} message ImportErrorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportErrorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; + } + return object; + }; + + /** + * Converts this ImportErrorConfig to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @instance + * @returns {Object.} JSON object + */ + ImportErrorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportErrorConfig + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportErrorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportErrorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportErrorConfig"; + }; + + return ImportErrorConfig; + })(); + + v1.ImportUserEventsRequest = (function() { + + /** + * Properties of an ImportUserEventsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportUserEventsRequest + * @property {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource|null} [inlineSource] ImportUserEventsRequest inlineSource + * @property {google.cloud.discoveryengine.v1.IGcsSource|null} [gcsSource] ImportUserEventsRequest gcsSource + * @property {google.cloud.discoveryengine.v1.IBigQuerySource|null} [bigquerySource] ImportUserEventsRequest bigquerySource + * @property {string|null} [parent] ImportUserEventsRequest parent + * @property {google.cloud.discoveryengine.v1.IImportErrorConfig|null} [errorConfig] ImportUserEventsRequest errorConfig + */ + + /** + * Constructs a new ImportUserEventsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportUserEventsRequest. + * @implements IImportUserEventsRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest=} [properties] Properties to set + */ + function ImportUserEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportUserEventsRequest inlineSource. + * @member {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.inlineSource = null; + + /** + * ImportUserEventsRequest gcsSource. + * @member {google.cloud.discoveryengine.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.gcsSource = null; + + /** + * ImportUserEventsRequest bigquerySource. + * @member {google.cloud.discoveryengine.v1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.bigquerySource = null; + + /** + * ImportUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.parent = ""; + + /** + * ImportUserEventsRequest errorConfig. + * @member {google.cloud.discoveryengine.v1.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.errorConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportUserEventsRequest source. + * @member {"inlineSource"|"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + */ + Object.defineProperty(ImportUserEventsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest} ImportUserEventsRequest instance + */ + ImportUserEventsRequest.create = function create(properties) { + return new ImportUserEventsRequest(properties); + }; + + /** + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsRequest.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.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) + $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.discoveryengine.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.discoveryengine.v1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest} ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.inlineSource = $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest} ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportUserEventsRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportUserEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.verify(message.inlineSource); + if (error) + return "inlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + return null; + }; + + /** + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest} ImportUserEventsRequest + */ + ImportUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest(); + if (object.inlineSource != null) { + if (typeof object.inlineSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.fromObject(object.inlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.fromObject(object.bigquerySource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.fromObject(object.errorConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest} message ImportUserEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.errorConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + object.inlineSource = $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.toObject(message.inlineSource, options); + if (options.oneofs) + object.source = "inlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.toObject(message.errorConfig, options); + return object; + }; + + /** + * Converts this ImportUserEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportUserEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportUserEventsRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportUserEventsRequest"; + }; + + ImportUserEventsRequest.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @interface IInlineSource + * @property {Array.|null} [userEvents] InlineSource userEvents + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + this.userEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource userEvents. + * @member {Array.} userEvents + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @instance + */ + InlineSource.prototype.userEvents = $util.emptyArray; + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userEvents != null && message.userEvents.length) + for (var i = 0; i < message.userEvents.length; ++i) + $root.google.cloud.discoveryengine.v1.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.userEvents && message.userEvents.length)) + message.userEvents = []; + message.userEvents.push($root.google.cloud.discoveryengine.v1.UserEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userEvents != null && message.hasOwnProperty("userEvents")) { + if (!Array.isArray(message.userEvents)) + return "userEvents: array expected"; + for (var i = 0; i < message.userEvents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.UserEvent.verify(message.userEvents[i]); + if (error) + return "userEvents." + error; + } + } + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource(); + if (object.userEvents) { + if (!Array.isArray(object.userEvents)) + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.userEvents: array expected"); + message.userEvents = []; + for (var i = 0; i < object.userEvents.length; ++i) { + if (typeof object.userEvents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource.userEvents: object expected"); + message.userEvents[i] = $root.google.cloud.discoveryengine.v1.UserEvent.fromObject(object.userEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userEvents = []; + if (message.userEvents && message.userEvents.length) { + object.userEvents = []; + for (var j = 0; j < message.userEvents.length; ++j) + object.userEvents[j] = $root.google.cloud.discoveryengine.v1.UserEvent.toObject(message.userEvents[j], options); + } + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource"; + }; + + return InlineSource; + })(); + + return ImportUserEventsRequest; + })(); + + v1.ImportUserEventsResponse = (function() { + + /** + * Properties of an ImportUserEventsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportUserEventsResponse + * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples + * @property {google.cloud.discoveryengine.v1.IImportErrorConfig|null} [errorConfig] ImportUserEventsResponse errorConfig + * @property {number|Long|null} [joinedEventsCount] ImportUserEventsResponse joinedEventsCount + * @property {number|Long|null} [unjoinedEventsCount] ImportUserEventsResponse unjoinedEventsCount + */ + + /** + * Constructs a new ImportUserEventsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportUserEventsResponse. + * @implements IImportUserEventsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportUserEventsResponse=} [properties] Properties to set + */ + function ImportUserEventsResponse(properties) { + this.errorSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportUserEventsResponse errorConfig. + * @member {google.cloud.discoveryengine.v1.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.errorConfig = null; + + /** + * ImportUserEventsResponse joinedEventsCount. + * @member {number|Long} joinedEventsCount + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportUserEventsResponse unjoinedEventsCount. + * @member {number|Long} unjoinedEventsCount + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportUserEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsResponse} ImportUserEventsResponse instance + */ + ImportUserEventsResponse.create = function create(properties) { + return new ImportUserEventsResponse(properties); + }; + + /** + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.joinedEventsCount); + if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.unjoinedEventsCount); + return writer; + }; + + /** + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsResponse} ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.joinedEventsCount = reader.int64(); + break; + } + case 4: { + message.unjoinedEventsCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsResponse} ImportUserEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportUserEventsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportUserEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) + return "joinedEventsCount: integer|Long expected"; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) + return "unjoinedEventsCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsResponse} ImportUserEventsResponse + */ + ImportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportUserEventsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsResponse.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.fromObject(object.errorConfig); + } + if (object.joinedEventsCount != null) + if ($util.Long) + (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; + else if (typeof object.joinedEventsCount === "string") + message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); + else if (typeof object.joinedEventsCount === "number") + message.joinedEventsCount = object.joinedEventsCount; + else if (typeof object.joinedEventsCount === "object") + message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); + if (object.unjoinedEventsCount != null) + if ($util.Long) + (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; + else if (typeof object.unjoinedEventsCount === "string") + message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); + else if (typeof object.unjoinedEventsCount === "number") + message.unjoinedEventsCount = object.unjoinedEventsCount; + else if (typeof object.unjoinedEventsCount === "object") + message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportUserEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) { + object.errorConfig = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.joinedEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unjoinedEventsCount = options.longs === String ? "0" : 0; + } + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.toObject(message.errorConfig, options); + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (typeof message.joinedEventsCount === "number") + object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; + else + object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (typeof message.unjoinedEventsCount === "number") + object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; + else + object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; + return object; + }; + + /** + * Converts this ImportUserEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportUserEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportUserEventsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportUserEventsResponse"; + }; + + return ImportUserEventsResponse; + })(); + + v1.ImportUserEventsMetadata = (function() { + + /** + * Properties of an ImportUserEventsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportUserEventsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportUserEventsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportUserEventsMetadata updateTime + * @property {number|Long|null} [successCount] ImportUserEventsMetadata successCount + * @property {number|Long|null} [failureCount] ImportUserEventsMetadata failureCount + */ + + /** + * Constructs a new ImportUserEventsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportUserEventsMetadata. + * @implements IImportUserEventsMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportUserEventsMetadata=} [properties] Properties to set + */ + function ImportUserEventsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportUserEventsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.createTime = null; + + /** + * ImportUserEventsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.updateTime = null; + + /** + * ImportUserEventsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportUserEventsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportUserEventsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsMetadata} ImportUserEventsMetadata instance + */ + ImportUserEventsMetadata.create = function create(properties) { + return new ImportUserEventsMetadata(properties); + }; + + /** + * Encodes the specified ImportUserEventsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified ImportUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportUserEventsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsMetadata} ImportUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsMetadata} ImportUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportUserEventsMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportUserEventsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportUserEventsMetadata} ImportUserEventsMetadata + */ + ImportUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportUserEventsMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportUserEventsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportUserEventsMetadata.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.discoveryengine.v1.ImportUserEventsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportUserEventsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.ImportUserEventsMetadata} message ImportUserEventsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportUserEventsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + 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.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this ImportUserEventsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportUserEventsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportUserEventsMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportUserEventsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportUserEventsMetadata"; + }; + + return ImportUserEventsMetadata; + })(); + + v1.ImportDocumentsMetadata = (function() { + + /** + * Properties of an ImportDocumentsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportDocumentsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportDocumentsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportDocumentsMetadata updateTime + * @property {number|Long|null} [successCount] ImportDocumentsMetadata successCount + * @property {number|Long|null} [failureCount] ImportDocumentsMetadata failureCount + */ + + /** + * Constructs a new ImportDocumentsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportDocumentsMetadata. + * @implements IImportDocumentsMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportDocumentsMetadata=} [properties] Properties to set + */ + function ImportDocumentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.createTime = null; + + /** + * ImportDocumentsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.updateTime = null; + + /** + * ImportDocumentsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportDocumentsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportDocumentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsMetadata} ImportDocumentsMetadata instance + */ + ImportDocumentsMetadata.create = function create(properties) { + return new ImportDocumentsMetadata(properties); + }; + + /** + * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsMetadata} ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsMetadata} ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsMetadata} ImportDocumentsMetadata + */ + ImportDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportDocumentsMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsMetadata.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.discoveryengine.v1.ImportDocumentsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsMetadata} message ImportDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + 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.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportDocumentsMetadata"; + }; + + return ImportDocumentsMetadata; + })(); + + v1.ImportDocumentsRequest = (function() { + + /** + * Properties of an ImportDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportDocumentsRequest + * @property {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource|null} [inlineSource] ImportDocumentsRequest inlineSource + * @property {google.cloud.discoveryengine.v1.IGcsSource|null} [gcsSource] ImportDocumentsRequest gcsSource + * @property {google.cloud.discoveryengine.v1.IBigQuerySource|null} [bigquerySource] ImportDocumentsRequest bigquerySource + * @property {string|null} [parent] ImportDocumentsRequest parent + * @property {google.cloud.discoveryengine.v1.IImportErrorConfig|null} [errorConfig] ImportDocumentsRequest errorConfig + * @property {google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode|null} [reconciliationMode] ImportDocumentsRequest reconciliationMode + * @property {boolean|null} [autoGenerateIds] ImportDocumentsRequest autoGenerateIds + * @property {string|null} [idField] ImportDocumentsRequest idField + */ + + /** + * Constructs a new ImportDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportDocumentsRequest. + * @implements IImportDocumentsRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest=} [properties] Properties to set + */ + function ImportDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsRequest inlineSource. + * @member {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.inlineSource = null; + + /** + * ImportDocumentsRequest gcsSource. + * @member {google.cloud.discoveryengine.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.gcsSource = null; + + /** + * ImportDocumentsRequest bigquerySource. + * @member {google.cloud.discoveryengine.v1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.bigquerySource = null; + + /** + * ImportDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.parent = ""; + + /** + * ImportDocumentsRequest errorConfig. + * @member {google.cloud.discoveryengine.v1.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.errorConfig = null; + + /** + * ImportDocumentsRequest reconciliationMode. + * @member {google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode} reconciliationMode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.reconciliationMode = 0; + + /** + * ImportDocumentsRequest autoGenerateIds. + * @member {boolean} autoGenerateIds + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.autoGenerateIds = false; + + /** + * ImportDocumentsRequest idField. + * @member {string} idField + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.idField = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportDocumentsRequest source. + * @member {"inlineSource"|"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + */ + Object.defineProperty(ImportDocumentsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest} ImportDocumentsRequest instance + */ + ImportDocumentsRequest.create = function create(properties) { + return new ImportDocumentsRequest(properties); + }; + + /** + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.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.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) + $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.discoveryengine.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.discoveryengine.v1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reconciliationMode); + if (message.autoGenerateIds != null && Object.hasOwnProperty.call(message, "autoGenerateIds")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.autoGenerateIds); + if (message.idField != null && Object.hasOwnProperty.call(message, "idField")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.idField); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.inlineSource = $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.reconciliationMode = reader.int32(); + break; + } + case 8: { + message.autoGenerateIds = reader.bool(); + break; + } + case 9: { + message.idField = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.verify(message.inlineSource); + if (error) + return "inlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + switch (message.reconciliationMode) { + default: + return "reconciliationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + if (typeof message.autoGenerateIds !== "boolean") + return "autoGenerateIds: boolean expected"; + if (message.idField != null && message.hasOwnProperty("idField")) + if (!$util.isString(message.idField)) + return "idField: string expected"; + return null; + }; + + /** + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest} ImportDocumentsRequest + */ + ImportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest(); + if (object.inlineSource != null) { + if (typeof object.inlineSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.fromObject(object.inlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.fromObject(object.bigquerySource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.fromObject(object.errorConfig); + } + switch (object.reconciliationMode) { + default: + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; + break; + } + break; + case "RECONCILIATION_MODE_UNSPECIFIED": + case 0: + message.reconciliationMode = 0; + break; + case "INCREMENTAL": + case 1: + message.reconciliationMode = 1; + break; + case "FULL": + case 2: + message.reconciliationMode = 2; + break; + } + if (object.autoGenerateIds != null) + message.autoGenerateIds = Boolean(object.autoGenerateIds); + if (object.idField != null) + message.idField = String(object.idField); + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.errorConfig = null; + object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.autoGenerateIds = false; + object.idField = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + object.inlineSource = $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.toObject(message.inlineSource, options); + if (options.oneofs) + object.source = "inlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.discoveryengine.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.discoveryengine.v1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.toObject(message.errorConfig, options); + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + object.reconciliationMode = options.enums === String ? $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + object.autoGenerateIds = message.autoGenerateIds; + if (message.idField != null && message.hasOwnProperty("idField")) + object.idField = message.idField; + return object; + }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportDocumentsRequest"; + }; + + ImportDocumentsRequest.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @interface IInlineSource + * @property {Array.|null} [documents] InlineSource documents + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource documents. + * @member {Array.} documents + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @instance + */ + InlineSource.prototype.documents = $util.emptyArray; + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.discoveryengine.v1.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.discoveryengine.v1.Document.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource.documents: object expected"); + message.documents[i] = $root.google.cloud.discoveryengine.v1.Document.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.discoveryengine.v1.Document.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource"; + }; + + return InlineSource; + })(); + + /** + * ReconciliationMode enum. + * @name google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode + * @enum {number} + * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value + * @property {number} INCREMENTAL=1 INCREMENTAL value + * @property {number} FULL=2 FULL value + */ + ImportDocumentsRequest.ReconciliationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCREMENTAL"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ImportDocumentsRequest; + })(); + + v1.ImportDocumentsResponse = (function() { + + /** + * Properties of an ImportDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface IImportDocumentsResponse + * @property {Array.|null} [errorSamples] ImportDocumentsResponse errorSamples + * @property {google.cloud.discoveryengine.v1.IImportErrorConfig|null} [errorConfig] ImportDocumentsResponse errorConfig + */ + + /** + * Constructs a new ImportDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an ImportDocumentsResponse. + * @implements IImportDocumentsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.IImportDocumentsResponse=} [properties] Properties to set + */ + function ImportDocumentsResponse(properties) { + this.errorSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @instance + */ + ImportDocumentsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportDocumentsResponse errorConfig. + * @member {google.cloud.discoveryengine.v1.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @instance + */ + ImportDocumentsResponse.prototype.errorConfig = null; + + /** + * Creates a new ImportDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsResponse} ImportDocumentsResponse instance + */ + ImportDocumentsResponse.create = function create(properties) { + return new ImportDocumentsResponse(properties); + }; + + /** + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ImportDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ImportDocumentsResponse} ImportDocumentsResponse + */ + ImportDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ImportDocumentsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ImportDocumentsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ImportDocumentsResponse.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.fromObject(object.errorConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.ImportDocumentsResponse} message ImportDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1.ImportErrorConfig.toObject(message.errorConfig, options); + return object; + }; + + /** + * Converts this ImportDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ImportDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ImportDocumentsResponse"; + }; + + return ImportDocumentsResponse; + })(); + + v1.UserEvent = (function() { + + /** + * Properties of a UserEvent. + * @memberof google.cloud.discoveryengine.v1 + * @interface IUserEvent + * @property {string|null} [eventType] UserEvent eventType + * @property {string|null} [userPseudoId] UserEvent userPseudoId + * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime + * @property {google.cloud.discoveryengine.v1.IUserInfo|null} [userInfo] UserEvent userInfo + * @property {boolean|null} [directUserRequest] UserEvent directUserRequest + * @property {string|null} [sessionId] UserEvent sessionId + * @property {google.cloud.discoveryengine.v1.IPageInfo|null} [pageInfo] UserEvent pageInfo + * @property {string|null} [attributionToken] UserEvent attributionToken + * @property {string|null} [filter] UserEvent filter + * @property {Array.|null} [documents] UserEvent documents + * @property {google.cloud.discoveryengine.v1.IPanelInfo|null} [panel] UserEvent panel + * @property {google.cloud.discoveryengine.v1.ISearchInfo|null} [searchInfo] UserEvent searchInfo + * @property {google.cloud.discoveryengine.v1.ICompletionInfo|null} [completionInfo] UserEvent completionInfo + * @property {google.cloud.discoveryengine.v1.ITransactionInfo|null} [transactionInfo] UserEvent transactionInfo + * @property {Array.|null} [tagIds] UserEvent tagIds + * @property {Array.|null} [promotionIds] UserEvent promotionIds + * @property {Object.|null} [attributes] UserEvent attributes + * @property {google.cloud.discoveryengine.v1.IMediaInfo|null} [mediaInfo] UserEvent mediaInfo + */ + + /** + * Constructs a new UserEvent. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a UserEvent. + * @implements IUserEvent + * @constructor + * @param {google.cloud.discoveryengine.v1.IUserEvent=} [properties] Properties to set + */ + function UserEvent(properties) { + this.documents = []; + this.tagIds = []; + this.promotionIds = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserEvent eventType. + * @member {string} eventType + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.eventType = ""; + + /** + * UserEvent userPseudoId. + * @member {string} userPseudoId + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.userPseudoId = ""; + + /** + * UserEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.eventTime = null; + + /** + * UserEvent userInfo. + * @member {google.cloud.discoveryengine.v1.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.userInfo = null; + + /** + * UserEvent directUserRequest. + * @member {boolean} directUserRequest + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.directUserRequest = false; + + /** + * UserEvent sessionId. + * @member {string} sessionId + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.sessionId = ""; + + /** + * UserEvent pageInfo. + * @member {google.cloud.discoveryengine.v1.IPageInfo|null|undefined} pageInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.pageInfo = null; + + /** + * UserEvent attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.attributionToken = ""; + + /** + * UserEvent filter. + * @member {string} filter + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.filter = ""; + + /** + * UserEvent documents. + * @member {Array.} documents + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.documents = $util.emptyArray; + + /** + * UserEvent panel. + * @member {google.cloud.discoveryengine.v1.IPanelInfo|null|undefined} panel + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.panel = null; + + /** + * UserEvent searchInfo. + * @member {google.cloud.discoveryengine.v1.ISearchInfo|null|undefined} searchInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.searchInfo = null; + + /** + * UserEvent completionInfo. + * @member {google.cloud.discoveryengine.v1.ICompletionInfo|null|undefined} completionInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.completionInfo = null; + + /** + * UserEvent transactionInfo. + * @member {google.cloud.discoveryengine.v1.ITransactionInfo|null|undefined} transactionInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.transactionInfo = null; + + /** + * UserEvent tagIds. + * @member {Array.} tagIds + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.tagIds = $util.emptyArray; + + /** + * UserEvent promotionIds. + * @member {Array.} promotionIds + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.promotionIds = $util.emptyArray; + + /** + * UserEvent attributes. + * @member {Object.} attributes + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.attributes = $util.emptyObject; + + /** + * UserEvent mediaInfo. + * @member {google.cloud.discoveryengine.v1.IMediaInfo|null|undefined} mediaInfo + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + */ + UserEvent.prototype.mediaInfo = null; + + /** + * Creates a new UserEvent instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {google.cloud.discoveryengine.v1.IUserEvent=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.UserEvent} UserEvent instance + */ + UserEvent.create = function create(properties) { + return new UserEvent(properties); + }; + + /** + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.discoveryengine.v1.UserEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {google.cloud.discoveryengine.v1.IUserEvent} message UserEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); + if (message.userPseudoId != null && Object.hasOwnProperty.call(message, "userPseudoId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userPseudoId); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.discoveryengine.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.directUserRequest != null && Object.hasOwnProperty.call(message, "directUserRequest")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.directUserRequest); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sessionId); + if (message.pageInfo != null && Object.hasOwnProperty.call(message, "pageInfo")) + $root.google.cloud.discoveryengine.v1.PageInfo.encode(message.pageInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.attributionToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.filter); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.discoveryengine.v1.DocumentInfo.encode(message.documents[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.panel != null && Object.hasOwnProperty.call(message, "panel")) + $root.google.cloud.discoveryengine.v1.PanelInfo.encode(message.panel, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.searchInfo != null && Object.hasOwnProperty.call(message, "searchInfo")) + $root.google.cloud.discoveryengine.v1.SearchInfo.encode(message.searchInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.completionInfo != null && Object.hasOwnProperty.call(message, "completionInfo")) + $root.google.cloud.discoveryengine.v1.CompletionInfo.encode(message.completionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.transactionInfo != null && Object.hasOwnProperty.call(message, "transactionInfo")) + $root.google.cloud.discoveryengine.v1.TransactionInfo.encode(message.transactionInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.tagIds != null && message.tagIds.length) + for (var i = 0; i < message.tagIds.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.tagIds[i]); + if (message.promotionIds != null && message.promotionIds.length) + for (var i = 0; i < message.promotionIds.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.promotionIds[i]); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.discoveryengine.v1.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.mediaInfo != null && Object.hasOwnProperty.call(message, "mediaInfo")) + $root.google.cloud.discoveryengine.v1.MediaInfo.encode(message.mediaInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UserEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {google.cloud.discoveryengine.v1.IUserEvent} message UserEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.UserEvent} UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.UserEvent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.eventType = reader.string(); + break; + } + case 2: { + message.userPseudoId = reader.string(); + break; + } + case 3: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + case 5: { + message.directUserRequest = reader.bool(); + break; + } + case 6: { + message.sessionId = reader.string(); + break; + } + case 7: { + message.pageInfo = $root.google.cloud.discoveryengine.v1.PageInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.attributionToken = reader.string(); + break; + } + case 9: { + message.filter = reader.string(); + break; + } + case 10: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.discoveryengine.v1.DocumentInfo.decode(reader, reader.uint32())); + break; + } + case 11: { + message.panel = $root.google.cloud.discoveryengine.v1.PanelInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.searchInfo = $root.google.cloud.discoveryengine.v1.SearchInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.completionInfo = $root.google.cloud.discoveryengine.v1.CompletionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.transactionInfo = $root.google.cloud.discoveryengine.v1.TransactionInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + if (!(message.tagIds && message.tagIds.length)) + message.tagIds = []; + message.tagIds.push(reader.string()); + break; + } + case 16: { + if (!(message.promotionIds && message.promotionIds.length)) + message.promotionIds = []; + message.promotionIds.push(reader.string()); + break; + } + case 17: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.discoveryengine.v1.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 18: { + message.mediaInfo = $root.google.cloud.discoveryengine.v1.MediaInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.UserEvent} UserEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserEvent message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + if (!$util.isString(message.userPseudoId)) + return "userPseudoId: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.discoveryengine.v1.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + if (typeof message.directUserRequest !== "boolean") + return "directUserRequest: boolean expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) { + var error = $root.google.cloud.discoveryengine.v1.PageInfo.verify(message.pageInfo); + if (error) + return "pageInfo." + error; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.DocumentInfo.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + if (message.panel != null && message.hasOwnProperty("panel")) { + var error = $root.google.cloud.discoveryengine.v1.PanelInfo.verify(message.panel); + if (error) + return "panel." + error; + } + if (message.searchInfo != null && message.hasOwnProperty("searchInfo")) { + var error = $root.google.cloud.discoveryengine.v1.SearchInfo.verify(message.searchInfo); + if (error) + return "searchInfo." + error; + } + if (message.completionInfo != null && message.hasOwnProperty("completionInfo")) { + var error = $root.google.cloud.discoveryengine.v1.CompletionInfo.verify(message.completionInfo); + if (error) + return "completionInfo." + error; + } + if (message.transactionInfo != null && message.hasOwnProperty("transactionInfo")) { + var error = $root.google.cloud.discoveryengine.v1.TransactionInfo.verify(message.transactionInfo); + if (error) + return "transactionInfo." + error; + } + if (message.tagIds != null && message.hasOwnProperty("tagIds")) { + if (!Array.isArray(message.tagIds)) + return "tagIds: array expected"; + for (var i = 0; i < message.tagIds.length; ++i) + if (!$util.isString(message.tagIds[i])) + return "tagIds: string[] expected"; + } + if (message.promotionIds != null && message.hasOwnProperty("promotionIds")) { + if (!Array.isArray(message.promotionIds)) + return "promotionIds: array expected"; + for (var i = 0; i < message.promotionIds.length; ++i) + if (!$util.isString(message.promotionIds[i])) + return "promotionIds: string[] expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.mediaInfo != null && message.hasOwnProperty("mediaInfo")) { + var error = $root.google.cloud.discoveryengine.v1.MediaInfo.verify(message.mediaInfo); + if (error) + return "mediaInfo." + error; + } + return null; + }; + + /** + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.UserEvent} UserEvent + */ + UserEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.UserEvent) + return object; + var message = new $root.google.cloud.discoveryengine.v1.UserEvent(); + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.userPseudoId != null) + message.userPseudoId = String(object.userPseudoId); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.userInfo: object expected"); + message.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.fromObject(object.userInfo); + } + if (object.directUserRequest != null) + message.directUserRequest = Boolean(object.directUserRequest); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.pageInfo != null) { + if (typeof object.pageInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.pageInfo: object expected"); + message.pageInfo = $root.google.cloud.discoveryengine.v1.PageInfo.fromObject(object.pageInfo); + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.documents: object expected"); + message.documents[i] = $root.google.cloud.discoveryengine.v1.DocumentInfo.fromObject(object.documents[i]); + } + } + if (object.panel != null) { + if (typeof object.panel !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.panel: object expected"); + message.panel = $root.google.cloud.discoveryengine.v1.PanelInfo.fromObject(object.panel); + } + if (object.searchInfo != null) { + if (typeof object.searchInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.searchInfo: object expected"); + message.searchInfo = $root.google.cloud.discoveryengine.v1.SearchInfo.fromObject(object.searchInfo); + } + if (object.completionInfo != null) { + if (typeof object.completionInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.completionInfo: object expected"); + message.completionInfo = $root.google.cloud.discoveryengine.v1.CompletionInfo.fromObject(object.completionInfo); + } + if (object.transactionInfo != null) { + if (typeof object.transactionInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.transactionInfo: object expected"); + message.transactionInfo = $root.google.cloud.discoveryengine.v1.TransactionInfo.fromObject(object.transactionInfo); + } + if (object.tagIds) { + if (!Array.isArray(object.tagIds)) + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.tagIds: array expected"); + message.tagIds = []; + for (var i = 0; i < object.tagIds.length; ++i) + message.tagIds[i] = String(object.tagIds[i]); + } + if (object.promotionIds) { + if (!Array.isArray(object.promotionIds)) + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.promotionIds: array expected"); + message.promotionIds = []; + for (var i = 0; i < object.promotionIds.length; ++i) + message.promotionIds[i] = String(object.promotionIds[i]); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.discoveryengine.v1.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.mediaInfo != null) { + if (typeof object.mediaInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UserEvent.mediaInfo: object expected"); + message.mediaInfo = $root.google.cloud.discoveryengine.v1.MediaInfo.fromObject(object.mediaInfo); + } + return message; + }; + + /** + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {google.cloud.discoveryengine.v1.UserEvent} message UserEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.documents = []; + object.tagIds = []; + object.promotionIds = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.eventType = ""; + object.userPseudoId = ""; + object.eventTime = null; + object.userInfo = null; + object.directUserRequest = false; + object.sessionId = ""; + object.pageInfo = null; + object.attributionToken = ""; + object.filter = ""; + object.panel = null; + object.searchInfo = null; + object.completionInfo = null; + object.transactionInfo = null; + object.mediaInfo = null; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + object.userPseudoId = message.userPseudoId; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.toObject(message.userInfo, options); + if (message.directUserRequest != null && message.hasOwnProperty("directUserRequest")) + object.directUserRequest = message.directUserRequest; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.pageInfo != null && message.hasOwnProperty("pageInfo")) + object.pageInfo = $root.google.cloud.discoveryengine.v1.PageInfo.toObject(message.pageInfo, options); + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.discoveryengine.v1.DocumentInfo.toObject(message.documents[j], options); + } + if (message.panel != null && message.hasOwnProperty("panel")) + object.panel = $root.google.cloud.discoveryengine.v1.PanelInfo.toObject(message.panel, options); + if (message.searchInfo != null && message.hasOwnProperty("searchInfo")) + object.searchInfo = $root.google.cloud.discoveryengine.v1.SearchInfo.toObject(message.searchInfo, options); + if (message.completionInfo != null && message.hasOwnProperty("completionInfo")) + object.completionInfo = $root.google.cloud.discoveryengine.v1.CompletionInfo.toObject(message.completionInfo, options); + if (message.transactionInfo != null && message.hasOwnProperty("transactionInfo")) + object.transactionInfo = $root.google.cloud.discoveryengine.v1.TransactionInfo.toObject(message.transactionInfo, options); + if (message.tagIds && message.tagIds.length) { + object.tagIds = []; + for (var j = 0; j < message.tagIds.length; ++j) + object.tagIds[j] = message.tagIds[j]; + } + if (message.promotionIds && message.promotionIds.length) { + object.promotionIds = []; + for (var j = 0; j < message.promotionIds.length; ++j) + object.promotionIds[j] = message.promotionIds[j]; + } + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.discoveryengine.v1.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.mediaInfo != null && message.hasOwnProperty("mediaInfo")) + object.mediaInfo = $root.google.cloud.discoveryengine.v1.MediaInfo.toObject(message.mediaInfo, options); + return object; + }; + + /** + * Converts this UserEvent to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @instance + * @returns {Object.} JSON object + */ + UserEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserEvent + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.UserEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.UserEvent"; + }; + + return UserEvent; + })(); + + v1.PageInfo = (function() { + + /** + * Properties of a PageInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface IPageInfo + * @property {string|null} [pageviewId] PageInfo pageviewId + * @property {string|null} [pageCategory] PageInfo pageCategory + * @property {string|null} [uri] PageInfo uri + * @property {string|null} [referrerUri] PageInfo referrerUri + */ + + /** + * Constructs a new PageInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a PageInfo. + * @implements IPageInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.IPageInfo=} [properties] Properties to set + */ + function PageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageInfo pageviewId. + * @member {string} pageviewId + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @instance + */ + PageInfo.prototype.pageviewId = ""; + + /** + * PageInfo pageCategory. + * @member {string} pageCategory + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @instance + */ + PageInfo.prototype.pageCategory = ""; + + /** + * PageInfo uri. + * @member {string} uri + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @instance + */ + PageInfo.prototype.uri = ""; + + /** + * PageInfo referrerUri. + * @member {string} referrerUri + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @instance + */ + PageInfo.prototype.referrerUri = ""; + + /** + * Creates a new PageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPageInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.PageInfo} PageInfo instance + */ + PageInfo.create = function create(properties) { + return new PageInfo(properties); + }; + + /** + * Encodes the specified PageInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.PageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageviewId != null && Object.hasOwnProperty.call(message, "pageviewId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pageviewId); + if (message.pageCategory != null && Object.hasOwnProperty.call(message, "pageCategory")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageCategory); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.referrerUri); + return writer; + }; + + /** + * Encodes the specified PageInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPageInfo} message PageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.PageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageviewId = reader.string(); + break; + } + case 2: { + message.pageCategory = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.referrerUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.PageInfo} PageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageviewId != null && message.hasOwnProperty("pageviewId")) + if (!$util.isString(message.pageviewId)) + return "pageviewId: string expected"; + if (message.pageCategory != null && message.hasOwnProperty("pageCategory")) + if (!$util.isString(message.pageCategory)) + return "pageCategory: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + if (!$util.isString(message.referrerUri)) + return "referrerUri: string expected"; + return null; + }; + + /** + * Creates a PageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.PageInfo} PageInfo + */ + PageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.PageInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.PageInfo(); + if (object.pageviewId != null) + message.pageviewId = String(object.pageviewId); + if (object.pageCategory != null) + message.pageCategory = String(object.pageCategory); + if (object.uri != null) + message.uri = String(object.uri); + if (object.referrerUri != null) + message.referrerUri = String(object.referrerUri); + return message; + }; + + /** + * Creates a plain object from a PageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {google.cloud.discoveryengine.v1.PageInfo} message PageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageviewId = ""; + object.pageCategory = ""; + object.uri = ""; + object.referrerUri = ""; + } + if (message.pageviewId != null && message.hasOwnProperty("pageviewId")) + object.pageviewId = message.pageviewId; + if (message.pageCategory != null && message.hasOwnProperty("pageCategory")) + object.pageCategory = message.pageCategory; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + object.referrerUri = message.referrerUri; + return object; + }; + + /** + * Converts this PageInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @instance + * @returns {Object.} JSON object + */ + PageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.PageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.PageInfo"; + }; + + return PageInfo; + })(); + + v1.SearchInfo = (function() { + + /** + * Properties of a SearchInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface ISearchInfo + * @property {string|null} [searchQuery] SearchInfo searchQuery + * @property {string|null} [orderBy] SearchInfo orderBy + * @property {number|null} [offset] SearchInfo offset + */ + + /** + * Constructs a new SearchInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a SearchInfo. + * @implements ISearchInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.ISearchInfo=} [properties] Properties to set + */ + function SearchInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchInfo searchQuery. + * @member {string} searchQuery + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @instance + */ + SearchInfo.prototype.searchQuery = ""; + + /** + * SearchInfo orderBy. + * @member {string} orderBy + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @instance + */ + SearchInfo.prototype.orderBy = ""; + + /** + * SearchInfo offset. + * @member {number|null|undefined} offset + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @instance + */ + SearchInfo.prototype.offset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SearchInfo _offset. + * @member {"offset"|undefined} _offset + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @instance + */ + Object.defineProperty(SearchInfo.prototype, "_offset", { + get: $util.oneOfGetter($oneOfFields = ["offset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SearchInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {google.cloud.discoveryengine.v1.ISearchInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchInfo} SearchInfo instance + */ + SearchInfo.create = function create(properties) { + return new SearchInfo(properties); + }; + + /** + * Encodes the specified SearchInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {google.cloud.discoveryengine.v1.ISearchInfo} message SearchInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.searchQuery); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.orderBy); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.offset); + return writer; + }; + + /** + * Encodes the specified SearchInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {google.cloud.discoveryengine.v1.ISearchInfo} message SearchInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchInfo} SearchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.searchQuery = reader.string(); + break; + } + case 2: { + message.orderBy = reader.string(); + break; + } + case 3: { + message.offset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchInfo} SearchInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + if (!$util.isString(message.searchQuery)) + return "searchQuery: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) { + properties._offset = 1; + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + } + return null; + }; + + /** + * Creates a SearchInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchInfo} SearchInfo + */ + SearchInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchInfo(); + if (object.searchQuery != null) + message.searchQuery = String(object.searchQuery); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.offset != null) + message.offset = object.offset | 0; + return message; + }; + + /** + * Creates a plain object from a SearchInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {google.cloud.discoveryengine.v1.SearchInfo} message SearchInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.searchQuery = ""; + object.orderBy = ""; + } + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + object.searchQuery = message.searchQuery; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.offset != null && message.hasOwnProperty("offset")) { + object.offset = message.offset; + if (options.oneofs) + object._offset = "offset"; + } + return object; + }; + + /** + * Converts this SearchInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @instance + * @returns {Object.} JSON object + */ + SearchInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchInfo"; + }; + + return SearchInfo; + })(); + + v1.CompletionInfo = (function() { + + /** + * Properties of a CompletionInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICompletionInfo + * @property {string|null} [selectedSuggestion] CompletionInfo selectedSuggestion + * @property {number|null} [selectedPosition] CompletionInfo selectedPosition + */ + + /** + * Constructs a new CompletionInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CompletionInfo. + * @implements ICompletionInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.ICompletionInfo=} [properties] Properties to set + */ + function CompletionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompletionInfo selectedSuggestion. + * @member {string} selectedSuggestion + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @instance + */ + CompletionInfo.prototype.selectedSuggestion = ""; + + /** + * CompletionInfo selectedPosition. + * @member {number} selectedPosition + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @instance + */ + CompletionInfo.prototype.selectedPosition = 0; + + /** + * Creates a new CompletionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ICompletionInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CompletionInfo} CompletionInfo instance + */ + CompletionInfo.create = function create(properties) { + return new CompletionInfo(properties); + }; + + /** + * Encodes the specified CompletionInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.CompletionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ICompletionInfo} message CompletionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedSuggestion); + if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.selectedPosition); + return writer; + }; + + /** + * Encodes the specified CompletionInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CompletionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ICompletionInfo} message CompletionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CompletionInfo} CompletionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CompletionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selectedSuggestion = reader.string(); + break; + } + case 2: { + message.selectedPosition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CompletionInfo} CompletionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + if (!$util.isString(message.selectedSuggestion)) + return "selectedSuggestion: string expected"; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + if (!$util.isInteger(message.selectedPosition)) + return "selectedPosition: integer expected"; + return null; + }; + + /** + * Creates a CompletionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CompletionInfo} CompletionInfo + */ + CompletionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CompletionInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CompletionInfo(); + if (object.selectedSuggestion != null) + message.selectedSuggestion = String(object.selectedSuggestion); + if (object.selectedPosition != null) + message.selectedPosition = object.selectedPosition | 0; + return message; + }; + + /** + * Creates a plain object from a CompletionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {google.cloud.discoveryengine.v1.CompletionInfo} message CompletionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectedSuggestion = ""; + object.selectedPosition = 0; + } + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + object.selectedSuggestion = message.selectedSuggestion; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + object.selectedPosition = message.selectedPosition; + return object; + }; + + /** + * Converts this CompletionInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @instance + * @returns {Object.} JSON object + */ + CompletionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompletionInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CompletionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompletionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CompletionInfo"; + }; + + return CompletionInfo; + })(); + + v1.TransactionInfo = (function() { + + /** + * Properties of a TransactionInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface ITransactionInfo + * @property {number|null} [value] TransactionInfo value + * @property {string|null} [currency] TransactionInfo currency + * @property {string|null} [transactionId] TransactionInfo transactionId + * @property {number|null} [tax] TransactionInfo tax + * @property {number|null} [cost] TransactionInfo cost + * @property {number|null} [discountValue] TransactionInfo discountValue + */ + + /** + * Constructs a new TransactionInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a TransactionInfo. + * @implements ITransactionInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.ITransactionInfo=} [properties] Properties to set + */ + function TransactionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionInfo value. + * @member {number|null|undefined} value + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.value = null; + + /** + * TransactionInfo currency. + * @member {string} currency + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.currency = ""; + + /** + * TransactionInfo transactionId. + * @member {string} transactionId + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.transactionId = ""; + + /** + * TransactionInfo tax. + * @member {number|null|undefined} tax + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.tax = null; + + /** + * TransactionInfo cost. + * @member {number|null|undefined} cost + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.cost = null; + + /** + * TransactionInfo discountValue. + * @member {number|null|undefined} discountValue + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + TransactionInfo.prototype.discountValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionInfo _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + Object.defineProperty(TransactionInfo.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransactionInfo _tax. + * @member {"tax"|undefined} _tax + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + Object.defineProperty(TransactionInfo.prototype, "_tax", { + get: $util.oneOfGetter($oneOfFields = ["tax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransactionInfo _cost. + * @member {"cost"|undefined} _cost + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + Object.defineProperty(TransactionInfo.prototype, "_cost", { + get: $util.oneOfGetter($oneOfFields = ["cost"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransactionInfo _discountValue. + * @member {"discountValue"|undefined} _discountValue + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + */ + Object.defineProperty(TransactionInfo.prototype, "_discountValue", { + get: $util.oneOfGetter($oneOfFields = ["discountValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ITransactionInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.TransactionInfo} TransactionInfo instance + */ + TransactionInfo.create = function create(properties) { + return new TransactionInfo(properties); + }; + + /** + * Encodes the specified TransactionInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.TransactionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ITransactionInfo} message TransactionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.currency); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionId); + if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.tax); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.cost); + if (message.discountValue != null && Object.hasOwnProperty.call(message, "discountValue")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.discountValue); + return writer; + }; + + /** + * Encodes the specified TransactionInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.TransactionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {google.cloud.discoveryengine.v1.ITransactionInfo} message TransactionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.TransactionInfo} TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.TransactionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + case 2: { + message.currency = reader.string(); + break; + } + case 3: { + message.transactionId = reader.string(); + break; + } + case 4: { + message.tax = reader.float(); + break; + } + case 5: { + message.cost = reader.float(); + break; + } + case 6: { + message.discountValue = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.TransactionInfo} TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (typeof message.value !== "number") + return "value: number expected"; + } + if (message.currency != null && message.hasOwnProperty("currency")) + if (!$util.isString(message.currency)) + return "currency: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + if (message.tax != null && message.hasOwnProperty("tax")) { + properties._tax = 1; + if (typeof message.tax !== "number") + return "tax: number expected"; + } + if (message.cost != null && message.hasOwnProperty("cost")) { + properties._cost = 1; + if (typeof message.cost !== "number") + return "cost: number expected"; + } + if (message.discountValue != null && message.hasOwnProperty("discountValue")) { + properties._discountValue = 1; + if (typeof message.discountValue !== "number") + return "discountValue: number expected"; + } + return null; + }; + + /** + * Creates a TransactionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.TransactionInfo} TransactionInfo + */ + TransactionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.TransactionInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.TransactionInfo(); + if (object.value != null) + message.value = Number(object.value); + if (object.currency != null) + message.currency = String(object.currency); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + if (object.tax != null) + message.tax = Number(object.tax); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.discountValue != null) + message.discountValue = Number(object.discountValue); + return message; + }; + + /** + * Creates a plain object from a TransactionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {google.cloud.discoveryengine.v1.TransactionInfo} message TransactionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currency = ""; + object.transactionId = ""; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.currency != null && message.hasOwnProperty("currency")) + object.currency = message.currency; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = message.transactionId; + if (message.tax != null && message.hasOwnProperty("tax")) { + object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; + if (options.oneofs) + object._tax = "tax"; + } + if (message.cost != null && message.hasOwnProperty("cost")) { + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (options.oneofs) + object._cost = "cost"; + } + if (message.discountValue != null && message.hasOwnProperty("discountValue")) { + object.discountValue = options.json && !isFinite(message.discountValue) ? String(message.discountValue) : message.discountValue; + if (options.oneofs) + object._discountValue = "discountValue"; + } + return object; + }; + + /** + * Converts this TransactionInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @instance + * @returns {Object.} JSON object + */ + TransactionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.TransactionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.TransactionInfo"; + }; + + return TransactionInfo; + })(); + + v1.DocumentInfo = (function() { + + /** + * Properties of a DocumentInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface IDocumentInfo + * @property {string|null} [id] DocumentInfo id + * @property {string|null} [name] DocumentInfo name + * @property {number|null} [quantity] DocumentInfo quantity + * @property {Array.|null} [promotionIds] DocumentInfo promotionIds + */ + + /** + * Constructs a new DocumentInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a DocumentInfo. + * @implements IDocumentInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.IDocumentInfo=} [properties] Properties to set + */ + function DocumentInfo(properties) { + this.promotionIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInfo id. + * @member {string|null|undefined} id + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + DocumentInfo.prototype.id = null; + + /** + * DocumentInfo name. + * @member {string|null|undefined} name + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + DocumentInfo.prototype.name = null; + + /** + * DocumentInfo quantity. + * @member {number|null|undefined} quantity + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + DocumentInfo.prototype.quantity = null; + + /** + * DocumentInfo promotionIds. + * @member {Array.} promotionIds + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + DocumentInfo.prototype.promotionIds = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentInfo documentDescriptor. + * @member {"id"|"name"|undefined} documentDescriptor + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + Object.defineProperty(DocumentInfo.prototype, "documentDescriptor", { + get: $util.oneOfGetter($oneOfFields = ["id", "name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DocumentInfo _quantity. + * @member {"quantity"|undefined} _quantity + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + */ + Object.defineProperty(DocumentInfo.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {google.cloud.discoveryengine.v1.IDocumentInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.DocumentInfo} DocumentInfo instance + */ + DocumentInfo.create = function create(properties) { + return new DocumentInfo(properties); + }; + + /** + * Encodes the specified DocumentInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.DocumentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {google.cloud.discoveryengine.v1.IDocumentInfo} message DocumentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.quantity); + if (message.promotionIds != null && message.promotionIds.length) + for (var i = 0; i < message.promotionIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.promotionIds[i]); + return writer; + }; + + /** + * Encodes the specified DocumentInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DocumentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {google.cloud.discoveryengine.v1.IDocumentInfo} message DocumentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.DocumentInfo} DocumentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.DocumentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.quantity = reader.int32(); + break; + } + case 4: { + if (!(message.promotionIds && message.promotionIds.length)) + message.promotionIds = []; + message.promotionIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.DocumentInfo} DocumentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties.documentDescriptor = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (properties.documentDescriptor === 1) + return "documentDescriptor: multiple values"; + properties.documentDescriptor = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity)) + return "quantity: integer expected"; + } + if (message.promotionIds != null && message.hasOwnProperty("promotionIds")) { + if (!Array.isArray(message.promotionIds)) + return "promotionIds: array expected"; + for (var i = 0; i < message.promotionIds.length; ++i) + if (!$util.isString(message.promotionIds[i])) + return "promotionIds: string[] expected"; + } + return null; + }; + + /** + * Creates a DocumentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.DocumentInfo} DocumentInfo + */ + DocumentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.DocumentInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.DocumentInfo(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.quantity != null) + message.quantity = object.quantity | 0; + if (object.promotionIds) { + if (!Array.isArray(object.promotionIds)) + throw TypeError(".google.cloud.discoveryengine.v1.DocumentInfo.promotionIds: array expected"); + message.promotionIds = []; + for (var i = 0; i < object.promotionIds.length; ++i) + message.promotionIds[i] = String(object.promotionIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {google.cloud.discoveryengine.v1.DocumentInfo} message DocumentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.promotionIds = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object.documentDescriptor = "id"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object.documentDescriptor = "name"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + object.quantity = message.quantity; + if (options.oneofs) + object._quantity = "quantity"; + } + if (message.promotionIds && message.promotionIds.length) { + object.promotionIds = []; + for (var j = 0; j < message.promotionIds.length; ++j) + object.promotionIds[j] = message.promotionIds[j]; + } + return object; + }; + + /** + * Converts this DocumentInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @instance + * @returns {Object.} JSON object + */ + DocumentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.DocumentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.DocumentInfo"; + }; + + return DocumentInfo; + })(); + + v1.PanelInfo = (function() { + + /** + * Properties of a PanelInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface IPanelInfo + * @property {string|null} [panelId] PanelInfo panelId + * @property {string|null} [displayName] PanelInfo displayName + * @property {number|null} [panelPosition] PanelInfo panelPosition + * @property {number|null} [totalPanels] PanelInfo totalPanels + */ + + /** + * Constructs a new PanelInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a PanelInfo. + * @implements IPanelInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.IPanelInfo=} [properties] Properties to set + */ + function PanelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PanelInfo panelId. + * @member {string} panelId + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + PanelInfo.prototype.panelId = ""; + + /** + * PanelInfo displayName. + * @member {string} displayName + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + PanelInfo.prototype.displayName = ""; + + /** + * PanelInfo panelPosition. + * @member {number|null|undefined} panelPosition + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + PanelInfo.prototype.panelPosition = null; + + /** + * PanelInfo totalPanels. + * @member {number|null|undefined} totalPanels + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + PanelInfo.prototype.totalPanels = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PanelInfo _panelPosition. + * @member {"panelPosition"|undefined} _panelPosition + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + Object.defineProperty(PanelInfo.prototype, "_panelPosition", { + get: $util.oneOfGetter($oneOfFields = ["panelPosition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PanelInfo _totalPanels. + * @member {"totalPanels"|undefined} _totalPanels + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + */ + Object.defineProperty(PanelInfo.prototype, "_totalPanels", { + get: $util.oneOfGetter($oneOfFields = ["totalPanels"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PanelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPanelInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.PanelInfo} PanelInfo instance + */ + PanelInfo.create = function create(properties) { + return new PanelInfo(properties); + }; + + /** + * Encodes the specified PanelInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.PanelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPanelInfo} message PanelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PanelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.panelId != null && Object.hasOwnProperty.call(message, "panelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.panelId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.panelPosition != null && Object.hasOwnProperty.call(message, "panelPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.panelPosition); + if (message.totalPanels != null && Object.hasOwnProperty.call(message, "totalPanels")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalPanels); + return writer; + }; + + /** + * Encodes the specified PanelInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PanelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {google.cloud.discoveryengine.v1.IPanelInfo} message PanelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PanelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PanelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.PanelInfo} PanelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PanelInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.PanelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.panelId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.panelPosition = reader.int32(); + break; + } + case 5: { + message.totalPanels = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PanelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.PanelInfo} PanelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PanelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PanelInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PanelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.panelId != null && message.hasOwnProperty("panelId")) + if (!$util.isString(message.panelId)) + return "panelId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.panelPosition != null && message.hasOwnProperty("panelPosition")) { + properties._panelPosition = 1; + if (!$util.isInteger(message.panelPosition)) + return "panelPosition: integer expected"; + } + if (message.totalPanels != null && message.hasOwnProperty("totalPanels")) { + properties._totalPanels = 1; + if (!$util.isInteger(message.totalPanels)) + return "totalPanels: integer expected"; + } + return null; + }; + + /** + * Creates a PanelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.PanelInfo} PanelInfo + */ + PanelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.PanelInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.PanelInfo(); + if (object.panelId != null) + message.panelId = String(object.panelId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.panelPosition != null) + message.panelPosition = object.panelPosition | 0; + if (object.totalPanels != null) + message.totalPanels = object.totalPanels | 0; + return message; + }; + + /** + * Creates a plain object from a PanelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {google.cloud.discoveryengine.v1.PanelInfo} message PanelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PanelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.panelId = ""; + object.displayName = ""; + } + if (message.panelId != null && message.hasOwnProperty("panelId")) + object.panelId = message.panelId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.panelPosition != null && message.hasOwnProperty("panelPosition")) { + object.panelPosition = message.panelPosition; + if (options.oneofs) + object._panelPosition = "panelPosition"; + } + if (message.totalPanels != null && message.hasOwnProperty("totalPanels")) { + object.totalPanels = message.totalPanels; + if (options.oneofs) + object._totalPanels = "totalPanels"; + } + return object; + }; + + /** + * Converts this PanelInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @instance + * @returns {Object.} JSON object + */ + PanelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PanelInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.PanelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PanelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.PanelInfo"; + }; + + return PanelInfo; + })(); + + v1.MediaInfo = (function() { + + /** + * Properties of a MediaInfo. + * @memberof google.cloud.discoveryengine.v1 + * @interface IMediaInfo + * @property {google.protobuf.IDuration|null} [mediaProgressDuration] MediaInfo mediaProgressDuration + * @property {number|null} [mediaProgressPercentage] MediaInfo mediaProgressPercentage + */ + + /** + * Constructs a new MediaInfo. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a MediaInfo. + * @implements IMediaInfo + * @constructor + * @param {google.cloud.discoveryengine.v1.IMediaInfo=} [properties] Properties to set + */ + function MediaInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MediaInfo mediaProgressDuration. + * @member {google.protobuf.IDuration|null|undefined} mediaProgressDuration + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @instance + */ + MediaInfo.prototype.mediaProgressDuration = null; + + /** + * MediaInfo mediaProgressPercentage. + * @member {number|null|undefined} mediaProgressPercentage + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @instance + */ + MediaInfo.prototype.mediaProgressPercentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MediaInfo _mediaProgressPercentage. + * @member {"mediaProgressPercentage"|undefined} _mediaProgressPercentage + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @instance + */ + Object.defineProperty(MediaInfo.prototype, "_mediaProgressPercentage", { + get: $util.oneOfGetter($oneOfFields = ["mediaProgressPercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MediaInfo instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {google.cloud.discoveryengine.v1.IMediaInfo=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.MediaInfo} MediaInfo instance + */ + MediaInfo.create = function create(properties) { + return new MediaInfo(properties); + }; + + /** + * Encodes the specified MediaInfo message. Does not implicitly {@link google.cloud.discoveryengine.v1.MediaInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {google.cloud.discoveryengine.v1.IMediaInfo} message MediaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mediaProgressDuration != null && Object.hasOwnProperty.call(message, "mediaProgressDuration")) + $root.google.protobuf.Duration.encode(message.mediaProgressDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mediaProgressPercentage != null && Object.hasOwnProperty.call(message, "mediaProgressPercentage")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.mediaProgressPercentage); + return writer; + }; + + /** + * Encodes the specified MediaInfo message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.MediaInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {google.cloud.discoveryengine.v1.IMediaInfo} message MediaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MediaInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.MediaInfo} MediaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.MediaInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mediaProgressDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mediaProgressPercentage = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MediaInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.MediaInfo} MediaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MediaInfo message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MediaInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mediaProgressDuration != null && message.hasOwnProperty("mediaProgressDuration")) { + var error = $root.google.protobuf.Duration.verify(message.mediaProgressDuration); + if (error) + return "mediaProgressDuration." + error; + } + if (message.mediaProgressPercentage != null && message.hasOwnProperty("mediaProgressPercentage")) { + properties._mediaProgressPercentage = 1; + if (typeof message.mediaProgressPercentage !== "number") + return "mediaProgressPercentage: number expected"; + } + return null; + }; + + /** + * Creates a MediaInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.MediaInfo} MediaInfo + */ + MediaInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.MediaInfo) + return object; + var message = new $root.google.cloud.discoveryengine.v1.MediaInfo(); + if (object.mediaProgressDuration != null) { + if (typeof object.mediaProgressDuration !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.MediaInfo.mediaProgressDuration: object expected"); + message.mediaProgressDuration = $root.google.protobuf.Duration.fromObject(object.mediaProgressDuration); + } + if (object.mediaProgressPercentage != null) + message.mediaProgressPercentage = Number(object.mediaProgressPercentage); + return message; + }; + + /** + * Creates a plain object from a MediaInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {google.cloud.discoveryengine.v1.MediaInfo} message MediaInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MediaInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mediaProgressDuration = null; + if (message.mediaProgressDuration != null && message.hasOwnProperty("mediaProgressDuration")) + object.mediaProgressDuration = $root.google.protobuf.Duration.toObject(message.mediaProgressDuration, options); + if (message.mediaProgressPercentage != null && message.hasOwnProperty("mediaProgressPercentage")) { + object.mediaProgressPercentage = options.json && !isFinite(message.mediaProgressPercentage) ? String(message.mediaProgressPercentage) : message.mediaProgressPercentage; + if (options.oneofs) + object._mediaProgressPercentage = "mediaProgressPercentage"; + } + return object; + }; + + /** + * Converts this MediaInfo to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @instance + * @returns {Object.} JSON object + */ + MediaInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MediaInfo + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.MediaInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MediaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.MediaInfo"; + }; + + return MediaInfo; + })(); + + v1.PurgeDocumentsRequest = (function() { + + /** + * Properties of a PurgeDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IPurgeDocumentsRequest + * @property {string|null} [parent] PurgeDocumentsRequest parent + * @property {string|null} [filter] PurgeDocumentsRequest filter + * @property {boolean|null} [force] PurgeDocumentsRequest force + */ + + /** + * Constructs a new PurgeDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a PurgeDocumentsRequest. + * @implements IPurgeDocumentsRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest=} [properties] Properties to set + */ + function PurgeDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @instance + */ + PurgeDocumentsRequest.prototype.parent = ""; + + /** + * PurgeDocumentsRequest filter. + * @member {string} filter + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @instance + */ + PurgeDocumentsRequest.prototype.filter = ""; + + /** + * PurgeDocumentsRequest force. + * @member {boolean} force + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @instance + */ + PurgeDocumentsRequest.prototype.force = false; + + /** + * Creates a new PurgeDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsRequest} PurgeDocumentsRequest instance + */ + PurgeDocumentsRequest.create = function create(properties) { + return new PurgeDocumentsRequest(properties); + }; + + /** + * Encodes the specified PurgeDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest} message PurgeDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified PurgeDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsRequest} message PurgeDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsRequest} PurgeDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsRequest} PurgeDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeDocumentsRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a PurgeDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsRequest} PurgeDocumentsRequest + */ + PurgeDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.PurgeDocumentsRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a PurgeDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1.PurgeDocumentsRequest} message PurgeDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this PurgeDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.PurgeDocumentsRequest"; + }; + + return PurgeDocumentsRequest; + })(); + + v1.PurgeDocumentsResponse = (function() { + + /** + * Properties of a PurgeDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface IPurgeDocumentsResponse + * @property {number|Long|null} [purgeCount] PurgeDocumentsResponse purgeCount + * @property {Array.|null} [purgeSample] PurgeDocumentsResponse purgeSample + */ + + /** + * Constructs a new PurgeDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a PurgeDocumentsResponse. + * @implements IPurgeDocumentsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsResponse=} [properties] Properties to set + */ + function PurgeDocumentsResponse(properties) { + this.purgeSample = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeDocumentsResponse purgeCount. + * @member {number|Long} purgeCount + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @instance + */ + PurgeDocumentsResponse.prototype.purgeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeDocumentsResponse purgeSample. + * @member {Array.} purgeSample + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @instance + */ + PurgeDocumentsResponse.prototype.purgeSample = $util.emptyArray; + + /** + * Creates a new PurgeDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsResponse} PurgeDocumentsResponse instance + */ + PurgeDocumentsResponse.create = function create(properties) { + return new PurgeDocumentsResponse(properties); + }; + + /** + * Encodes the specified PurgeDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsResponse} message PurgeDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purgeCount != null && Object.hasOwnProperty.call(message, "purgeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgeCount); + if (message.purgeSample != null && message.purgeSample.length) + for (var i = 0; i < message.purgeSample.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.purgeSample[i]); + return writer; + }; + + /** + * Encodes the specified PurgeDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsResponse} message PurgeDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsResponse} PurgeDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.purgeCount = reader.int64(); + break; + } + case 2: { + if (!(message.purgeSample && message.purgeSample.length)) + message.purgeSample = []; + message.purgeSample.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsResponse} PurgeDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeDocumentsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (!$util.isInteger(message.purgeCount) && !(message.purgeCount && $util.isInteger(message.purgeCount.low) && $util.isInteger(message.purgeCount.high))) + return "purgeCount: integer|Long expected"; + if (message.purgeSample != null && message.hasOwnProperty("purgeSample")) { + if (!Array.isArray(message.purgeSample)) + return "purgeSample: array expected"; + for (var i = 0; i < message.purgeSample.length; ++i) + if (!$util.isString(message.purgeSample[i])) + return "purgeSample: string[] expected"; + } + return null; + }; + + /** + * Creates a PurgeDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsResponse} PurgeDocumentsResponse + */ + PurgeDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.PurgeDocumentsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsResponse(); + if (object.purgeCount != null) + if ($util.Long) + (message.purgeCount = $util.Long.fromValue(object.purgeCount)).unsigned = false; + else if (typeof object.purgeCount === "string") + message.purgeCount = parseInt(object.purgeCount, 10); + else if (typeof object.purgeCount === "number") + message.purgeCount = object.purgeCount; + else if (typeof object.purgeCount === "object") + message.purgeCount = new $util.LongBits(object.purgeCount.low >>> 0, object.purgeCount.high >>> 0).toNumber(); + if (object.purgeSample) { + if (!Array.isArray(object.purgeSample)) + throw TypeError(".google.cloud.discoveryengine.v1.PurgeDocumentsResponse.purgeSample: array expected"); + message.purgeSample = []; + for (var i = 0; i < object.purgeSample.length; ++i) + message.purgeSample[i] = String(object.purgeSample[i]); + } + return message; + }; + + /** + * Creates a plain object from a PurgeDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1.PurgeDocumentsResponse} message PurgeDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeSample = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgeCount = options.longs === String ? "0" : 0; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (typeof message.purgeCount === "number") + object.purgeCount = options.longs === String ? String(message.purgeCount) : message.purgeCount; + else + object.purgeCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgeCount) : options.longs === Number ? new $util.LongBits(message.purgeCount.low >>> 0, message.purgeCount.high >>> 0).toNumber() : message.purgeCount; + if (message.purgeSample && message.purgeSample.length) { + object.purgeSample = []; + for (var j = 0; j < message.purgeSample.length; ++j) + object.purgeSample[j] = message.purgeSample[j]; + } + return object; + }; + + /** + * Converts this PurgeDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + PurgeDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.PurgeDocumentsResponse"; + }; + + return PurgeDocumentsResponse; + })(); + + v1.PurgeDocumentsMetadata = (function() { + + /** + * Properties of a PurgeDocumentsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface IPurgeDocumentsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] PurgeDocumentsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PurgeDocumentsMetadata updateTime + * @property {number|Long|null} [successCount] PurgeDocumentsMetadata successCount + * @property {number|Long|null} [failureCount] PurgeDocumentsMetadata failureCount + */ + + /** + * Constructs a new PurgeDocumentsMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a PurgeDocumentsMetadata. + * @implements IPurgeDocumentsMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata=} [properties] Properties to set + */ + function PurgeDocumentsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeDocumentsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @instance + */ + PurgeDocumentsMetadata.prototype.createTime = null; + + /** + * PurgeDocumentsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @instance + */ + PurgeDocumentsMetadata.prototype.updateTime = null; + + /** + * PurgeDocumentsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @instance + */ + PurgeDocumentsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeDocumentsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @instance + */ + PurgeDocumentsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PurgeDocumentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsMetadata} PurgeDocumentsMetadata instance + */ + PurgeDocumentsMetadata.create = function create(properties) { + return new PurgeDocumentsMetadata(properties); + }; + + /** + * Encodes the specified PurgeDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata} message PurgeDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified PurgeDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.PurgeDocumentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata} message PurgeDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeDocumentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsMetadata} PurgeDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeDocumentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsMetadata} PurgeDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeDocumentsMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeDocumentsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates a PurgeDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.PurgeDocumentsMetadata} PurgeDocumentsMetadata + */ + PurgeDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.PurgeDocumentsMetadata.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.discoveryengine.v1.PurgeDocumentsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PurgeDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {google.cloud.discoveryengine.v1.PurgeDocumentsMetadata} message PurgeDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + 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.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this PurgeDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + PurgeDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeDocumentsMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.PurgeDocumentsMetadata"; + }; + + return PurgeDocumentsMetadata; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.discoveryengine.v1 + * @interface ISchema + * @property {google.protobuf.IStruct|null} [structSchema] Schema structSchema + * @property {string|null} [jsonSchema] Schema jsonSchema + * @property {string|null} [name] Schema name + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.discoveryengine.v1.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema structSchema. + * @member {google.protobuf.IStruct|null|undefined} structSchema + * @memberof google.cloud.discoveryengine.v1.Schema + * @instance + */ + Schema.prototype.structSchema = null; + + /** + * Schema jsonSchema. + * @member {string|null|undefined} jsonSchema + * @memberof google.cloud.discoveryengine.v1.Schema + * @instance + */ + Schema.prototype.jsonSchema = null; + + /** + * Schema name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.Schema + * @instance + */ + Schema.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Schema schema. + * @member {"structSchema"|"jsonSchema"|undefined} schema + * @memberof google.cloud.discoveryengine.v1.Schema + * @instance + */ + Object.defineProperty(Schema.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["structSchema", "jsonSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {google.cloud.discoveryengine.v1.ISchema=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.discoveryengine.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {google.cloud.discoveryengine.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.structSchema != null && Object.hasOwnProperty.call(message, "structSchema")) + $root.google.protobuf.Struct.encode(message.structSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jsonSchema != null && Object.hasOwnProperty.call(message, "jsonSchema")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jsonSchema); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {google.cloud.discoveryengine.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.structSchema = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.jsonSchema = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.structSchema != null && message.hasOwnProperty("structSchema")) { + properties.schema = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structSchema); + if (error) + return "structSchema." + error; + } + } + if (message.jsonSchema != null && message.hasOwnProperty("jsonSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + if (!$util.isString(message.jsonSchema)) + return "jsonSchema: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.Schema) + return object; + var message = new $root.google.cloud.discoveryengine.v1.Schema(); + if (object.structSchema != null) { + if (typeof object.structSchema !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.Schema.structSchema: object expected"); + message.structSchema = $root.google.protobuf.Struct.fromObject(object.structSchema); + } + if (object.jsonSchema != null) + message.jsonSchema = String(object.jsonSchema); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {google.cloud.discoveryengine.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.structSchema != null && message.hasOwnProperty("structSchema")) { + object.structSchema = $root.google.protobuf.Struct.toObject(message.structSchema, options); + if (options.oneofs) + object.schema = "structSchema"; + } + if (message.jsonSchema != null && message.hasOwnProperty("jsonSchema")) { + object.jsonSchema = message.jsonSchema; + if (options.oneofs) + object.schema = "jsonSchema"; + } + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.Schema"; + }; + + return Schema; + })(); + + v1.SchemaService = (function() { + + /** + * Constructs a new SchemaService service. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a SchemaService + * @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 SchemaService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SchemaService; + + /** + * Creates new SchemaService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @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 {SchemaService} RPC service. Useful where requests and/or responses are streamed. + */ + SchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|getSchema}. + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @typedef GetSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.Schema} [response] Schema + */ + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SchemaService.GetSchemaCallback} callback Node-style callback called with the error, if any, and Schema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.getSchema = function getSchema(request, callback) { + return this.rpcCall(getSchema, $root.google.cloud.discoveryengine.v1.GetSchemaRequest, $root.google.cloud.discoveryengine.v1.Schema, request, callback); + }, "name", { value: "GetSchema" }); + + /** + * Calls GetSchema. + * @function getSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|listSchemas}. + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @typedef ListSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.ListSchemasResponse} [response] ListSchemasResponse + */ + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SchemaService.ListSchemasCallback} callback Node-style callback called with the error, if any, and ListSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.listSchemas = function listSchemas(request, callback) { + return this.rpcCall(listSchemas, $root.google.cloud.discoveryengine.v1.ListSchemasRequest, $root.google.cloud.discoveryengine.v1.ListSchemasResponse, request, callback); + }, "name", { value: "ListSchemas" }); + + /** + * Calls ListSchemas. + * @function listSchemas + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest} request ListSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|createSchema}. + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @typedef CreateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SchemaService.CreateSchemaCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.createSchema = function createSchema(request, callback) { + return this.rpcCall(createSchema, $root.google.cloud.discoveryengine.v1.CreateSchemaRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSchema" }); + + /** + * Calls CreateSchema. + * @function createSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|updateSchema}. + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @typedef UpdateSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSchema. + * @function updateSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest} request UpdateSchemaRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SchemaService.UpdateSchemaCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.updateSchema = function updateSchema(request, callback) { + return this.rpcCall(updateSchema, $root.google.cloud.discoveryengine.v1.UpdateSchemaRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSchema" }); + + /** + * Calls UpdateSchema. + * @function updateSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest} request UpdateSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SchemaService|deleteSchema}. + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @typedef DeleteSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SchemaService.DeleteSchemaCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SchemaService.prototype.deleteSchema = function deleteSchema(request, callback) { + return this.rpcCall(deleteSchema, $root.google.cloud.discoveryengine.v1.DeleteSchemaRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSchema" }); + + /** + * Calls DeleteSchema. + * @function deleteSchema + * @memberof google.cloud.discoveryengine.v1.SchemaService + * @instance + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SchemaService; + })(); + + v1.GetSchemaRequest = (function() { + + /** + * Properties of a GetSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IGetSchemaRequest + * @property {string|null} [name] GetSchemaRequest name + */ + + /** + * Constructs a new GetSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a GetSchemaRequest. + * @implements IGetSchemaRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest=} [properties] Properties to set + */ + function GetSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.name = ""; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.GetSchemaRequest} GetSchemaRequest instance + */ + GetSchemaRequest.create = function create(properties) { + return new GetSchemaRequest(properties); + }; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.GetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.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 GetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.GetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.GetSchemaRequest(); + 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 GetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaRequest.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 GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.GetSchemaRequest} GetSchemaRequest + */ + GetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.GetSchemaRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.GetSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.GetSchemaRequest} message GetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaRequest.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 GetSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.GetSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.GetSchemaRequest"; + }; + + return GetSchemaRequest; + })(); + + v1.ListSchemasRequest = (function() { + + /** + * Properties of a ListSchemasRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IListSchemasRequest + * @property {string|null} [parent] ListSchemasRequest parent + * @property {number|null} [pageSize] ListSchemasRequest pageSize + * @property {string|null} [pageToken] ListSchemasRequest pageToken + */ + + /** + * Constructs a new ListSchemasRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a ListSchemasRequest. + * @implements IListSchemasRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest=} [properties] Properties to set + */ + function ListSchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.parent = ""; + + /** + * ListSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageSize = 0; + + /** + * ListSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @instance + */ + ListSchemasRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ListSchemasRequest} ListSchemasRequest instance + */ + ListSchemasRequest.create = function create(properties) { + return new ListSchemasRequest(properties); + }; + + /** + * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ListSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ListSchemasRequest} ListSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ListSchemasRequest} ListSchemasRequest + */ + ListSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ListSchemasRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ListSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {google.cloud.discoveryengine.v1.ListSchemasRequest} message ListSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ListSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ListSchemasRequest"; + }; + + return ListSchemasRequest; + })(); + + v1.ListSchemasResponse = (function() { + + /** + * Properties of a ListSchemasResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface IListSchemasResponse + * @property {Array.|null} [schemas] ListSchemasResponse schemas + * @property {string|null} [nextPageToken] ListSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListSchemasResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a ListSchemasResponse. + * @implements IListSchemasResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.IListSchemasResponse=} [properties] Properties to set + */ + function ListSchemasResponse(properties) { + this.schemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchemasResponse schemas. + * @member {Array.} schemas + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.schemas = $util.emptyArray; + + /** + * ListSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @instance + */ + ListSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.ListSchemasResponse} ListSchemasResponse instance + */ + ListSchemasResponse.create = function create(properties) { + return new ListSchemasResponse(properties); + }; + + /** + * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemas != null && message.schemas.length) + for (var i = 0; i < message.schemas.length; ++i) + $root.google.cloud.discoveryengine.v1.Schema.encode(message.schemas[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 ListSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.ListSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {google.cloud.discoveryengine.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.ListSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.schemas && message.schemas.length)) + message.schemas = []; + message.schemas.push($root.google.cloud.discoveryengine.v1.Schema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.ListSchemasResponse} ListSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchemasResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemas != null && message.hasOwnProperty("schemas")) { + if (!Array.isArray(message.schemas)) + return "schemas: array expected"; + for (var i = 0; i < message.schemas.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.Schema.verify(message.schemas[i]); + if (error) + return "schemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.ListSchemasResponse} ListSchemasResponse + */ + ListSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.ListSchemasResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.ListSchemasResponse(); + if (object.schemas) { + if (!Array.isArray(object.schemas)) + throw TypeError(".google.cloud.discoveryengine.v1.ListSchemasResponse.schemas: array expected"); + message.schemas = []; + for (var i = 0; i < object.schemas.length; ++i) { + if (typeof object.schemas[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.ListSchemasResponse.schemas: object expected"); + message.schemas[i] = $root.google.cloud.discoveryengine.v1.Schema.fromObject(object.schemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {google.cloud.discoveryengine.v1.ListSchemasResponse} message ListSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schemas && message.schemas.length) { + object.schemas = []; + for (var j = 0; j < message.schemas.length; ++j) + object.schemas[j] = $root.google.cloud.discoveryengine.v1.Schema.toObject(message.schemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.ListSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.ListSchemasResponse"; + }; + + return ListSchemasResponse; + })(); + + v1.CreateSchemaRequest = (function() { + + /** + * Properties of a CreateSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICreateSchemaRequest + * @property {string|null} [parent] CreateSchemaRequest parent + * @property {google.cloud.discoveryengine.v1.ISchema|null} [schema] CreateSchemaRequest schema + * @property {string|null} [schemaId] CreateSchemaRequest schemaId + */ + + /** + * Constructs a new CreateSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CreateSchemaRequest. + * @implements ICreateSchemaRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest=} [properties] Properties to set + */ + function CreateSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.parent = ""; + + /** + * CreateSchemaRequest schema. + * @member {google.cloud.discoveryengine.v1.ISchema|null|undefined} schema + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schema = null; + + /** + * CreateSchemaRequest schemaId. + * @member {string} schemaId + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @instance + */ + CreateSchemaRequest.prototype.schemaId = ""; + + /** + * Creates a new CreateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CreateSchemaRequest} CreateSchemaRequest instance + */ + CreateSchemaRequest.create = function create(properties) { + return new CreateSchemaRequest(properties); + }; + + /** + * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.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.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.discoveryengine.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); + return writer; + }; + + /** + * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CreateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schema = $root.google.cloud.discoveryengine.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.schemaId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CreateSchemaRequest} CreateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaRequest.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.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.discoveryengine.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + if (!$util.isString(message.schemaId)) + return "schemaId: string expected"; + return null; + }; + + /** + * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CreateSchemaRequest} CreateSchemaRequest + */ + CreateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CreateSchemaRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CreateSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.CreateSchemaRequest.schema: object expected"); + message.schema = $root.google.cloud.discoveryengine.v1.Schema.fromObject(object.schema); + } + if (object.schemaId != null) + message.schemaId = String(object.schemaId); + return message; + }; + + /** + * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.CreateSchemaRequest} message CreateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schema = null; + object.schemaId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.discoveryengine.v1.Schema.toObject(message.schema, options); + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + object.schemaId = message.schemaId; + return object; + }; + + /** + * Converts this CreateSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CreateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CreateSchemaRequest"; + }; + + return CreateSchemaRequest; + })(); + + v1.UpdateSchemaRequest = (function() { + + /** + * Properties of an UpdateSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IUpdateSchemaRequest + * @property {google.cloud.discoveryengine.v1.ISchema|null} [schema] UpdateSchemaRequest schema + * @property {boolean|null} [allowMissing] UpdateSchemaRequest allowMissing + */ + + /** + * Constructs a new UpdateSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an UpdateSchemaRequest. + * @implements IUpdateSchemaRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest=} [properties] Properties to set + */ + function UpdateSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaRequest schema. + * @member {google.cloud.discoveryengine.v1.ISchema|null|undefined} schema + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @instance + */ + UpdateSchemaRequest.prototype.schema = null; + + /** + * UpdateSchemaRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @instance + */ + UpdateSchemaRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaRequest} UpdateSchemaRequest instance + */ + UpdateSchemaRequest.create = function create(properties) { + return new UpdateSchemaRequest(properties); + }; + + /** + * Encodes the specified UpdateSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest} message UpdateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.discoveryengine.v1.Schema.encode(message.schema, writer.uint32(/* id 1, wireType 2 =*/10).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 UpdateSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaRequest} message UpdateSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaRequest} UpdateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.UpdateSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.schema = $root.google.cloud.discoveryengine.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaRequest} UpdateSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.discoveryengine.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaRequest} UpdateSchemaRequest + */ + UpdateSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.UpdateSchemaRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.UpdateSchemaRequest(); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UpdateSchemaRequest.schema: object expected"); + message.schema = $root.google.cloud.discoveryengine.v1.Schema.fromObject(object.schema); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.UpdateSchemaRequest} message UpdateSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schema = null; + object.allowMissing = false; + } + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.discoveryengine.v1.Schema.toObject(message.schema, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.UpdateSchemaRequest"; + }; + + return UpdateSchemaRequest; + })(); + + v1.DeleteSchemaRequest = (function() { + + /** + * Properties of a DeleteSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IDeleteSchemaRequest + * @property {string|null} [name] DeleteSchemaRequest name + */ + + /** + * Constructs a new DeleteSchemaRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a DeleteSchemaRequest. + * @implements IDeleteSchemaRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest=} [properties] Properties to set + */ + function DeleteSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @instance + */ + DeleteSchemaRequest.prototype.name = ""; + + /** + * Creates a new DeleteSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaRequest} DeleteSchemaRequest instance + */ + DeleteSchemaRequest.create = function create(properties) { + return new DeleteSchemaRequest(properties); + }; + + /** + * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.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 DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.DeleteSchemaRequest(); + 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 DeleteSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaRequest} DeleteSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaRequest.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 DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaRequest} DeleteSchemaRequest + */ + DeleteSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.DeleteSchemaRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.DeleteSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {google.cloud.discoveryengine.v1.DeleteSchemaRequest} message DeleteSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaRequest.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 DeleteSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.DeleteSchemaRequest"; + }; + + return DeleteSchemaRequest; + })(); + + v1.CreateSchemaMetadata = (function() { + + /** + * Properties of a CreateSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICreateSchemaMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateSchemaMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CreateSchemaMetadata updateTime + */ + + /** + * Constructs a new CreateSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CreateSchemaMetadata. + * @implements ICreateSchemaMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.ICreateSchemaMetadata=} [properties] Properties to set + */ + function CreateSchemaMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @instance + */ + CreateSchemaMetadata.prototype.createTime = null; + + /** + * CreateSchemaMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @instance + */ + CreateSchemaMetadata.prototype.updateTime = null; + + /** + * Creates a new CreateSchemaMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CreateSchemaMetadata} CreateSchemaMetadata instance + */ + CreateSchemaMetadata.create = function create(properties) { + return new CreateSchemaMetadata(properties); + }; + + /** + * Encodes the specified CreateSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaMetadata} message CreateSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CreateSchemaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.ICreateSchemaMetadata} message CreateSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CreateSchemaMetadata} CreateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CreateSchemaMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CreateSchemaMetadata} CreateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a CreateSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CreateSchemaMetadata} CreateSchemaMetadata + */ + CreateSchemaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CreateSchemaMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CreateSchemaMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.CreateSchemaMetadata.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.discoveryengine.v1.CreateSchemaMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateSchemaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.CreateSchemaMetadata} message CreateSchemaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this CreateSchemaMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CreateSchemaMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CreateSchemaMetadata"; + }; + + return CreateSchemaMetadata; + })(); + + v1.UpdateSchemaMetadata = (function() { + + /** + * Properties of an UpdateSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface IUpdateSchemaMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] UpdateSchemaMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] UpdateSchemaMetadata updateTime + */ + + /** + * Constructs a new UpdateSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents an UpdateSchemaMetadata. + * @implements IUpdateSchemaMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaMetadata=} [properties] Properties to set + */ + function UpdateSchemaMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSchemaMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @instance + */ + UpdateSchemaMetadata.prototype.createTime = null; + + /** + * UpdateSchemaMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @instance + */ + UpdateSchemaMetadata.prototype.updateTime = null; + + /** + * Creates a new UpdateSchemaMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaMetadata} UpdateSchemaMetadata instance + */ + UpdateSchemaMetadata.create = function create(properties) { + return new UpdateSchemaMetadata(properties); + }; + + /** + * Encodes the specified UpdateSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaMetadata} message UpdateSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.UpdateSchemaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IUpdateSchemaMetadata} message UpdateSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSchemaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSchemaMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaMetadata} UpdateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.UpdateSchemaMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSchemaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaMetadata} UpdateSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSchemaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSchemaMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSchemaMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an UpdateSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.UpdateSchemaMetadata} UpdateSchemaMetadata + */ + UpdateSchemaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.UpdateSchemaMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.UpdateSchemaMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.UpdateSchemaMetadata.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.discoveryengine.v1.UpdateSchemaMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSchemaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.UpdateSchemaMetadata} message UpdateSchemaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSchemaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this UpdateSchemaMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateSchemaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSchemaMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.UpdateSchemaMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSchemaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.UpdateSchemaMetadata"; + }; + + return UpdateSchemaMetadata; + })(); + + v1.DeleteSchemaMetadata = (function() { + + /** + * Properties of a DeleteSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @interface IDeleteSchemaMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] DeleteSchemaMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DeleteSchemaMetadata updateTime + */ + + /** + * Constructs a new DeleteSchemaMetadata. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a DeleteSchemaMetadata. + * @implements IDeleteSchemaMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaMetadata=} [properties] Properties to set + */ + function DeleteSchemaMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSchemaMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @instance + */ + DeleteSchemaMetadata.prototype.createTime = null; + + /** + * DeleteSchemaMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @instance + */ + DeleteSchemaMetadata.prototype.updateTime = null; + + /** + * Creates a new DeleteSchemaMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaMetadata} DeleteSchemaMetadata instance + */ + DeleteSchemaMetadata.create = function create(properties) { + return new DeleteSchemaMetadata(properties); + }; + + /** + * Encodes the specified DeleteSchemaMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaMetadata} message DeleteSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaMetadata.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.DeleteSchemaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.IDeleteSchemaMetadata} message DeleteSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSchemaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSchemaMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaMetadata} DeleteSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.DeleteSchemaMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSchemaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaMetadata} DeleteSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSchemaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSchemaMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSchemaMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a DeleteSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.DeleteSchemaMetadata} DeleteSchemaMetadata + */ + DeleteSchemaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.DeleteSchemaMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1.DeleteSchemaMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.DeleteSchemaMetadata.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.discoveryengine.v1.DeleteSchemaMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteSchemaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {google.cloud.discoveryengine.v1.DeleteSchemaMetadata} message DeleteSchemaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSchemaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this DeleteSchemaMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteSchemaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSchemaMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.DeleteSchemaMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSchemaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.DeleteSchemaMetadata"; + }; + + return DeleteSchemaMetadata; + })(); + + v1.SearchService = (function() { + + /** + * Constructs a new SearchService service. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a SearchService + * @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 SearchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; + + /** + * Creates new SearchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchService + * @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 {SearchService} RPC service. Useful where requests and/or responses are streamed. + */ + SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.SearchService|search}. + * @memberof google.cloud.discoveryengine.v1.SearchService + * @typedef SearchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.SearchResponse} [response] SearchResponse + */ + + /** + * Calls Search. + * @function search + * @memberof google.cloud.discoveryengine.v1.SearchService + * @instance + * @param {google.cloud.discoveryengine.v1.ISearchRequest} request SearchRequest message or plain object + * @param {google.cloud.discoveryengine.v1.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SearchService.prototype.search = function search(request, callback) { + return this.rpcCall(search, $root.google.cloud.discoveryengine.v1.SearchRequest, $root.google.cloud.discoveryengine.v1.SearchResponse, request, callback); + }, "name", { value: "Search" }); + + /** + * Calls Search. + * @function search + * @memberof google.cloud.discoveryengine.v1.SearchService + * @instance + * @param {google.cloud.discoveryengine.v1.ISearchRequest} request SearchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SearchService; + })(); + + v1.SearchRequest = (function() { + + /** + * Properties of a SearchRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface ISearchRequest + * @property {string|null} [servingConfig] SearchRequest servingConfig + * @property {string|null} [branch] SearchRequest branch + * @property {string|null} [query] SearchRequest query + * @property {number|null} [pageSize] SearchRequest pageSize + * @property {string|null} [pageToken] SearchRequest pageToken + * @property {number|null} [offset] SearchRequest offset + * @property {google.cloud.discoveryengine.v1.IUserInfo|null} [userInfo] SearchRequest userInfo + * @property {Object.|null} [params] SearchRequest params + * @property {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec + * @property {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec|null} [spellCorrectionSpec] SearchRequest spellCorrectionSpec + * @property {string|null} [userPseudoId] SearchRequest userPseudoId + * @property {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec|null} [contentSearchSpec] SearchRequest contentSearchSpec + * @property {boolean|null} [safeSearch] SearchRequest safeSearch + * @property {Object.|null} [userLabels] SearchRequest userLabels + */ + + /** + * Constructs a new SearchRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a SearchRequest. + * @implements ISearchRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.ISearchRequest=} [properties] Properties to set + */ + function SearchRequest(properties) { + this.params = {}; + this.userLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchRequest servingConfig. + * @member {string} servingConfig + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.servingConfig = ""; + + /** + * SearchRequest branch. + * @member {string} branch + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.branch = ""; + + /** + * SearchRequest query. + * @member {string} query + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.query = ""; + + /** + * SearchRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.pageSize = 0; + + /** + * SearchRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.pageToken = ""; + + /** + * SearchRequest offset. + * @member {number} offset + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.offset = 0; + + /** + * SearchRequest userInfo. + * @member {google.cloud.discoveryengine.v1.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.userInfo = null; + + /** + * SearchRequest params. + * @member {Object.} params + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.params = $util.emptyObject; + + /** + * SearchRequest queryExpansionSpec. + * @member {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.queryExpansionSpec = null; + + /** + * SearchRequest spellCorrectionSpec. + * @member {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec|null|undefined} spellCorrectionSpec + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.spellCorrectionSpec = null; + + /** + * SearchRequest userPseudoId. + * @member {string} userPseudoId + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.userPseudoId = ""; + + /** + * SearchRequest contentSearchSpec. + * @member {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec|null|undefined} contentSearchSpec + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.contentSearchSpec = null; + + /** + * SearchRequest safeSearch. + * @member {boolean} safeSearch + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.safeSearch = false; + + /** + * SearchRequest userLabels. + * @member {Object.} userLabels + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + */ + SearchRequest.prototype.userLabels = $util.emptyObject; + + /** + * Creates a new SearchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {google.cloud.discoveryengine.v1.ISearchRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchRequest} SearchRequest instance + */ + SearchRequest.create = function create(properties) { + return new SearchRequest(properties); + }; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {google.cloud.discoveryengine.v1.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfig); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.offset); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) + $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.spellCorrectionSpec != null && Object.hasOwnProperty.call(message, "spellCorrectionSpec")) + $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.encode(message.spellCorrectionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.userPseudoId != null && Object.hasOwnProperty.call(message, "userPseudoId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.userPseudoId); + if (message.safeSearch != null && Object.hasOwnProperty.call(message, "safeSearch")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.safeSearch); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.discoveryengine.v1.UserInfo.encode(message.userInfo, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); + if (message.contentSearchSpec != null && Object.hasOwnProperty.call(message, "contentSearchSpec")) + $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.encode(message.contentSearchSpec, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {google.cloud.discoveryengine.v1.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.servingConfig = reader.string(); + break; + } + case 2: { + message.branch = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.offset = reader.int32(); + break; + } + case 21: { + message.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + if (message.params === $util.emptyObject) + message.params = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.params[key] = value; + break; + } + case 13: { + message.queryExpansionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); + break; + } + case 14: { + message.spellCorrectionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.decode(reader, reader.uint32()); + break; + } + case 15: { + message.userPseudoId = reader.string(); + break; + } + case 24: { + message.contentSearchSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.decode(reader, reader.uint32()); + break; + } + case 20: { + message.safeSearch = reader.bool(); + break; + } + case 22: { + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + 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.userLabels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + if (!$util.isString(message.servingConfig)) + return "servingConfig: string expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.discoveryengine.v1.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.params[key[i]]); + if (error) + return "params." + error; + } + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { + var error = $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (error) + return "queryExpansionSpec." + error; + } + if (message.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) { + var error = $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.verify(message.spellCorrectionSpec); + if (error) + return "spellCorrectionSpec." + error; + } + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + if (!$util.isString(message.userPseudoId)) + return "userPseudoId: string expected"; + if (message.contentSearchSpec != null && message.hasOwnProperty("contentSearchSpec")) { + var error = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.verify(message.contentSearchSpec); + if (error) + return "contentSearchSpec." + error; + } + if (message.safeSearch != null && message.hasOwnProperty("safeSearch")) + if (typeof message.safeSearch !== "boolean") + return "safeSearch: boolean expected"; + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchRequest} SearchRequest + */ + SearchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchRequest(); + if (object.servingConfig != null) + message.servingConfig = String(object.servingConfig); + if (object.branch != null) + message.branch = String(object.branch); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.fromObject(object.userInfo); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.params: object expected"); + message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); + } + } + if (object.queryExpansionSpec != null) { + if (typeof object.queryExpansionSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.queryExpansionSpec: object expected"); + message.queryExpansionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); + } + if (object.spellCorrectionSpec != null) { + if (typeof object.spellCorrectionSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.spellCorrectionSpec: object expected"); + message.spellCorrectionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.fromObject(object.spellCorrectionSpec); + } + if (object.userPseudoId != null) + message.userPseudoId = String(object.userPseudoId); + if (object.contentSearchSpec != null) { + if (typeof object.contentSearchSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.contentSearchSpec: object expected"); + message.contentSearchSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.fromObject(object.contentSearchSpec); + } + if (object.safeSearch != null) + message.safeSearch = Boolean(object.safeSearch); + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest} message SearchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.params = {}; + object.userLabels = {}; + } + if (options.defaults) { + object.servingConfig = ""; + object.branch = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.offset = 0; + object.queryExpansionSpec = null; + object.spellCorrectionSpec = null; + object.userPseudoId = ""; + object.safeSearch = false; + object.userInfo = null; + object.contentSearchSpec = null; + } + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = message.servingConfig; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) + object.queryExpansionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); + if (message.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) + object.spellCorrectionSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.toObject(message.spellCorrectionSpec, options); + if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) + object.userPseudoId = message.userPseudoId; + if (message.safeSearch != null && message.hasOwnProperty("safeSearch")) + object.safeSearch = message.safeSearch; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.discoveryengine.v1.UserInfo.toObject(message.userInfo, options); + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + if (message.contentSearchSpec != null && message.hasOwnProperty("contentSearchSpec")) + object.contentSearchSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.toObject(message.contentSearchSpec, options); + return object; + }; + + /** + * Converts this SearchRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @instance + * @returns {Object.} JSON object + */ + SearchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchRequest"; + }; + + SearchRequest.QueryExpansionSpec = (function() { + + /** + * Properties of a QueryExpansionSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @interface IQueryExpansionSpec + * @property {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition + */ + + /** + * Constructs a new QueryExpansionSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @classdesc Represents a QueryExpansionSpec. + * @implements IQueryExpansionSpec + * @constructor + * @param {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + */ + function QueryExpansionSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryExpansionSpec condition. + * @member {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition} condition + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.condition = 0; + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance + */ + QueryExpansionSpec.create = function create(properties) { + return new QueryExpansionSpec(properties); + }; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); + return writer; + }; + + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.condition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryExpansionSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryExpansionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + */ + QueryExpansionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec(); + switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; + case "CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "DISABLED": + case 1: + message.condition = 1; + break; + case "AUTO": + case 2: + message.condition = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryExpansionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + return object; + }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryExpansionSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryExpansionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec"; + }; + + /** + * Condition enum. + * @name google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition + * @enum {number} + * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} AUTO=2 AUTO value + */ + QueryExpansionSpec.Condition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "AUTO"] = 2; + return values; + })(); + + return QueryExpansionSpec; + })(); + + SearchRequest.SpellCorrectionSpec = (function() { + + /** + * Properties of a SpellCorrectionSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @interface ISpellCorrectionSpec + * @property {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode|null} [mode] SpellCorrectionSpec mode + */ + + /** + * Constructs a new SpellCorrectionSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @classdesc Represents a SpellCorrectionSpec. + * @implements ISpellCorrectionSpec + * @constructor + * @param {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set + */ + function SpellCorrectionSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpellCorrectionSpec mode. + * @member {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode} mode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @instance + */ + SpellCorrectionSpec.prototype.mode = 0; + + /** + * Creates a new SpellCorrectionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec instance + */ + SpellCorrectionSpec.create = function create(properties) { + return new SpellCorrectionSpec(properties); + }; + + /** + * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellCorrectionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellCorrectionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellCorrectionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellCorrectionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpellCorrectionSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpellCorrectionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + */ + SpellCorrectionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SUGGESTION_ONLY": + case 1: + message.mode = 1; + break; + case "AUTO": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} message SpellCorrectionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpellCorrectionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this SpellCorrectionSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @instance + * @returns {Object.} JSON object + */ + SpellCorrectionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpellCorrectionSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpellCorrectionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec"; + }; + + /** + * Mode enum. + * @name google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} SUGGESTION_ONLY=1 SUGGESTION_ONLY value + * @property {number} AUTO=2 AUTO value + */ + SpellCorrectionSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUGGESTION_ONLY"] = 1; + values[valuesById[2] = "AUTO"] = 2; + return values; + })(); + + return SpellCorrectionSpec; + })(); + + SearchRequest.ContentSearchSpec = (function() { + + /** + * Properties of a ContentSearchSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @interface IContentSearchSpec + * @property {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec|null} [snippetSpec] ContentSearchSpec snippetSpec + */ + + /** + * Constructs a new ContentSearchSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest + * @classdesc Represents a ContentSearchSpec. + * @implements IContentSearchSpec + * @constructor + * @param {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec=} [properties] Properties to set + */ + function ContentSearchSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentSearchSpec snippetSpec. + * @member {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec|null|undefined} snippetSpec + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @instance + */ + ContentSearchSpec.prototype.snippetSpec = null; + + /** + * Creates a new ContentSearchSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} ContentSearchSpec instance + */ + ContentSearchSpec.create = function create(properties) { + return new ContentSearchSpec(properties); + }; + + /** + * Encodes the specified ContentSearchSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec} message ContentSearchSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentSearchSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snippetSpec != null && Object.hasOwnProperty.call(message, "snippetSpec")) + $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.encode(message.snippetSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContentSearchSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.IContentSearchSpec} message ContentSearchSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentSearchSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentSearchSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} ContentSearchSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentSearchSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snippetSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentSearchSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} ContentSearchSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentSearchSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentSearchSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentSearchSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snippetSpec != null && message.hasOwnProperty("snippetSpec")) { + var error = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.verify(message.snippetSpec); + if (error) + return "snippetSpec." + error; + } + return null; + }; + + /** + * Creates a ContentSearchSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} ContentSearchSpec + */ + ContentSearchSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec(); + if (object.snippetSpec != null) { + if (typeof object.snippetSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.snippetSpec: object expected"); + message.snippetSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.fromObject(object.snippetSpec); + } + return message; + }; + + /** + * Creates a plain object from a ContentSearchSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} message ContentSearchSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentSearchSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snippetSpec = null; + if (message.snippetSpec != null && message.hasOwnProperty("snippetSpec")) + object.snippetSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.toObject(message.snippetSpec, options); + return object; + }; + + /** + * Converts this ContentSearchSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @instance + * @returns {Object.} JSON object + */ + ContentSearchSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentSearchSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentSearchSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec"; + }; + + ContentSearchSpec.SnippetSpec = (function() { + + /** + * Properties of a SnippetSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @interface ISnippetSpec + * @property {number|null} [maxSnippetCount] SnippetSpec maxSnippetCount + * @property {boolean|null} [referenceOnly] SnippetSpec referenceOnly + */ + + /** + * Constructs a new SnippetSpec. + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec + * @classdesc Represents a SnippetSpec. + * @implements ISnippetSpec + * @constructor + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec=} [properties] Properties to set + */ + function SnippetSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnippetSpec maxSnippetCount. + * @member {number} maxSnippetCount + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @instance + */ + SnippetSpec.prototype.maxSnippetCount = 0; + + /** + * SnippetSpec referenceOnly. + * @member {boolean} referenceOnly + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @instance + */ + SnippetSpec.prototype.referenceOnly = false; + + /** + * Creates a new SnippetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} SnippetSpec instance + */ + SnippetSpec.create = function create(properties) { + return new SnippetSpec(properties); + }; + + /** + * Encodes the specified SnippetSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec} message SnippetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnippetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxSnippetCount != null && Object.hasOwnProperty.call(message, "maxSnippetCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxSnippetCount); + if (message.referenceOnly != null && Object.hasOwnProperty.call(message, "referenceOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.referenceOnly); + return writer; + }; + + /** + * Encodes the specified SnippetSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ISnippetSpec} message SnippetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnippetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnippetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} SnippetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnippetSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxSnippetCount = reader.int32(); + break; + } + case 2: { + message.referenceOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnippetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} SnippetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnippetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnippetSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnippetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxSnippetCount != null && message.hasOwnProperty("maxSnippetCount")) + if (!$util.isInteger(message.maxSnippetCount)) + return "maxSnippetCount: integer expected"; + if (message.referenceOnly != null && message.hasOwnProperty("referenceOnly")) + if (typeof message.referenceOnly !== "boolean") + return "referenceOnly: boolean expected"; + return null; + }; + + /** + * Creates a SnippetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} SnippetSpec + */ + SnippetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec(); + if (object.maxSnippetCount != null) + message.maxSnippetCount = object.maxSnippetCount | 0; + if (object.referenceOnly != null) + message.referenceOnly = Boolean(object.referenceOnly); + return message; + }; + + /** + * Creates a plain object from a SnippetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec} message SnippetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnippetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxSnippetCount = 0; + object.referenceOnly = false; + } + if (message.maxSnippetCount != null && message.hasOwnProperty("maxSnippetCount")) + object.maxSnippetCount = message.maxSnippetCount; + if (message.referenceOnly != null && message.hasOwnProperty("referenceOnly")) + object.referenceOnly = message.referenceOnly; + return object; + }; + + /** + * Converts this SnippetSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @instance + * @returns {Object.} JSON object + */ + SnippetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnippetSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnippetSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec"; + }; + + return SnippetSpec; + })(); + + return ContentSearchSpec; + })(); + + return SearchRequest; + })(); + + v1.SearchResponse = (function() { + + /** + * Properties of a SearchResponse. + * @memberof google.cloud.discoveryengine.v1 + * @interface ISearchResponse + * @property {Array.|null} [results] SearchResponse results + * @property {number|null} [totalSize] SearchResponse totalSize + * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [nextPageToken] SearchResponse nextPageToken + * @property {string|null} [correctedQuery] SearchResponse correctedQuery + */ + + /** + * Constructs a new SearchResponse. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a SearchResponse. + * @implements ISearchResponse + * @constructor + * @param {google.cloud.discoveryengine.v1.ISearchResponse=} [properties] Properties to set + */ + function SearchResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResponse results. + * @member {Array.} results + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + */ + SearchResponse.prototype.results = $util.emptyArray; + + /** + * SearchResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + */ + SearchResponse.prototype.totalSize = 0; + + /** + * SearchResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + */ + SearchResponse.prototype.attributionToken = ""; + + /** + * SearchResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + */ + SearchResponse.prototype.nextPageToken = ""; + + /** + * SearchResponse correctedQuery. + * @member {string} correctedQuery + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + */ + SearchResponse.prototype.correctedQuery = ""; + + /** + * Creates a new SearchResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {google.cloud.discoveryengine.v1.ISearchResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchResponse} SearchResponse instance + */ + SearchResponse.create = function create(properties) { + return new SearchResponse(properties); + }; + + /** + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {google.cloud.discoveryengine.v1.ISearchResponse} message SearchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.attributionToken); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.nextPageToken); + if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.correctedQuery); + return writer; + }; + + /** + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {google.cloud.discoveryengine.v1.ISearchResponse} message SearchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchResponse} SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + case 4: { + message.attributionToken = reader.string(); + break; + } + case 5: { + message.nextPageToken = reader.string(); + break; + } + case 7: { + message.correctedQuery = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchResponse} SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + if (!$util.isString(message.correctedQuery)) + return "correctedQuery: string expected"; + return null; + }; + + /** + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchResponse} SearchResponse + */ + SearchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.results: object expected"); + message.results[i] = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.fromObject(object.results[i]); + } + } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.correctedQuery != null) + message.correctedQuery = String(object.correctedQuery); + return message; + }; + + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {google.cloud.discoveryengine.v1.SearchResponse} message SearchResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) { + object.totalSize = 0; + object.attributionToken = ""; + object.nextPageToken = ""; + object.correctedQuery = ""; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.toObject(message.results[j], options); + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + object.correctedQuery = message.correctedQuery; + return object; + }; + + /** + * Converts this SearchResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @instance + * @returns {Object.} JSON object + */ + SearchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchResponse"; + }; + + SearchResponse.SearchResult = (function() { + + /** + * Properties of a SearchResult. + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @interface ISearchResult + * @property {string|null} [id] SearchResult id + * @property {google.cloud.discoveryengine.v1.IDocument|null} [document] SearchResult document + */ + + /** + * Constructs a new SearchResult. + * @memberof google.cloud.discoveryengine.v1.SearchResponse + * @classdesc Represents a SearchResult. + * @implements ISearchResult + * @constructor + * @param {google.cloud.discoveryengine.v1.SearchResponse.ISearchResult=} [properties] Properties to set + */ + function SearchResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResult id. + * @member {string} id + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.id = ""; + + /** + * SearchResult document. + * @member {google.cloud.discoveryengine.v1.IDocument|null|undefined} document + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.document = null; + + /** + * Creates a new SearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {google.cloud.discoveryengine.v1.SearchResponse.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult} SearchResult instance + */ + SearchResult.create = function create(properties) { + return new SearchResult(properties); + }; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {google.cloud.discoveryengine.v1.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.discoveryengine.v1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {google.cloud.discoveryengine.v1.SearchResponse.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.discoveryengine.v1.Document.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResult message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.discoveryengine.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + return null; + }; + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult} SearchResult + */ + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult) + return object; + var message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult(); + if (object.id != null) + message.id = String(object.id); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.SearchResult.document: object expected"); + message.document = $root.google.cloud.discoveryengine.v1.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult} message SearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.document = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.discoveryengine.v1.Document.toObject(message.document, options); + return object; + }; + + /** + * Converts this SearchResult to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @instance + * @returns {Object.} JSON object + */ + SearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResult + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchResponse.SearchResult"; + }; + + return SearchResult; + })(); + + return SearchResponse; + })(); + + v1.UserEventService = (function() { + + /** + * Constructs a new UserEventService service. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a UserEventService + * @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 UserEventService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserEventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserEventService; + + /** + * Creates new UserEventService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @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 {UserEventService} RPC service. Useful where requests and/or responses are streamed. + */ + UserEventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|writeUserEvent}. + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @typedef WriteUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1.UserEvent} [response] UserEvent + */ + + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @param {google.cloud.discoveryengine.v1.UserEventService.WriteUserEventCallback} callback Node-style callback called with the error, if any, and UserEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.writeUserEvent = function writeUserEvent(request, callback) { + return this.rpcCall(writeUserEvent, $root.google.cloud.discoveryengine.v1.WriteUserEventRequest, $root.google.cloud.discoveryengine.v1.UserEvent, request, callback); + }, "name", { value: "WriteUserEvent" }); + + /** + * Calls WriteUserEvent. + * @function writeUserEvent + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest} request WriteUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|collectUserEvent}. + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @typedef CollectUserEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @param {google.cloud.discoveryengine.v1.UserEventService.CollectUserEventCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.collectUserEvent = function collectUserEvent(request, callback) { + return this.rpcCall(collectUserEvent, $root.google.cloud.discoveryengine.v1.CollectUserEventRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "CollectUserEvent" }); + + /** + * Calls CollectUserEvent. + * @function collectUserEvent + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest} request CollectUserEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1.UserEventService|importUserEvents}. + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @typedef ImportUserEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @param {google.cloud.discoveryengine.v1.UserEventService.ImportUserEventsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserEventService.prototype.importUserEvents = function importUserEvents(request, callback) { + return this.rpcCall(importUserEvents, $root.google.cloud.discoveryengine.v1.ImportUserEventsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportUserEvents" }); + + /** + * Calls ImportUserEvents. + * @function importUserEvents + * @memberof google.cloud.discoveryengine.v1.UserEventService + * @instance + * @param {google.cloud.discoveryengine.v1.IImportUserEventsRequest} request ImportUserEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserEventService; + })(); + + v1.WriteUserEventRequest = (function() { + + /** + * Properties of a WriteUserEventRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface IWriteUserEventRequest + * @property {string|null} [parent] WriteUserEventRequest parent + * @property {google.cloud.discoveryengine.v1.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent + */ + + /** + * Constructs a new WriteUserEventRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a WriteUserEventRequest. + * @implements IWriteUserEventRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest=} [properties] Properties to set + */ + function WriteUserEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.parent = ""; + + /** + * WriteUserEventRequest userEvent. + * @member {google.cloud.discoveryengine.v1.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.userEvent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WriteUserEventRequest _userEvent. + * @member {"userEvent"|undefined} _userEvent + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @instance + */ + Object.defineProperty(WriteUserEventRequest.prototype, "_userEvent", { + get: $util.oneOfGetter($oneOfFields = ["userEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WriteUserEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.WriteUserEventRequest} WriteUserEventRequest instance + */ + WriteUserEventRequest.create = function create(properties) { + return new WriteUserEventRequest(properties); + }; + + /** + * Encodes the specified WriteUserEventRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.WriteUserEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteUserEventRequest.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.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + $root.google.cloud.discoveryengine.v1.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WriteUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.WriteUserEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.IWriteUserEventRequest} message WriteUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.WriteUserEventRequest} WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteUserEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.WriteUserEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userEvent = $root.google.cloud.discoveryengine.v1.UserEvent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WriteUserEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.WriteUserEventRequest} WriteUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteUserEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteUserEventRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteUserEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + properties._userEvent = 1; + { + var error = $root.google.cloud.discoveryengine.v1.UserEvent.verify(message.userEvent); + if (error) + return "userEvent." + error; + } + } + return null; + }; + + /** + * Creates a WriteUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.WriteUserEventRequest} WriteUserEventRequest + */ + WriteUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.WriteUserEventRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.WriteUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.discoveryengine.v1.WriteUserEventRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.discoveryengine.v1.UserEvent.fromObject(object.userEvent); + } + return message; + }; + + /** + * Creates a plain object from a WriteUserEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.WriteUserEventRequest} message WriteUserEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteUserEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + object.userEvent = $root.google.cloud.discoveryengine.v1.UserEvent.toObject(message.userEvent, options); + if (options.oneofs) + object._userEvent = "userEvent"; + } + return object; + }; + + /** + * Converts this WriteUserEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @instance + * @returns {Object.} JSON object + */ + WriteUserEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteUserEventRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.WriteUserEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteUserEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.WriteUserEventRequest"; + }; + + return WriteUserEventRequest; + })(); + + v1.CollectUserEventRequest = (function() { + + /** + * Properties of a CollectUserEventRequest. + * @memberof google.cloud.discoveryengine.v1 + * @interface ICollectUserEventRequest + * @property {string|null} [parent] CollectUserEventRequest parent + * @property {string|null} [userEvent] CollectUserEventRequest userEvent + * @property {string|null} [uri] CollectUserEventRequest uri + * @property {number|Long|null} [ets] CollectUserEventRequest ets + */ + + /** + * Constructs a new CollectUserEventRequest. + * @memberof google.cloud.discoveryengine.v1 + * @classdesc Represents a CollectUserEventRequest. + * @implements ICollectUserEventRequest + * @constructor + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest=} [properties] Properties to set + */ + function CollectUserEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CollectUserEventRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.parent = ""; + + /** + * CollectUserEventRequest userEvent. + * @member {string} userEvent + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.userEvent = ""; + + /** + * CollectUserEventRequest uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.uri = null; + + /** + * CollectUserEventRequest ets. + * @member {number|Long|null|undefined} ets + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.ets = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CollectUserEventRequest _uri. + * @member {"uri"|undefined} _uri + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + Object.defineProperty(CollectUserEventRequest.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CollectUserEventRequest _ets. + * @member {"ets"|undefined} _ets + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + */ + Object.defineProperty(CollectUserEventRequest.prototype, "_ets", { + get: $util.oneOfGetter($oneOfFields = ["ets"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CollectUserEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1.CollectUserEventRequest} CollectUserEventRequest instance + */ + CollectUserEventRequest.create = function create(properties) { + return new CollectUserEventRequest(properties); + }; + + /** + * Encodes the specified CollectUserEventRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1.CollectUserEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectUserEventRequest.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.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userEvent); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.ets != null && Object.hasOwnProperty.call(message, "ets")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ets); + return writer; + }; + + /** + * Encodes the specified CollectUserEventRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.CollectUserEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.ICollectUserEventRequest} message CollectUserEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollectUserEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1.CollectUserEventRequest} CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectUserEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.CollectUserEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userEvent = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.ets = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CollectUserEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1.CollectUserEventRequest} CollectUserEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollectUserEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CollectUserEventRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollectUserEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + if (!$util.isString(message.userEvent)) + return "userEvent: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.ets != null && message.hasOwnProperty("ets")) { + properties._ets = 1; + if (!$util.isInteger(message.ets) && !(message.ets && $util.isInteger(message.ets.low) && $util.isInteger(message.ets.high))) + return "ets: integer|Long expected"; + } + return null; + }; + + /** + * Creates a CollectUserEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1.CollectUserEventRequest} CollectUserEventRequest + */ + CollectUserEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1.CollectUserEventRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1.CollectUserEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userEvent != null) + message.userEvent = String(object.userEvent); + if (object.uri != null) + message.uri = String(object.uri); + if (object.ets != null) + if ($util.Long) + (message.ets = $util.Long.fromValue(object.ets)).unsigned = false; + else if (typeof object.ets === "string") + message.ets = parseInt(object.ets, 10); + else if (typeof object.ets === "number") + message.ets = object.ets; + else if (typeof object.ets === "object") + message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CollectUserEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {google.cloud.discoveryengine.v1.CollectUserEventRequest} message CollectUserEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CollectUserEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userEvent = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = message.userEvent; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.ets != null && message.hasOwnProperty("ets")) { + if (typeof message.ets === "number") + object.ets = options.longs === String ? String(message.ets) : message.ets; + else + object.ets = options.longs === String ? $util.Long.prototype.toString.call(message.ets) : options.longs === Number ? new $util.LongBits(message.ets.low >>> 0, message.ets.high >>> 0).toNumber() : message.ets; + if (options.oneofs) + object._ets = "ets"; + } + return object; + }; + + /** + * Converts this CollectUserEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @instance + * @returns {Object.} JSON object + */ + CollectUserEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CollectUserEventRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1.CollectUserEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CollectUserEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1.CollectUserEventRequest"; + }; + + return CollectUserEventRequest; + })(); + + return v1; + })(); + discoveryengine.v1beta = (function() { /** @@ -6329,6 +22223,8 @@ * @property {string|null} [parent] ImportDocumentsRequest parent * @property {google.cloud.discoveryengine.v1beta.IImportErrorConfig|null} [errorConfig] ImportDocumentsRequest errorConfig * @property {google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode|null} [reconciliationMode] ImportDocumentsRequest reconciliationMode + * @property {boolean|null} [autoGenerateIds] ImportDocumentsRequest autoGenerateIds + * @property {string|null} [idField] ImportDocumentsRequest idField */ /** @@ -6394,6 +22290,22 @@ */ ImportDocumentsRequest.prototype.reconciliationMode = 0; + /** + * ImportDocumentsRequest autoGenerateIds. + * @member {boolean} autoGenerateIds + * @memberof google.cloud.discoveryengine.v1beta.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.autoGenerateIds = false; + + /** + * ImportDocumentsRequest idField. + * @member {string} idField + * @memberof google.cloud.discoveryengine.v1beta.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.idField = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6444,6 +22356,10 @@ $root.google.cloud.discoveryengine.v1beta.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reconciliationMode); + if (message.autoGenerateIds != null && Object.hasOwnProperty.call(message, "autoGenerateIds")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.autoGenerateIds); + if (message.idField != null && Object.hasOwnProperty.call(message, "idField")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.idField); return writer; }; @@ -6502,6 +22418,14 @@ message.reconciliationMode = reader.int32(); break; } + case 8: { + message.autoGenerateIds = reader.bool(); + break; + } + case 9: { + message.idField = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6583,6 +22507,12 @@ case 2: break; } + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + if (typeof message.autoGenerateIds !== "boolean") + return "autoGenerateIds: boolean expected"; + if (message.idField != null && message.hasOwnProperty("idField")) + if (!$util.isString(message.idField)) + return "idField: string expected"; return null; }; @@ -6640,6 +22570,10 @@ message.reconciliationMode = 2; break; } + if (object.autoGenerateIds != null) + message.autoGenerateIds = Boolean(object.autoGenerateIds); + if (object.idField != null) + message.idField = String(object.idField); return message; }; @@ -6660,6 +22594,8 @@ object.parent = ""; object.errorConfig = null; object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.autoGenerateIds = false; + object.idField = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -6682,6 +22618,10 @@ object.errorConfig = $root.google.cloud.discoveryengine.v1beta.ImportErrorConfig.toObject(message.errorConfig, options); if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) object.reconciliationMode = options.enums === String ? $root.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + object.autoGenerateIds = message.autoGenerateIds; + if (message.idField != null && message.hasOwnProperty("idField")) + object.idField = message.idField; return object; }; @@ -14562,6 +30502,7 @@ * @property {number|null} [offset] SearchRequest offset * @property {string|null} [filter] SearchRequest filter * @property {string|null} [orderBy] SearchRequest orderBy + * @property {google.cloud.discoveryengine.v1beta.IUserInfo|null} [userInfo] SearchRequest userInfo * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs * @property {google.cloud.discoveryengine.v1beta.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec * @property {Object.|null} [params] SearchRequest params @@ -14569,6 +30510,8 @@ * @property {google.cloud.discoveryengine.v1beta.SearchRequest.ISpellCorrectionSpec|null} [spellCorrectionSpec] SearchRequest spellCorrectionSpec * @property {string|null} [userPseudoId] SearchRequest userPseudoId * @property {google.cloud.discoveryengine.v1beta.SearchRequest.IContentSearchSpec|null} [contentSearchSpec] SearchRequest contentSearchSpec + * @property {boolean|null} [safeSearch] SearchRequest safeSearch + * @property {Object.|null} [userLabels] SearchRequest userLabels */ /** @@ -14582,6 +30525,7 @@ function SearchRequest(properties) { this.facetSpecs = []; this.params = {}; + this.userLabels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14652,6 +30596,14 @@ */ SearchRequest.prototype.orderBy = ""; + /** + * SearchRequest userInfo. + * @member {google.cloud.discoveryengine.v1beta.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest + * @instance + */ + SearchRequest.prototype.userInfo = null; + /** * SearchRequest facetSpecs. * @member {Array.} facetSpecs @@ -14708,6 +30660,22 @@ */ SearchRequest.prototype.contentSearchSpec = null; + /** + * SearchRequest safeSearch. + * @member {boolean} safeSearch + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest + * @instance + */ + SearchRequest.prototype.safeSearch = false; + + /** + * SearchRequest userLabels. + * @member {Object.} userLabels + * @memberof google.cloud.discoveryengine.v1beta.SearchRequest + * @instance + */ + SearchRequest.prototype.userLabels = $util.emptyObject; + /** * Creates a new SearchRequest instance using the specified properties. * @function create @@ -14764,6 +30732,13 @@ $root.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.encode(message.spellCorrectionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.userPseudoId != null && Object.hasOwnProperty.call(message, "userPseudoId")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.userPseudoId); + if (message.safeSearch != null && Object.hasOwnProperty.call(message, "safeSearch")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.safeSearch); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.discoveryengine.v1beta.UserInfo.encode(message.userInfo, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); if (message.contentSearchSpec != null && Object.hasOwnProperty.call(message, "contentSearchSpec")) $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.encode(message.contentSearchSpec, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; @@ -14832,6 +30807,10 @@ message.orderBy = reader.string(); break; } + case 21: { + message.userInfo = $root.google.cloud.discoveryengine.v1beta.UserInfo.decode(reader, reader.uint32()); + break; + } case 9: { if (!(message.facetSpecs && message.facetSpecs.length)) message.facetSpecs = []; @@ -14881,6 +30860,33 @@ message.contentSearchSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.decode(reader, reader.uint32()); break; } + case 20: { + message.safeSearch = reader.bool(); + break; + } + case 22: { + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + 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.userLabels[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -14940,6 +30946,11 @@ if (message.orderBy != null && message.hasOwnProperty("orderBy")) if (!$util.isString(message.orderBy)) return "orderBy: string expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.discoveryengine.v1beta.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { if (!Array.isArray(message.facetSpecs)) return "facetSpecs: array expected"; @@ -14982,6 +30993,17 @@ if (error) return "contentSearchSpec." + error; } + if (message.safeSearch != null && message.hasOwnProperty("safeSearch")) + if (typeof message.safeSearch !== "boolean") + return "safeSearch: boolean expected"; + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } return null; }; @@ -15013,6 +31035,11 @@ message.filter = String(object.filter); if (object.orderBy != null) message.orderBy = String(object.orderBy); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.discoveryengine.v1beta.UserInfo.fromObject(object.userInfo); + } if (object.facetSpecs) { if (!Array.isArray(object.facetSpecs)) throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.facetSpecs: array expected"); @@ -15055,6 +31082,15 @@ throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.contentSearchSpec: object expected"); message.contentSearchSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.fromObject(object.contentSearchSpec); } + if (object.safeSearch != null) + message.safeSearch = Boolean(object.safeSearch); + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.cloud.discoveryengine.v1beta.SearchRequest.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } return message; }; @@ -15073,8 +31109,10 @@ var object = {}; if (options.arrays || options.defaults) object.facetSpecs = []; - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.params = {}; + object.userLabels = {}; + } if (options.defaults) { object.servingConfig = ""; object.branch = ""; @@ -15088,6 +31126,8 @@ object.queryExpansionSpec = null; object.spellCorrectionSpec = null; object.userPseudoId = ""; + object.safeSearch = false; + object.userInfo = null; object.contentSearchSpec = null; } if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) @@ -15125,6 +31165,15 @@ object.spellCorrectionSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.SpellCorrectionSpec.toObject(message.spellCorrectionSpec, options); if (message.userPseudoId != null && message.hasOwnProperty("userPseudoId")) object.userPseudoId = message.userPseudoId; + if (message.safeSearch != null && message.hasOwnProperty("safeSearch")) + object.safeSearch = message.safeSearch; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.discoveryengine.v1beta.UserInfo.toObject(message.userInfo, options); + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } if (message.contentSearchSpec != null && message.hasOwnProperty("contentSearchSpec")) object.contentSearchSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.toObject(message.contentSearchSpec, options); return object; diff --git a/packages/google-cloud-discoveryengine/protos/protos.json b/packages/google-cloud-discoveryengine/protos/protos.json index bf20098fccc4..cee19da20d99 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.json +++ b/packages/google-cloud-discoveryengine/protos/protos.json @@ -6,6 +6,1792 @@ "nested": { "discoveryengine": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.DiscoveryEngine.V1", + "go_package": "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb", + "java_multiple_files": true, + "java_outer_classname": "UserEventServiceProto", + "java_package": "com.google.cloud.discoveryengine.v1", + "objc_class_prefix": "DISCOVERYENGINE", + "php_namespace": "Google\\Cloud\\DiscoveryEngine\\V1", + "ruby_package": "Google::Cloud::DiscoveryEngine::V1", + "(google.api.resource_definition).type": "discoveryengine.googleapis.com/ServingConfig", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}" + }, + "nested": { + "CustomAttribute": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "numbers": { + "rule": "repeated", + "type": "double", + "id": 2 + } + } + }, + "UserInfo": { + "fields": { + "userId": { + "type": "string", + "id": 1 + }, + "userAgent": { + "type": "string", + "id": 2 + } + } + }, + "CompletionService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CompleteQuery": { + "requestType": "CompleteQueryRequest", + "responseType": "CompleteQueryResponse", + "options": { + "(google.api.http).get": "/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQuery", + "(google.api.http).additional_bindings.get": "/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQuery", + "additional_bindings": { + "get": "/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery" + } + } + } + ] + } + } + }, + "CompleteQueryRequest": { + "fields": { + "dataStore": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "queryModel": { + "type": "string", + "id": 3 + }, + "userPseudoId": { + "type": "string", + "id": 4 + } + } + }, + "CompleteQueryResponse": { + "fields": { + "querySuggestions": { + "rule": "repeated", + "type": "QuerySuggestion", + "id": 1 + } + }, + "nested": { + "QuerySuggestion": { + "fields": { + "suggestion": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Document": { + "options": { + "(google.api.resource).type": "discoveryengine.googleapis.com/Document", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}" + }, + "oneofs": { + "data": { + "oneof": [ + "structData", + "jsonData" + ] + } + }, + "fields": { + "structData": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "jsonData": { + "type": "string", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "schemaId": { + "type": "string", + "id": 3 + }, + "content": { + "type": "Content", + "id": 10 + }, + "parentDocumentId": { + "type": "string", + "id": 7 + }, + "derivedStructData": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Content": { + "oneofs": { + "content": { + "oneof": [ + "rawBytes", + "uri" + ] + } + }, + "fields": { + "rawBytes": { + "type": "bytes", + "id": 2 + }, + "uri": { + "type": "string", + "id": 3 + }, + "mimeType": { + "type": "string", + "id": 1 + } + } + } + } + }, + "DocumentService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDocuments": { + "requestType": "ListDocumentsRequest", + "responseType": "ListDocumentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDocument": { + "requestType": "CreateDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents", + "(google.api.http).additional_bindings.body": "document", + "(google.api.method_signature)": "parent,document,document_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + "body": "document", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents", + "body": "document" + } + } + }, + { + "(google.api.method_signature)": "parent,document,document_id" + } + ] + }, + "UpdateDocument": { + "requestType": "UpdateDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).patch": "/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.patch": "/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}", + "(google.api.http).additional_bindings.body": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "body": "document", + "additional_bindings": { + "patch": "/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}", + "body": "document" + } + } + } + ] + }, + "DeleteDocument": { + "requestType": "DeleteDocumentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportDocuments": { + "requestType": "ImportDocumentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.discoveryengine.v1.ImportDocumentsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.ImportDocumentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.discoveryengine.v1.ImportDocumentsResponse", + "metadata_type": "google.cloud.discoveryengine.v1.ImportDocumentsMetadata" + } + } + ] + }, + "PurgeDocuments": { + "requestType": "PurgeDocumentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.discoveryengine.v1.PurgeDocumentsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.PurgeDocumentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.discoveryengine.v1.PurgeDocumentsResponse", + "metadata_type": "google.cloud.discoveryengine.v1.PurgeDocumentsMetadata" + } + } + ] + } + } + }, + "GetDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + } + } + }, + "ListDocumentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Branch" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDocumentsResponse": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Branch" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDocumentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowMissing": { + "type": "bool", + "id": 2 + } + } + }, + "DeleteDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataSchema": { + "type": "string", + "id": 2 + } + } + }, + "BigQuerySource": { + "oneofs": { + "partition": { + "oneof": [ + "partitionDate" + ] + } + }, + "fields": { + "partitionDate": { + "type": "google.type.Date", + "id": 5 + }, + "projectId": { + "type": "string", + "id": 1 + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsStagingDir": { + "type": "string", + "id": 4 + }, + "dataSchema": { + "type": "string", + "id": 6 + } + } + }, + "ImportErrorConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsPrefix" + ] + } + }, + "fields": { + "gcsPrefix": { + "type": "string", + "id": 1 + } + } + }, + "ImportUserEventsRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineSource", + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "inlineSource": { + "type": "InlineSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsSource": { + "type": "GcsSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "errorConfig": { + "type": "ImportErrorConfig", + "id": 5 + } + }, + "nested": { + "InlineSource": { + "fields": { + "userEvents": { + "rule": "repeated", + "type": "UserEvent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ImportUserEventsResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "errorConfig": { + "type": "ImportErrorConfig", + "id": 2 + }, + "joinedEventsCount": { + "type": "int64", + "id": 3 + }, + "unjoinedEventsCount": { + "type": "int64", + "id": 4 + } + } + }, + "ImportUserEventsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + } + } + }, + "ImportDocumentsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + } + } + }, + "ImportDocumentsRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineSource", + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "inlineSource": { + "type": "InlineSource", + "id": 2 + }, + "gcsSource": { + "type": "GcsSource", + "id": 3 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 4 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Branch" + } + }, + "errorConfig": { + "type": "ImportErrorConfig", + "id": 5 + }, + "reconciliationMode": { + "type": "ReconciliationMode", + "id": 6 + }, + "autoGenerateIds": { + "type": "bool", + "id": 8 + }, + "idField": { + "type": "string", + "id": 9 + } + }, + "nested": { + "InlineSource": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReconciliationMode": { + "values": { + "RECONCILIATION_MODE_UNSPECIFIED": 0, + "INCREMENTAL": 1, + "FULL": 2 + } + } + } + }, + "ImportDocumentsResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "errorConfig": { + "type": "ImportErrorConfig", + "id": 2 + } + } + }, + "UserEvent": { + "fields": { + "eventType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userPseudoId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "userInfo": { + "type": "UserInfo", + "id": 4 + }, + "directUserRequest": { + "type": "bool", + "id": 5 + }, + "sessionId": { + "type": "string", + "id": 6 + }, + "pageInfo": { + "type": "PageInfo", + "id": 7 + }, + "attributionToken": { + "type": "string", + "id": 8 + }, + "filter": { + "type": "string", + "id": 9 + }, + "documents": { + "rule": "repeated", + "type": "DocumentInfo", + "id": 10 + }, + "panel": { + "type": "PanelInfo", + "id": 11 + }, + "searchInfo": { + "type": "SearchInfo", + "id": 12 + }, + "completionInfo": { + "type": "CompletionInfo", + "id": 13 + }, + "transactionInfo": { + "type": "TransactionInfo", + "id": 14 + }, + "tagIds": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "promotionIds": { + "rule": "repeated", + "type": "string", + "id": 16 + }, + "attributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 17 + }, + "mediaInfo": { + "type": "MediaInfo", + "id": 18 + } + } + }, + "PageInfo": { + "fields": { + "pageviewId": { + "type": "string", + "id": 1 + }, + "pageCategory": { + "type": "string", + "id": 2 + }, + "uri": { + "type": "string", + "id": 3 + }, + "referrerUri": { + "type": "string", + "id": 4 + } + } + }, + "SearchInfo": { + "oneofs": { + "_offset": { + "oneof": [ + "offset" + ] + } + }, + "fields": { + "searchQuery": { + "type": "string", + "id": 1 + }, + "orderBy": { + "type": "string", + "id": 2 + }, + "offset": { + "type": "int32", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "CompletionInfo": { + "fields": { + "selectedSuggestion": { + "type": "string", + "id": 1 + }, + "selectedPosition": { + "type": "int32", + "id": 2 + } + } + }, + "TransactionInfo": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + }, + "_tax": { + "oneof": [ + "tax" + ] + }, + "_cost": { + "oneof": [ + "cost" + ] + }, + "_discountValue": { + "oneof": [ + "discountValue" + ] + } + }, + "fields": { + "value": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "currency": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transactionId": { + "type": "string", + "id": 3 + }, + "tax": { + "type": "float", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "cost": { + "type": "float", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "discountValue": { + "type": "float", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "DocumentInfo": { + "oneofs": { + "documentDescriptor": { + "oneof": [ + "id", + "name" + ] + }, + "_quantity": { + "oneof": [ + "quantity" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + }, + "quantity": { + "type": "int32", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "promotionIds": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "PanelInfo": { + "oneofs": { + "_panelPosition": { + "oneof": [ + "panelPosition" + ] + }, + "_totalPanels": { + "oneof": [ + "totalPanels" + ] + } + }, + "fields": { + "panelId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "panelPosition": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "totalPanels": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "MediaInfo": { + "oneofs": { + "_mediaProgressPercentage": { + "oneof": [ + "mediaProgressPercentage" + ] + } + }, + "fields": { + "mediaProgressDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "mediaProgressPercentage": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "PurgeDocumentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Branch" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "PurgeDocumentsResponse": { + "fields": { + "purgeCount": { + "type": "int64", + "id": 1 + }, + "purgeSample": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + } + } + }, + "PurgeDocumentsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + } + } + }, + "Schema": { + "options": { + "(google.api.resource).type": "discoveryengine.googleapis.com/Schema", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}" + }, + "oneofs": { + "schema": { + "oneof": [ + "structSchema", + "jsonSchema" + ] + } + }, + "fields": { + "structSchema": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "jsonSchema": { + "type": "string", + "id": 3 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "SchemaService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetSchema": { + "requestType": "GetSchemaRequest", + "responseType": "Schema", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSchemas": { + "requestType": "ListSchemasRequest", + "responseType": "ListSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateSchema": { + "requestType": "CreateSchemaRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas", + "(google.api.http).body": "schema", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas", + "(google.api.http).additional_bindings.body": "schema", + "(google.api.method_signature)": "parent,schema,schema_id", + "(google.longrunning.operation_info).response_type": "google.cloud.discoveryengine.v1.Schema", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.CreateSchemaMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas", + "body": "schema", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas", + "body": "schema" + } + } + }, + { + "(google.api.method_signature)": "parent,schema,schema_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.discoveryengine.v1.Schema", + "metadata_type": "google.cloud.discoveryengine.v1.CreateSchemaMetadata" + } + } + ] + }, + "UpdateSchema": { + "requestType": "UpdateSchemaRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}", + "(google.api.http).body": "schema", + "(google.api.http).additional_bindings.patch": "/v1/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}", + "(google.api.http).additional_bindings.body": "schema", + "(google.longrunning.operation_info).response_type": "google.cloud.discoveryengine.v1.Schema", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.UpdateSchemaMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}", + "body": "schema", + "additional_bindings": { + "patch": "/v1/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}", + "body": "schema" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.discoveryengine.v1.Schema", + "metadata_type": "google.cloud.discoveryengine.v1.UpdateSchemaMetadata" + } + } + ] + }, + "DeleteSchema": { + "requestType": "DeleteSchemaRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.DeleteSchemaMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.discoveryengine.v1.DeleteSchemaMetadata" + } + } + ] + } + } + }, + "GetSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Schema" + } + } + } + }, + "ListSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSchemasResponse": { + "fields": { + "schemas": { + "rule": "repeated", + "type": "Schema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "schema": { + "type": "Schema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSchemaRequest": { + "fields": { + "schema": { + "type": "Schema", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Schema" + } + } + } + }, + "CreateSchemaMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "UpdateSchemaMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DeleteSchemaMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "SearchService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Search": { + "requestType": "SearchRequest", + "responseType": "SearchResponse", + "options": { + "(google.api.http).post": "/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search", + "body": "*", + "additional_bindings": { + "post": "/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search", + "body": "*" + } + } + } + ] + } + } + }, + "SearchRequest": { + "fields": { + "servingConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/ServingConfig" + } + }, + "branch": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Branch" + } + }, + "query": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "offset": { + "type": "int32", + "id": 6 + }, + "userInfo": { + "type": "UserInfo", + "id": 21 + }, + "params": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 11 + }, + "queryExpansionSpec": { + "type": "QueryExpansionSpec", + "id": 13 + }, + "spellCorrectionSpec": { + "type": "SpellCorrectionSpec", + "id": 14 + }, + "userPseudoId": { + "type": "string", + "id": 15 + }, + "contentSearchSpec": { + "type": "ContentSearchSpec", + "id": 24 + }, + "safeSearch": { + "type": "bool", + "id": 20 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 22 + } + }, + "nested": { + "QueryExpansionSpec": { + "fields": { + "condition": { + "type": "Condition", + "id": 1 + } + }, + "nested": { + "Condition": { + "values": { + "CONDITION_UNSPECIFIED": 0, + "DISABLED": 1, + "AUTO": 2 + } + } + } + }, + "SpellCorrectionSpec": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "SUGGESTION_ONLY": 1, + "AUTO": 2 + } + } + } + }, + "ContentSearchSpec": { + "fields": { + "snippetSpec": { + "type": "SnippetSpec", + "id": 1 + } + }, + "nested": { + "SnippetSpec": { + "fields": { + "maxSnippetCount": { + "type": "int32", + "id": 1 + }, + "referenceOnly": { + "type": "bool", + "id": 2 + } + } + } + } + } + } + }, + "SearchResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "SearchResult", + "id": 1 + }, + "totalSize": { + "type": "int32", + "id": 3 + }, + "attributionToken": { + "type": "string", + "id": 4 + }, + "nextPageToken": { + "type": "string", + "id": 5 + }, + "correctedQuery": { + "type": "string", + "id": 7 + } + }, + "nested": { + "SearchResult": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "document": { + "type": "Document", + "id": 2 + } + } + } + } + }, + "UserEventService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "WriteUserEvent": { + "requestType": "WriteUserEventRequest", + "responseType": "UserEvent", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write", + "(google.api.http).body": "user_event", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write", + "(google.api.http).additional_bindings.body": "user_event" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write", + "body": "user_event", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write", + "body": "user_event" + } + } + } + ] + }, + "CollectUserEvent": { + "requestType": "CollectUserEventRequest", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect" + } + } + } + ] + }, + "ImportUserEvents": { + "requestType": "ImportUserEventsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.discoveryengine.v1.ImportUserEventsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.discoveryengine.v1.ImportUserEventsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.discoveryengine.v1.ImportUserEventsResponse", + "metadata_type": "google.cloud.discoveryengine.v1.ImportUserEventsMetadata" + } + } + ] + } + } + }, + "WriteUserEventRequest": { + "oneofs": { + "_userEvent": { + "oneof": [ + "userEvent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "userEvent": { + "type": "UserEvent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "CollectUserEventRequest": { + "oneofs": { + "_uri": { + "oneof": [ + "uri" + ] + }, + "_ets": { + "oneof": [ + "ets" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "userEvent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uri": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "ets": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + } + } + }, "v1beta": { "options": { "csharp_namespace": "Google.Cloud.DiscoveryEngine.V1Beta", @@ -746,6 +2532,14 @@ "reconciliationMode": { "type": "ReconciliationMode", "id": 6 + }, + "autoGenerateIds": { + "type": "bool", + "id": 8 + }, + "idField": { + "type": "string", + "id": 9 } }, "nested": { @@ -1653,6 +3447,10 @@ "type": "string", "id": 8 }, + "userInfo": { + "type": "UserInfo", + "id": 21 + }, "facetSpecs": { "rule": "repeated", "type": "FacetSpec", @@ -1682,6 +3480,15 @@ "contentSearchSpec": { "type": "ContentSearchSpec", "id": 24 + }, + "safeSearch": { + "type": "bool", + "id": 20 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 22 } }, "nested": { diff --git a/packages/google-cloud-discoveryengine/samples/README.md b/packages/google-cloud-discoveryengine/samples/README.md index c0fff948a8b8..0996ce4c8833 100644 --- a/packages/google-cloud-discoveryengine/samples/README.md +++ b/packages/google-cloud-discoveryengine/samples/README.md @@ -12,6 +12,23 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Completion_service.complete_query](#completion_service.complete_query) + * [Document_service.create_document](#document_service.create_document) + * [Document_service.delete_document](#document_service.delete_document) + * [Document_service.get_document](#document_service.get_document) + * [Document_service.import_documents](#document_service.import_documents) + * [Document_service.list_documents](#document_service.list_documents) + * [Document_service.purge_documents](#document_service.purge_documents) + * [Document_service.update_document](#document_service.update_document) + * [Schema_service.create_schema](#schema_service.create_schema) + * [Schema_service.delete_schema](#schema_service.delete_schema) + * [Schema_service.get_schema](#schema_service.get_schema) + * [Schema_service.list_schemas](#schema_service.list_schemas) + * [Schema_service.update_schema](#schema_service.update_schema) + * [Search_service.search](#search_service.search) + * [User_event_service.collect_user_event](#user_event_service.collect_user_event) + * [User_event_service.import_user_events](#user_event_service.import_user_events) + * [User_event_service.write_user_event](#user_event_service.write_user_event) * [Completion_service.complete_query](#completion_service.complete_query) * [Document_service.create_document](#document_service.create_document) * [Document_service.delete_document](#document_service.delete_document) @@ -31,7 +48,6 @@ * [User_event_service.import_user_events](#user_event_service.import_user_events) * [User_event_service.write_user_event](#user_event_service.write_user_event) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -48,6 +64,295 @@ Before running the samples, make sure you've followed the steps outlined in +### Completion_service.complete_query + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/completion_service.complete_query.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js` + + +----- + + + + +### Document_service.create_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.create_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js` + + +----- + + + + +### Document_service.delete_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.delete_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js` + + +----- + + + + +### Document_service.get_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.get_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js` + + +----- + + + + +### Document_service.import_documents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.import_documents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js` + + +----- + + + + +### Document_service.list_documents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.list_documents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js` + + +----- + + + + +### Document_service.purge_documents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.purge_documents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js` + + +----- + + + + +### Document_service.update_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/document_service.update_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js` + + +----- + + + + +### Schema_service.create_schema + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.create_schema.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js` + + +----- + + + + +### Schema_service.delete_schema + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.delete_schema.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js` + + +----- + + + + +### Schema_service.get_schema + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.get_schema.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js` + + +----- + + + + +### Schema_service.list_schemas + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js` + + +----- + + + + +### Schema_service.update_schema + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/schema_service.update_schema.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js` + + +----- + + + + +### Search_service.search + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/search_service.search.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js` + + +----- + + + + +### User_event_service.collect_user_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js` + + +----- + + + + +### User_event_service.import_user_events + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js` + + +----- + + + + +### User_event_service.write_user_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js). + +[![Open in Cloud 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-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js` + + +----- + + + + ### Completion_service.complete_query View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js). @@ -366,23 +671,6 @@ __Usage:__ `node packages/google-cloud-discoveryengine/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/test/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-discoveryengine/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-discoveryengine/samples/test/quickstart.js` - - diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js b/packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js new file mode 100644 index 000000000000..3b28773bbfe6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/completion_service.complete_query.js @@ -0,0 +1,99 @@ +// 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(dataStore, query) { + // [START discoveryengine_v1_generated_CompletionService_CompleteQuery_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 data store resource name for which the completion is + * performed, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store`. + */ + // const dataStore = 'abc123' + /** + * Required. The typeahead input used to fetch suggestions. Maximum length is + * 128 characters. + */ + // const query = 'abc123' + /** + * Selects data model of query suggestions for serving. Currently supported + * values: + * * `document` - Using suggestions generated from user-imported documents. + * * `search-history` - Using suggestions generated from the past history of + * SearchService.Search google.cloud.discoveryengine.v1.SearchService.Search + * API calls. Do not use it when there is no traffic for Search API. + * * `user-event` - Using suggestions generated from user-imported search + * events. + * Default values: + * * `document` is the default model for regular dataStores. + * * `search-history` is the default model for + * IndustryVertical.SITE_SEARCH google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH + * dataStores. + */ + // const queryModel = 'abc123' + /** + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * This should be the same identifier as + * UserEvent.user_pseudo_id google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id + * and + * SearchRequest.user_pseudo_id google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id. + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + */ + // const userPseudoId = 'abc123' + + // Imports the Discoveryengine library + const {CompletionServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new CompletionServiceClient(); + + async function callCompleteQuery() { + // Construct request + const request = { + dataStore, + query, + }; + + // Run request + const response = await discoveryengineClient.completeQuery(request); + console.log(response); + } + + callCompleteQuery(); + // [END discoveryengine_v1_generated_CompletionService_CompleteQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js new file mode 100644 index 000000000000..ecc3fd1a6330 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.create_document.js @@ -0,0 +1,86 @@ +// 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, document, documentId) { + // [START discoveryengine_v1_generated_DocumentService_CreateDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + */ + // const parent = 'abc123' + /** + * Required. The Document google.cloud.discoveryengine.v1.Document to + * create. + */ + // const document = {} + /** + * Required. The ID to use for the + * Document google.cloud.discoveryengine.v1.Document, which will become the + * final component of the + * Document.name google.cloud.discoveryengine.v1.Document.name. + * If the caller does not have permission to create the + * Document google.cloud.discoveryengine.v1.Document, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * This field must be unique among all + * Document google.cloud.discoveryengine.v1.Document s with the same + * parent google.cloud.discoveryengine.v1.CreateDocumentRequest.parent. + * Otherwise, an `ALREADY_EXISTS` error is returned. + * This field must conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) + * standard with a length limit of 63 characters. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + */ + // const documentId = 'abc123' + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callCreateDocument() { + // Construct request + const request = { + parent, + document, + documentId, + }; + + // Run request + const response = await discoveryengineClient.createDocument(request); + console.log(response); + } + + callCreateDocument(); + // [END discoveryengine_v1_generated_DocumentService_CreateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js new file mode 100644 index 000000000000..07ea8d637586 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.delete_document.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START discoveryengine_v1_generated_DocumentService_DeleteDocument_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. Full resource name of + * Document google.cloud.discoveryengine.v1.Document, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * If the caller does not have permission to delete the + * Document google.cloud.discoveryengine.v1.Document, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * If the Document google.cloud.discoveryengine.v1.Document to delete does + * not exist, a `NOT_FOUND` error is returned. + */ + // const name = 'abc123' + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callDeleteDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await discoveryengineClient.deleteDocument(request); + console.log(response); + } + + callDeleteDocument(); + // [END discoveryengine_v1_generated_DocumentService_DeleteDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js new file mode 100644 index 000000000000..c841cd21a708 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.get_document.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START discoveryengine_v1_generated_DocumentService_GetDocument_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. Full resource name of + * Document google.cloud.discoveryengine.v1.Document, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * If the caller does not have permission to access the + * Document google.cloud.discoveryengine.v1.Document, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * If the requested Document google.cloud.discoveryengine.v1.Document does + * not exist, a `NOT_FOUND` error is returned. + */ + // const name = 'abc123' + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callGetDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await discoveryengineClient.getDocument(request); + console.log(response); + } + + callGetDocument(); + // [END discoveryengine_v1_generated_DocumentService_GetDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js new file mode 100644 index 000000000000..575940b0b67b --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.import_documents.js @@ -0,0 +1,133 @@ +// 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 discoveryengine_v1_generated_DocumentService_ImportDocuments_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. + */ + /** + * The Inline source for the input content for documents. + */ + // const inlineSource = {} + /** + * Cloud Storage location for the input content. + */ + // const gcsSource = {} + /** + * BigQuery input source. + */ + // const bigquerySource = {} + /** + * Required. The parent branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Requires create/update permission. + */ + // const parent = 'abc123' + /** + * The desired location of errors incurred during the Import. + */ + // const errorConfig = {} + /** + * The mode of reconciliation between existing documents and the documents to + * be imported. Defaults to + * ReconciliationMode.INCREMENTAL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL. + */ + // const reconciliationMode = {} + /** + * Whether to automatically generate IDs for the documents if absent. + * If set to `true`, + * Document.id google.cloud.discoveryengine.v1.Document.id s are + * automatically generated based on the hash of the payload, where IDs may not + * be consistent during multiple imports. In which case + * ReconciliationMode.FULL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL + * is highly recommended to avoid duplicate contents. If unset or set to + * `false`, Document.id google.cloud.discoveryengine.v1.Document.id s have + * to be specified using + * id_field google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field, + * otherwises, documents without IDs will fail to be imported. + * Only set this field when using + * GcsSource google.cloud.discoveryengine.v1.GcsSource or + * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource, and when + * GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema + * or + * BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema + * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + */ + // const autoGenerateIds = true + /** + * The field in the Cloud Storage and BigQuery sources that indicates the + * unique IDs of the documents. + * For GcsSource google.cloud.discoveryengine.v1.GcsSource it is the key of + * the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + * For BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource it is + * the column name of the BigQuery table where the unique ids are stored. + * The values of the JSON field or the BigQuery column will be used as the + * Document.id google.cloud.discoveryengine.v1.Document.id s. The JSON field + * or the BigQuery column must be of string type, and the values must be set + * as valid strings conform to RFC-1034 (https://tools.ietf.org/html/rfc1034) + * with 1-63 characters. Otherwise, documents without valid IDs will fail to + * be imported. + * Only set this field when using + * GcsSource google.cloud.discoveryengine.v1.GcsSource or + * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource, and when + * GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema + * or + * BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema + * is `custom`. And only set this field when + * auto_generate_ids google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids + * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + * If it is unset, a default value `_id` is used when importing from the + * allowed data sources. + */ + // const idField = 'abc123' + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callImportDocuments() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await discoveryengineClient.importDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportDocuments(); + // [END discoveryengine_v1_generated_DocumentService_ImportDocuments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js new file mode 100644 index 000000000000..35776f52b3b5 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.list_documents.js @@ -0,0 +1,88 @@ +// 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 discoveryengine_v1_generated_DocumentService_ListDocuments_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 branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default + * branch. + * If the caller does not have permission to list Documents s under this + * branch, regardless of whether or not this branch exists, a + * `PERMISSION_DENIED` error is returned. + */ + // const parent = 'abc123' + /** + * Maximum number of Document google.cloud.discoveryengine.v1.Document s to + * return. If unspecified, defaults to 100. The maximum allowed value is 1000. + * Values above 1000 will be coerced to 1000. + * If this field is negative, an `INVALID_ARGUMENT` error is returned. + */ + // const pageSize = 1234 + /** + * A page token + * ListDocumentsResponse.next_page_token google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token, + * received from a previous + * DocumentService.ListDocuments google.cloud.discoveryengine.v1.DocumentService.ListDocuments + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * DocumentService.ListDocuments google.cloud.discoveryengine.v1.DocumentService.ListDocuments + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + */ + // const pageToken = 'abc123' + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callListDocuments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await discoveryengineClient.listDocumentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDocuments(); + // [END discoveryengine_v1_generated_DocumentService_ListDocuments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.js new file mode 100644 index 000000000000..e16e9efda701 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.purge_documents.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(parent, filter) { + // [START discoveryengine_v1_generated_DocumentService_PurgeDocuments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + */ + // const parent = 'abc123' + /** + * Required. Filter matching documents to purge. Only currently supported + * value is + * `*` (all items). + */ + // const filter = 'abc123' + /** + * Actually performs the purge. If `force` is set to false, return the + * expected purge count without deleting any documents. + */ + // const force = true + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callPurgeDocuments() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const [operation] = await discoveryengineClient.purgeDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPurgeDocuments(); + // [END discoveryengine_v1_generated_DocumentService_PurgeDocuments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js new file mode 100644 index 000000000000..34a13e9d7db2 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/document_service.update_document.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(document) { + // [START discoveryengine_v1_generated_DocumentService_UpdateDocument_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 document to update/create. + * If the caller does not have permission to update the + * Document google.cloud.discoveryengine.v1.Document, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * If the Document google.cloud.discoveryengine.v1.Document to update does + * not exist and + * allow_missing google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing + * is not set, a `NOT_FOUND` error is returned. + */ + // const document = {} + /** + * If set to true, and the + * Document google.cloud.discoveryengine.v1.Document is not found, a new + * Document google.cloud.discoveryengine.v1.Document will be created. + */ + // const allowMissing = true + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callUpdateDocument() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await discoveryengineClient.updateDocument(request); + console.log(response); + } + + callUpdateDocument(); + // [END discoveryengine_v1_generated_DocumentService_UpdateDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js new file mode 100644 index 000000000000..c3858db0cc99 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.create_schema.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, schema, schemaId) { + // [START discoveryengine_v1_generated_SchemaService_CreateSchema_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 data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + */ + // const parent = 'abc123' + /** + * Required. The Schema google.cloud.discoveryengine.v1.Schema to create. + */ + // const schema = {} + /** + * Required. The ID to use for the + * Schema google.cloud.discoveryengine.v1.Schema, which will become the + * final component of the + * Schema.name google.cloud.discoveryengine.v1.Schema.name. + * This field should conform to + * RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length + * limit of 63 characters. + */ + // const schemaId = 'abc123' + + // Imports the Discoveryengine library + const {SchemaServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SchemaServiceClient(); + + async function callCreateSchema() { + // Construct request + const request = { + parent, + schema, + schemaId, + }; + + // Run request + const [operation] = await discoveryengineClient.createSchema(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSchema(); + // [END discoveryengine_v1_generated_SchemaService_CreateSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.js new file mode 100644 index 000000000000..453197cb6ac0 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.delete_schema.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 discoveryengine_v1_generated_SchemaService_DeleteSchema_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 full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + */ + // const name = 'abc123' + + // Imports the Discoveryengine library + const {SchemaServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SchemaServiceClient(); + + async function callDeleteSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await discoveryengineClient.deleteSchema(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSchema(); + // [END discoveryengine_v1_generated_SchemaService_DeleteSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.js new file mode 100644 index 000000000000..bead062baab0 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.get_schema.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 discoveryengine_v1_generated_SchemaService_GetSchema_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 full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + */ + // const name = 'abc123' + + // Imports the Discoveryengine library + const {SchemaServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SchemaServiceClient(); + + async function callGetSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await discoveryengineClient.getSchema(request); + console.log(response); + } + + callGetSchema(); + // [END discoveryengine_v1_generated_SchemaService_GetSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js new file mode 100644 index 000000000000..892e642a95e2 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.list_schemas.js @@ -0,0 +1,81 @@ +// 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 discoveryengine_v1_generated_SchemaService_ListSchemas_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 data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + */ + // const parent = 'abc123' + /** + * The maximum number of Schema google.cloud.discoveryengine.v1.Schema s to + * return. The service may return fewer than this value. + * If unspecified, at most 100 + * Schema google.cloud.discoveryengine.v1.Schema s will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * SchemaService.ListSchemas google.cloud.discoveryengine.v1.SchemaService.ListSchemas + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * SchemaService.ListSchemas google.cloud.discoveryengine.v1.SchemaService.ListSchemas + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Discoveryengine library + const {SchemaServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SchemaServiceClient(); + + async function callListSchemas() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await discoveryengineClient.listSchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSchemas(); + // [END discoveryengine_v1_generated_SchemaService_ListSchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.js new file mode 100644 index 000000000000..280538e45323 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/schema_service.update_schema.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(schema) { + // [START discoveryengine_v1_generated_SchemaService_UpdateSchema_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 Schema google.cloud.discoveryengine.v1.Schema to update. + */ + // const schema = {} + /** + * If set to true, and the Schema google.cloud.discoveryengine.v1.Schema is + * not found, a new Schema google.cloud.discoveryengine.v1.Schema will be + * created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Discoveryengine library + const {SchemaServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SchemaServiceClient(); + + async function callUpdateSchema() { + // Construct request + const request = { + schema, + }; + + // Run request + const [operation] = await discoveryengineClient.updateSchema(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSchema(); + // [END discoveryengine_v1_generated_SchemaService_UpdateSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js b/packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js new file mode 100644 index 000000000000..58f51dba0edb --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/search_service.search.js @@ -0,0 +1,172 @@ +// 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(servingConfig) { + // [START discoveryengine_v1_generated_SearchService_Search_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Search serving config, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + */ + // const servingConfig = 'abc123' + /** + * The branch resource name, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + * Use `default_branch` as the branch ID or leave this field empty, to search + * documents under the default branch. + */ + // const branch = 'abc123' + /** + * Raw search query. + */ + // const query = 'abc123' + /** + * Maximum number of Document google.cloud.discoveryengine.v1.Document s to + * return. If unspecified, defaults to a reasonable value. The maximum allowed + * value is 100. Values above 100 will be coerced to 100. + * If this field is negative, an `INVALID_ARGUMENT` is returned. + */ + // const pageSize = 1234 + /** + * A page token received from a previous + * SearchService.Search google.cloud.discoveryengine.v1.SearchService.Search + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * SearchService.Search google.cloud.discoveryengine.v1.SearchService.Search + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + */ + // const pageToken = 'abc123' + /** + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the + * Document google.cloud.discoveryengine.v1.Document s deemed by the API as + * relevant) in search results. This field is only considered if + * page_token google.cloud.discoveryengine.v1.SearchRequest.page_token is + * unset. + * If this field is negative, an `INVALID_ARGUMENT` is returned. + */ + // const offset = 1234 + /** + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. + */ + // const userInfo = {} + /** + * Additional search parameters. + * For public website search only, supported values are: + * * `user_country_code`: string. Default empty. If set to non-empty, results + * are restricted or boosted based on the location provided. + * * `search_type`: double. Default empty. Enables non-webpage searching + * depending on the value. The only valid non-default value is 1, + * which enables image searching. + */ + // const params = 1234 + /** + * The query expansion specification that specifies the conditions under which + * query expansion will occur. + */ + // const queryExpansionSpec = {} + /** + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + */ + // const spellCorrectionSpec = {} + /** + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * This field should NOT have a fixed value such as `unknown_visitor`. + * This should be the same identifier as + * UserEvent.user_pseudo_id google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id + * and + * CompleteQueryRequest.user_pseudo_id google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + */ + // const userPseudoId = 'abc123' + /** + * The content search spec that configs the desired behavior of content + * search. + */ + // const contentSearchSpec = {} + /** + * Whether to turn on safe search. This is only supported for + * ContentConfig.PUBLIC_WEBSITE . + */ + // const safeSearch = true + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See Google Cloud + * Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + */ + // const userLabels = 1234 + + // Imports the Discoveryengine library + const {SearchServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new SearchServiceClient(); + + async function callSearch() { + // Construct request + const request = { + servingConfig, + }; + + // Run request + const iterable = await discoveryengineClient.searchAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearch(); + // [END discoveryengine_v1_generated_SearchService_Search_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json b/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json new file mode 100644 index 000000000000..31b61379a4d4 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json @@ -0,0 +1,867 @@ +{ + "clientLibrary": { + "name": "nodejs-discoveryengine", + "version": "0.6.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.discoveryengine.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "discoveryengine_v1_generated_CompletionService_CompleteQuery_async", + "title": "CompletionService completeQuery Sample", + "origin": "API_DEFINITION", + "description": " Completes the specified user input with keyword suggestions.", + "canonical": true, + "file": "completion_service.complete_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.discoveryengine.v1.CompletionService.CompleteQuery", + "async": true, + "parameters": [ + { + "name": "data_store", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "query_model", + "type": "TYPE_STRING" + }, + { + "name": "user_pseudo_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.CompleteQueryResponse", + "client": { + "shortName": "CompletionServiceClient", + "fullName": "google.cloud.discoveryengine.v1.CompletionServiceClient" + }, + "method": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.discoveryengine.v1.CompletionService.CompleteQuery", + "service": { + "shortName": "CompletionService", + "fullName": "google.cloud.discoveryengine.v1.CompletionService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_GetDocument_async", + "title": "CompletionService getDocument Sample", + "origin": "API_DEFINITION", + "description": " Gets a [Document][google.cloud.discoveryengine.v1.Document].", + "canonical": true, + "file": "document_service.get_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.GetDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.Document", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "GetDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.GetDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_ListDocuments_async", + "title": "CompletionService listDocuments Sample", + "origin": "API_DEFINITION", + "description": " Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s.", + "canonical": true, + "file": "document_service.list_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.ListDocuments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.ListDocumentsResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "ListDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.ListDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_CreateDocument_async", + "title": "CompletionService createDocument Sample", + "origin": "API_DEFINITION", + "description": " Creates a [Document][google.cloud.discoveryengine.v1.Document].", + "canonical": true, + "file": "document_service.create_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.CreateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.cloud.discoveryengine.v1.Document" + }, + { + "name": "document_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.Document", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "CreateDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.CreateDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_UpdateDocument_async", + "title": "CompletionService updateDocument Sample", + "origin": "API_DEFINITION", + "description": " Updates a [Document][google.cloud.discoveryengine.v1.Document].", + "canonical": true, + "file": "document_service.update_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.UpdateDocument", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.discoveryengine.v1.Document" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.Document", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "UpdateDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.UpdateDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_DeleteDocument_async", + "title": "CompletionService deleteDocument Sample", + "origin": "API_DEFINITION", + "description": " Deletes a [Document][google.cloud.discoveryengine.v1.Document].", + "canonical": true, + "file": "document_service.delete_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.DeleteDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "DeleteDocument", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.DeleteDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_ImportDocuments_async", + "title": "CompletionService importDocuments Sample", + "origin": "API_DEFINITION", + "description": " Bulk import of multiple [Document][google.cloud.discoveryengine.v1.Document]s. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the [Document][google.cloud.discoveryengine.v1.Document]s to be successfully updated.", + "canonical": true, + "file": "document_service.import_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 125, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.ImportDocuments", + "async": true, + "parameters": [ + { + "name": "inline_source", + "type": ".google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource" + }, + { + "name": "gcs_source", + "type": ".google.cloud.discoveryengine.v1.GcsSource" + }, + { + "name": "bigquery_source", + "type": ".google.cloud.discoveryengine.v1.BigQuerySource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "error_config", + "type": ".google.cloud.discoveryengine.v1.ImportErrorConfig" + }, + { + "name": "reconciliation_mode", + "type": ".google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode" + }, + { + "name": "auto_generate_ids", + "type": "TYPE_BOOL" + }, + { + "name": "id_field", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "ImportDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.ImportDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_DocumentService_PurgeDocuments_async", + "title": "CompletionService purgeDocuments Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes all selected [Document][google.cloud.discoveryengine.v1.Document]s in a branch. This process is asynchronous. Depending on the number of [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this operation can take hours to complete. Before the delete operation completes, some [Document][google.cloud.discoveryengine.v1.Document]s might still be returned by [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument] or [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]. To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, set [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force] to false.", + "canonical": true, + "file": "document_service.purge_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PurgeDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1.DocumentServiceClient" + }, + "method": { + "shortName": "PurgeDocuments", + "fullName": "google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1.DocumentService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SchemaService_GetSchema_async", + "title": "CompletionService getSchema Sample", + "origin": "API_DEFINITION", + "description": " Gets a [Schema][google.cloud.discoveryengine.v1.Schema].", + "canonical": true, + "file": "schema_service.get_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.GetSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.Schema", + "client": { + "shortName": "SchemaServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SchemaServiceClient" + }, + "method": { + "shortName": "GetSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.GetSchema", + "service": { + "shortName": "SchemaService", + "fullName": "google.cloud.discoveryengine.v1.SchemaService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SchemaService_ListSchemas_async", + "title": "CompletionService listSchemas Sample", + "origin": "API_DEFINITION", + "description": " Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.", + "canonical": true, + "file": "schema_service.list_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSchemas", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.ListSchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.ListSchemasResponse", + "client": { + "shortName": "SchemaServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SchemaServiceClient" + }, + "method": { + "shortName": "ListSchemas", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.ListSchemas", + "service": { + "shortName": "SchemaService", + "fullName": "google.cloud.discoveryengine.v1.SchemaService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SchemaService_CreateSchema_async", + "title": "CompletionService createSchema Sample", + "origin": "API_DEFINITION", + "description": " Creates a [Schema][google.cloud.discoveryengine.v1.Schema].", + "canonical": true, + "file": "schema_service.create_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.CreateSchema", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "schema", + "type": ".google.cloud.discoveryengine.v1.Schema" + }, + { + "name": "schema_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SchemaServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SchemaServiceClient" + }, + "method": { + "shortName": "CreateSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.CreateSchema", + "service": { + "shortName": "SchemaService", + "fullName": "google.cloud.discoveryengine.v1.SchemaService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SchemaService_UpdateSchema_async", + "title": "CompletionService updateSchema Sample", + "origin": "API_DEFINITION", + "description": " Updates a [Schema][google.cloud.discoveryengine.v1.Schema].", + "canonical": true, + "file": "schema_service.update_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.UpdateSchema", + "async": true, + "parameters": [ + { + "name": "schema", + "type": ".google.cloud.discoveryengine.v1.Schema" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SchemaServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SchemaServiceClient" + }, + "method": { + "shortName": "UpdateSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.UpdateSchema", + "service": { + "shortName": "SchemaService", + "fullName": "google.cloud.discoveryengine.v1.SchemaService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SchemaService_DeleteSchema_async", + "title": "CompletionService deleteSchema Sample", + "origin": "API_DEFINITION", + "description": " Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].", + "canonical": true, + "file": "schema_service.delete_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.DeleteSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SchemaServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SchemaServiceClient" + }, + "method": { + "shortName": "DeleteSchema", + "fullName": "google.cloud.discoveryengine.v1.SchemaService.DeleteSchema", + "service": { + "shortName": "SchemaService", + "fullName": "google.cloud.discoveryengine.v1.SchemaService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_SearchService_Search_async", + "title": "CompletionService search Sample", + "origin": "API_DEFINITION", + "description": " Performs a search.", + "canonical": true, + "file": "search_service.search.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 164, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Search", + "fullName": "google.cloud.discoveryengine.v1.SearchService.Search", + "async": true, + "parameters": [ + { + "name": "serving_config", + "type": "TYPE_STRING" + }, + { + "name": "branch", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "user_info", + "type": ".google.cloud.discoveryengine.v1.UserInfo" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "query_expansion_spec", + "type": ".google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec" + }, + { + "name": "spell_correction_spec", + "type": ".google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec" + }, + { + "name": "user_pseudo_id", + "type": "TYPE_STRING" + }, + { + "name": "content_search_spec", + "type": ".google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec" + }, + { + "name": "safe_search", + "type": "TYPE_BOOL" + }, + { + "name": "user_labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.SearchResponse", + "client": { + "shortName": "SearchServiceClient", + "fullName": "google.cloud.discoveryengine.v1.SearchServiceClient" + }, + "method": { + "shortName": "Search", + "fullName": "google.cloud.discoveryengine.v1.SearchService.Search", + "service": { + "shortName": "SearchService", + "fullName": "google.cloud.discoveryengine.v1.SearchService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_UserEventService_WriteUserEvent_async", + "title": "CompletionService writeUserEvent Sample", + "origin": "API_DEFINITION", + "description": " Writes a single user event.", + "canonical": true, + "file": "user_event_service.write_user_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "WriteUserEvent", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.WriteUserEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_event", + "type": ".google.cloud.discoveryengine.v1.UserEvent" + } + ], + "resultType": ".google.cloud.discoveryengine.v1.UserEvent", + "client": { + "shortName": "UserEventServiceClient", + "fullName": "google.cloud.discoveryengine.v1.UserEventServiceClient" + }, + "method": { + "shortName": "WriteUserEvent", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.WriteUserEvent", + "service": { + "shortName": "UserEventService", + "fullName": "google.cloud.discoveryengine.v1.UserEventService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_UserEventService_CollectUserEvent_async", + "title": "CompletionService collectUserEvent Sample", + "origin": "API_DEFINITION", + "description": " Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + "canonical": true, + "file": "user_event_service.collect_user_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CollectUserEvent", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_event", + "type": "TYPE_STRING" + }, + { + "name": "uri", + "type": "TYPE_STRING" + }, + { + "name": "ets", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "UserEventServiceClient", + "fullName": "google.cloud.discoveryengine.v1.UserEventServiceClient" + }, + "method": { + "shortName": "CollectUserEvent", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent", + "service": { + "shortName": "UserEventService", + "fullName": "google.cloud.discoveryengine.v1.UserEventService" + } + } + } + }, + { + "regionTag": "discoveryengine_v1_generated_UserEventService_ImportUserEvents_async", + "title": "CompletionService importUserEvents Sample", + "origin": "API_DEFINITION", + "description": " Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + "canonical": true, + "file": "user_event_service.import_user_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportUserEvents", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents", + "async": true, + "parameters": [ + { + "name": "inline_source", + "type": ".google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource" + }, + { + "name": "gcs_source", + "type": ".google.cloud.discoveryengine.v1.GcsSource" + }, + { + "name": "bigquery_source", + "type": ".google.cloud.discoveryengine.v1.BigQuerySource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "error_config", + "type": ".google.cloud.discoveryengine.v1.ImportErrorConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "UserEventServiceClient", + "fullName": "google.cloud.discoveryengine.v1.UserEventServiceClient" + }, + "method": { + "shortName": "ImportUserEvents", + "fullName": "google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents", + "service": { + "shortName": "UserEventService", + "fullName": "google.cloud.discoveryengine.v1.UserEventService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js new file mode 100644 index 000000000000..3be0b538b160 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.collect_user_event.js @@ -0,0 +1,81 @@ +// 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, userEvent) { + // [START discoveryengine_v1_generated_UserEventService_CollectUserEvent_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 DataStore resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + */ + // const parent = 'abc123' + /** + * Required. URL encoded UserEvent proto with a length limit of 2,000,000 + * characters. + */ + // const userEvent = 'abc123' + /** + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. This is often more useful than the + * referer URL, because many browsers only send the domain for 3rd party + * requests. + */ + // const uri = 'abc123' + /** + * The event timestamp in milliseconds. This prevents browser caching of + * otherwise identical get requests. The name is abbreviated to reduce the + * payload bytes. + */ + // const ets = 1234 + + // Imports the Discoveryengine library + const {UserEventServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new UserEventServiceClient(); + + async function callCollectUserEvent() { + // Construct request + const request = { + parent, + userEvent, + }; + + // Run request + const response = await discoveryengineClient.collectUserEvent(request); + console.log(response); + } + + callCollectUserEvent(); + // [END discoveryengine_v1_generated_UserEventService_CollectUserEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.js new file mode 100644 index 000000000000..a5e95b91695f --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.import_user_events.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(inlineSource, gcsSource, bigquerySource, parent) { + // [START discoveryengine_v1_generated_UserEventService_ImportUserEvents_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 Inline source for the input content for UserEvents. + */ + // const inlineSource = {} + /** + * Required. Cloud Storage location for the input content. + */ + // const gcsSource = {} + /** + * Required. BigQuery input source. + */ + // const bigquerySource = {} + /** + * Required. Parent DataStore resource name, of the form + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + */ + // const parent = 'abc123' + /** + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + */ + // const errorConfig = {} + + // Imports the Discoveryengine library + const {UserEventServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new UserEventServiceClient(); + + async function callImportUserEvents() { + // Construct request + const request = { + inlineSource, + gcsSource, + bigquerySource, + parent, + }; + + // Run request + const [operation] = await discoveryengineClient.importUserEvents(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportUserEvents(); + // [END discoveryengine_v1_generated_UserEventService_ImportUserEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.js new file mode 100644 index 000000000000..c55a9f3aefb7 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/user_event_service.write_user_event.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(parent, userEvent) { + // [START discoveryengine_v1_generated_UserEventService_WriteUserEvent_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 DataStore resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + */ + // const parent = 'abc123' + /** + * Required. User event to write. + */ + // const userEvent = {} + + // Imports the Discoveryengine library + const {UserEventServiceClient} = require('@google-cloud/discoveryengine').v1; + + // Instantiates a client + const discoveryengineClient = new UserEventServiceClient(); + + async function callWriteUserEvent() { + // Construct request + const request = { + parent, + userEvent, + }; + + // Run request + const response = await discoveryengineClient.writeUserEvent(request); + console.log(response); + } + + callWriteUserEvent(); + // [END discoveryengine_v1_generated_UserEventService_WriteUserEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js index 04258a8d5d5f..129eba4de805 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js @@ -56,6 +56,56 @@ function main(parent) { * ReconciliationMode.INCREMENTAL google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL. */ // const reconciliationMode = {} + /** + * Whether to automatically generate IDs for the documents if absent. + * If set to `true`, + * Document.id google.cloud.discoveryengine.v1beta.Document.id s are + * automatically generated based on the hash of the payload, where IDs may not + * be consistent during multiple imports. In which case + * ReconciliationMode.FULL google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL + * is highly recommended to avoid duplicate contents. If unset or set to + * `false`, Document.id google.cloud.discoveryengine.v1beta.Document.id s + * have to be specified using + * id_field google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field, + * otherwises, documents without IDs will fail to be imported. + * Only set this field when using + * GcsSource google.cloud.discoveryengine.v1beta.GcsSource or + * BigQuerySource google.cloud.discoveryengine.v1beta.BigQuerySource, and + * when + * GcsSource.data_schema google.cloud.discoveryengine.v1beta.GcsSource.data_schema + * or + * BigQuerySource.data_schema google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema + * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + */ + // const autoGenerateIds = true + /** + * The field in the Cloud Storage and BigQuery sources that indicates the + * unique IDs of the documents. + * For GcsSource google.cloud.discoveryengine.v1beta.GcsSource it is the + * key of the JSON field. For instance, `my_id` for JSON `{"my_id": + * "some_uuid"}`. For + * BigQuerySource google.cloud.discoveryengine.v1beta.BigQuerySource it is + * the column name of the BigQuery table where the unique ids are stored. + * The values of the JSON field or the BigQuery column will be used as the + * Document.id google.cloud.discoveryengine.v1beta.Document.id s. The JSON + * field or the BigQuery column must be of string type, and the values must be + * set as valid strings conform to + * RFC-1034 (https://tools.ietf.org/html/rfc1034) with 1-63 characters. + * Otherwise, documents without valid IDs will fail to be imported. + * Only set this field when using + * GcsSource google.cloud.discoveryengine.v1beta.GcsSource or + * BigQuerySource google.cloud.discoveryengine.v1beta.BigQuerySource, and + * when + * GcsSource.data_schema google.cloud.discoveryengine.v1beta.GcsSource.data_schema + * or + * BigQuerySource.data_schema google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema + * is `custom`. And only set this field when + * auto_generate_ids google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids + * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + * If it is unset, a default value `_id` is used when importing from the + * allowed data sources. + */ + // const idField = 'abc123' // Imports the Discoveryengine library const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1beta; diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js b/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js index 1656df41e479..0ff320218305 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js @@ -88,6 +88,12 @@ function main(servingConfig) { * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. */ // const orderBy = 'abc123' + /** + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. + */ + // const userInfo = {} /** * Facet specifications for faceted search. If empty, no facets are returned. * A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` @@ -100,15 +106,12 @@ function main(servingConfig) { // const boostSpec = {} /** * Additional search parameters. - * For - * IndustryVertical.SITE_SEARCH google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH - * vertical, supported values are: + * For public website search only, supported values are: * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * This field is ignored for other verticals. */ // const params = 1234 /** @@ -140,6 +143,29 @@ function main(servingConfig) { * search. */ // const contentSearchSpec = {} + /** + * Whether to turn on safe search. This is only supported for + * ContentConfig.PUBLIC_WEBSITE . + */ + // const safeSearch = true + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See Google Cloud + * Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + */ + // const userLabels = 1234 // Imports the Discoveryengine library const {SearchServiceClient} = require('@google-cloud/discoveryengine').v1beta; diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json index 35e9bcf924fb..2d4df227bc5c 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 78, + "end": 128, "type": "FULL" } ], @@ -326,6 +326,14 @@ { "name": "reconciliation_mode", "type": ".google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode" + }, + { + "name": "auto_generate_ids", + "type": "TYPE_BOOL" + }, + { + "name": "id_field", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", @@ -686,7 +694,7 @@ "segments": [ { "start": 25, - "end": 163, + "end": 189, "type": "FULL" } ], @@ -727,6 +735,10 @@ "name": "order_by", "type": "TYPE_STRING" }, + { + "name": "user_info", + "type": ".google.cloud.discoveryengine.v1beta.UserInfo" + }, { "name": "facet_specs", "type": "TYPE_MESSAGE[]" @@ -754,6 +766,14 @@ { "name": "content_search_spec", "type": ".google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec" + }, + { + "name": "safe_search", + "type": "TYPE_BOOL" + }, + { + "name": "user_labels", + "type": "TYPE_MESSAGE[]" } ], "resultType": ".google.cloud.discoveryengine.v1beta.SearchResponse", diff --git a/packages/google-cloud-discoveryengine/src/index.ts b/packages/google-cloud-discoveryengine/src/index.ts index 0a2d2bbdd809..52839bd3f200 100644 --- a/packages/google-cloud-discoveryengine/src/index.ts +++ b/packages/google-cloud-discoveryengine/src/index.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta from './v1beta'; const CompletionServiceClient = v1beta.CompletionServiceClient; @@ -32,6 +33,7 @@ const UserEventServiceClient = v1beta.UserEventServiceClient; type UserEventServiceClient = v1beta.UserEventServiceClient; export { + v1, v1beta, CompletionServiceClient, DocumentServiceClient, @@ -41,6 +43,7 @@ export { UserEventServiceClient, }; export default { + v1, v1beta, CompletionServiceClient, DocumentServiceClient, diff --git a/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts new file mode 100644 index 000000000000..55a4e7d5cc06 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts @@ -0,0 +1,1047 @@ +// 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/completion_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './completion_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for Auto-Completion. + * @class + * @memberof v1 + */ +export class CompletionServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + completionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CompletionServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 CompletionServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CompletionServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1.CompletionService', + 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.completionServiceStub) { + return this.completionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1.CompletionService. + this.completionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1.CompletionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1 + .CompletionService, + 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 completionServiceStubMethods = ['completeQuery']; + for (const methodName of completionServiceStubMethods) { + const callPromise = this.completionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.completionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'discoveryengine.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 'discoveryengine.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 -- + // ------------------- + /** + * Completes the specified user input with keyword suggestions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataStore + * Required. The parent data store resource name for which the completion is + * performed, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store`. + * @param {string} request.query + * Required. The typeahead input used to fetch suggestions. Maximum length is + * 128 characters. + * @param {string} request.queryModel + * Selects data model of query suggestions for serving. Currently supported + * values: + * + * * `document` - Using suggestions generated from user-imported documents. + * * `search-history` - Using suggestions generated from the past history of + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * API calls. Do not use it when there is no traffic for Search API. + * * `user-event` - Using suggestions generated from user-imported search + * events. + * + * Default values: + * + * * `document` is the default model for regular dataStores. + * * `search-history` is the default model for + * {@link google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH} + * dataStores. + * @param {string} request.userPseudoId + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * + * This field should NOT have a fixed value such as `unknown_visitor`. + * + * This should be the same identifier as + * {@link google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id} + * and + * {@link google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id|SearchRequest.user_pseudo_id}. + * + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.discoveryengine.v1.CompleteQueryResponse | CompleteQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/completion_service.complete_query.js + * region_tag:discoveryengine_v1_generated_CompletionService_CompleteQuery_async + */ + completeQuery( + request?: protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest | undefined, + {} | undefined + ] + >; + completeQuery( + request: protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + | protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request: protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + | protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request?: protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + | protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + | protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse, + protos.google.cloud.discoveryengine.v1.ICompleteQueryRequest | 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({ + data_store: request.dataStore ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeQuery(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * 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.completionServiceStub && !this._terminated) { + return this.completionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/completion_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1/completion_service_client_config.json new file mode 100644 index 000000000000..8cf2b18b202b --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/completion_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.CompletionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "319f27672a8be83550d842a373549dd84649a57e": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 5000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CompleteQuery": { + "timeout_millis": 5000, + "retry_codes_name": "unavailable", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/completion_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1/completion_service_proto_list.json new file mode 100644 index 000000000000..60d54073cfa6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/completion_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/discoveryengine/v1/common.proto", + "../../protos/google/cloud/discoveryengine/v1/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1/document.proto", + "../../protos/google/cloud/discoveryengine/v1/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1/schema.proto", + "../../protos/google/cloud/discoveryengine/v1/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts new file mode 100644 index 000000000000..c37765989d89 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts @@ -0,0 +1,2297 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/document_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for ingesting {@link google.cloud.discoveryengine.v1.Document|Document} + * information of the customer's website. + * @class + * @memberof v1 + */ +export class DocumentServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + documentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 DocumentServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DocumentServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectLocationCollectionDataStoreBranchPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStoreBranchPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + }; + + // 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 = { + listDocuments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'documents' + ), + }; + + 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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/operations/*}', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*}/operations', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/collections/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*}/operations'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const importDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.ImportDocumentsResponse' + ) as gax.protobuf.Type; + const importDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.ImportDocumentsMetadata' + ) as gax.protobuf.Type; + const purgeDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.PurgeDocumentsResponse' + ) as gax.protobuf.Type; + const purgeDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + importDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDocumentsResponse.decode.bind(importDocumentsResponse), + importDocumentsMetadata.decode.bind(importDocumentsMetadata) + ), + purgeDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeDocumentsResponse.decode.bind(purgeDocumentsResponse), + purgeDocumentsMetadata.decode.bind(purgeDocumentsMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1.DocumentService', + 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.documentServiceStub) { + return this.documentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1.DocumentService. + this.documentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1.DocumentService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1.DocumentService, + 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 documentServiceStubMethods = [ + 'getDocument', + 'listDocuments', + 'createDocument', + 'updateDocument', + 'deleteDocument', + 'importDocuments', + 'purgeDocuments', + ]; + for (const methodName of documentServiceStubMethods) { + const callPromise = this.documentServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'discoveryengine.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 'discoveryengine.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 a {@link google.cloud.discoveryengine.v1.Document|Document}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full resource name of + * {@link google.cloud.discoveryengine.v1.Document|Document}, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * + * If the caller does not have permission to access the + * {@link google.cloud.discoveryengine.v1.Document|Document}, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * + * If the requested {@link google.cloud.discoveryengine.v1.Document|Document} does + * not exist, a `NOT_FOUND` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.discoveryengine.v1.Document | Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/document_service.get_document.js + * region_tag:discoveryengine_v1_generated_DocumentService_GetDocument_async + */ + getDocument( + request?: protos.google.cloud.discoveryengine.v1.IGetDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.IGetDocumentRequest | undefined, + {} | undefined + ] + >; + getDocument( + request: protos.google.cloud.discoveryengine.v1.IGetDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDocument( + request: protos.google.cloud.discoveryengine.v1.IGetDocumentRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDocument( + request?: protos.google.cloud.discoveryengine.v1.IGetDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.IGetDocumentRequest | 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.getDocument(request, options, callback); + } + /** + * Creates a {@link google.cloud.discoveryengine.v1.Document|Document}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * @param {google.cloud.discoveryengine.v1.Document} request.document + * Required. The {@link google.cloud.discoveryengine.v1.Document|Document} to + * create. + * @param {string} request.documentId + * Required. The ID to use for the + * {@link google.cloud.discoveryengine.v1.Document|Document}, which will become the + * final component of the + * {@link google.cloud.discoveryengine.v1.Document.name|Document.name}. + * + * If the caller does not have permission to create the + * {@link google.cloud.discoveryengine.v1.Document|Document}, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * + * This field must be unique among all + * {@link google.cloud.discoveryengine.v1.Document|Document}s with the same + * {@link google.cloud.discoveryengine.v1.CreateDocumentRequest.parent|parent}. + * Otherwise, an `ALREADY_EXISTS` error is returned. + * + * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + * standard with a length limit of 63 characters. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.discoveryengine.v1.Document | Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/document_service.create_document.js + * region_tag:discoveryengine_v1_generated_DocumentService_CreateDocument_async + */ + createDocument( + request?: protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest | undefined, + {} | undefined + ] + >; + createDocument( + request: protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDocument( + request: protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDocument( + request?: protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.ICreateDocumentRequest | 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.createDocument(request, options, callback); + } + /** + * Updates a {@link google.cloud.discoveryengine.v1.Document|Document}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.discoveryengine.v1.Document} request.document + * Required. The document to update/create. + * + * If the caller does not have permission to update the + * {@link google.cloud.discoveryengine.v1.Document|Document}, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * + * If the {@link google.cloud.discoveryengine.v1.Document|Document} to update does + * not exist and + * {@link google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing|allow_missing} + * is not set, a `NOT_FOUND` error is returned. + * @param {boolean} request.allowMissing + * If set to true, and the + * {@link google.cloud.discoveryengine.v1.Document|Document} is not found, a new + * {@link google.cloud.discoveryengine.v1.Document|Document} will be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.discoveryengine.v1.Document | Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/document_service.update_document.js + * region_tag:discoveryengine_v1_generated_DocumentService_UpdateDocument_async + */ + updateDocument( + request?: protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest | undefined, + {} | undefined + ] + >; + updateDocument( + request: protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDocument( + request: protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDocument( + request?: protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.IDocument, + | protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument, + protos.google.cloud.discoveryengine.v1.IUpdateDocumentRequest | 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({ + 'document.name': request.document!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDocument(request, options, callback); + } + /** + * Deletes a {@link google.cloud.discoveryengine.v1.Document|Document}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full resource name of + * {@link google.cloud.discoveryengine.v1.Document|Document}, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * + * If the caller does not have permission to delete the + * {@link google.cloud.discoveryengine.v1.Document|Document}, regardless of whether + * or not it exists, a `PERMISSION_DENIED` error is returned. + * + * If the {@link google.cloud.discoveryengine.v1.Document|Document} to delete does + * not exist, a `NOT_FOUND` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/document_service.delete_document.js + * region_tag:discoveryengine_v1_generated_DocumentService_DeleteDocument_async + */ + deleteDocument( + request?: protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest | undefined, + {} | undefined + ] + >; + deleteDocument( + request: protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDocument( + request: protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDocument( + request?: protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteDocumentRequest | 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.deleteDocument(request, options, callback); + } + + /** + * Bulk import of multiple + * {@link google.cloud.discoveryengine.v1.Document|Document}s. Request processing + * may be synchronous. Non-existing items will be created. + * + * Note: It is possible for a subset of the + * {@link google.cloud.discoveryengine.v1.Document|Document}s to be successfully + * updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource} request.inlineSource + * The Inline source for the input content for documents. + * @param {google.cloud.discoveryengine.v1.GcsSource} request.gcsSource + * Cloud Storage location for the input content. + * @param {google.cloud.discoveryengine.v1.BigQuerySource} request.bigquerySource + * BigQuery input source. + * @param {string} request.parent + * Required. The parent branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Requires create/update permission. + * @param {google.cloud.discoveryengine.v1.ImportErrorConfig} request.errorConfig + * The desired location of errors incurred during the Import. + * @param {google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode} request.reconciliationMode + * The mode of reconciliation between existing documents and the documents to + * be imported. Defaults to + * {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL|ReconciliationMode.INCREMENTAL}. + * @param {boolean} request.autoGenerateIds + * Whether to automatically generate IDs for the documents if absent. + * + * If set to `true`, + * {@link google.cloud.discoveryengine.v1.Document.id|Document.id}s are + * automatically generated based on the hash of the payload, where IDs may not + * be consistent during multiple imports. In which case + * {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL|ReconciliationMode.FULL} + * is highly recommended to avoid duplicate contents. If unset or set to + * `false`, {@link google.cloud.discoveryengine.v1.Document.id|Document.id}s have + * to be specified using + * {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field|id_field}, + * otherwises, documents without IDs will fail to be imported. + * + * Only set this field when using + * {@link google.cloud.discoveryengine.v1.GcsSource|GcsSource} or + * {@link google.cloud.discoveryengine.v1.BigQuerySource|BigQuerySource}, and when + * {@link google.cloud.discoveryengine.v1.GcsSource.data_schema|GcsSource.data_schema} + * or + * {@link google.cloud.discoveryengine.v1.BigQuerySource.data_schema|BigQuerySource.data_schema} + * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * @param {string} request.idField + * The field in the Cloud Storage and BigQuery sources that indicates the + * unique IDs of the documents. + * + * For {@link google.cloud.discoveryengine.v1.GcsSource|GcsSource} it is the key of + * the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + * For {@link google.cloud.discoveryengine.v1.BigQuerySource|BigQuerySource} it is + * the column name of the BigQuery table where the unique ids are stored. + * + * The values of the JSON field or the BigQuery column will be used as the + * {@link google.cloud.discoveryengine.v1.Document.id|Document.id}s. The JSON field + * or the BigQuery column must be of string type, and the values must be set + * as valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + * with 1-63 characters. Otherwise, documents without valid IDs will fail to + * be imported. + * + * Only set this field when using + * {@link google.cloud.discoveryengine.v1.GcsSource|GcsSource} or + * {@link google.cloud.discoveryengine.v1.BigQuerySource|BigQuerySource}, and when + * {@link google.cloud.discoveryengine.v1.GcsSource.data_schema|GcsSource.data_schema} + * or + * {@link google.cloud.discoveryengine.v1.BigQuerySource.data_schema|BigQuerySource.data_schema} + * is `custom`. And only set this field when + * {@link google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids|auto_generate_ids} + * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + * + * If it is unset, a default value `_id` is used when importing from the + * allowed data sources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/document_service.import_documents.js + * region_tag:discoveryengine_v1_generated_DocumentService_ImportDocuments_async + */ + importDocuments( + request?: protos.google.cloud.discoveryengine.v1.IImportDocumentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importDocuments( + request: protos.google.cloud.discoveryengine.v1.IImportDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importDocuments( + request: protos.google.cloud.discoveryengine.v1.IImportDocumentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importDocuments( + request?: protos.google.cloud.discoveryengine.v1.IImportDocumentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >, + 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.importDocuments(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importDocuments()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/document_service.import_documents.js + * region_tag:discoveryengine_v1_generated_DocumentService_ImportDocuments_async + */ + async checkImportDocumentsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.discoveryengine.v1.ImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.ImportDocumentsMetadata + > + > { + 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.importDocuments, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.discoveryengine.v1.ImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.ImportDocumentsMetadata + >; + } + /** + * Permanently deletes all selected + * {@link google.cloud.discoveryengine.v1.Document|Document}s in a branch. + * + * This process is asynchronous. Depending on the number of + * {@link google.cloud.discoveryengine.v1.Document|Document}s to be deleted, this + * operation can take hours to complete. Before the delete operation + * completes, some {@link google.cloud.discoveryengine.v1.Document|Document}s might + * still be returned by + * {@link google.cloud.discoveryengine.v1.DocumentService.GetDocument|DocumentService.GetDocument} + * or + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments}. + * + * To get a list of the {@link google.cloud.discoveryengine.v1.Document|Document}s + * to be deleted, set + * {@link google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force|PurgeDocumentsRequest.force} + * to false. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * @param {string} request.filter + * Required. Filter matching documents to purge. Only currently supported + * value is + * `*` (all items). + * @param {boolean} request.force + * Actually performs the purge. If `force` is set to false, return the + * expected purge count without deleting any documents. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/document_service.purge_documents.js + * region_tag:discoveryengine_v1_generated_DocumentService_PurgeDocuments_async + */ + purgeDocuments( + request?: protos.google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + purgeDocuments( + request: protos.google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeDocuments( + request: protos.google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeDocuments( + request?: protos.google.cloud.discoveryengine.v1.IPurgeDocumentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >, + 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.purgeDocuments(request, options, callback); + } + /** + * Check the status of the long running operation returned by `purgeDocuments()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/document_service.purge_documents.js + * region_tag:discoveryengine_v1_generated_DocumentService_PurgeDocuments_async + */ + async checkPurgeDocumentsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.discoveryengine.v1.PurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + > + > { + 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.purgeDocuments, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.discoveryengine.v1.PurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.PurgeDocumentsMetadata + >; + } + /** + * Gets a list of {@link google.cloud.discoveryengine.v1.Document|Document}s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default + * branch. + * + * If the caller does not have permission to list {@link |Documents}s under this + * branch, regardless of whether or not this branch exists, a + * `PERMISSION_DENIED` error is returned. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to 100. The maximum allowed value is 1000. + * Values above 1000 will be coerced to 1000. + * + * If this field is negative, an `INVALID_ARGUMENT` error is returned. + * @param {string} request.pageToken + * A page token + * {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token}, + * received from a previous + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.discoveryengine.v1.Document | Document}. + * 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 `listDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDocuments( + request?: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument[], + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest | null, + protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + ] + >; + listDocuments( + request: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + | protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.IDocument + > + ): void; + listDocuments( + request: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + | protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.IDocument + > + ): void; + listDocuments( + request?: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + | protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.IDocument + >, + callback?: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + | protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.IDocument + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IDocument[], + protos.google.cloud.discoveryengine.v1.IListDocumentsRequest | null, + protos.google.cloud.discoveryengine.v1.IListDocumentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listDocuments(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 branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default + * branch. + * + * If the caller does not have permission to list {@link |Documents}s under this + * branch, regardless of whether or not this branch exists, a + * `PERMISSION_DENIED` error is returned. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to 100. The maximum allowed value is 1000. + * Values above 1000 will be coerced to 1000. + * + * If this field is negative, an `INVALID_ARGUMENT` error is returned. + * @param {string} request.pageToken + * A page token + * {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token}, + * received from a previous + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.discoveryengine.v1.Document | Document} 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 `listDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDocumentsStream( + request?: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + 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['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDocuments.createStream( + this.innerApiCalls.listDocuments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDocuments`, 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 branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default + * branch. + * + * If the caller does not have permission to list {@link |Documents}s under this + * branch, regardless of whether or not this branch exists, a + * `PERMISSION_DENIED` error is returned. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to 100. The maximum allowed value is 1000. + * Values above 1000 will be coerced to 1000. + * + * If this field is negative, an `INVALID_ARGUMENT` error is returned. + * @param {string} request.pageToken + * A page token + * {@link google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token}, + * received from a previous + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.DocumentService.ListDocuments|DocumentService.ListDocuments} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.discoveryengine.v1.Document | Document}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/document_service.list_documents.js + * region_tag:discoveryengine_v1_generated_DocumentService_ListDocuments_async + */ + listDocumentsAsync( + request?: protos.google.cloud.discoveryengine.v1.IListDocumentsRequest, + 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['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDocuments.asyncIterate( + this.innerApiCalls['listDocuments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 projectLocationCollectionDataStoreBranch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).branch; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchPath( + project: string, + location: string, + dataStore: string, + branch: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).branch; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * 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.documentServiceStub && !this._terminated) { + return this.documentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/document_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1/document_service_client_config.json new file mode 100644 index 000000000000..cb11ed6b90af --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/document_service_client_config.json @@ -0,0 +1,82 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.DocumentService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "e6a9f61a856ca7c2128ab9550ca4fb9e97c77876": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetDocument": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDocuments": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateDocument": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDocument": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDocument": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ImportDocuments": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "e6a9f61a856ca7c2128ab9550ca4fb9e97c77876" + }, + "PurgeDocuments": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/document_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1/document_service_proto_list.json new file mode 100644 index 000000000000..60d54073cfa6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/document_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/discoveryengine/v1/common.proto", + "../../protos/google/cloud/discoveryengine/v1/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1/document.proto", + "../../protos/google/cloud/discoveryengine/v1/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1/schema.proto", + "../../protos/google/cloud/discoveryengine/v1/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1/gapic_metadata.json b/packages/google-cloud-discoveryengine/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..4ca67f3204bd --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/gapic_metadata.json @@ -0,0 +1,261 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.discoveryengine.v1", + "libraryPackage": "@google-cloud/discoveryengine", + "services": { + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "PurgeDocuments": { + "methods": [ + "purgeDocuments" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "PurgeDocuments": { + "methods": [ + "purgeDocuments" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + } + } + }, + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "SchemaServiceClient", + "rpcs": { + "GetSchema": { + "methods": [ + "getSchema" + ] + }, + "CreateSchema": { + "methods": [ + "createSchema" + ] + }, + "UpdateSchema": { + "methods": [ + "updateSchema" + ] + }, + "DeleteSchema": { + "methods": [ + "deleteSchema" + ] + }, + "ListSchemas": { + "methods": [ + "listSchemas", + "listSchemasStream", + "listSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SchemaServiceClient", + "rpcs": { + "GetSchema": { + "methods": [ + "getSchema" + ] + }, + "CreateSchema": { + "methods": [ + "createSchema" + ] + }, + "UpdateSchema": { + "methods": [ + "updateSchema" + ] + }, + "DeleteSchema": { + "methods": [ + "deleteSchema" + ] + }, + "ListSchemas": { + "methods": [ + "listSchemas", + "listSchemasStream", + "listSchemasAsync" + ] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": [ + "search", + "searchStream", + "searchAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": [ + "search", + "searchStream", + "searchAsync" + ] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventServiceClient", + "rpcs": { + "WriteUserEvent": { + "methods": [ + "writeUserEvent" + ] + }, + "CollectUserEvent": { + "methods": [ + "collectUserEvent" + ] + }, + "ImportUserEvents": { + "methods": [ + "importUserEvents" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UserEventServiceClient", + "rpcs": { + "WriteUserEvent": { + "methods": [ + "writeUserEvent" + ] + }, + "CollectUserEvent": { + "methods": [ + "collectUserEvent" + ] + }, + "ImportUserEvents": { + "methods": [ + "importUserEvents" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/index.ts b/packages/google-cloud-discoveryengine/src/v1/index.ts new file mode 100644 index 000000000000..ecca0c5d1937 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/index.ts @@ -0,0 +1,23 @@ +// 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 {CompletionServiceClient} from './completion_service_client'; +export {DocumentServiceClient} from './document_service_client'; +export {SchemaServiceClient} from './schema_service_client'; +export {SearchServiceClient} from './search_service_client'; +export {UserEventServiceClient} from './user_event_service_client'; diff --git a/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts new file mode 100644 index 000000000000..37c578d83fa9 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts @@ -0,0 +1,1983 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/schema_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './schema_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.discoveryengine.v1.Schema|Schema}s. + * @class + * @memberof v1 + */ +export class SchemaServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + schemaServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SchemaServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 SchemaServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SchemaServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + }; + + // 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 = { + listSchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'schemas' + ), + }; + + 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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/operations/*}', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*}/operations', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/collections/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*}/operations'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createSchemaResponse = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.Schema' + ) as gax.protobuf.Type; + const createSchemaMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.CreateSchemaMetadata' + ) as gax.protobuf.Type; + const updateSchemaResponse = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.Schema' + ) as gax.protobuf.Type; + const updateSchemaMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.UpdateSchemaMetadata' + ) as gax.protobuf.Type; + const deleteSchemaResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteSchemaMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.DeleteSchemaMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSchema: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSchemaResponse.decode.bind(createSchemaResponse), + createSchemaMetadata.decode.bind(createSchemaMetadata) + ), + updateSchema: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSchemaResponse.decode.bind(updateSchemaResponse), + updateSchemaMetadata.decode.bind(updateSchemaMetadata) + ), + deleteSchema: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSchemaResponse.decode.bind(deleteSchemaResponse), + deleteSchemaMetadata.decode.bind(deleteSchemaMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1.SchemaService', + 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.schemaServiceStub) { + return this.schemaServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1.SchemaService. + this.schemaServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1.SchemaService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1.SchemaService, + 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 schemaServiceStubMethods = [ + 'getSchema', + 'listSchemas', + 'createSchema', + 'updateSchema', + 'deleteSchema', + ]; + for (const methodName of schemaServiceStubMethods) { + const callPromise = this.schemaServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.schemaServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'discoveryengine.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 'discoveryengine.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 a {@link google.cloud.discoveryengine.v1.Schema|Schema}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.discoveryengine.v1.Schema | Schema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.get_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_GetSchema_async + */ + getSchema( + request?: protos.google.cloud.discoveryengine.v1.IGetSchemaRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IGetSchemaRequest | undefined, + {} | undefined + ] + >; + getSchema( + request: protos.google.cloud.discoveryengine.v1.IGetSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.ISchema, + | protos.google.cloud.discoveryengine.v1.IGetSchemaRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSchema( + request: protos.google.cloud.discoveryengine.v1.IGetSchemaRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.ISchema, + | protos.google.cloud.discoveryengine.v1.IGetSchemaRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSchema( + request?: protos.google.cloud.discoveryengine.v1.IGetSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.ISchema, + | protos.google.cloud.discoveryengine.v1.IGetSchemaRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.ISchema, + | protos.google.cloud.discoveryengine.v1.IGetSchemaRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IGetSchemaRequest | 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.getSchema(request, options, callback); + } + + /** + * Creates a {@link google.cloud.discoveryengine.v1.Schema|Schema}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {google.cloud.discoveryengine.v1.Schema} request.schema + * Required. The {@link google.cloud.discoveryengine.v1.Schema|Schema} to create. + * @param {string} request.schemaId + * Required. The ID to use for the + * {@link google.cloud.discoveryengine.v1.Schema|Schema}, which will become the + * final component of the + * {@link google.cloud.discoveryengine.v1.Schema.name|Schema.name}. + * + * This field should conform to + * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + * limit of 63 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.create_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_CreateSchema_async + */ + createSchema( + request?: protos.google.cloud.discoveryengine.v1.ICreateSchemaRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createSchema( + request: protos.google.cloud.discoveryengine.v1.ICreateSchemaRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSchema( + request: protos.google.cloud.discoveryengine.v1.ICreateSchemaRequest, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSchema( + request?: protos.google.cloud.discoveryengine.v1.ICreateSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >, + 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.createSchema(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createSchema()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.create_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_CreateSchema_async + */ + async checkCreateSchemaProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.discoveryengine.v1.Schema, + protos.google.cloud.discoveryengine.v1.CreateSchemaMetadata + > + > { + 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.createSchema, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.discoveryengine.v1.Schema, + protos.google.cloud.discoveryengine.v1.CreateSchemaMetadata + >; + } + /** + * Updates a {@link google.cloud.discoveryengine.v1.Schema|Schema}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.discoveryengine.v1.Schema} request.schema + * Required. The {@link google.cloud.discoveryengine.v1.Schema|Schema} to update. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.discoveryengine.v1.Schema|Schema} is + * not found, a new {@link google.cloud.discoveryengine.v1.Schema|Schema} 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.update_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_UpdateSchema_async + */ + updateSchema( + request?: protos.google.cloud.discoveryengine.v1.IUpdateSchemaRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateSchema( + request: protos.google.cloud.discoveryengine.v1.IUpdateSchemaRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateSchema( + request: protos.google.cloud.discoveryengine.v1.IUpdateSchemaRequest, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateSchema( + request?: protos.google.cloud.discoveryengine.v1.IUpdateSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >, + 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({ + 'schema.name': request.schema!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSchema(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateSchema()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.update_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_UpdateSchema_async + */ + async checkUpdateSchemaProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.discoveryengine.v1.Schema, + protos.google.cloud.discoveryengine.v1.UpdateSchemaMetadata + > + > { + 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.updateSchema, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.discoveryengine.v1.Schema, + protos.google.cloud.discoveryengine.v1.UpdateSchemaMetadata + >; + } + /** + * Deletes a {@link google.cloud.discoveryengine.v1.Schema|Schema}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.delete_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_DeleteSchema_async + */ + deleteSchema( + request?: protos.google.cloud.discoveryengine.v1.IDeleteSchemaRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteSchema( + request: protos.google.cloud.discoveryengine.v1.IDeleteSchemaRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSchema( + request: protos.google.cloud.discoveryengine.v1.IDeleteSchemaRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSchema( + request?: protos.google.cloud.discoveryengine.v1.IDeleteSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >, + 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.deleteSchema(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteSchema()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.delete_schema.js + * region_tag:discoveryengine_v1_generated_SchemaService_DeleteSchema_async + */ + async checkDeleteSchemaProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.discoveryengine.v1.DeleteSchemaMetadata + > + > { + 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.deleteSchema, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.discoveryengine.v1.DeleteSchemaMetadata + >; + } + /** + * Gets a list of {@link google.cloud.discoveryengine.v1.Schema|Schema}s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {number} request.pageSize + * The maximum number of {@link google.cloud.discoveryengine.v1.Schema|Schema}s to + * return. The service may return fewer than this value. + * + * If unspecified, at most 100 + * {@link google.cloud.discoveryengine.v1.Schema|Schema}s will be returned. + * + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.discoveryengine.v1.Schema | Schema}. + * 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 `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSchemas( + request?: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ISchema[], + protos.google.cloud.discoveryengine.v1.IListSchemasRequest | null, + protos.google.cloud.discoveryengine.v1.IListSchemasResponse + ] + >; + listSchemas( + request: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + | protos.google.cloud.discoveryengine.v1.IListSchemasResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.ISchema + > + ): void; + listSchemas( + request: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + | protos.google.cloud.discoveryengine.v1.IListSchemasResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.ISchema + > + ): void; + listSchemas( + request?: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + | protos.google.cloud.discoveryengine.v1.IListSchemasResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.ISchema + >, + callback?: PaginationCallback< + protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + | protos.google.cloud.discoveryengine.v1.IListSchemasResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.ISchema + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.ISchema[], + protos.google.cloud.discoveryengine.v1.IListSchemasRequest | null, + protos.google.cloud.discoveryengine.v1.IListSchemasResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listSchemas(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 data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {number} request.pageSize + * The maximum number of {@link google.cloud.discoveryengine.v1.Schema|Schema}s to + * return. The service may return fewer than this value. + * + * If unspecified, at most 100 + * {@link google.cloud.discoveryengine.v1.Schema|Schema}s will be returned. + * + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.discoveryengine.v1.Schema | Schema} 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 `listSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSchemasStream( + request?: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + 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['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemas.createStream( + this.innerApiCalls.listSchemas as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSchemas`, 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 data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {number} request.pageSize + * The maximum number of {@link google.cloud.discoveryengine.v1.Schema|Schema}s to + * return. The service may return fewer than this value. + * + * If unspecified, at most 100 + * {@link google.cloud.discoveryengine.v1.Schema|Schema}s will be returned. + * + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SchemaService.ListSchemas|SchemaService.ListSchemas} + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.discoveryengine.v1.Schema | Schema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/schema_service.list_schemas.js + * region_tag:discoveryengine_v1_generated_SchemaService_ListSchemas_async + */ + listSchemasAsync( + request?: protos.google.cloud.discoveryengine.v1.IListSchemasRequest, + 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['listSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSchemas.asyncIterate( + this.innerApiCalls['listSchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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 projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * 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.schemaServiceStub && !this._terminated) { + return this.schemaServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/schema_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1/schema_service_client_config.json new file mode 100644 index 000000000000..3f6973aed287 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/schema_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.SchemaService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetSchema": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSchemas": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateSchema": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSchema": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteSchema": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/schema_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1/schema_service_proto_list.json new file mode 100644 index 000000000000..60d54073cfa6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/schema_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/discoveryengine/v1/common.proto", + "../../protos/google/cloud/discoveryengine/v1/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1/document.proto", + "../../protos/google/cloud/discoveryengine/v1/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1/schema.proto", + "../../protos/google/cloud/discoveryengine/v1/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts new file mode 100644 index 000000000000..ed86a1f29695 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts @@ -0,0 +1,1619 @@ +// 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, +} 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/search_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './search_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for search. + * @class + * @memberof v1 + */ +export class SearchServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + searchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SearchServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 SearchServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SearchServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectLocationCollectionDataStoreBranchPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationCollectionDataStoreServingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}' + ), + projectLocationDataStoreBranchPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStoreServingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}' + ), + }; + + // 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 = { + search: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1.SearchService', + 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.searchServiceStub) { + return this.searchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1.SearchService. + this.searchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1.SearchService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1.SearchService, + 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 searchServiceStubMethods = ['search']; + for (const methodName of searchServiceStubMethods) { + const callPromise = this.searchServiceStub.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.searchServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'discoveryengine.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 'discoveryengine.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 -- + // ------------------- + + /** + * Performs a search. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.servingConfig + * Required. The resource name of the Search serving config, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * @param {string} request.branch + * The branch resource name, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + * + * Use `default_branch` as the branch ID or leave this field empty, to search + * documents under the default branch. + * @param {string} request.query + * Raw search query. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to a reasonable value. The maximum allowed + * value is 100. Values above 100 will be coerced to 100. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {number} request.offset + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the + * {@link google.cloud.discoveryengine.v1.Document|Document}s deemed by the API as + * relevant) in search results. This field is only considered if + * {@link google.cloud.discoveryengine.v1.SearchRequest.page_token|page_token} is + * unset. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. + * @param {number[]} request.params + * Additional search parameters. + * + * For public website search only, supported values are: + * + * * `user_country_code`: string. Default empty. If set to non-empty, results + * are restricted or boosted based on the location provided. + * * `search_type`: double. Default empty. Enables non-webpage searching + * depending on the value. The only valid non-default value is 1, + * which enables image searching. + * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec + * The query expansion specification that specifies the conditions under which + * query expansion will occur. + * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * @param {string} request.userPseudoId + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * + * This field should NOT have a fixed value such as `unknown_visitor`. + * + * This should be the same identifier as + * {@link google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id} + * and + * {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id} + * + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} request.contentSearchSpec + * The content search spec that configs the desired behavior of content + * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.discoveryengine.v1.SearchResponse.SearchResult | SearchResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + search( + request?: protos.google.cloud.discoveryengine.v1.ISearchRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[], + protos.google.cloud.discoveryengine.v1.ISearchRequest | null, + protos.google.cloud.discoveryengine.v1.ISearchResponse + ] + >; + search( + request: protos.google.cloud.discoveryengine.v1.ISearchRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.ISearchRequest, + protos.google.cloud.discoveryengine.v1.ISearchResponse | null | undefined, + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult + > + ): void; + search( + request: protos.google.cloud.discoveryengine.v1.ISearchRequest, + callback: PaginationCallback< + protos.google.cloud.discoveryengine.v1.ISearchRequest, + protos.google.cloud.discoveryengine.v1.ISearchResponse | null | undefined, + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult + > + ): void; + search( + request?: protos.google.cloud.discoveryengine.v1.ISearchRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.discoveryengine.v1.ISearchRequest, + | protos.google.cloud.discoveryengine.v1.ISearchResponse + | null + | undefined, + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult + >, + callback?: PaginationCallback< + protos.google.cloud.discoveryengine.v1.ISearchRequest, + protos.google.cloud.discoveryengine.v1.ISearchResponse | null | undefined, + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[], + protos.google.cloud.discoveryengine.v1.ISearchRequest | null, + protos.google.cloud.discoveryengine.v1.ISearchResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + serving_config: request.servingConfig ?? '', + }); + this.initialize(); + return this.innerApiCalls.search(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.servingConfig + * Required. The resource name of the Search serving config, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * @param {string} request.branch + * The branch resource name, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + * + * Use `default_branch` as the branch ID or leave this field empty, to search + * documents under the default branch. + * @param {string} request.query + * Raw search query. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to a reasonable value. The maximum allowed + * value is 100. Values above 100 will be coerced to 100. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {number} request.offset + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the + * {@link google.cloud.discoveryengine.v1.Document|Document}s deemed by the API as + * relevant) in search results. This field is only considered if + * {@link google.cloud.discoveryengine.v1.SearchRequest.page_token|page_token} is + * unset. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. + * @param {number[]} request.params + * Additional search parameters. + * + * For public website search only, supported values are: + * + * * `user_country_code`: string. Default empty. If set to non-empty, results + * are restricted or boosted based on the location provided. + * * `search_type`: double. Default empty. Enables non-webpage searching + * depending on the value. The only valid non-default value is 1, + * which enables image searching. + * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec + * The query expansion specification that specifies the conditions under which + * query expansion will occur. + * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * @param {string} request.userPseudoId + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * + * This field should NOT have a fixed value such as `unknown_visitor`. + * + * This should be the same identifier as + * {@link google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id} + * and + * {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id} + * + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} request.contentSearchSpec + * The content search spec that configs the desired behavior of content + * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * @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 google.cloud.discoveryengine.v1.SearchResponse.SearchResult | SearchResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchStream( + request?: protos.google.cloud.discoveryengine.v1.ISearchRequest, + 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({ + serving_config: request.servingConfig ?? '', + }); + const defaultCallSettings = this._defaults['search']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.search.createStream( + this.innerApiCalls.search as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `search`, 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.servingConfig + * Required. The resource name of the Search serving config, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + * This field is used to identify the serving configuration name, set + * of models used to make the search. + * @param {string} request.branch + * The branch resource name, such as + * `projects/* /locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + * + * Use `default_branch` as the branch ID or leave this field empty, to search + * documents under the default branch. + * @param {string} request.query + * Raw search query. + * @param {number} request.pageSize + * Maximum number of {@link google.cloud.discoveryengine.v1.Document|Document}s to + * return. If unspecified, defaults to a reasonable value. The maximum allowed + * value is 100. Values above 100 will be coerced to 100. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.discoveryengine.v1.SearchService.Search|SearchService.Search} + * must match the call that provided the page token. Otherwise, an + * `INVALID_ARGUMENT` error is returned. + * @param {number} request.offset + * A 0-indexed integer that specifies the current offset (that is, starting + * result location, amongst the + * {@link google.cloud.discoveryengine.v1.Document|Document}s deemed by the API as + * relevant) in search results. This field is only considered if + * {@link google.cloud.discoveryengine.v1.SearchRequest.page_token|page_token} is + * unset. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. + * @param {number[]} request.params + * Additional search parameters. + * + * For public website search only, supported values are: + * + * * `user_country_code`: string. Default empty. If set to non-empty, results + * are restricted or boosted based on the location provided. + * * `search_type`: double. Default empty. Enables non-webpage searching + * depending on the value. The only valid non-default value is 1, + * which enables image searching. + * @param {google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec + * The query expansion specification that specifies the conditions under which + * query expansion will occur. + * @param {google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec + * The spell correction specification that specifies the mode under + * which spell correction will take effect. + * @param {string} request.userPseudoId + * A unique identifier for tracking visitors. For example, this could be + * implemented with an HTTP cookie, which should be able to uniquely identify + * a visitor on a single device. This unique identifier should not change if + * the visitor logs in or out of the website. + * + * This field should NOT have a fixed value such as `unknown_visitor`. + * + * This should be the same identifier as + * {@link google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id|UserEvent.user_pseudo_id} + * and + * {@link google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id|CompleteQueryRequest.user_pseudo_id} + * + * The field must be a UTF-8 encoded string with a length limit of 128 + * characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @param {google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec} request.contentSearchSpec + * The content search spec that configs the desired behavior of content + * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult | SearchResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/search_service.search.js + * region_tag:discoveryengine_v1_generated_SearchService_Search_async + */ + searchAsync( + request?: protos.google.cloud.discoveryengine.v1.ISearchRequest, + 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({ + serving_config: request.servingConfig ?? '', + }); + const defaultCallSettings = this._defaults['search']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.search.asyncIterate( + this.innerApiCalls['search'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranch resource. + * + * @param {string} projectLocationCollectionDataStoreBranchName + * A fully-qualified path representing project_location_collection_data_store_branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchName( + projectLocationCollectionDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match( + projectLocationCollectionDataStoreBranchName + ).branch; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreServingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} serving_config + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreServingConfigPath( + project: string, + location: string, + collection: string, + dataStore: string, + servingConfig: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + serving_config: servingConfig, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).data_store; + } + + /** + * Parse the serving_config from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).serving_config; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchPath( + project: string, + location: string, + dataStore: string, + branch: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranch resource. + * + * @param {string} projectLocationDataStoreBranchName + * A fully-qualified path representing project_location_data_store_branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchName( + projectLocationDataStoreBranchName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchPathTemplate.match( + projectLocationDataStoreBranchName + ).branch; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStoreServingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} serving_config + * @returns {string} Resource name string. + */ + projectLocationDataStoreServingConfigPath( + project: string, + location: string, + dataStore: string, + servingConfig: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + serving_config: servingConfig, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).data_store; + } + + /** + * Parse the serving_config from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).serving_config; + } + + /** + * 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.searchServiceStub && !this._terminated) { + return this.searchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/search_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1/search_service_client_config.json new file mode 100644 index 000000000000..a923eb634aa0 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/search_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.SearchService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "319f27672a8be83550d842a373549dd84649a57e": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 5000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Search": { + "timeout_millis": 5000, + "retry_codes_name": "unavailable", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/search_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1/search_service_proto_list.json new file mode 100644 index 000000000000..60d54073cfa6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/search_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/discoveryengine/v1/common.proto", + "../../protos/google/cloud/discoveryengine/v1/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1/document.proto", + "../../protos/google/cloud/discoveryengine/v1/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1/schema.proto", + "../../protos/google/cloud/discoveryengine/v1/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts new file mode 100644 index 000000000000..50c7cd87327c --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts @@ -0,0 +1,1555 @@ +// 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/user_event_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './user_event_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for ingesting end user actions on a website to Discovery Engine API. + * @class + * @memberof v1 + */ +export class UserEventServiceClient { + 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}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + userEventServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UserEventServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 UserEventServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof UserEventServiceClient; + 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; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + }; + + 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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/operations/*}', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*}/operations', + additional_bindings: [ + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/collections/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*}/operations'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const importUserEventsResponse = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.ImportUserEventsResponse' + ) as gax.protobuf.Type; + const importUserEventsMetadata = protoFilesRoot.lookup( + '.google.cloud.discoveryengine.v1.ImportUserEventsMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + importUserEvents: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importUserEventsResponse.decode.bind(importUserEventsResponse), + importUserEventsMetadata.decode.bind(importUserEventsMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1.UserEventService', + 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.userEventServiceStub) { + return this.userEventServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1.UserEventService. + this.userEventServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1.UserEventService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1 + .UserEventService, + 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 userEventServiceStubMethods = [ + 'writeUserEvent', + 'collectUserEvent', + 'importUserEvents', + ]; + for (const methodName of userEventServiceStubMethods) { + const callPromise = this.userEventServiceStub.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.userEventServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'discoveryengine.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 'discoveryengine.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 -- + // ------------------- + /** + * Writes a single user event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent DataStore resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {google.cloud.discoveryengine.v1.UserEvent} request.userEvent + * Required. User event to write. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.discoveryengine.v1.UserEvent | UserEvent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/user_event_service.write_user_event.js + * region_tag:discoveryengine_v1_generated_UserEventService_WriteUserEvent_async + */ + writeUserEvent( + request?: protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IUserEvent, + protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest | undefined, + {} | undefined + ] + >; + writeUserEvent( + request: protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IUserEvent, + | protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + writeUserEvent( + request: protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1.IUserEvent, + | protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + writeUserEvent( + request?: protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1.IUserEvent, + | protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1.IUserEvent, + | protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1.IUserEvent, + protos.google.cloud.discoveryengine.v1.IWriteUserEventRequest | 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.writeUserEvent(request, options, callback); + } + /** + * Writes a single user event from the browser. This uses a GET request to + * due to browser restriction of POST-ing to a 3rd party domain. + * + * This method is used only by the Discovery Engine API JavaScript pixel and + * Google Tag Manager. Users should not call this method directly. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent DataStore resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param {string} request.userEvent + * Required. URL encoded UserEvent proto with a length limit of 2,000,000 + * characters. + * @param {string} request.uri + * The URL including cgi-parameters but excluding the hash fragment with a + * length limit of 5,000 characters. This is often more useful than the + * referer URL, because many browsers only send the domain for 3rd party + * requests. + * @param {number} request.ets + * The event timestamp in milliseconds. This prevents browser caching of + * otherwise identical get requests. The name is abbreviated to reduce the + * payload bytes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.api.HttpBody | HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/user_event_service.collect_user_event.js + * region_tag:discoveryengine_v1_generated_UserEventService_CollectUserEvent_async + */ + collectUserEvent( + request?: protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | undefined + ), + {} | undefined + ] + >; + collectUserEvent( + request: protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + collectUserEvent( + request: protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + collectUserEvent( + request?: protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.discoveryengine.v1.ICollectUserEventRequest + | 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.collectUserEvent(request, options, callback); + } + + /** + * Bulk import of User events. Request processing might be + * synchronous. Events that already exist are skipped. + * Use this method for backfilling historical user events. + * + * Operation.response is of type ImportResponse. Note that it is + * possible for a subset of the items to be successfully inserted. + * Operation.metadata is of type ImportMetadata. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource} request.inlineSource + * Required. The Inline source for the input content for UserEvents. + * @param {google.cloud.discoveryengine.v1.GcsSource} request.gcsSource + * Required. Cloud Storage location for the input content. + * @param {google.cloud.discoveryengine.v1.BigQuerySource} request.bigquerySource + * Required. BigQuery input source. + * @param {string} request.parent + * Required. Parent DataStore resource name, of the form + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + * @param {google.cloud.discoveryengine.v1.ImportErrorConfig} request.errorConfig + * The desired location of errors incurred during the Import. Cannot be set + * for inline user event imports. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/user_event_service.import_user_events.js + * region_tag:discoveryengine_v1_generated_UserEventService_ImportUserEvents_async + */ + importUserEvents( + request?: protos.google.cloud.discoveryengine.v1.IImportUserEventsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importUserEvents( + request: protos.google.cloud.discoveryengine.v1.IImportUserEventsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importUserEvents( + request: protos.google.cloud.discoveryengine.v1.IImportUserEventsRequest, + callback: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importUserEvents( + request?: protos.google.cloud.discoveryengine.v1.IImportUserEventsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >, + 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.importUserEvents(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importUserEvents()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/user_event_service.import_user_events.js + * region_tag:discoveryengine_v1_generated_UserEventService_ImportUserEvents_async + */ + async checkImportUserEventsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.discoveryengine.v1.ImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.ImportUserEventsMetadata + > + > { + 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.importUserEvents, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.discoveryengine.v1.ImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.ImportUserEventsMetadata + >; + } + /** + * 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 projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * 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.userEventServiceStub && !this._terminated) { + return this.userEventServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/user_event_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client_config.json new file mode 100644 index 000000000000..4592e12161ac --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1.UserEventService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "e6a9f61a856ca7c2128ab9550ca4fb9e97c77876": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "WriteUserEvent": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CollectUserEvent": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ImportUserEvents": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "e6a9f61a856ca7c2128ab9550ca4fb9e97c77876" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1/user_event_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1/user_event_service_proto_list.json new file mode 100644 index 000000000000..60d54073cfa6 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1/user_event_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/discoveryengine/v1/common.proto", + "../../protos/google/cloud/discoveryengine/v1/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1/document.proto", + "../../protos/google/cloud/discoveryengine/v1/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1/schema.proto", + "../../protos/google/cloud/discoveryengine/v1/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts index ddbb791dd442..f5bf6a7e05d1 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts @@ -241,6 +241,9 @@ export class DocumentServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, @@ -264,6 +267,9 @@ export class DocumentServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, @@ -928,6 +934,58 @@ export class DocumentServiceClient { * The mode of reconciliation between existing documents and the documents to * be imported. Defaults to * {@link google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL|ReconciliationMode.INCREMENTAL}. + * @param {boolean} request.autoGenerateIds + * Whether to automatically generate IDs for the documents if absent. + * + * If set to `true`, + * {@link google.cloud.discoveryengine.v1beta.Document.id|Document.id}s are + * automatically generated based on the hash of the payload, where IDs may not + * be consistent during multiple imports. In which case + * {@link google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL|ReconciliationMode.FULL} + * is highly recommended to avoid duplicate contents. If unset or set to + * `false`, {@link google.cloud.discoveryengine.v1beta.Document.id|Document.id}s + * have to be specified using + * {@link google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field|id_field}, + * otherwises, documents without IDs will fail to be imported. + * + * Only set this field when using + * {@link google.cloud.discoveryengine.v1beta.GcsSource|GcsSource} or + * {@link google.cloud.discoveryengine.v1beta.BigQuerySource|BigQuerySource}, and + * when + * {@link google.cloud.discoveryengine.v1beta.GcsSource.data_schema|GcsSource.data_schema} + * or + * {@link google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema|BigQuerySource.data_schema} + * is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown. + * @param {string} request.idField + * The field in the Cloud Storage and BigQuery sources that indicates the + * unique IDs of the documents. + * + * For {@link google.cloud.discoveryengine.v1beta.GcsSource|GcsSource} it is the + * key of the JSON field. For instance, `my_id` for JSON `{"my_id": + * "some_uuid"}`. For + * {@link google.cloud.discoveryengine.v1beta.BigQuerySource|BigQuerySource} it is + * the column name of the BigQuery table where the unique ids are stored. + * + * The values of the JSON field or the BigQuery column will be used as the + * {@link google.cloud.discoveryengine.v1beta.Document.id|Document.id}s. The JSON + * field or the BigQuery column must be of string type, and the values must be + * set as valid strings conform to + * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters. + * Otherwise, documents without valid IDs will fail to be imported. + * + * Only set this field when using + * {@link google.cloud.discoveryengine.v1beta.GcsSource|GcsSource} or + * {@link google.cloud.discoveryengine.v1beta.BigQuerySource|BigQuerySource}, and + * when + * {@link google.cloud.discoveryengine.v1beta.GcsSource.data_schema|GcsSource.data_schema} + * or + * {@link google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema|BigQuerySource.data_schema} + * is `custom`. And only set this field when + * {@link google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids|auto_generate_ids} + * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + * + * If it is unset, a default value `_id` is used when importing from the + * allowed data sources. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts index fccc470ac43e..fc04b9bc7e14 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts @@ -238,6 +238,9 @@ export class SchemaServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, @@ -261,6 +264,9 @@ export class SchemaServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, diff --git a/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts index 04018fad33d0..fbcd91bf6388 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts @@ -412,6 +412,10 @@ export class SearchServiceClient { * case-sensitive. * * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1beta.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. * @param {number[]} request.facetSpecs * Facet specifications for faceted search. If empty, no facets are returned. * @@ -422,16 +426,13 @@ export class SearchServiceClient { * @param {number[]} request.params * Additional search parameters. * - * For - * {@link google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH} - * vertical, supported values are: + * For public website search only, supported values are: * * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * This field is ignored for other verticals. * @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which * query expansion will occur. @@ -456,6 +457,27 @@ export class SearchServiceClient { * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec * The content search spec that configs the desired behavior of content * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -598,6 +620,10 @@ export class SearchServiceClient { * case-sensitive. * * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1beta.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. * @param {number[]} request.facetSpecs * Facet specifications for faceted search. If empty, no facets are returned. * @@ -608,16 +634,13 @@ export class SearchServiceClient { * @param {number[]} request.params * Additional search parameters. * - * For - * {@link google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH} - * vertical, supported values are: + * For public website search only, supported values are: * * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * This field is ignored for other verticals. * @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which * query expansion will occur. @@ -642,6 +665,27 @@ export class SearchServiceClient { * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec * The content search spec that configs the desired behavior of content * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -732,6 +776,10 @@ export class SearchServiceClient { * case-sensitive. * * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + * @param {google.cloud.discoveryengine.v1beta.UserInfo} request.userInfo + * Information about the end user. + * Highly recommended for analytics. The user_agent string in UserInfo will + * be used to deduce device_type for analytics. * @param {number[]} request.facetSpecs * Facet specifications for faceted search. If empty, no facets are returned. * @@ -742,16 +790,13 @@ export class SearchServiceClient { * @param {number[]} request.params * Additional search parameters. * - * For - * {@link google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH|IndustryVertical.SITE_SEARCH} - * vertical, supported values are: + * For public website search only, supported values are: * * * `user_country_code`: string. Default empty. If set to non-empty, results * are restricted or boosted based on the location provided. * * `search_type`: double. Default empty. Enables non-webpage searching * depending on the value. The only valid non-default value is 1, * which enables image searching. - * This field is ignored for other verticals. * @param {google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which * query expansion will occur. @@ -776,6 +821,27 @@ export class SearchServiceClient { * @param {google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec} request.contentSearchSpec * The content search spec that configs the desired behavior of content * search. + * @param {boolean} request.safeSearch + * Whether to turn on safe search. This is only supported for + * {@link |ContentConfig.PUBLIC_WEBSITE}. + * @param {number[]} request.userLabels + * The user labels applied to a resource must meet the following requirements: + * + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts index b5a76e4f3fc0..15040d8bce6c 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts @@ -225,6 +225,9 @@ export class UserEventServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}', }, @@ -248,6 +251,9 @@ export class UserEventServiceClient { { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations', }, + { + get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations', + }, { get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations', }, diff --git a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts new file mode 100644 index 000000000000..ef34e5bc1028 --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts @@ -0,0 +1,968 @@ +// 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 completionserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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); +} + +describe('v1.CompletionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + completionserviceModule.v1.CompletionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + completionserviceModule.v1.CompletionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = completionserviceModule.v1.CompletionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new completionserviceModule.v1.CompletionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionServiceStub, undefined); + await client.initialize(); + assert(client.completionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.completionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new completionserviceModule.v1.CompletionServiceClient({ + 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 completionserviceModule.v1.CompletionServiceClient({ + 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('completeQuery', () => { + it('invokes completeQuery without error', async () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CompleteQueryRequest', + ['dataStore'] + ); + request.dataStore = defaultValue1; + const expectedHeaderRequestParams = `data_store=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = stubSimpleCall(expectedResponse); + const [response] = await client.completeQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery without error using callback', async () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CompleteQueryRequest', + ['dataStore'] + ); + request.dataStore = defaultValue1; + const expectedHeaderRequestParams = `data_store=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeQuery( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.ICompleteQueryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with error', async () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CompleteQueryRequest', + ['dataStore'] + ); + request.dataStore = defaultValue1; + const expectedHeaderRequestParams = `data_store=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeQuery = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.completeQuery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with closed client', async () => { + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CompleteQueryRequest', + ['dataStore'] + ); + request.dataStore = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeQuery(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('projectLocationCollectionDataStore', () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStore', () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new completionserviceModule.v1.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts new file mode 100644 index 000000000000..6c7651711cdf --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts @@ -0,0 +1,2515 @@ +// 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 documentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DocumentServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + documentserviceModule.v1.DocumentServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + documentserviceModule.v1.DocumentServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = documentserviceModule.v1.DocumentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentserviceModule.v1.DocumentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentServiceStub, undefined); + await client.initialize(); + assert(client.documentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.documentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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('getDocument', () => { + it('invokes getDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCall(expectedResponse); + const [response] = await client.getDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.getDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDocument(request), expectedError); + }); + }); + + describe('createDocument', () => { + it('invokes createDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.createDocument = stubSimpleCall(expectedResponse); + const [response] = await client.createDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.createDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDocument(request), expectedError); + }); + }); + + describe('updateDocument', () => { + it('invokes updateDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.updateDocument = stubSimpleCall(expectedResponse); + const [response] = await client.updateDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ); + client.innerApiCalls.updateDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDocument(request), expectedError); + }); + }); + + describe('deleteDocument', () => { + it('invokes deleteDocument without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDocument( + 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.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with closed client', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDocument(request), expectedError); + }); + }); + + describe('importDocuments', () => { + it('invokes importDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importDocuments( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.discoveryengine.v1.IImportDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IImportDocumentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments with call error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importDocuments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments with LRO error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDocumentsProgress without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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.checkImportDocumentsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDocumentsProgress with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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.checkImportDocumentsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('purgeDocuments', () => { + it('invokes purgeDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.PurgeDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.PurgeDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeDocuments = + stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeDocuments without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.PurgeDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.PurgeDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeDocuments = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeDocuments( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsResponse, + protos.google.cloud.discoveryengine.v1.IPurgeDocumentsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeDocuments with call error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.PurgeDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.PurgeDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeDocuments = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.purgeDocuments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeDocuments with LRO error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.PurgeDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.PurgeDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeDocuments = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.purgeDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPurgeDocumentsProgress without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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.checkPurgeDocumentsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeDocumentsProgress with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + 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.checkPurgeDocumentsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDocuments', () => { + it('invokes listDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + ]; + client.innerApiCalls.listDocuments = stubSimpleCall(expectedResponse); + const [response] = await client.listDocuments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments without error using callback', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + ]; + client.innerApiCalls.listDocuments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDocuments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.IDocument[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDocuments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDocuments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentsStream without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + ]; + client.descriptors.page.listDocuments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.Document[] = []; + stream.on( + 'data', + (response: protos.google.cloud.discoveryengine.v1.Document) => { + 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.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDocumentsStream with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.Document[] = []; + stream.on( + 'data', + (response: protos.google.cloud.discoveryengine.v1.Document) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocuments without error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Document() + ), + ]; + client.descriptors.page.listDocuments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.discoveryengine.v1.IDocument[] = []; + const iterable = client.listDocumentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDocuments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocuments with error', async () => { + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDocumentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.discoveryengine.v1.IDocument[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDocuments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDocuments.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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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 documentserviceModule.v1.DocumentServiceClient({ + 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('projectLocationCollectionDataStoreBranch', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchPath', () => { + const result = client.projectLocationCollectionDataStoreBranchPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranch', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchPath', () => { + const result = client.projectLocationDataStoreBranchPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new documentserviceModule.v1.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts new file mode 100644 index 000000000000..e17d71b10d59 --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts @@ -0,0 +1,2268 @@ +// 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 schemaserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SchemaServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + schemaserviceModule.v1.SchemaServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + schemaserviceModule.v1.SchemaServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = schemaserviceModule.v1.SchemaServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + await client.initialize(); + assert(client.schemaServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.schemaServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.schemaServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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('getSchema', () => { + it('invokes getSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ); + client.innerApiCalls.getSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ); + client.innerApiCalls.getSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSchema( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.ISchema | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSchema with closed client', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.GetSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.GetSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSchema(request), expectedError); + }); + }); + + describe('createSchema', () => { + it('invokes createSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateSchemaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSchema = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSchema(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateSchemaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSchema = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSchema( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.ICreateSchemaMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with call error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateSchemaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchema = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSchema with LRO error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CreateSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CreateSchemaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSchema = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createSchema(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSchemaProgress without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkCreateSchemaProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSchemaProgress with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkCreateSchemaProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSchema', () => { + it('invokes updateSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateSchemaRequest() + ); + request.schema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateSchemaRequest', + ['schema', 'name'] + ); + request.schema.name = defaultValue1; + const expectedHeaderRequestParams = `schema.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSchema = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSchema(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateSchemaRequest() + ); + request.schema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateSchemaRequest', + ['schema', 'name'] + ); + request.schema.name = defaultValue1; + const expectedHeaderRequestParams = `schema.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSchema = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSchema( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.discoveryengine.v1.ISchema, + protos.google.cloud.discoveryengine.v1.IUpdateSchemaMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchema with call error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateSchemaRequest() + ); + request.schema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateSchemaRequest', + ['schema', 'name'] + ); + request.schema.name = defaultValue1; + const expectedHeaderRequestParams = `schema.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSchema = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSchema with LRO error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UpdateSchemaRequest() + ); + request.schema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.UpdateSchemaRequest', + ['schema', 'name'] + ); + request.schema.name = defaultValue1; + const expectedHeaderRequestParams = `schema.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSchema = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateSchema(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSchemaProgress without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkUpdateSchemaProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSchemaProgress with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkUpdateSchemaProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSchema', () => { + it('invokes deleteSchema without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSchema = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSchema(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSchema = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSchema( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.discoveryengine.v1.IDeleteSchemaMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with call error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchema = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSchema with LRO error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.DeleteSchemaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.DeleteSchemaRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSchema = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteSchema(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSchemaProgress without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkDeleteSchemaProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSchemaProgress with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + 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.checkDeleteSchemaProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listSchemas', () => { + it('invokes listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + ]; + client.innerApiCalls.listSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas without error using callback', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + ]; + client.innerApiCalls.listSchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSchemas( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.ISchema[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSchemas = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSchemas(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSchemasStream without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + ]; + client.descriptors.page.listSchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.Schema[] = []; + stream.on( + 'data', + (response: protos.google.cloud.discoveryengine.v1.Schema) => { + 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.listSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemas, request) + ); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSchemasStream with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.Schema[] = []; + stream.on( + 'data', + (response: protos.google.cloud.discoveryengine.v1.Schema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSchemas, request) + ); + assert( + (client.descriptors.page.listSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemas without error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.Schema() + ), + ]; + client.descriptors.page.listSchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.discoveryengine.v1.ISchema[] = []; + const iterable = client.listSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSchemas with error', async () => { + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ListSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ListSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSchemas.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.discoveryengine.v1.ISchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSchemas.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSchemas.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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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 schemaserviceModule.v1.SchemaServiceClient({ + 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('projectLocationCollectionDataStore', () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStore', () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts new file mode 100644 index 000000000000..e0c370c109f8 --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts @@ -0,0 +1,1507 @@ +// 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 searchserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).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.SearchServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + searchserviceModule.v1.SearchServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + searchserviceModule.v1.SearchServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = searchserviceModule.v1.SearchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new searchserviceModule.v1.SearchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.searchServiceStub, undefined); + await client.initialize(); + assert(client.searchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.searchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.searchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new searchserviceModule.v1.SearchServiceClient({ + 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 searchserviceModule.v1.SearchServiceClient({ + 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('search', () => { + it('invokes search without error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + ]; + client.innerApiCalls.search = stubSimpleCall(expectedResponse); + const [response] = await client.search(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.search as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.search as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes search without error using callback', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + ]; + client.innerApiCalls.search = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.search( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.search as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.search as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes search with error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.search = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.search(request), expectedError); + const actualRequest = (client.innerApiCalls.search as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.search as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchStream without error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + ]; + client.descriptors.page.search.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.search.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.search, request) + ); + assert( + (client.descriptors.page.search.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchStream with error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.search.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.search.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.search, request) + ); + assert( + (client.descriptors.page.search.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with search without error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchResponse.SearchResult() + ), + ]; + client.descriptors.page.search.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[] = + []; + const iterable = client.searchAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.search.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.search.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with search with error', async () => { + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.SearchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.SearchRequest', + ['servingConfig'] + ); + request.servingConfig = defaultValue1; + const expectedHeaderRequestParams = `serving_config=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.search.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.discoveryengine.v1.SearchResponse.ISearchResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.search.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.search.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('projectLocationCollectionDataStoreBranch', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchPath', () => { + const result = client.projectLocationCollectionDataStoreBranchPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreServingConfig', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreServingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + serving_config: 'servingConfigValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreServingConfigPath', () => { + const result = + client.projectLocationCollectionDataStoreServingConfigPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'servingConfigValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranch', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchPath', () => { + const result = client.projectLocationDataStoreBranchPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreBranchPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreServingConfig', () => { + const fakePath = '/rendered/path/projectLocationDataStoreServingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + serving_config: 'servingConfigValue', + }; + const client = new searchserviceModule.v1.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreServingConfigPath', () => { + const result = client.projectLocationDataStoreServingConfigPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchServingConfigFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'servingConfigValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts new file mode 100644 index 000000000000..5eb35c46a991 --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts @@ -0,0 +1,1649 @@ +// 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 usereventserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} 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.UserEventServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + usereventserviceModule.v1.UserEventServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + usereventserviceModule.v1.UserEventServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = usereventserviceModule.v1.UserEventServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new usereventserviceModule.v1.UserEventServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userEventServiceStub, undefined); + await client.initialize(); + assert(client.userEventServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.userEventServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userEventServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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('writeUserEvent', () => { + it('invokes writeUserEvent without error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.WriteUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.WriteUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UserEvent() + ); + client.innerApiCalls.writeUserEvent = stubSimpleCall(expectedResponse); + const [response] = await client.writeUserEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeUserEvent without error using callback', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.WriteUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.WriteUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.UserEvent() + ); + client.innerApiCalls.writeUserEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeUserEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1.IUserEvent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeUserEvent with error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.WriteUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.WriteUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeUserEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.writeUserEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeUserEvent with closed client', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.WriteUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.WriteUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeUserEvent(request), expectedError); + }); + }); + + describe('collectUserEvent', () => { + it('invokes collectUserEvent without error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CollectUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CollectUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.collectUserEvent = stubSimpleCall(expectedResponse); + const [response] = await client.collectUserEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.collectUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.collectUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes collectUserEvent without error using callback', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CollectUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CollectUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.collectUserEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.collectUserEvent( + 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.collectUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.collectUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes collectUserEvent with error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CollectUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CollectUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.collectUserEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.collectUserEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.collectUserEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.collectUserEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes collectUserEvent with closed client', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.CollectUserEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.CollectUserEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.collectUserEvent(request), expectedError); + }); + }); + + describe('importUserEvents', () => { + it('invokes importUserEvents without error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportUserEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportUserEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importUserEvents = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importUserEvents(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importUserEvents without error using callback', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportUserEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportUserEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importUserEvents = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importUserEvents( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.discoveryengine.v1.IImportUserEventsResponse, + protos.google.cloud.discoveryengine.v1.IImportUserEventsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importUserEvents with call error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportUserEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportUserEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importUserEvents = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importUserEvents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importUserEvents with LRO error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1.ImportUserEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1.ImportUserEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importUserEvents = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importUserEvents(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importUserEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportUserEventsProgress without error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + 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.checkImportUserEventsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportUserEventsProgress with error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + 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.checkImportUserEventsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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 usereventserviceModule.v1.UserEventServiceClient({ + 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('projectLocationCollectionDataStore', () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStore', () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); From 1415f5f0cdbd284fb11427fe1053048e278e7546 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 12 Jun 2023 15:51:23 -0700 Subject: [PATCH 33/46] feat!: use v1 as the default version (#4333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: use v1 as the default version * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: remove RecommendationServiceClient from pack test --------- Co-authored-by: Owl Bot Release-As: v0.7.0 --- .../.repo-metadata.json | 2 +- .../google-cloud-discoveryengine/src/index.ts | 24 ++++++++----------- .../system-test/fixtures/sample/src/index.js | 2 -- .../system-test/fixtures/sample/src/index.ts | 9 ------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-discoveryengine/.repo-metadata.json b/packages/google-cloud-discoveryengine/.repo-metadata.json index be983330fa5f..d7b5c425a592 100644 --- a/packages/google-cloud-discoveryengine/.repo-metadata.json +++ b/packages/google-cloud-discoveryengine/.repo-metadata.json @@ -9,7 +9,7 @@ "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/discoveryengine", "api_id": "discoveryengine.googleapis.com", - "default_version": "v1beta", + "default_version": "v1", "requires_billing": true, "library_type": "GAPIC_AUTO", "api_shortname": "discoveryengine" diff --git a/packages/google-cloud-discoveryengine/src/index.ts b/packages/google-cloud-discoveryengine/src/index.ts index 52839bd3f200..cc9e260a730a 100644 --- a/packages/google-cloud-discoveryengine/src/index.ts +++ b/packages/google-cloud-discoveryengine/src/index.ts @@ -19,25 +19,22 @@ import * as v1 from './v1'; import * as v1beta from './v1beta'; -const CompletionServiceClient = v1beta.CompletionServiceClient; -type CompletionServiceClient = v1beta.CompletionServiceClient; -const DocumentServiceClient = v1beta.DocumentServiceClient; -type DocumentServiceClient = v1beta.DocumentServiceClient; -const RecommendationServiceClient = v1beta.RecommendationServiceClient; -type RecommendationServiceClient = v1beta.RecommendationServiceClient; -const SchemaServiceClient = v1beta.SchemaServiceClient; -type SchemaServiceClient = v1beta.SchemaServiceClient; -const SearchServiceClient = v1beta.SearchServiceClient; -type SearchServiceClient = v1beta.SearchServiceClient; -const UserEventServiceClient = v1beta.UserEventServiceClient; -type UserEventServiceClient = v1beta.UserEventServiceClient; +const CompletionServiceClient = v1.CompletionServiceClient; +type CompletionServiceClient = v1.CompletionServiceClient; +const DocumentServiceClient = v1.DocumentServiceClient; +type DocumentServiceClient = v1.DocumentServiceClient; +const SchemaServiceClient = v1.SchemaServiceClient; +type SchemaServiceClient = v1.SchemaServiceClient; +const SearchServiceClient = v1.SearchServiceClient; +type SearchServiceClient = v1.SearchServiceClient; +const UserEventServiceClient = v1.UserEventServiceClient; +type UserEventServiceClient = v1.UserEventServiceClient; export { v1, v1beta, CompletionServiceClient, DocumentServiceClient, - RecommendationServiceClient, SchemaServiceClient, SearchServiceClient, UserEventServiceClient, @@ -47,7 +44,6 @@ export default { v1beta, CompletionServiceClient, DocumentServiceClient, - RecommendationServiceClient, SchemaServiceClient, SearchServiceClient, UserEventServiceClient, diff --git a/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.js b/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.js index c179b77c9972..927f3c258643 100644 --- a/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.js @@ -22,8 +22,6 @@ const discoveryengine = require('@google-cloud/discoveryengine'); function main() { const completionServiceClient = new discoveryengine.CompletionServiceClient(); const documentServiceClient = new discoveryengine.DocumentServiceClient(); - const recommendationServiceClient = - new discoveryengine.RecommendationServiceClient(); const schemaServiceClient = new discoveryengine.SchemaServiceClient(); const searchServiceClient = new discoveryengine.SearchServiceClient(); const userEventServiceClient = new discoveryengine.UserEventServiceClient(); diff --git a/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.ts index ae43429f8f4d..fbd8dade6d51 100644 --- a/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-discoveryengine/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,6 @@ import { CompletionServiceClient, DocumentServiceClient, - RecommendationServiceClient, SchemaServiceClient, SearchServiceClient, UserEventServiceClient, @@ -32,11 +31,6 @@ function doStuffWithCompletionServiceClient(client: CompletionServiceClient) { function doStuffWithDocumentServiceClient(client: DocumentServiceClient) { client.close(); } -function doStuffWithRecommendationServiceClient( - client: RecommendationServiceClient -) { - client.close(); -} function doStuffWithSchemaServiceClient(client: SchemaServiceClient) { client.close(); } @@ -55,9 +49,6 @@ function main() { const documentServiceClient = new DocumentServiceClient(); doStuffWithDocumentServiceClient(documentServiceClient); // check that the client instance can be created - const recommendationServiceClient = new RecommendationServiceClient(); - doStuffWithRecommendationServiceClient(recommendationServiceClient); - // check that the client instance can be created const schemaServiceClient = new SchemaServiceClient(); doStuffWithSchemaServiceClient(schemaServiceClient); // check that the client instance can be created From e1211f0b2bc1557cca5ba63949ef1fb8cdacedf6 Mon Sep 17 00:00:00 2001 From: "owlbot-bootstrapper[bot]" <104649659+owlbot-bootstrapper[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 09:29:53 -0700 Subject: [PATCH 34/46] feat: add initial files for google.cloud.rapidmigrationassessment.v1 (#4335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: initial commit * feat: initial generation of library Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJhcGlkbWlncmF0aW9uYXNzZXNzbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiODdlOTE0NTJkY2UxM2MzZTE3NmEyMDkzMDY1YjNlMzhlMmIwZGM5MCJ9 * Owl Bot copied code from https://github.com/googleapis/googleapis-gen/commit/87e91452dce13c3e176a2093065b3e38e2b0dc90 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * samples: add quickstart sample * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: fix samples quickstart test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: formatting --------- Co-authored-by: Owlbot Bootstrapper Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- .../.OwlBot.yaml | 19 + .../.eslintignore | 7 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../.gitignore | 14 + .../.jsdoc.js | 55 + .../.mocharc.js | 29 + .../.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 17 + .../.repo-metadata.json | 17 + .../CODE_OF_CONDUCT.md | 94 + .../CONTRIBUTING.md | 76 + .../LICENSE | 202 + .../README.md | 194 + .../linkinator.config.json | 16 + .../package.json | 73 + .../v1/api_entities.proto | 171 + .../v1/rapidmigrationassessment.proto | 421 + .../protos/protos.d.ts | 7649 ++++++ .../protos/protos.js | 19588 ++++++++++++++++ .../protos/protos.json | 2169 ++ .../samples/README.md | 230 + ..._migration_assessment.create_annotation.js | 71 + ...d_migration_assessment.create_collector.js | 76 + ...d_migration_assessment.delete_collector.js | 76 + ...pid_migration_assessment.get_annotation.js | 61 + ...apid_migration_assessment.get_collector.js | 61 + ...id_migration_assessment.list_collectors.js | 80 + ...id_migration_assessment.pause_collector.js | 76 + ...migration_assessment.register_collector.js | 76 + ...d_migration_assessment.resume_collector.js | 76 + ...d_migration_assessment.update_collector.js | 85 + ...gle.cloud.rapidmigrationassessment.v1.json | 475 + .../samples/package.json | 24 + .../samples/quickstart.js | 74 + .../samples/test/quickstart.js | 31 + .../src/index.ts | 27 + .../src/v1/gapic_metadata.json | 127 + .../src/v1/index.ts | 19 + .../v1/rapid_migration_assessment_client.ts | 2351 ++ ...id_migration_assessment_client_config.json | 85 + ...rapid_migration_assessment_proto_list.json | 4 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 34 + .../system-test/install.ts | 51 + .../gapic_rapid_migration_assessment_v1.ts | 2991 +++ .../tsconfig.json | 19 + .../webpack.config.js | 64 + release-please-config.json | 3 +- 50 files changed, 38221 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-rapidmigrationassessment/.OwlBot.yaml create mode 100644 packages/google-cloud-rapidmigrationassessment/.eslintignore create mode 100644 packages/google-cloud-rapidmigrationassessment/.eslintrc.json create mode 100644 packages/google-cloud-rapidmigrationassessment/.gitattributes create mode 100644 packages/google-cloud-rapidmigrationassessment/.gitignore create mode 100644 packages/google-cloud-rapidmigrationassessment/.jsdoc.js create mode 100644 packages/google-cloud-rapidmigrationassessment/.mocharc.js create mode 100644 packages/google-cloud-rapidmigrationassessment/.nycrc create mode 100644 packages/google-cloud-rapidmigrationassessment/.prettierignore create mode 100644 packages/google-cloud-rapidmigrationassessment/.prettierrc.js create mode 100644 packages/google-cloud-rapidmigrationassessment/.repo-metadata.json create mode 100644 packages/google-cloud-rapidmigrationassessment/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-rapidmigrationassessment/CONTRIBUTING.md create mode 100644 packages/google-cloud-rapidmigrationassessment/LICENSE create mode 100644 packages/google-cloud-rapidmigrationassessment/README.md create mode 100644 packages/google-cloud-rapidmigrationassessment/linkinator.config.json create mode 100644 packages/google-cloud-rapidmigrationassessment/package.json create mode 100644 packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/api_entities.proto create mode 100644 packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto create mode 100644 packages/google-cloud-rapidmigrationassessment/protos/protos.d.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/protos/protos.js create mode 100644 packages/google-cloud-rapidmigrationassessment/protos/protos.json create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/README.md create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/package.json create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/quickstart.js create mode 100644 packages/google-cloud-rapidmigrationassessment/samples/test/quickstart.js create mode 100644 packages/google-cloud-rapidmigrationassessment/src/index.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-rapidmigrationassessment/src/v1/index.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client_config.json create mode 100644 packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_proto_list.json create mode 100644 packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/system-test/install.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/test/gapic_rapid_migration_assessment_v1.ts create mode 100644 packages/google-cloud-rapidmigrationassessment/tsconfig.json create mode 100644 packages/google-cloud-rapidmigrationassessment/webpack.config.js diff --git a/packages/google-cloud-rapidmigrationassessment/.OwlBot.yaml b/packages/google-cloud-rapidmigrationassessment/.OwlBot.yaml new file mode 100644 index 000000000000..4dc78150c394 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/cloud/rapidmigrationassessment/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-rapidmigrationassessment/$1 + +api-name: rapidmigrationassessment \ No newline at end of file diff --git a/packages/google-cloud-rapidmigrationassessment/.eslintignore b/packages/google-cloud-rapidmigrationassessment/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-rapidmigrationassessment/.eslintrc.json b/packages/google-cloud-rapidmigrationassessment/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-rapidmigrationassessment/.gitattributes b/packages/google-cloud-rapidmigrationassessment/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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-rapidmigrationassessment/.gitignore b/packages/google-cloud-rapidmigrationassessment/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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-rapidmigrationassessment/.jsdoc.js b/packages/google-cloud-rapidmigrationassessment/.jsdoc.js new file mode 100644 index 000000000000..ca6869617a6f --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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/rapidmigrationassessment', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-rapidmigrationassessment/.mocharc.js b/packages/google-cloud-rapidmigrationassessment/.mocharc.js new file mode 100644 index 000000000000..49e7e228701d --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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-rapidmigrationassessment/.nycrc b/packages/google-cloud-rapidmigrationassessment/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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-rapidmigrationassessment/.prettierignore b/packages/google-cloud-rapidmigrationassessment/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-rapidmigrationassessment/.prettierrc.js b/packages/google-cloud-rapidmigrationassessment/.prettierrc.js new file mode 100644 index 000000000000..1e6cec783e40 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.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-rapidmigrationassessment/.repo-metadata.json b/packages/google-cloud-rapidmigrationassessment/.repo-metadata.json new file mode 100644 index 000000000000..f9f185841df6 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "rapidmigrationassessment", + "name_pretty": "Rapid Migration Assessment API", + "product_documentation": "https://cloud.google.com/migration-center/docs", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/rapidmigrationassessment/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/rapidmigrationassessment", + "api_id": "rapidmigrationassessment.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "rapidmigrationassessment" +} + diff --git a/packages/google-cloud-rapidmigrationassessment/CODE_OF_CONDUCT.md b/packages/google-cloud-rapidmigrationassessment/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/CONTRIBUTING.md b/packages/google-cloud-rapidmigrationassessment/CONTRIBUTING.md new file mode 100644 index 000000000000..05abc7f22e38 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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 Rapid Migration Assessment 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=rapidmigrationassessment.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-rapidmigrationassessment/LICENSE b/packages/google-cloud-rapidmigrationassessment/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/README.md b/packages/google-cloud-rapidmigrationassessment/README.md new file mode 100644 index 000000000000..0ff57cd89cdf --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/README.md @@ -0,0 +1,194 @@ +[//]: # "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 + +# [Rapid Migration Assessment API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/rapidmigrationassessment.svg)](https://www.npmjs.org/package/@google-cloud/rapidmigrationassessment) + + + + +Rapid Migration Assessment API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment/CHANGELOG.md). + +* [Rapid Migration Assessment API Node.js Client API Reference][client-docs] +* [Rapid Migration Assessment API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-rapidmigrationassessment](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Rapid Migration Assessment 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/rapidmigrationassessment +``` + + +### Using the client library + +```javascript + +// Imports the Rapidmigrationassessment library +const {RapidMigrationAssessmentClient} = + require('@google-cloud/rapidmigrationassessment').v1; + +// Instantiates a client +const rapidMigrationAssessmentClient = new RapidMigrationAssessmentClient(); + +async function quickstart() { + const project = await rapidMigrationAssessmentClient.getProjectId(); + + // List supported locations + const locationsIterable = + await rapidMigrationAssessmentClient.listLocationsAsync({ + name: `projects/${project}`, + }); + + const locations = []; + for await (const response of locationsIterable) { + console.log(`Supported location: ${response.name}`); + locations.push(response.name); + } + + for (const location of locations) { + // Construct request + const request = { + parent: location, + }; + + // Run request + const iterable = await rapidMigrationAssessmentClient.listCollectorsAsync( + request + ); + console.log(`Listing collectors for location ${location}:`); + let count = 0; + for await (const response of iterable) { + console.log(response); + ++count; + } + console.log(`${count} collectors found.`); + } +} + +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Rapid_migration_assessment.create_annotation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.create_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.delete_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.get_annotation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.get_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.list_collectors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.pause_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.register_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.resume_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Rapid_migration_assessment.update_collector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js) | [![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/samples/quickstart.js,packages/google-cloud-rapidmigrationassessment/samples/README.md) | + + + +The [Rapid Migration Assessment API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +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/rapidmigrationassessment@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/rapidmigrationassessment/latest +[product-docs]: https://cloud.google.com/migration-center/docs +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=rapidmigrationassessment.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-rapidmigrationassessment/linkinator.config.json b/packages/google-cloud-rapidmigrationassessment/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/package.json b/packages/google-cloud-rapidmigrationassessment/package.json new file mode 100644 index 000000000000..d6849c20af53 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/package.json @@ -0,0 +1,73 @@ +{ + "name": "@google-cloud/rapidmigrationassessment", + "version": "0.0.0", + "description": "Rapid Migration Assessment API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-rapidmigrationassessment" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google rapidmigrationassessment", + "rapidmigrationassessment", + "Rapid Migration Assessment API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.8" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "long": "^5.2.3", + "linkinator": "4.1.2", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/api_entities.proto b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/api_entities.proto new file mode 100644 index 000000000000..54a3247c536c --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/api_entities.proto @@ -0,0 +1,171 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.rapidmigrationassessment.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RapidMigrationAssessment.V1"; +option go_package = "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiEntitiesProto"; +option java_package = "com.google.cloud.rapidmigrationassessment.v1"; +option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; +option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; + +// Message describing a MC Source of type Guest OS Scan. +message GuestOsScan { + // reference to the corresponding Guest OS Scan in MC Source. + string core_source = 1; +} + +// Message describing a MC Source of type VSphere Scan. +message VSphereScan { + // reference to the corresponding VSphere Scan in MC Source. + string core_source = 1; +} + +// Message describing Collector object. +message Collector { + option (google.api.resource) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + pattern: "projects/{project}/locations/{location}/collectors/{collector}" + }; + + // -- Using suggestion from API Linter Analyzer for nesting enum -- + // -- https://linter.aip.dev/216/nesting -- + // State of a Collector (server_side). + // States are used for internal purposes and named to keep + // convention of legacy product: + // https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe. + enum State { + // Collector state is not recognized. + STATE_UNSPECIFIED = 0; + + // Collector started to create, but hasn't been completed MC source creation + // and db object creation. + STATE_INITIALIZING = 1; + + // Collector has been created, MC source creation and db object creation + // completed. + STATE_READY_TO_USE = 2; + + // Collector client has been registered with client. + STATE_REGISTERED = 3; + + // Collector client is actively scanning. + STATE_ACTIVE = 4; + + // Collector is not actively scanning. + STATE_PAUSED = 5; + + // Collector is starting background job for deletion. + STATE_DELETING = 6; + + // Collector completed all tasks for deletion. + STATE_DECOMMISSIONED = 7; + + // Collector is in error state. + STATE_ERROR = 8; + } + + // name of resource. + string name = 1; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // User specified name of the Collector. + string display_name = 5; + + // User specified description of the Collector. + string description = 6; + + // Service Account email used to ingest data to this Collector. + string service_account = 7; + + // Output only. Store cloud storage bucket name (which is a guid) created with + // this Collector. + string bucket = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified expected asset count. + int64 expected_asset_count = 9; + + // Output only. State of the Collector. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Client version. + string client_version = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reference to MC Source Guest Os Scan. + GuestOsScan guest_os_scan = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reference to MC Source vsphere_scan. + VSphereScan vsphere_scan = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // How many days to collect data. + int32 collection_days = 14; + + // Uri for EULA (End User License Agreement) from customer. + string eula_uri = 15; +} + +// Message describing an Annotation +message Annotation { + option (google.api.resource) = { + type: "rapidmigrationassessment.googleapis.com/Annotation" + pattern: "projects/{project}/locations/{location}/annotations/{annotation}" + }; + + // Types for project level setting. + enum Type { + // Unknown type + TYPE_UNSPECIFIED = 0; + + // Indicates that this project has opted into StratoZone export. + TYPE_LEGACY_EXPORT_CONSENT = 1; + + // Indicates that this project is created by Qwiklab. + TYPE_QWIKLAB = 2; + } + + // name of resource. + string name = 1; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Type of an annotation. + Type type = 5; +} diff --git a/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto new file mode 100644 index 000000000000..4e4026efe04c --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto @@ -0,0 +1,421 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.rapidmigrationassessment.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/rapidmigrationassessment/v1/api_entities.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RapidMigrationAssessment.V1"; +option go_package = "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb"; +option java_multiple_files = true; +option java_outer_classname = "RapidMigrationAssessmentProto"; +option java_package = "com.google.cloud.rapidmigrationassessment.v1"; +option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; +option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; + +// Rapid Migration Assessment service +service RapidMigrationAssessment { + option (google.api.default_host) = "rapidmigrationassessment.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Collector to manage the on-prem appliance which collects + // information about Customer assets. + rpc CreateCollector(CreateCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/collectors" + body: "collector" + }; + option (google.api.method_signature) = "parent,collector,collector_id"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Creates an Annotation + rpc CreateAnnotation(CreateAnnotationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/annotations" + body: "annotation" + }; + option (google.api.method_signature) = "parent,annotation"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.rapidmigrationassessment.v1.Annotation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single Annotation. + rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/annotations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Collectors in a given project and location. + rpc ListCollectors(ListCollectorsRequest) returns (ListCollectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/collectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Collector. + rpc GetCollector(GetCollectorRequest) returns (Collector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/collectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the parameters of a single Collector. + rpc UpdateCollector(UpdateCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{collector.name=projects/*/locations/*/collectors/*}" + body: "collector" + }; + option (google.api.method_signature) = "collector,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Collector - changes state of collector to "Deleting". + rpc DeleteCollector(DeleteCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/collectors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Resumes the given collector. + rpc ResumeCollector(ResumeCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Registers the given collector. + rpc RegisterCollector(RegisterCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:register" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Pauses the given collector. + rpc PauseCollector(PauseCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for creating an AnnotationS. +message CreateAnnotationRequest { + // Required. Name of the parent (project+location). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The resource being created. + Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for getting a specific Annotation +message GetAnnotationRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Annotation" + } + ]; +} + +// Message for creating a Collector. +message CreateCollectorRequest { + // Required. Name of the parent (project+location). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Id of the requesting object. + string collector_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Collector collector = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Collectors. +message ListCollectorsRequest { + // Required. Parent value for ListCollectorsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Collectors. +message ListCollectorsResponse { + // The list of Collectors. + repeated Collector collectors = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a specific Collector. +message GetCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; +} + +// Message for deleting a Collector. +message DeleteCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Collector. +message UpdateCollectorRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Collector resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Collector collector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for resuming a Collector. +message ResumeCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for registering a Collector. +message RegisterCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for pausing a Collector. +message PauseCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-rapidmigrationassessment/protos/protos.d.ts b/packages/google-cloud-rapidmigrationassessment/protos/protos.d.ts new file mode 100644 index 000000000000..d788e6cbe0f9 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/protos/protos.d.ts @@ -0,0 +1,7649 @@ +// 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 rapidmigrationassessment. */ + namespace rapidmigrationassessment { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a GuestOsScan. */ + interface IGuestOsScan { + + /** GuestOsScan coreSource */ + coreSource?: (string|null); + } + + /** Represents a GuestOsScan. */ + class GuestOsScan implements IGuestOsScan { + + /** + * Constructs a new GuestOsScan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IGuestOsScan); + + /** GuestOsScan coreSource. */ + public coreSource: string; + + /** + * Creates a new GuestOsScan instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestOsScan instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IGuestOsScan): google.cloud.rapidmigrationassessment.v1.GuestOsScan; + + /** + * Encodes the specified GuestOsScan message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GuestOsScan.verify|verify} messages. + * @param message GuestOsScan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IGuestOsScan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestOsScan message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GuestOsScan.verify|verify} messages. + * @param message GuestOsScan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IGuestOsScan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestOsScan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestOsScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.GuestOsScan; + + /** + * Decodes a GuestOsScan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestOsScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.GuestOsScan; + + /** + * Verifies a GuestOsScan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestOsScan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestOsScan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.GuestOsScan; + + /** + * Creates a plain object from a GuestOsScan message. Also converts values to other types if specified. + * @param message GuestOsScan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.GuestOsScan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestOsScan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GuestOsScan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VSphereScan. */ + interface IVSphereScan { + + /** VSphereScan coreSource */ + coreSource?: (string|null); + } + + /** Represents a VSphereScan. */ + class VSphereScan implements IVSphereScan { + + /** + * Constructs a new VSphereScan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IVSphereScan); + + /** VSphereScan coreSource. */ + public coreSource: string; + + /** + * Creates a new VSphereScan instance using the specified properties. + * @param [properties] Properties to set + * @returns VSphereScan instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IVSphereScan): google.cloud.rapidmigrationassessment.v1.VSphereScan; + + /** + * Encodes the specified VSphereScan message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.VSphereScan.verify|verify} messages. + * @param message VSphereScan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IVSphereScan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VSphereScan message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.VSphereScan.verify|verify} messages. + * @param message VSphereScan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IVSphereScan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VSphereScan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VSphereScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.VSphereScan; + + /** + * Decodes a VSphereScan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VSphereScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.VSphereScan; + + /** + * Verifies a VSphereScan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VSphereScan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VSphereScan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.VSphereScan; + + /** + * Creates a plain object from a VSphereScan message. Also converts values to other types if specified. + * @param message VSphereScan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.VSphereScan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VSphereScan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VSphereScan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Collector. */ + interface ICollector { + + /** Collector name */ + name?: (string|null); + + /** Collector createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Collector updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Collector labels */ + labels?: ({ [k: string]: string }|null); + + /** Collector displayName */ + displayName?: (string|null); + + /** Collector description */ + description?: (string|null); + + /** Collector serviceAccount */ + serviceAccount?: (string|null); + + /** Collector bucket */ + bucket?: (string|null); + + /** Collector expectedAssetCount */ + expectedAssetCount?: (number|Long|string|null); + + /** Collector state */ + state?: (google.cloud.rapidmigrationassessment.v1.Collector.State|keyof typeof google.cloud.rapidmigrationassessment.v1.Collector.State|null); + + /** Collector clientVersion */ + clientVersion?: (string|null); + + /** Collector guestOsScan */ + guestOsScan?: (google.cloud.rapidmigrationassessment.v1.IGuestOsScan|null); + + /** Collector vsphereScan */ + vsphereScan?: (google.cloud.rapidmigrationassessment.v1.IVSphereScan|null); + + /** Collector collectionDays */ + collectionDays?: (number|null); + + /** Collector eulaUri */ + eulaUri?: (string|null); + } + + /** Represents a Collector. */ + class Collector implements ICollector { + + /** + * Constructs a new Collector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.ICollector); + + /** Collector name. */ + public name: string; + + /** Collector createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Collector updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Collector labels. */ + public labels: { [k: string]: string }; + + /** Collector displayName. */ + public displayName: string; + + /** Collector description. */ + public description: string; + + /** Collector serviceAccount. */ + public serviceAccount: string; + + /** Collector bucket. */ + public bucket: string; + + /** Collector expectedAssetCount. */ + public expectedAssetCount: (number|Long|string); + + /** Collector state. */ + public state: (google.cloud.rapidmigrationassessment.v1.Collector.State|keyof typeof google.cloud.rapidmigrationassessment.v1.Collector.State); + + /** Collector clientVersion. */ + public clientVersion: string; + + /** Collector guestOsScan. */ + public guestOsScan?: (google.cloud.rapidmigrationassessment.v1.IGuestOsScan|null); + + /** Collector vsphereScan. */ + public vsphereScan?: (google.cloud.rapidmigrationassessment.v1.IVSphereScan|null); + + /** Collector collectionDays. */ + public collectionDays: number; + + /** Collector eulaUri. */ + public eulaUri: string; + + /** + * Creates a new Collector instance using the specified properties. + * @param [properties] Properties to set + * @returns Collector instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.ICollector): google.cloud.rapidmigrationassessment.v1.Collector; + + /** + * Encodes the specified Collector message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Collector.verify|verify} messages. + * @param message Collector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.ICollector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Collector message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Collector.verify|verify} messages. + * @param message Collector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.ICollector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Collector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Collector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.Collector; + + /** + * Decodes a Collector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Collector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.Collector; + + /** + * Verifies a Collector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Collector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Collector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.Collector; + + /** + * Creates a plain object from a Collector message. Also converts values to other types if specified. + * @param message Collector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.Collector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Collector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Collector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Collector { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STATE_INITIALIZING = 1, + STATE_READY_TO_USE = 2, + STATE_REGISTERED = 3, + STATE_ACTIVE = 4, + STATE_PAUSED = 5, + STATE_DELETING = 6, + STATE_DECOMMISSIONED = 7, + STATE_ERROR = 8 + } + } + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation name */ + name?: (string|null); + + /** Annotation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Annotation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Annotation labels */ + labels?: ({ [k: string]: string }|null); + + /** Annotation type */ + type?: (google.cloud.rapidmigrationassessment.v1.Annotation.Type|keyof typeof google.cloud.rapidmigrationassessment.v1.Annotation.Type|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IAnnotation); + + /** Annotation name. */ + public name: string; + + /** Annotation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Annotation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Annotation labels. */ + public labels: { [k: string]: string }; + + /** Annotation type. */ + public type: (google.cloud.rapidmigrationassessment.v1.Annotation.Type|keyof typeof google.cloud.rapidmigrationassessment.v1.Annotation.Type); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IAnnotation): google.cloud.rapidmigrationassessment.v1.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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 { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TYPE_LEGACY_EXPORT_CONSENT = 1, + TYPE_QWIKLAB = 2 + } + } + + /** Represents a RapidMigrationAssessment */ + class RapidMigrationAssessment extends $protobuf.rpc.Service { + + /** + * Constructs a new RapidMigrationAssessment 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 RapidMigrationAssessment 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): RapidMigrationAssessment; + + /** + * Calls CreateCollector. + * @param request CreateCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCollector(request: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollectorCallback): void; + + /** + * Calls CreateCollector. + * @param request CreateCollectorRequest message or plain object + * @returns Promise + */ + public createCollector(request: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest): Promise; + + /** + * Calls CreateAnnotation. + * @param request CreateAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAnnotation(request: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotationCallback): void; + + /** + * Calls CreateAnnotation. + * @param request CreateAnnotationRequest message or plain object + * @returns Promise + */ + public createAnnotation(request: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest): Promise; + + /** + * Calls GetAnnotation. + * @param request GetAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Annotation + */ + public getAnnotation(request: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotationCallback): void; + + /** + * Calls GetAnnotation. + * @param request GetAnnotationRequest message or plain object + * @returns Promise + */ + public getAnnotation(request: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest): Promise; + + /** + * Calls ListCollectors. + * @param request ListCollectorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCollectorsResponse + */ + public listCollectors(request: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectorsCallback): void; + + /** + * Calls ListCollectors. + * @param request ListCollectorsRequest message or plain object + * @returns Promise + */ + public listCollectors(request: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest): Promise; + + /** + * Calls GetCollector. + * @param request GetCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Collector + */ + public getCollector(request: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollectorCallback): void; + + /** + * Calls GetCollector. + * @param request GetCollectorRequest message or plain object + * @returns Promise + */ + public getCollector(request: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest): Promise; + + /** + * Calls UpdateCollector. + * @param request UpdateCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCollector(request: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollectorCallback): void; + + /** + * Calls UpdateCollector. + * @param request UpdateCollectorRequest message or plain object + * @returns Promise + */ + public updateCollector(request: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest): Promise; + + /** + * Calls DeleteCollector. + * @param request DeleteCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCollector(request: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollectorCallback): void; + + /** + * Calls DeleteCollector. + * @param request DeleteCollectorRequest message or plain object + * @returns Promise + */ + public deleteCollector(request: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest): Promise; + + /** + * Calls ResumeCollector. + * @param request ResumeCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resumeCollector(request: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollectorCallback): void; + + /** + * Calls ResumeCollector. + * @param request ResumeCollectorRequest message or plain object + * @returns Promise + */ + public resumeCollector(request: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest): Promise; + + /** + * Calls RegisterCollector. + * @param request RegisterCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public registerCollector(request: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollectorCallback): void; + + /** + * Calls RegisterCollector. + * @param request RegisterCollectorRequest message or plain object + * @returns Promise + */ + public registerCollector(request: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest): Promise; + + /** + * Calls PauseCollector. + * @param request PauseCollectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public pauseCollector(request: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, callback: google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollectorCallback): void; + + /** + * Calls PauseCollector. + * @param request PauseCollectorRequest message or plain object + * @returns Promise + */ + public pauseCollector(request: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest): Promise; + } + + namespace RapidMigrationAssessment { + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|createCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|createAnnotation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAnnotationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|getAnnotation}. + * @param error Error, if any + * @param [response] Annotation + */ + type GetAnnotationCallback = (error: (Error|null), response?: google.cloud.rapidmigrationassessment.v1.Annotation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|listCollectors}. + * @param error Error, if any + * @param [response] ListCollectorsResponse + */ + type ListCollectorsCallback = (error: (Error|null), response?: google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|getCollector}. + * @param error Error, if any + * @param [response] Collector + */ + type GetCollectorCallback = (error: (Error|null), response?: google.cloud.rapidmigrationassessment.v1.Collector) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|updateCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|deleteCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|resumeCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type ResumeCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|registerCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type RegisterCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|pauseCollector}. + * @param error Error, if any + * @param [response] Operation + */ + type PauseCollectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateAnnotationRequest. */ + interface ICreateAnnotationRequest { + + /** CreateAnnotationRequest parent */ + parent?: (string|null); + + /** CreateAnnotationRequest annotation */ + annotation?: (google.cloud.rapidmigrationassessment.v1.IAnnotation|null); + + /** CreateAnnotationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateAnnotationRequest. */ + class CreateAnnotationRequest implements ICreateAnnotationRequest { + + /** + * Constructs a new CreateAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest); + + /** CreateAnnotationRequest parent. */ + public parent: string; + + /** CreateAnnotationRequest annotation. */ + public annotation?: (google.cloud.rapidmigrationassessment.v1.IAnnotation|null); + + /** CreateAnnotationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnnotationRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest): google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; + + /** + * Encodes the specified CreateAnnotationRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.verify|verify} messages. + * @param message CreateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.verify|verify} messages. + * @param message CreateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; + + /** + * Verifies a CreateAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; + + /** + * Creates a plain object from a CreateAnnotationRequest message. Also converts values to other types if specified. + * @param message CreateAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotationRequest. */ + interface IGetAnnotationRequest { + + /** GetAnnotationRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationRequest. */ + class GetAnnotationRequest implements IGetAnnotationRequest { + + /** + * Constructs a new GetAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest); + + /** GetAnnotationRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest): google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; + + /** + * Encodes the specified GetAnnotationRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.verify|verify} messages. + * @param message GetAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.verify|verify} messages. + * @param message GetAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; + + /** + * Verifies a GetAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; + + /** + * Creates a plain object from a GetAnnotationRequest message. Also converts values to other types if specified. + * @param message GetAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCollectorRequest. */ + interface ICreateCollectorRequest { + + /** CreateCollectorRequest parent */ + parent?: (string|null); + + /** CreateCollectorRequest collectorId */ + collectorId?: (string|null); + + /** CreateCollectorRequest collector */ + collector?: (google.cloud.rapidmigrationassessment.v1.ICollector|null); + + /** CreateCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCollectorRequest. */ + class CreateCollectorRequest implements ICreateCollectorRequest { + + /** + * Constructs a new CreateCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest); + + /** CreateCollectorRequest parent. */ + public parent: string; + + /** CreateCollectorRequest collectorId. */ + public collectorId: string; + + /** CreateCollectorRequest collector. */ + public collector?: (google.cloud.rapidmigrationassessment.v1.ICollector|null); + + /** CreateCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest): google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; + + /** + * Encodes the specified CreateCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.verify|verify} messages. + * @param message CreateCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.verify|verify} messages. + * @param message CreateCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; + + /** + * Decodes a CreateCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; + + /** + * Verifies a CreateCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; + + /** + * Creates a plain object from a CreateCollectorRequest message. Also converts values to other types if specified. + * @param message CreateCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCollectorsRequest. */ + interface IListCollectorsRequest { + + /** ListCollectorsRequest parent */ + parent?: (string|null); + + /** ListCollectorsRequest pageSize */ + pageSize?: (number|null); + + /** ListCollectorsRequest pageToken */ + pageToken?: (string|null); + + /** ListCollectorsRequest filter */ + filter?: (string|null); + + /** ListCollectorsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCollectorsRequest. */ + class ListCollectorsRequest implements IListCollectorsRequest { + + /** + * Constructs a new ListCollectorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest); + + /** ListCollectorsRequest parent. */ + public parent: string; + + /** ListCollectorsRequest pageSize. */ + public pageSize: number; + + /** ListCollectorsRequest pageToken. */ + public pageToken: string; + + /** ListCollectorsRequest filter. */ + public filter: string; + + /** ListCollectorsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCollectorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCollectorsRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest): google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; + + /** + * Encodes the specified ListCollectorsRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.verify|verify} messages. + * @param message ListCollectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCollectorsRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.verify|verify} messages. + * @param message ListCollectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCollectorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCollectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; + + /** + * Decodes a ListCollectorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCollectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; + + /** + * Verifies a ListCollectorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCollectorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCollectorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; + + /** + * Creates a plain object from a ListCollectorsRequest message. Also converts values to other types if specified. + * @param message ListCollectorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCollectorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCollectorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCollectorsResponse. */ + interface IListCollectorsResponse { + + /** ListCollectorsResponse collectors */ + collectors?: (google.cloud.rapidmigrationassessment.v1.ICollector[]|null); + + /** ListCollectorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCollectorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCollectorsResponse. */ + class ListCollectorsResponse implements IListCollectorsResponse { + + /** + * Constructs a new ListCollectorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse); + + /** ListCollectorsResponse collectors. */ + public collectors: google.cloud.rapidmigrationassessment.v1.ICollector[]; + + /** ListCollectorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCollectorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCollectorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCollectorsResponse instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse): google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; + + /** + * Encodes the specified ListCollectorsResponse message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.verify|verify} messages. + * @param message ListCollectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCollectorsResponse message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.verify|verify} messages. + * @param message ListCollectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCollectorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCollectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; + + /** + * Decodes a ListCollectorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCollectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; + + /** + * Verifies a ListCollectorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCollectorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCollectorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; + + /** + * Creates a plain object from a ListCollectorsResponse message. Also converts values to other types if specified. + * @param message ListCollectorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCollectorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCollectorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCollectorRequest. */ + interface IGetCollectorRequest { + + /** GetCollectorRequest name */ + name?: (string|null); + } + + /** Represents a GetCollectorRequest. */ + class GetCollectorRequest implements IGetCollectorRequest { + + /** + * Constructs a new GetCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest); + + /** GetCollectorRequest name. */ + public name: string; + + /** + * Creates a new GetCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest): google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; + + /** + * Encodes the specified GetCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.verify|verify} messages. + * @param message GetCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.verify|verify} messages. + * @param message GetCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; + + /** + * Decodes a GetCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; + + /** + * Verifies a GetCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; + + /** + * Creates a plain object from a GetCollectorRequest message. Also converts values to other types if specified. + * @param message GetCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCollectorRequest. */ + interface IDeleteCollectorRequest { + + /** DeleteCollectorRequest name */ + name?: (string|null); + + /** DeleteCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteCollectorRequest. */ + class DeleteCollectorRequest implements IDeleteCollectorRequest { + + /** + * Constructs a new DeleteCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest); + + /** DeleteCollectorRequest name. */ + public name: string; + + /** DeleteCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest): google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; + + /** + * Encodes the specified DeleteCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.verify|verify} messages. + * @param message DeleteCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.verify|verify} messages. + * @param message DeleteCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; + + /** + * Decodes a DeleteCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; + + /** + * Verifies a DeleteCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; + + /** + * Creates a plain object from a DeleteCollectorRequest message. Also converts values to other types if specified. + * @param message DeleteCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCollectorRequest. */ + interface IUpdateCollectorRequest { + + /** UpdateCollectorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCollectorRequest collector */ + collector?: (google.cloud.rapidmigrationassessment.v1.ICollector|null); + + /** UpdateCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateCollectorRequest. */ + class UpdateCollectorRequest implements IUpdateCollectorRequest { + + /** + * Constructs a new UpdateCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest); + + /** UpdateCollectorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateCollectorRequest collector. */ + public collector?: (google.cloud.rapidmigrationassessment.v1.ICollector|null); + + /** UpdateCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest): google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; + + /** + * Encodes the specified UpdateCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.verify|verify} messages. + * @param message UpdateCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.verify|verify} messages. + * @param message UpdateCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; + + /** + * Decodes an UpdateCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; + + /** + * Verifies an UpdateCollectorRequest message. + * @param message Plain 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 UpdateCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; + + /** + * Creates a plain object from an UpdateCollectorRequest message. Also converts values to other types if specified. + * @param message UpdateCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeCollectorRequest. */ + interface IResumeCollectorRequest { + + /** ResumeCollectorRequest name */ + name?: (string|null); + + /** ResumeCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ResumeCollectorRequest. */ + class ResumeCollectorRequest implements IResumeCollectorRequest { + + /** + * Constructs a new ResumeCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest); + + /** ResumeCollectorRequest name. */ + public name: string; + + /** ResumeCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new ResumeCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest): google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + + /** + * Encodes the specified ResumeCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.verify|verify} messages. + * @param message ResumeCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.verify|verify} messages. + * @param message ResumeCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + + /** + * Decodes a ResumeCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + + /** + * Verifies a ResumeCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + + /** + * Creates a plain object from a ResumeCollectorRequest message. Also converts values to other types if specified. + * @param message ResumeCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegisterCollectorRequest. */ + interface IRegisterCollectorRequest { + + /** RegisterCollectorRequest name */ + name?: (string|null); + + /** RegisterCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RegisterCollectorRequest. */ + class RegisterCollectorRequest implements IRegisterCollectorRequest { + + /** + * Constructs a new RegisterCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest); + + /** RegisterCollectorRequest name. */ + public name: string; + + /** RegisterCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new RegisterCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegisterCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest): google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + + /** + * Encodes the specified RegisterCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.verify|verify} messages. + * @param message RegisterCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegisterCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.verify|verify} messages. + * @param message RegisterCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegisterCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegisterCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + + /** + * Decodes a RegisterCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegisterCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + + /** + * Verifies a RegisterCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegisterCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegisterCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + + /** + * Creates a plain object from a RegisterCollectorRequest message. Also converts values to other types if specified. + * @param message RegisterCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegisterCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegisterCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseCollectorRequest. */ + interface IPauseCollectorRequest { + + /** PauseCollectorRequest name */ + name?: (string|null); + + /** PauseCollectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PauseCollectorRequest. */ + class PauseCollectorRequest implements IPauseCollectorRequest { + + /** + * Constructs a new PauseCollectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest); + + /** PauseCollectorRequest name. */ + public name: string; + + /** PauseCollectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new PauseCollectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseCollectorRequest instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest): google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; + + /** + * Encodes the specified PauseCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.verify|verify} messages. + * @param message PauseCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.verify|verify} messages. + * @param message PauseCollectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseCollectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; + + /** + * Decodes a PauseCollectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; + + /** + * Verifies a PauseCollectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseCollectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; + + /** + * Creates a plain object from a PauseCollectorRequest message. Also converts values to other types if specified. + * @param message PauseCollectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseCollectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseCollectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.rapidmigrationassessment.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.rapidmigrationassessment.v1.IOperationMetadata): google.cloud.rapidmigrationassessment.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.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; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 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 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 + } + } + + /** 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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 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 Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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-rapidmigrationassessment/protos/protos.js b/packages/google-cloud-rapidmigrationassessment/protos/protos.js new file mode 100644 index 000000000000..2e1c4bce20ae --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/protos/protos.js @@ -0,0 +1,19588 @@ +// 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_rapidmigrationassessment_protos || ($protobuf.roots._google_cloud_rapidmigrationassessment_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.rapidmigrationassessment = (function() { + + /** + * Namespace rapidmigrationassessment. + * @memberof google.cloud + * @namespace + */ + var rapidmigrationassessment = {}; + + rapidmigrationassessment.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.rapidmigrationassessment + * @namespace + */ + var v1 = {}; + + v1.GuestOsScan = (function() { + + /** + * Properties of a GuestOsScan. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IGuestOsScan + * @property {string|null} [coreSource] GuestOsScan coreSource + */ + + /** + * Constructs a new GuestOsScan. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a GuestOsScan. + * @implements IGuestOsScan + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IGuestOsScan=} [properties] Properties to set + */ + function GuestOsScan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestOsScan coreSource. + * @member {string} coreSource + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @instance + */ + GuestOsScan.prototype.coreSource = ""; + + /** + * Creates a new GuestOsScan instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGuestOsScan=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.GuestOsScan} GuestOsScan instance + */ + GuestOsScan.create = function create(properties) { + return new GuestOsScan(properties); + }; + + /** + * Encodes the specified GuestOsScan message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GuestOsScan.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGuestOsScan} message GuestOsScan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsScan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreSource != null && Object.hasOwnProperty.call(message, "coreSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.coreSource); + return writer; + }; + + /** + * Encodes the specified GuestOsScan message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GuestOsScan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGuestOsScan} message GuestOsScan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsScan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestOsScan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.GuestOsScan} GuestOsScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsScan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestOsScan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.GuestOsScan} GuestOsScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsScan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestOsScan message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestOsScan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreSource != null && message.hasOwnProperty("coreSource")) + if (!$util.isString(message.coreSource)) + return "coreSource: string expected"; + return null; + }; + + /** + * Creates a GuestOsScan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.GuestOsScan} GuestOsScan + */ + GuestOsScan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan(); + if (object.coreSource != null) + message.coreSource = String(object.coreSource); + return message; + }; + + /** + * Creates a plain object from a GuestOsScan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.GuestOsScan} message GuestOsScan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestOsScan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreSource = ""; + if (message.coreSource != null && message.hasOwnProperty("coreSource")) + object.coreSource = message.coreSource; + return object; + }; + + /** + * Converts this GuestOsScan to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @instance + * @returns {Object.} JSON object + */ + GuestOsScan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuestOsScan + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.GuestOsScan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuestOsScan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.GuestOsScan"; + }; + + return GuestOsScan; + })(); + + v1.VSphereScan = (function() { + + /** + * Properties of a VSphereScan. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IVSphereScan + * @property {string|null} [coreSource] VSphereScan coreSource + */ + + /** + * Constructs a new VSphereScan. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a VSphereScan. + * @implements IVSphereScan + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IVSphereScan=} [properties] Properties to set + */ + function VSphereScan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VSphereScan coreSource. + * @member {string} coreSource + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @instance + */ + VSphereScan.prototype.coreSource = ""; + + /** + * Creates a new VSphereScan instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IVSphereScan=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.VSphereScan} VSphereScan instance + */ + VSphereScan.create = function create(properties) { + return new VSphereScan(properties); + }; + + /** + * Encodes the specified VSphereScan message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.VSphereScan.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IVSphereScan} message VSphereScan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VSphereScan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreSource != null && Object.hasOwnProperty.call(message, "coreSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.coreSource); + return writer; + }; + + /** + * Encodes the specified VSphereScan message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.VSphereScan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IVSphereScan} message VSphereScan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VSphereScan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VSphereScan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.VSphereScan} VSphereScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VSphereScan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.VSphereScan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VSphereScan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.VSphereScan} VSphereScan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VSphereScan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VSphereScan message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VSphereScan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreSource != null && message.hasOwnProperty("coreSource")) + if (!$util.isString(message.coreSource)) + return "coreSource: string expected"; + return null; + }; + + /** + * Creates a VSphereScan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.VSphereScan} VSphereScan + */ + VSphereScan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.VSphereScan) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.VSphereScan(); + if (object.coreSource != null) + message.coreSource = String(object.coreSource); + return message; + }; + + /** + * Creates a plain object from a VSphereScan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {google.cloud.rapidmigrationassessment.v1.VSphereScan} message VSphereScan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VSphereScan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreSource = ""; + if (message.coreSource != null && message.hasOwnProperty("coreSource")) + object.coreSource = message.coreSource; + return object; + }; + + /** + * Converts this VSphereScan to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @instance + * @returns {Object.} JSON object + */ + VSphereScan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VSphereScan + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.VSphereScan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VSphereScan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.VSphereScan"; + }; + + return VSphereScan; + })(); + + v1.Collector = (function() { + + /** + * Properties of a Collector. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface ICollector + * @property {string|null} [name] Collector name + * @property {google.protobuf.ITimestamp|null} [createTime] Collector createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Collector updateTime + * @property {Object.|null} [labels] Collector labels + * @property {string|null} [displayName] Collector displayName + * @property {string|null} [description] Collector description + * @property {string|null} [serviceAccount] Collector serviceAccount + * @property {string|null} [bucket] Collector bucket + * @property {number|Long|null} [expectedAssetCount] Collector expectedAssetCount + * @property {google.cloud.rapidmigrationassessment.v1.Collector.State|null} [state] Collector state + * @property {string|null} [clientVersion] Collector clientVersion + * @property {google.cloud.rapidmigrationassessment.v1.IGuestOsScan|null} [guestOsScan] Collector guestOsScan + * @property {google.cloud.rapidmigrationassessment.v1.IVSphereScan|null} [vsphereScan] Collector vsphereScan + * @property {number|null} [collectionDays] Collector collectionDays + * @property {string|null} [eulaUri] Collector eulaUri + */ + + /** + * Constructs a new Collector. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a Collector. + * @implements ICollector + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.ICollector=} [properties] Properties to set + */ + function Collector(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Collector name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.name = ""; + + /** + * Collector createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.createTime = null; + + /** + * Collector updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.updateTime = null; + + /** + * Collector labels. + * @member {Object.} labels + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.labels = $util.emptyObject; + + /** + * Collector displayName. + * @member {string} displayName + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.displayName = ""; + + /** + * Collector description. + * @member {string} description + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.description = ""; + + /** + * Collector serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.serviceAccount = ""; + + /** + * Collector bucket. + * @member {string} bucket + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.bucket = ""; + + /** + * Collector expectedAssetCount. + * @member {number|Long} expectedAssetCount + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.expectedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Collector state. + * @member {google.cloud.rapidmigrationassessment.v1.Collector.State} state + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.state = 0; + + /** + * Collector clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.clientVersion = ""; + + /** + * Collector guestOsScan. + * @member {google.cloud.rapidmigrationassessment.v1.IGuestOsScan|null|undefined} guestOsScan + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.guestOsScan = null; + + /** + * Collector vsphereScan. + * @member {google.cloud.rapidmigrationassessment.v1.IVSphereScan|null|undefined} vsphereScan + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.vsphereScan = null; + + /** + * Collector collectionDays. + * @member {number} collectionDays + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.collectionDays = 0; + + /** + * Collector eulaUri. + * @member {string} eulaUri + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + */ + Collector.prototype.eulaUri = ""; + + /** + * Creates a new Collector instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICollector=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.Collector} Collector instance + */ + Collector.create = function create(properties) { + return new Collector(properties); + }; + + /** + * Encodes the specified Collector message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Collector.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICollector} message Collector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Collector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.bucket); + if (message.expectedAssetCount != null && Object.hasOwnProperty.call(message, "expectedAssetCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.expectedAssetCount); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.clientVersion); + if (message.guestOsScan != null && Object.hasOwnProperty.call(message, "guestOsScan")) + $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan.encode(message.guestOsScan, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vsphereScan != null && Object.hasOwnProperty.call(message, "vsphereScan")) + $root.google.cloud.rapidmigrationassessment.v1.VSphereScan.encode(message.vsphereScan, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.collectionDays != null && Object.hasOwnProperty.call(message, "collectionDays")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.collectionDays); + if (message.eulaUri != null && Object.hasOwnProperty.call(message, "eulaUri")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.eulaUri); + return writer; + }; + + /** + * Encodes the specified Collector message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Collector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICollector} message Collector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Collector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Collector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.Collector} Collector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Collector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.Collector(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.serviceAccount = reader.string(); + break; + } + case 8: { + message.bucket = reader.string(); + break; + } + case 9: { + message.expectedAssetCount = reader.int64(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.clientVersion = reader.string(); + break; + } + case 12: { + message.guestOsScan = $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan.decode(reader, reader.uint32()); + break; + } + case 13: { + message.vsphereScan = $root.google.cloud.rapidmigrationassessment.v1.VSphereScan.decode(reader, reader.uint32()); + break; + } + case 14: { + message.collectionDays = reader.int32(); + break; + } + case 15: { + message.eulaUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Collector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.Collector} Collector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Collector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Collector message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Collector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.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.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.expectedAssetCount != null && message.hasOwnProperty("expectedAssetCount")) + if (!$util.isInteger(message.expectedAssetCount) && !(message.expectedAssetCount && $util.isInteger(message.expectedAssetCount.low) && $util.isInteger(message.expectedAssetCount.high))) + return "expectedAssetCount: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + if (message.guestOsScan != null && message.hasOwnProperty("guestOsScan")) { + var error = $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan.verify(message.guestOsScan); + if (error) + return "guestOsScan." + error; + } + if (message.vsphereScan != null && message.hasOwnProperty("vsphereScan")) { + var error = $root.google.cloud.rapidmigrationassessment.v1.VSphereScan.verify(message.vsphereScan); + if (error) + return "vsphereScan." + error; + } + if (message.collectionDays != null && message.hasOwnProperty("collectionDays")) + if (!$util.isInteger(message.collectionDays)) + return "collectionDays: integer expected"; + if (message.eulaUri != null && message.hasOwnProperty("eulaUri")) + if (!$util.isString(message.eulaUri)) + return "eulaUri: string expected"; + return null; + }; + + /** + * Creates a Collector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.Collector} Collector + */ + Collector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.Collector) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.Collector(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Collector.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.rapidmigrationassessment.v1.Collector.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Collector.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.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.expectedAssetCount != null) + if ($util.Long) + (message.expectedAssetCount = $util.Long.fromValue(object.expectedAssetCount)).unsigned = false; + else if (typeof object.expectedAssetCount === "string") + message.expectedAssetCount = parseInt(object.expectedAssetCount, 10); + else if (typeof object.expectedAssetCount === "number") + message.expectedAssetCount = object.expectedAssetCount; + else if (typeof object.expectedAssetCount === "object") + message.expectedAssetCount = new $util.LongBits(object.expectedAssetCount.low >>> 0, object.expectedAssetCount.high >>> 0).toNumber(); + 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 "STATE_INITIALIZING": + case 1: + message.state = 1; + break; + case "STATE_READY_TO_USE": + case 2: + message.state = 2; + break; + case "STATE_REGISTERED": + case 3: + message.state = 3; + break; + case "STATE_ACTIVE": + case 4: + message.state = 4; + break; + case "STATE_PAUSED": + case 5: + message.state = 5; + break; + case "STATE_DELETING": + case 6: + message.state = 6; + break; + case "STATE_DECOMMISSIONED": + case 7: + message.state = 7; + break; + case "STATE_ERROR": + case 8: + message.state = 8; + break; + } + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + if (object.guestOsScan != null) { + if (typeof object.guestOsScan !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Collector.guestOsScan: object expected"); + message.guestOsScan = $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan.fromObject(object.guestOsScan); + } + if (object.vsphereScan != null) { + if (typeof object.vsphereScan !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Collector.vsphereScan: object expected"); + message.vsphereScan = $root.google.cloud.rapidmigrationassessment.v1.VSphereScan.fromObject(object.vsphereScan); + } + if (object.collectionDays != null) + message.collectionDays = object.collectionDays | 0; + if (object.eulaUri != null) + message.eulaUri = String(object.eulaUri); + return message; + }; + + /** + * Creates a plain object from a Collector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {google.cloud.rapidmigrationassessment.v1.Collector} message Collector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Collector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.description = ""; + object.serviceAccount = ""; + object.bucket = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expectedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expectedAssetCount = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.clientVersion = ""; + object.guestOsScan = null; + object.vsphereScan = null; + object.collectionDays = 0; + object.eulaUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.expectedAssetCount != null && message.hasOwnProperty("expectedAssetCount")) + if (typeof message.expectedAssetCount === "number") + object.expectedAssetCount = options.longs === String ? String(message.expectedAssetCount) : message.expectedAssetCount; + else + object.expectedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.expectedAssetCount) : options.longs === Number ? new $util.LongBits(message.expectedAssetCount.low >>> 0, message.expectedAssetCount.high >>> 0).toNumber() : message.expectedAssetCount; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.rapidmigrationassessment.v1.Collector.State[message.state] === undefined ? message.state : $root.google.cloud.rapidmigrationassessment.v1.Collector.State[message.state] : message.state; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + if (message.guestOsScan != null && message.hasOwnProperty("guestOsScan")) + object.guestOsScan = $root.google.cloud.rapidmigrationassessment.v1.GuestOsScan.toObject(message.guestOsScan, options); + if (message.vsphereScan != null && message.hasOwnProperty("vsphereScan")) + object.vsphereScan = $root.google.cloud.rapidmigrationassessment.v1.VSphereScan.toObject(message.vsphereScan, options); + if (message.collectionDays != null && message.hasOwnProperty("collectionDays")) + object.collectionDays = message.collectionDays; + if (message.eulaUri != null && message.hasOwnProperty("eulaUri")) + object.eulaUri = message.eulaUri; + return object; + }; + + /** + * Converts this Collector to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @instance + * @returns {Object.} JSON object + */ + Collector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Collector + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.Collector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Collector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.Collector"; + }; + + /** + * State enum. + * @name google.cloud.rapidmigrationassessment.v1.Collector.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STATE_INITIALIZING=1 STATE_INITIALIZING value + * @property {number} STATE_READY_TO_USE=2 STATE_READY_TO_USE value + * @property {number} STATE_REGISTERED=3 STATE_REGISTERED value + * @property {number} STATE_ACTIVE=4 STATE_ACTIVE value + * @property {number} STATE_PAUSED=5 STATE_PAUSED value + * @property {number} STATE_DELETING=6 STATE_DELETING value + * @property {number} STATE_DECOMMISSIONED=7 STATE_DECOMMISSIONED value + * @property {number} STATE_ERROR=8 STATE_ERROR value + */ + Collector.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_INITIALIZING"] = 1; + values[valuesById[2] = "STATE_READY_TO_USE"] = 2; + values[valuesById[3] = "STATE_REGISTERED"] = 3; + values[valuesById[4] = "STATE_ACTIVE"] = 4; + values[valuesById[5] = "STATE_PAUSED"] = 5; + values[valuesById[6] = "STATE_DELETING"] = 6; + values[valuesById[7] = "STATE_DECOMMISSIONED"] = 7; + values[valuesById[8] = "STATE_ERROR"] = 8; + return values; + })(); + + return Collector; + })(); + + v1.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IAnnotation + * @property {string|null} [name] Annotation name + * @property {google.protobuf.ITimestamp|null} [createTime] Annotation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Annotation updateTime + * @property {Object.|null} [labels] Annotation labels + * @property {google.cloud.rapidmigrationassessment.v1.Annotation.Type|null} [type] Annotation type + */ + + /** + * Constructs a new Annotation. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @instance + */ + Annotation.prototype.name = ""; + + /** + * Annotation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @instance + */ + Annotation.prototype.createTime = null; + + /** + * Annotation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @instance + */ + Annotation.prototype.updateTime = null; + + /** + * Annotation labels. + * @member {Object.} labels + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @instance + */ + Annotation.prototype.labels = $util.emptyObject; + + /** + * Annotation type. + * @member {google.cloud.rapidmigrationassessment.v1.Annotation.Type} type + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @instance + */ + Annotation.prototype.type = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IAnnotation=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Annotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {google.cloud.rapidmigrationassessment.v1.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.Annotation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.type = 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.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: 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.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.Annotation) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.Annotation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Annotation.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.rapidmigrationassessment.v1.Annotation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.Annotation.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_LEGACY_EXPORT_CONSENT": + case 1: + message.type = 1; + break; + case "TYPE_QWIKLAB": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.Annotation + * @static + * @param {google.cloud.rapidmigrationassessment.v1.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.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.rapidmigrationassessment.v1.Annotation.Type[message.type] === undefined ? message.type : $root.google.cloud.rapidmigrationassessment.v1.Annotation.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.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.cloud.rapidmigrationassessment.v1.Annotation"; + }; + + /** + * Type enum. + * @name google.cloud.rapidmigrationassessment.v1.Annotation.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TYPE_LEGACY_EXPORT_CONSENT=1 TYPE_LEGACY_EXPORT_CONSENT value + * @property {number} TYPE_QWIKLAB=2 TYPE_QWIKLAB value + */ + Annotation.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_LEGACY_EXPORT_CONSENT"] = 1; + values[valuesById[2] = "TYPE_QWIKLAB"] = 2; + return values; + })(); + + return Annotation; + })(); + + v1.RapidMigrationAssessment = (function() { + + /** + * Constructs a new RapidMigrationAssessment service. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a RapidMigrationAssessment + * @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 RapidMigrationAssessment(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RapidMigrationAssessment.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RapidMigrationAssessment; + + /** + * Creates new RapidMigrationAssessment service using the specified rpc implementation. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @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 {RapidMigrationAssessment} RPC service. Useful where requests and/or responses are streamed. + */ + RapidMigrationAssessment.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|createCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef CreateCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCollector. + * @function createCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest} request CreateCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.createCollector = function createCollector(request, callback) { + return this.rpcCall(createCollector, $root.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCollector" }); + + /** + * Calls CreateCollector. + * @function createCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest} request CreateCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|createAnnotation}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef CreateAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAnnotation. + * @function createAnnotation + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest} request CreateAnnotationRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.createAnnotation = function createAnnotation(request, callback) { + return this.rpcCall(createAnnotation, $root.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAnnotation" }); + + /** + * Calls CreateAnnotation. + * @function createAnnotation + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest} request CreateAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|getAnnotation}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef GetAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.rapidmigrationassessment.v1.Annotation} [response] Annotation + */ + + /** + * Calls GetAnnotation. + * @function getAnnotation + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest} request GetAnnotationRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotationCallback} callback Node-style callback called with the error, if any, and Annotation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.getAnnotation = function getAnnotation(request, callback) { + return this.rpcCall(getAnnotation, $root.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, $root.google.cloud.rapidmigrationassessment.v1.Annotation, request, callback); + }, "name", { value: "GetAnnotation" }); + + /** + * Calls GetAnnotation. + * @function getAnnotation + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest} request GetAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|listCollectors}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef ListCollectorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} [response] ListCollectorsResponse + */ + + /** + * Calls ListCollectors. + * @function listCollectors + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest} request ListCollectorsRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectorsCallback} callback Node-style callback called with the error, if any, and ListCollectorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.listCollectors = function listCollectors(request, callback) { + return this.rpcCall(listCollectors, $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse, request, callback); + }, "name", { value: "ListCollectors" }); + + /** + * Calls ListCollectors. + * @function listCollectors + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest} request ListCollectorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|getCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef GetCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.rapidmigrationassessment.v1.Collector} [response] Collector + */ + + /** + * Calls GetCollector. + * @function getCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest} request GetCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollectorCallback} callback Node-style callback called with the error, if any, and Collector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.getCollector = function getCollector(request, callback) { + return this.rpcCall(getCollector, $root.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, $root.google.cloud.rapidmigrationassessment.v1.Collector, request, callback); + }, "name", { value: "GetCollector" }); + + /** + * Calls GetCollector. + * @function getCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest} request GetCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|updateCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef UpdateCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCollector. + * @function updateCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest} request UpdateCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.updateCollector = function updateCollector(request, callback) { + return this.rpcCall(updateCollector, $root.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCollector" }); + + /** + * Calls UpdateCollector. + * @function updateCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest} request UpdateCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|deleteCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef DeleteCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCollector. + * @function deleteCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest} request DeleteCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.deleteCollector = function deleteCollector(request, callback) { + return this.rpcCall(deleteCollector, $root.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCollector" }); + + /** + * Calls DeleteCollector. + * @function deleteCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest} request DeleteCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|resumeCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef ResumeCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResumeCollector. + * @function resumeCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest} request ResumeCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.resumeCollector = function resumeCollector(request, callback) { + return this.rpcCall(resumeCollector, $root.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResumeCollector" }); + + /** + * Calls ResumeCollector. + * @function resumeCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest} request ResumeCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|registerCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef RegisterCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RegisterCollector. + * @function registerCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest} request RegisterCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.registerCollector = function registerCollector(request, callback) { + return this.rpcCall(registerCollector, $root.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RegisterCollector" }); + + /** + * Calls RegisterCollector. + * @function registerCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest} request RegisterCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment|pauseCollector}. + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @typedef PauseCollectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PauseCollector. + * @function pauseCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest} request PauseCollectorRequest message or plain object + * @param {google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RapidMigrationAssessment.prototype.pauseCollector = function pauseCollector(request, callback) { + return this.rpcCall(pauseCollector, $root.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PauseCollector" }); + + /** + * Calls PauseCollector. + * @function pauseCollector + * @memberof google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment + * @instance + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest} request PauseCollectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RapidMigrationAssessment; + })(); + + v1.CreateAnnotationRequest = (function() { + + /** + * Properties of a CreateAnnotationRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface ICreateAnnotationRequest + * @property {string|null} [parent] CreateAnnotationRequest parent + * @property {google.cloud.rapidmigrationassessment.v1.IAnnotation|null} [annotation] CreateAnnotationRequest annotation + * @property {string|null} [requestId] CreateAnnotationRequest requestId + */ + + /** + * Constructs a new CreateAnnotationRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a CreateAnnotationRequest. + * @implements ICreateAnnotationRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest=} [properties] Properties to set + */ + function CreateAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnnotationRequest parent. + * @member {string} parent + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.parent = ""; + + /** + * CreateAnnotationRequest annotation. + * @member {google.cloud.rapidmigrationassessment.v1.IAnnotation|null|undefined} annotation + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.annotation = null; + + /** + * CreateAnnotationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} CreateAnnotationRequest instance + */ + CreateAnnotationRequest.create = function create(properties) { + return new CreateAnnotationRequest(properties); + }; + + /** + * Encodes the specified CreateAnnotationRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest} message CreateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationRequest.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.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.cloud.rapidmigrationassessment.v1.Annotation.encode(message.annotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest} message CreateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.annotation = $root.google.cloud.rapidmigrationassessment.v1.Annotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnnotationRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnnotationRequest.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.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.cloud.rapidmigrationassessment.v1.Annotation.verify(message.annotation); + if (error) + return "annotation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} CreateAnnotationRequest + */ + CreateAnnotationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.annotation: object expected"); + message.annotation = $root.google.cloud.rapidmigrationassessment.v1.Annotation.fromObject(object.annotation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} message CreateAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnnotationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.annotation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.cloud.rapidmigrationassessment.v1.Annotation.toObject(message.annotation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest"; + }; + + return CreateAnnotationRequest; + })(); + + v1.GetAnnotationRequest = (function() { + + /** + * Properties of a GetAnnotationRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IGetAnnotationRequest + * @property {string|null} [name] GetAnnotationRequest name + */ + + /** + * Constructs a new GetAnnotationRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a GetAnnotationRequest. + * @implements IGetAnnotationRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest=} [properties] Properties to set + */ + function GetAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @instance + */ + GetAnnotationRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} GetAnnotationRequest instance + */ + GetAnnotationRequest.create = function create(properties) { + return new GetAnnotationRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest} message GetAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationRequest.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 GetAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest} message GetAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest(); + 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 GetAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationRequest.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 GetAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} GetAnnotationRequest + */ + GetAnnotationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} message GetAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationRequest.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 GetAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest"; + }; + + return GetAnnotationRequest; + })(); + + v1.CreateCollectorRequest = (function() { + + /** + * Properties of a CreateCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface ICreateCollectorRequest + * @property {string|null} [parent] CreateCollectorRequest parent + * @property {string|null} [collectorId] CreateCollectorRequest collectorId + * @property {google.cloud.rapidmigrationassessment.v1.ICollector|null} [collector] CreateCollectorRequest collector + * @property {string|null} [requestId] CreateCollectorRequest requestId + */ + + /** + * Constructs a new CreateCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a CreateCollectorRequest. + * @implements ICreateCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest=} [properties] Properties to set + */ + function CreateCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCollectorRequest parent. + * @member {string} parent + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @instance + */ + CreateCollectorRequest.prototype.parent = ""; + + /** + * CreateCollectorRequest collectorId. + * @member {string} collectorId + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @instance + */ + CreateCollectorRequest.prototype.collectorId = ""; + + /** + * CreateCollectorRequest collector. + * @member {google.cloud.rapidmigrationassessment.v1.ICollector|null|undefined} collector + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @instance + */ + CreateCollectorRequest.prototype.collector = null; + + /** + * CreateCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @instance + */ + CreateCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} CreateCollectorRequest instance + */ + CreateCollectorRequest.create = function create(properties) { + return new CreateCollectorRequest(properties); + }; + + /** + * Encodes the specified CreateCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest} message CreateCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCollectorRequest.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.collectorId != null && Object.hasOwnProperty.call(message, "collectorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.collectorId); + if (message.collector != null && Object.hasOwnProperty.call(message, "collector")) + $root.google.cloud.rapidmigrationassessment.v1.Collector.encode(message.collector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest} message CreateCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} CreateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.collectorId = reader.string(); + break; + } + case 3: { + message.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} CreateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCollectorRequest.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.collectorId != null && message.hasOwnProperty("collectorId")) + if (!$util.isString(message.collectorId)) + return "collectorId: string expected"; + if (message.collector != null && message.hasOwnProperty("collector")) { + var error = $root.google.cloud.rapidmigrationassessment.v1.Collector.verify(message.collector); + if (error) + return "collector." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} CreateCollectorRequest + */ + CreateCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.collectorId != null) + message.collectorId = String(object.collectorId); + if (object.collector != null) { + if (typeof object.collector !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.collector: object expected"); + message.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.fromObject(object.collector); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} message CreateCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.collectorId = ""; + object.collector = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.collectorId != null && message.hasOwnProperty("collectorId")) + object.collectorId = message.collectorId; + if (message.collector != null && message.hasOwnProperty("collector")) + object.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.toObject(message.collector, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest"; + }; + + return CreateCollectorRequest; + })(); + + v1.ListCollectorsRequest = (function() { + + /** + * Properties of a ListCollectorsRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IListCollectorsRequest + * @property {string|null} [parent] ListCollectorsRequest parent + * @property {number|null} [pageSize] ListCollectorsRequest pageSize + * @property {string|null} [pageToken] ListCollectorsRequest pageToken + * @property {string|null} [filter] ListCollectorsRequest filter + * @property {string|null} [orderBy] ListCollectorsRequest orderBy + */ + + /** + * Constructs a new ListCollectorsRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a ListCollectorsRequest. + * @implements IListCollectorsRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest=} [properties] Properties to set + */ + function ListCollectorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCollectorsRequest parent. + * @member {string} parent + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + */ + ListCollectorsRequest.prototype.parent = ""; + + /** + * ListCollectorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + */ + ListCollectorsRequest.prototype.pageSize = 0; + + /** + * ListCollectorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + */ + ListCollectorsRequest.prototype.pageToken = ""; + + /** + * ListCollectorsRequest filter. + * @member {string} filter + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + */ + ListCollectorsRequest.prototype.filter = ""; + + /** + * ListCollectorsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + */ + ListCollectorsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCollectorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} ListCollectorsRequest instance + */ + ListCollectorsRequest.create = function create(properties) { + return new ListCollectorsRequest(properties); + }; + + /** + * Encodes the specified ListCollectorsRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest} message ListCollectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCollectorsRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest} message ListCollectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCollectorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} ListCollectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectorsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCollectorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} ListCollectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCollectorsRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCollectorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListCollectorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} ListCollectorsRequest + */ + ListCollectorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCollectorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} message ListCollectorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCollectorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCollectorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCollectorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCollectorsRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCollectorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest"; + }; + + return ListCollectorsRequest; + })(); + + v1.ListCollectorsResponse = (function() { + + /** + * Properties of a ListCollectorsResponse. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IListCollectorsResponse + * @property {Array.|null} [collectors] ListCollectorsResponse collectors + * @property {string|null} [nextPageToken] ListCollectorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCollectorsResponse unreachable + */ + + /** + * Constructs a new ListCollectorsResponse. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a ListCollectorsResponse. + * @implements IListCollectorsResponse + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse=} [properties] Properties to set + */ + function ListCollectorsResponse(properties) { + this.collectors = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCollectorsResponse collectors. + * @member {Array.} collectors + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @instance + */ + ListCollectorsResponse.prototype.collectors = $util.emptyArray; + + /** + * ListCollectorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @instance + */ + ListCollectorsResponse.prototype.nextPageToken = ""; + + /** + * ListCollectorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @instance + */ + ListCollectorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCollectorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} ListCollectorsResponse instance + */ + ListCollectorsResponse.create = function create(properties) { + return new ListCollectorsResponse(properties); + }; + + /** + * Encodes the specified ListCollectorsResponse message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse} message ListCollectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collectors != null && message.collectors.length) + for (var i = 0; i < message.collectors.length; ++i) + $root.google.cloud.rapidmigrationassessment.v1.Collector.encode(message.collectors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCollectorsResponse message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse} message ListCollectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCollectorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCollectorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} ListCollectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.collectors && message.collectors.length)) + message.collectors = []; + message.collectors.push($root.google.cloud.rapidmigrationassessment.v1.Collector.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCollectorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} ListCollectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCollectorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCollectorsResponse message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCollectorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collectors != null && message.hasOwnProperty("collectors")) { + if (!Array.isArray(message.collectors)) + return "collectors: array expected"; + for (var i = 0; i < message.collectors.length; ++i) { + var error = $root.google.cloud.rapidmigrationassessment.v1.Collector.verify(message.collectors[i]); + if (error) + return "collectors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCollectorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} ListCollectorsResponse + */ + ListCollectorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse(); + if (object.collectors) { + if (!Array.isArray(object.collectors)) + throw TypeError(".google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.collectors: array expected"); + message.collectors = []; + for (var i = 0; i < object.collectors.length; ++i) { + if (typeof object.collectors[i] !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.collectors: object expected"); + message.collectors[i] = $root.google.cloud.rapidmigrationassessment.v1.Collector.fromObject(object.collectors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCollectorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} message ListCollectorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCollectorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.collectors && message.collectors.length) { + object.collectors = []; + for (var j = 0; j < message.collectors.length; ++j) + object.collectors[j] = $root.google.cloud.rapidmigrationassessment.v1.Collector.toObject(message.collectors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCollectorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCollectorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCollectorsResponse + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCollectorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse"; + }; + + return ListCollectorsResponse; + })(); + + v1.GetCollectorRequest = (function() { + + /** + * Properties of a GetCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IGetCollectorRequest + * @property {string|null} [name] GetCollectorRequest name + */ + + /** + * Constructs a new GetCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a GetCollectorRequest. + * @implements IGetCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest=} [properties] Properties to set + */ + function GetCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCollectorRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @instance + */ + GetCollectorRequest.prototype.name = ""; + + /** + * Creates a new GetCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} GetCollectorRequest instance + */ + GetCollectorRequest.create = function create(properties) { + return new GetCollectorRequest(properties); + }; + + /** + * Encodes the specified GetCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest} message GetCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCollectorRequest.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 GetCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest} message GetCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} GetCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest(); + 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 GetCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} GetCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCollectorRequest.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 GetCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} GetCollectorRequest + */ + GetCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} message GetCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCollectorRequest.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 GetCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + GetCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.GetCollectorRequest"; + }; + + return GetCollectorRequest; + })(); + + v1.DeleteCollectorRequest = (function() { + + /** + * Properties of a DeleteCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IDeleteCollectorRequest + * @property {string|null} [name] DeleteCollectorRequest name + * @property {string|null} [requestId] DeleteCollectorRequest requestId + */ + + /** + * Constructs a new DeleteCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a DeleteCollectorRequest. + * @implements IDeleteCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest=} [properties] Properties to set + */ + function DeleteCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCollectorRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @instance + */ + DeleteCollectorRequest.prototype.name = ""; + + /** + * DeleteCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @instance + */ + DeleteCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} DeleteCollectorRequest instance + */ + DeleteCollectorRequest.create = function create(properties) { + return new DeleteCollectorRequest(properties); + }; + + /** + * Encodes the specified DeleteCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest} message DeleteCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCollectorRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest} message DeleteCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} DeleteCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} DeleteCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCollectorRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} DeleteCollectorRequest + */ + DeleteCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} message DeleteCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest"; + }; + + return DeleteCollectorRequest; + })(); + + v1.UpdateCollectorRequest = (function() { + + /** + * Properties of an UpdateCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IUpdateCollectorRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCollectorRequest updateMask + * @property {google.cloud.rapidmigrationassessment.v1.ICollector|null} [collector] UpdateCollectorRequest collector + * @property {string|null} [requestId] UpdateCollectorRequest requestId + */ + + /** + * Constructs a new UpdateCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents an UpdateCollectorRequest. + * @implements IUpdateCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest=} [properties] Properties to set + */ + function UpdateCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCollectorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @instance + */ + UpdateCollectorRequest.prototype.updateMask = null; + + /** + * UpdateCollectorRequest collector. + * @member {google.cloud.rapidmigrationassessment.v1.ICollector|null|undefined} collector + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @instance + */ + UpdateCollectorRequest.prototype.collector = null; + + /** + * UpdateCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @instance + */ + UpdateCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} UpdateCollectorRequest instance + */ + UpdateCollectorRequest.create = function create(properties) { + return new UpdateCollectorRequest(properties); + }; + + /** + * Encodes the specified UpdateCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest} message UpdateCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCollectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.collector != null && Object.hasOwnProperty.call(message, "collector")) + $root.google.cloud.rapidmigrationassessment.v1.Collector.encode(message.collector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest} message UpdateCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} UpdateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} UpdateCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCollectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.collector != null && message.hasOwnProperty("collector")) { + var error = $root.google.cloud.rapidmigrationassessment.v1.Collector.verify(message.collector); + if (error) + return "collector." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} UpdateCollectorRequest + */ + UpdateCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.collector != null) { + if (typeof object.collector !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.collector: object expected"); + message.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.fromObject(object.collector); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} message UpdateCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.collector = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.collector != null && message.hasOwnProperty("collector")) + object.collector = $root.google.cloud.rapidmigrationassessment.v1.Collector.toObject(message.collector, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest"; + }; + + return UpdateCollectorRequest; + })(); + + v1.ResumeCollectorRequest = (function() { + + /** + * Properties of a ResumeCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IResumeCollectorRequest + * @property {string|null} [name] ResumeCollectorRequest name + * @property {string|null} [requestId] ResumeCollectorRequest requestId + */ + + /** + * Constructs a new ResumeCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a ResumeCollectorRequest. + * @implements IResumeCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest=} [properties] Properties to set + */ + function ResumeCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeCollectorRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @instance + */ + ResumeCollectorRequest.prototype.name = ""; + + /** + * ResumeCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @instance + */ + ResumeCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new ResumeCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} ResumeCollectorRequest instance + */ + ResumeCollectorRequest.create = function create(properties) { + return new ResumeCollectorRequest(properties); + }; + + /** + * Encodes the specified ResumeCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest} message ResumeCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeCollectorRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResumeCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest} message ResumeCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} ResumeCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResumeCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} ResumeCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeCollectorRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResumeCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} ResumeCollectorRequest + */ + ResumeCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResumeCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} message ResumeCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResumeCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest"; + }; + + return ResumeCollectorRequest; + })(); + + v1.RegisterCollectorRequest = (function() { + + /** + * Properties of a RegisterCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IRegisterCollectorRequest + * @property {string|null} [name] RegisterCollectorRequest name + * @property {string|null} [requestId] RegisterCollectorRequest requestId + */ + + /** + * Constructs a new RegisterCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a RegisterCollectorRequest. + * @implements IRegisterCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest=} [properties] Properties to set + */ + function RegisterCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegisterCollectorRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @instance + */ + RegisterCollectorRequest.prototype.name = ""; + + /** + * RegisterCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @instance + */ + RegisterCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new RegisterCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} RegisterCollectorRequest instance + */ + RegisterCollectorRequest.create = function create(properties) { + return new RegisterCollectorRequest(properties); + }; + + /** + * Encodes the specified RegisterCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest} message RegisterCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterCollectorRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RegisterCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest} message RegisterCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegisterCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} RegisterCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegisterCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} RegisterCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegisterCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegisterCollectorRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RegisterCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} RegisterCollectorRequest + */ + RegisterCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RegisterCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} message RegisterCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegisterCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RegisterCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + RegisterCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegisterCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegisterCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest"; + }; + + return RegisterCollectorRequest; + })(); + + v1.PauseCollectorRequest = (function() { + + /** + * Properties of a PauseCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IPauseCollectorRequest + * @property {string|null} [name] PauseCollectorRequest name + * @property {string|null} [requestId] PauseCollectorRequest requestId + */ + + /** + * Constructs a new PauseCollectorRequest. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents a PauseCollectorRequest. + * @implements IPauseCollectorRequest + * @constructor + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest=} [properties] Properties to set + */ + function PauseCollectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseCollectorRequest name. + * @member {string} name + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @instance + */ + PauseCollectorRequest.prototype.name = ""; + + /** + * PauseCollectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @instance + */ + PauseCollectorRequest.prototype.requestId = ""; + + /** + * Creates a new PauseCollectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} PauseCollectorRequest instance + */ + PauseCollectorRequest.create = function create(properties) { + return new PauseCollectorRequest(properties); + }; + + /** + * Encodes the specified PauseCollectorRequest message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest} message PauseCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseCollectorRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified PauseCollectorRequest message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest} message PauseCollectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseCollectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseCollectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} PauseCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseCollectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PauseCollectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} PauseCollectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseCollectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseCollectorRequest message. + * @function verify + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseCollectorRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a PauseCollectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} PauseCollectorRequest + */ + PauseCollectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PauseCollectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} message PauseCollectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseCollectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this PauseCollectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @instance + * @returns {Object.} JSON object + */ + PauseCollectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseCollectorRequest + * @function getTypeUrl + * @memberof google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseCollectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest"; + }; + + return PauseCollectorRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.rapidmigrationassessment.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.rapidmigrationassessment.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {google.cloud.rapidmigrationassessment.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.rapidmigrationassessment.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.rapidmigrationassessment.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.rapidmigrationassessment.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.rapidmigrationassessment.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.rapidmigrationassessment.v1.OperationMetadata + * @static + * @param {google.cloud.rapidmigrationassessment.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.rapidmigrationassessment.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.rapidmigrationassessment.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.rapidmigrationassessment.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + return rapidmigrationassessment; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 {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 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.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 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.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.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[".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.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; + })(); + + 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 {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.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.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.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + 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-rapidmigrationassessment/protos/protos.json b/packages/google-cloud-rapidmigrationassessment/protos/protos.json new file mode 100644 index 000000000000..7bc32b79ef68 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/protos/protos.json @@ -0,0 +1,2169 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "rapidmigrationassessment": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.RapidMigrationAssessment.V1", + "go_package": "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb", + "java_multiple_files": true, + "java_outer_classname": "RapidMigrationAssessmentProto", + "java_package": "com.google.cloud.rapidmigrationassessment.v1", + "php_namespace": "Google\\Cloud\\RapidMigrationAssessment\\V1", + "ruby_package": "Google::Cloud::RapidMigrationAssessment::V1" + }, + "nested": { + "GuestOsScan": { + "fields": { + "coreSource": { + "type": "string", + "id": 1 + } + } + }, + "VSphereScan": { + "fields": { + "coreSource": { + "type": "string", + "id": 1 + } + } + }, + "Collector": { + "options": { + "(google.api.resource).type": "rapidmigrationassessment.googleapis.com/Collector", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/collectors/{collector}" + }, + "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" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "serviceAccount": { + "type": "string", + "id": 7 + }, + "bucket": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expectedAssetCount": { + "type": "int64", + "id": 9 + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientVersion": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "guestOsScan": { + "type": "GuestOsScan", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vsphereScan": { + "type": "VSphereScan", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "collectionDays": { + "type": "int32", + "id": 14 + }, + "eulaUri": { + "type": "string", + "id": 15 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STATE_INITIALIZING": 1, + "STATE_READY_TO_USE": 2, + "STATE_REGISTERED": 3, + "STATE_ACTIVE": 4, + "STATE_PAUSED": 5, + "STATE_DELETING": 6, + "STATE_DECOMMISSIONED": 7, + "STATE_ERROR": 8 + } + } + } + }, + "Annotation": { + "options": { + "(google.api.resource).type": "rapidmigrationassessment.googleapis.com/Annotation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/annotations/{annotation}" + }, + "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" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TYPE_LEGACY_EXPORT_CONSENT": 1, + "TYPE_QWIKLAB": 2 + } + } + } + }, + "RapidMigrationAssessment": { + "options": { + "(google.api.default_host)": "rapidmigrationassessment.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateCollector": { + "requestType": "CreateCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/collectors", + "(google.api.http).body": "collector", + "(google.api.method_signature)": "parent,collector,collector_id", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/collectors", + "body": "collector" + } + }, + { + "(google.api.method_signature)": "parent,collector,collector_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateAnnotation": { + "requestType": "CreateAnnotationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/annotations", + "(google.api.http).body": "annotation", + "(google.api.method_signature)": "parent,annotation", + "(google.longrunning.operation_info).response_type": "google.cloud.rapidmigrationassessment.v1.Annotation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/annotations", + "body": "annotation" + } + }, + { + "(google.api.method_signature)": "parent,annotation" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.rapidmigrationassessment.v1.Annotation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetAnnotation": { + "requestType": "GetAnnotationRequest", + "responseType": "Annotation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/annotations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/annotations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCollectors": { + "requestType": "ListCollectorsRequest", + "responseType": "ListCollectorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/collectors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/collectors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCollector": { + "requestType": "GetCollectorRequest", + "responseType": "Collector", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/collectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/collectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCollector": { + "requestType": "UpdateCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{collector.name=projects/*/locations/*/collectors/*}", + "(google.api.http).body": "collector", + "(google.api.method_signature)": "collector,update_mask", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{collector.name=projects/*/locations/*/collectors/*}", + "body": "collector" + } + }, + { + "(google.api.method_signature)": "collector,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCollector": { + "requestType": "DeleteCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/collectors/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/collectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ResumeCollector": { + "requestType": "ResumeCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/collectors/*}:resume", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/collectors/*}:resume", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RegisterCollector": { + "requestType": "RegisterCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/collectors/*}:register", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/collectors/*}:register", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PauseCollector": { + "requestType": "PauseCollectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/collectors/*}:pause", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Collector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/collectors/*}:pause", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Collector", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "CreateAnnotationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "annotation": { + "type": "Annotation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetAnnotationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Annotation" + } + } + } + }, + "CreateCollectorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "collectorId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "collector": { + "type": "Collector", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCollectorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListCollectorsResponse": { + "fields": { + "collectors": { + "rule": "repeated", + "type": "Collector", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCollectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Collector" + } + } + } + }, + "DeleteCollectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Collector" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateCollectorRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "collector": { + "type": "Collector", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResumeCollectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Collector" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RegisterCollectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Collector" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PauseCollectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "rapidmigrationassessment.googleapis.com/Collector" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "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-rapidmigrationassessment/samples/README.md b/packages/google-cloud-rapidmigrationassessment/samples/README.md new file mode 100644 index 000000000000..ff0d3fce0aec --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/README.md @@ -0,0 +1,230 @@ +[//]: # "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 + +# [Rapid Migration Assessment 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) + * [Rapid_migration_assessment.create_annotation](#rapid_migration_assessment.create_annotation) + * [Rapid_migration_assessment.create_collector](#rapid_migration_assessment.create_collector) + * [Rapid_migration_assessment.delete_collector](#rapid_migration_assessment.delete_collector) + * [Rapid_migration_assessment.get_annotation](#rapid_migration_assessment.get_annotation) + * [Rapid_migration_assessment.get_collector](#rapid_migration_assessment.get_collector) + * [Rapid_migration_assessment.list_collectors](#rapid_migration_assessment.list_collectors) + * [Rapid_migration_assessment.pause_collector](#rapid_migration_assessment.pause_collector) + * [Rapid_migration_assessment.register_collector](#rapid_migration_assessment.register_collector) + * [Rapid_migration_assessment.resume_collector](#rapid_migration_assessment.resume_collector) + * [Rapid_migration_assessment.update_collector](#rapid_migration_assessment.update_collector) + * [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 + + + +### Rapid_migration_assessment.create_annotation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js` + + +----- + + + + +### Rapid_migration_assessment.create_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js` + + +----- + + + + +### Rapid_migration_assessment.delete_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js` + + +----- + + + + +### Rapid_migration_assessment.get_annotation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js` + + +----- + + + + +### Rapid_migration_assessment.get_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js` + + +----- + + + + +### Rapid_migration_assessment.list_collectors + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js` + + +----- + + + + +### Rapid_migration_assessment.pause_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js` + + +----- + + + + +### Rapid_migration_assessment.register_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js` + + +----- + + + + +### Rapid_migration_assessment.resume_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js` + + +----- + + + + +### Rapid_migration_assessment.update_collector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js). + +[![Open in Cloud 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-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-rapidmigrationassessment/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/migration-center/docs diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js new file mode 100644 index 000000000000..8c36b454cac5 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_annotation.js @@ -0,0 +1,71 @@ +// 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, annotation) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_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. Name of the parent (project+location). + */ + // const parent = 'abc123' + /** + * Required. The resource being created. + */ + // const annotation = {} + /** + * Optional. An optional request ID to identify requests. + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callCreateAnnotation() { + // Construct request + const request = { + parent, + annotation, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.createAnnotation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAnnotation(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.js new file mode 100644 index 000000000000..17da48ec980f --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.create_collector.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, collectorId, collector) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_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. Name of the parent (project+location). + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const collectorId = 'abc123' + /** + * Required. The resource being created. + */ + // const collector = {} + /** + * Optional. An optional request ID to identify requests. + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callCreateCollector() { + // Construct request + const request = { + parent, + collectorId, + collector, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.createCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.js new file mode 100644 index 000000000000..c7504e2980b1 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.delete_collector.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(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_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. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callDeleteCollector() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.deleteCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js new file mode 100644 index 000000000000..44abe3640317 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_annotation.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_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. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callGetAnnotation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await rapidmigrationassessmentClient.getAnnotation(request); + console.log(response); + } + + callGetAnnotation(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js new file mode 100644 index 000000000000..a4948a4a784a --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.get_collector.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_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. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callGetCollector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await rapidmigrationassessmentClient.getCollector(request); + console.log(response); + } + + callGetCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js new file mode 100644 index 000000000000..106c18dadfab --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.list_collectors.js @@ -0,0 +1,80 @@ +// 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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_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 value for ListCollectorsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callListCollectors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await rapidmigrationassessmentClient.listCollectorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCollectors(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.js new file mode 100644 index 000000000000..3035bbf36548 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.pause_collector.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(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_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. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callPauseCollector() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.pauseCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPauseCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.js new file mode 100644 index 000000000000..87b3025700bb --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.register_collector.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(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_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. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callRegisterCollector() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.registerCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRegisterCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.js new file mode 100644 index 000000000000..d8610ae25a96 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.resume_collector.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(name) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_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. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callResumeCollector() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.resumeCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResumeCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js new file mode 100644 index 000000000000..0f957714578e --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/rapid_migration_assessment.update_collector.js @@ -0,0 +1,85 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, collector) { + // [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_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. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const collector = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidmigrationassessmentClient = new RapidMigrationAssessmentClient(); + + async function callUpdateCollector() { + // Construct request + const request = { + updateMask, + collector, + }; + + // Run request + const [operation] = await rapidmigrationassessmentClient.updateCollector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCollector(); + // [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json new file mode 100644 index 000000000000..8a5f913fcc34 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json @@ -0,0 +1,475 @@ +{ + "clientLibrary": { + "name": "nodejs-rapidmigrationassessment", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.rapidmigrationassessment.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async", + "title": "RapidMigrationAssessment createCollector Sample", + "origin": "API_DEFINITION", + "description": " Create a Collector to manage the on-prem appliance which collects information about Customer assets.", + "canonical": true, + "file": "rapid_migration_assessment.create_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollector", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "collector_id", + "type": "TYPE_STRING" + }, + { + "name": "collector", + "type": ".google.cloud.rapidmigrationassessment.v1.Collector" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "CreateCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async", + "title": "RapidMigrationAssessment createAnnotation Sample", + "origin": "API_DEFINITION", + "description": " Creates an Annotation", + "canonical": true, + "file": "rapid_migration_assessment.create_annotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAnnotation", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "annotation", + "type": ".google.cloud.rapidmigrationassessment.v1.Annotation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "CreateAnnotation", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotation", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_async", + "title": "RapidMigrationAssessment getAnnotation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Annotation.", + "canonical": true, + "file": "rapid_migration_assessment.get_annotation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotation", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.rapidmigrationassessment.v1.Annotation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "GetAnnotation", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotation", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_async", + "title": "RapidMigrationAssessment listCollectors Sample", + "origin": "API_DEFINITION", + "description": " Lists Collectors in a given project and location.", + "canonical": true, + "file": "rapid_migration_assessment.list_collectors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCollectors", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectors", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "ListCollectors", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectors", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_async", + "title": "RapidMigrationAssessment getCollector Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Collector.", + "canonical": true, + "file": "rapid_migration_assessment.get_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.rapidmigrationassessment.v1.Collector", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "GetCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async", + "title": "RapidMigrationAssessment updateCollector Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Collector.", + "canonical": true, + "file": "rapid_migration_assessment.update_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollector", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "collector", + "type": ".google.cloud.rapidmigrationassessment.v1.Collector" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "UpdateCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async", + "title": "RapidMigrationAssessment deleteCollector Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Collector - changes state of collector to \"Deleting\".", + "canonical": true, + "file": "rapid_migration_assessment.delete_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "DeleteCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async", + "title": "RapidMigrationAssessment resumeCollector Sample", + "origin": "API_DEFINITION", + "description": " Resumes the given collector.", + "canonical": true, + "file": "rapid_migration_assessment.resume_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "ResumeCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async", + "title": "RapidMigrationAssessment registerCollector Sample", + "origin": "API_DEFINITION", + "description": " Registers the given collector.", + "canonical": true, + "file": "rapid_migration_assessment.register_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RegisterCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "RegisterCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + }, + { + "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async", + "title": "RapidMigrationAssessment pauseCollector Sample", + "origin": "API_DEFINITION", + "description": " Pauses the given collector.", + "canonical": true, + "file": "rapid_migration_assessment.pause_collector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RapidMigrationAssessmentClient", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient" + }, + "method": { + "shortName": "PauseCollector", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollector", + "service": { + "shortName": "RapidMigrationAssessment", + "fullName": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-rapidmigrationassessment/samples/package.json b/packages/google-cloud-rapidmigrationassessment/samples/package.json new file mode 100644 index 000000000000..5bfa9df95d89 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "rapidmigrationassessment-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/rapidmigrationassessment": "0.0.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-rapidmigrationassessment/samples/quickstart.js b/packages/google-cloud-rapidmigrationassessment/samples/quickstart.js new file mode 100644 index 000000000000..6abe5d90d116 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/quickstart.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main() { + // [START rapidmigrationassessment_quickstart] + + // Imports the Rapidmigrationassessment library + const {RapidMigrationAssessmentClient} = + require('@google-cloud/rapidmigrationassessment').v1; + + // Instantiates a client + const rapidMigrationAssessmentClient = new RapidMigrationAssessmentClient(); + + async function quickstart() { + const project = await rapidMigrationAssessmentClient.getProjectId(); + + // List supported locations + const locationsIterable = + await rapidMigrationAssessmentClient.listLocationsAsync({ + name: `projects/${project}`, + }); + + const locations = []; + for await (const response of locationsIterable) { + console.log(`Supported location: ${response.name}`); + locations.push(response.name); + } + + for (const location of locations) { + // Construct request + const request = { + parent: location, + }; + + // Run request + const iterable = await rapidMigrationAssessmentClient.listCollectorsAsync( + request + ); + console.log(`Listing collectors for location ${location}:`); + let count = 0; + for await (const response of iterable) { + console.log(response); + ++count; + } + console.log(`${count} collectors found.`); + } + } + + quickstart(); + // [END rapidmigrationassessment_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-rapidmigrationassessment/samples/test/quickstart.js b/packages/google-cloud-rapidmigrationassessment/samples/test/quickstart.js new file mode 100644 index 000000000000..156ef257cc83 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/samples/test/quickstart.js @@ -0,0 +1,31 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const output = execSync('node ./quickstart.js', {cwd}); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-rapidmigrationassessment/src/index.ts b/packages/google-cloud-rapidmigrationassessment/src/index.ts new file mode 100644 index 000000000000..bf1c9234f604 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const RapidMigrationAssessmentClient = v1.RapidMigrationAssessmentClient; +type RapidMigrationAssessmentClient = v1.RapidMigrationAssessmentClient; + +export {v1, RapidMigrationAssessmentClient}; +export default {v1, RapidMigrationAssessmentClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/gapic_metadata.json b/packages/google-cloud-rapidmigrationassessment/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..556ad365abb0 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/gapic_metadata.json @@ -0,0 +1,127 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.rapidmigrationassessment.v1", + "libraryPackage": "@google-cloud/rapidmigrationassessment", + "services": { + "RapidMigrationAssessment": { + "clients": { + "grpc": { + "libraryClient": "RapidMigrationAssessmentClient", + "rpcs": { + "GetAnnotation": { + "methods": [ + "getAnnotation" + ] + }, + "GetCollector": { + "methods": [ + "getCollector" + ] + }, + "CreateCollector": { + "methods": [ + "createCollector" + ] + }, + "CreateAnnotation": { + "methods": [ + "createAnnotation" + ] + }, + "UpdateCollector": { + "methods": [ + "updateCollector" + ] + }, + "DeleteCollector": { + "methods": [ + "deleteCollector" + ] + }, + "ResumeCollector": { + "methods": [ + "resumeCollector" + ] + }, + "RegisterCollector": { + "methods": [ + "registerCollector" + ] + }, + "PauseCollector": { + "methods": [ + "pauseCollector" + ] + }, + "ListCollectors": { + "methods": [ + "listCollectors", + "listCollectorsStream", + "listCollectorsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RapidMigrationAssessmentClient", + "rpcs": { + "GetAnnotation": { + "methods": [ + "getAnnotation" + ] + }, + "GetCollector": { + "methods": [ + "getCollector" + ] + }, + "CreateCollector": { + "methods": [ + "createCollector" + ] + }, + "CreateAnnotation": { + "methods": [ + "createAnnotation" + ] + }, + "UpdateCollector": { + "methods": [ + "updateCollector" + ] + }, + "DeleteCollector": { + "methods": [ + "deleteCollector" + ] + }, + "ResumeCollector": { + "methods": [ + "resumeCollector" + ] + }, + "RegisterCollector": { + "methods": [ + "registerCollector" + ] + }, + "PauseCollector": { + "methods": [ + "pauseCollector" + ] + }, + "ListCollectors": { + "methods": [ + "listCollectors", + "listCollectorsStream", + "listCollectorsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/index.ts b/packages/google-cloud-rapidmigrationassessment/src/v1/index.ts new file mode 100644 index 000000000000..25827d9bbd93 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {RapidMigrationAssessmentClient} from './rapid_migration_assessment_client'; diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts new file mode 100644 index 000000000000..c7b9bf8e0cc5 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts @@ -0,0 +1,2351 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + 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/rapid_migration_assessment_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './rapid_migration_assessment_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Rapid Migration Assessment service + * @class + * @memberof v1 + */ +export class RapidMigrationAssessmentClient { + 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}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + rapidMigrationAssessmentStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RapidMigrationAssessmentClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @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 RapidMigrationAssessmentClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof RapidMigrationAssessmentClient; + 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.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 if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/annotations/{annotation}' + ), + collectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collectors/{collector}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listCollectors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'collectors' + ), + }; + + 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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const createCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createAnnotationResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Annotation' + ) as gax.protobuf.Type; + const createAnnotationMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const updateCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const deleteCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const resumeCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const resumeCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const registerCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const registerCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + const pauseCollectorResponse = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.Collector' + ) as gax.protobuf.Type; + const pauseCollectorMetadata = protoFilesRoot.lookup( + '.google.cloud.rapidmigrationassessment.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCollectorResponse.decode.bind(createCollectorResponse), + createCollectorMetadata.decode.bind(createCollectorMetadata) + ), + createAnnotation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAnnotationResponse.decode.bind(createAnnotationResponse), + createAnnotationMetadata.decode.bind(createAnnotationMetadata) + ), + updateCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCollectorResponse.decode.bind(updateCollectorResponse), + updateCollectorMetadata.decode.bind(updateCollectorMetadata) + ), + deleteCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCollectorResponse.decode.bind(deleteCollectorResponse), + deleteCollectorMetadata.decode.bind(deleteCollectorMetadata) + ), + resumeCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resumeCollectorResponse.decode.bind(resumeCollectorResponse), + resumeCollectorMetadata.decode.bind(resumeCollectorMetadata) + ), + registerCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + registerCollectorResponse.decode.bind(registerCollectorResponse), + registerCollectorMetadata.decode.bind(registerCollectorMetadata) + ), + pauseCollector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + pauseCollectorResponse.decode.bind(pauseCollectorResponse), + pauseCollectorMetadata.decode.bind(pauseCollectorMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment', + 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.rapidMigrationAssessmentStub) { + return this.rapidMigrationAssessmentStub; + } + + // Put together the "service stub" for + // google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment. + this.rapidMigrationAssessmentStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.rapidmigrationassessment.v1 + .RapidMigrationAssessment, + 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 rapidMigrationAssessmentStubMethods = [ + 'createCollector', + 'createAnnotation', + 'getAnnotation', + 'listCollectors', + 'getCollector', + 'updateCollector', + 'deleteCollector', + 'resumeCollector', + 'registerCollector', + 'pauseCollector', + ]; + for (const methodName of rapidMigrationAssessmentStubMethods) { + const callPromise = this.rapidMigrationAssessmentStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.rapidMigrationAssessmentStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'rapidmigrationassessment.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 'rapidmigrationassessment.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 Annotation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.rapidmigrationassessment.v1.Annotation | Annotation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.get_annotation.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_async + */ + getAnnotation( + request?: protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + ( + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | undefined + ), + {} | undefined + ] + >; + getAnnotation( + request: protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotation( + request: protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, + callback: Callback< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotation( + request?: protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + ( + | protos.google.cloud.rapidmigrationassessment.v1.IGetAnnotationRequest + | 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.getAnnotation(request, options, callback); + } + /** + * Gets details of a single Collector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.rapidmigrationassessment.v1.Collector | Collector}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.get_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_async + */ + getCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + ( + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | undefined + ), + {} | undefined + ] + >; + getCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, + callback: Callback< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + ( + | protos.google.cloud.rapidmigrationassessment.v1.IGetCollectorRequest + | 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.getCollector(request, options, callback); + } + + /** + * Create a Collector to manage the on-prem appliance which collects + * information about Customer assets. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent (project+location). + * @param {string} request.collectorId + * Required. Id of the requesting object. + * @param {google.cloud.rapidmigrationassessment.v1.Collector} request.collector + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.create_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async + */ + createCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.ICreateCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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.createCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.create_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async + */ + async checkCreateCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.createCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Creates an Annotation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the parent (project+location). + * @param {google.cloud.rapidmigrationassessment.v1.Annotation} request.annotation + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.create_annotation.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async + */ + createAnnotation( + request?: protos.google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createAnnotation( + request: protos.google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAnnotation( + request: protos.google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAnnotation( + request?: protos.google.cloud.rapidmigrationassessment.v1.ICreateAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.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.createAnnotation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createAnnotation()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.create_annotation.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async + */ + async checkCreateAnnotationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Annotation, + protos.google.cloud.rapidmigrationassessment.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.createAnnotation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Annotation, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Collector. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.rapidmigrationassessment.v1.Collector} request.collector + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.update_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async + */ + updateCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IUpdateCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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({ + 'collector.name': request.collector!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.update_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async + */ + async checkUpdateCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.updateCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.delete_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async + */ + deleteCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IDeleteCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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.deleteCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.delete_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async + */ + async checkDeleteCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.deleteCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Resumes the given collector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.resume_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async + */ + resumeCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resumeCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IResumeCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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.resumeCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `resumeCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.resume_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async + */ + async checkResumeCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.resumeCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Registers the given collector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.register_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async + */ + registerCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + registerCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + registerCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + registerCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IRegisterCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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.registerCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `registerCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.register_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async + */ + async checkRegisterCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.registerCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Pauses the given collector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.pause_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async + */ + pauseCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + pauseCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + pauseCollector( + request: protos.google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + pauseCollector( + request?: protos.google.cloud.rapidmigrationassessment.v1.IPauseCollectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.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.pauseCollector(request, options, callback); + } + /** + * Check the status of the long running operation returned by `pauseCollector()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.pause_collector.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async + */ + async checkPauseCollectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.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.pauseCollector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.Collector, + protos.google.cloud.rapidmigrationassessment.v1.OperationMetadata + >; + } + /** + * Lists Collectors in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListCollectorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.rapidmigrationassessment.v1.Collector | Collector}. + * 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 `listCollectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCollectors( + request?: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.ICollector[], + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest | null, + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + ] + >; + listCollectors( + request: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + | protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + | null + | undefined, + protos.google.cloud.rapidmigrationassessment.v1.ICollector + > + ): void; + listCollectors( + request: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + callback: PaginationCallback< + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + | protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + | null + | undefined, + protos.google.cloud.rapidmigrationassessment.v1.ICollector + > + ): void; + listCollectors( + request?: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + | protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + | null + | undefined, + protos.google.cloud.rapidmigrationassessment.v1.ICollector + >, + callback?: PaginationCallback< + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + | protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + | null + | undefined, + protos.google.cloud.rapidmigrationassessment.v1.ICollector + > + ): Promise< + [ + protos.google.cloud.rapidmigrationassessment.v1.ICollector[], + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest | null, + protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listCollectors(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListCollectorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.rapidmigrationassessment.v1.Collector | Collector} 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 `listCollectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCollectorsStream( + request?: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + 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['listCollectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCollectors.createStream( + this.innerApiCalls.listCollectors as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCollectors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListCollectorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.rapidmigrationassessment.v1.Collector | Collector}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/rapid_migration_assessment.list_collectors.js + * region_tag:rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_async + */ + listCollectorsAsync( + request?: protos.google.cloud.rapidmigrationassessment.v1.IListCollectorsRequest, + 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['listCollectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCollectors.asyncIterate( + this.innerApiCalls['listCollectors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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 annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project: string, location: string, annotation: string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified collector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collector + * @returns {string} Resource name string. + */ + collectorPath(project: string, location: string, collector: string) { + return this.pathTemplates.collectorPathTemplate.render({ + project: project, + location: location, + collector: collector, + }); + } + + /** + * Parse the project from Collector resource. + * + * @param {string} collectorName + * A fully-qualified path representing Collector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCollectorName(collectorName: string) { + return this.pathTemplates.collectorPathTemplate.match(collectorName) + .project; + } + + /** + * Parse the location from Collector resource. + * + * @param {string} collectorName + * A fully-qualified path representing Collector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCollectorName(collectorName: string) { + return this.pathTemplates.collectorPathTemplate.match(collectorName) + .location; + } + + /** + * Parse the collector from Collector resource. + * + * @param {string} collectorName + * A fully-qualified path representing Collector resource. + * @returns {string} A string representing the collector. + */ + matchCollectorFromCollectorName(collectorName: string) { + return this.pathTemplates.collectorPathTemplate.match(collectorName) + .collector; + } + + /** + * 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; + } + + /** + * 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.rapidMigrationAssessmentStub && !this._terminated) { + return this.rapidMigrationAssessmentStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client_config.json b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client_config.json new file mode 100644 index 000000000000..83e4b3b1c8bd --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAnnotation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCollectors": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCollector": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RegisterCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseCollector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_proto_list.json b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_proto_list.json new file mode 100644 index 000000000000..6c93aa0c5bdf --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/rapidmigrationassessment/v1/api_entities.proto", + "../../protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto" +] diff --git a/packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.js b/packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..1d20b1da658a --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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 rapidmigrationassessment = require('@google-cloud/rapidmigrationassessment'); + +function main() { + const rapidMigrationAssessmentClient = + new rapidmigrationassessment.RapidMigrationAssessmentClient(); +} + +main(); diff --git a/packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..0dddbea7e170 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// 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 {RapidMigrationAssessmentClient} from '@google-cloud/rapidmigrationassessment'; + +// check that the client class type name can be used +function doStuffWithRapidMigrationAssessmentClient( + client: RapidMigrationAssessmentClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const rapidMigrationAssessmentClient = new RapidMigrationAssessmentClient(); + doStuffWithRapidMigrationAssessmentClient(rapidMigrationAssessmentClient); +} + +main(); diff --git a/packages/google-cloud-rapidmigrationassessment/system-test/install.ts b/packages/google-cloud-rapidmigrationassessment/system-test/install.ts new file mode 100644 index 000000000000..f61fe236476b --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/test/gapic_rapid_migration_assessment_v1.ts b/packages/google-cloud-rapidmigrationassessment/test/gapic_rapid_migration_assessment_v1.ts new file mode 100644 index 000000000000..56c312e4dd3a --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/test/gapic_rapid_migration_assessment_v1.ts @@ -0,0 +1,2991 @@ +// 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 rapidmigrationassessmentModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function 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.RapidMigrationAssessmentClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.rapidMigrationAssessmentStub, undefined); + await client.initialize(); + assert(client.rapidMigrationAssessmentStub); + }); + + it('has close method for the initialized client', done => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.rapidMigrationAssessmentStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.rapidMigrationAssessmentStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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('getAnnotation', () => { + it('invokes getAnnotation without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Annotation() + ); + client.innerApiCalls.getAnnotation = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Annotation() + ); + client.innerApiCalls.getAnnotation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.rapidmigrationassessment.v1.IAnnotation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation with closed client', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotation(request), expectedError); + }); + }); + + describe('getCollector', () => { + it('invokes getCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ); + client.innerApiCalls.getCollector = stubSimpleCall(expectedResponse); + const [response] = await client.getCollector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ); + client.innerApiCalls.getCollector = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCollector( + request, + ( + err?: Error | null, + result?: protos.google.cloud.rapidmigrationassessment.v1.ICollector | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCollector with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCollector = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCollector with closed client', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCollector(request), expectedError); + }); + }); + + describe('createCollector', () => { + it('invokes createCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkCreateCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkCreateCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createAnnotation', () => { + it('invokes createAnnotation without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnnotation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createAnnotation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnnotation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnnotation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.IAnnotation, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnnotation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnnotation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createAnnotation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAnnotationProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkCreateAnnotationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAnnotationProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkCreateAnnotationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCollector', () => { + it('invokes updateCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest() + ); + request.collector ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest', + ['collector', 'name'] + ); + request.collector.name = defaultValue1; + const expectedHeaderRequestParams = `collector.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest() + ); + request.collector ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest', + ['collector', 'name'] + ); + request.collector.name = defaultValue1; + const expectedHeaderRequestParams = `collector.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest() + ); + request.collector ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest', + ['collector', 'name'] + ); + request.collector.name = defaultValue1; + const expectedHeaderRequestParams = `collector.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest() + ); + request.collector ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest', + ['collector', 'name'] + ); + request.collector.name = defaultValue1; + const expectedHeaderRequestParams = `collector.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkUpdateCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkUpdateCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCollector', () => { + it('invokes deleteCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkDeleteCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkDeleteCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resumeCollector', () => { + it('invokes resumeCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resumeCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.resumeCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resumeCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResumeCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkResumeCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResumeCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkResumeCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('registerCollector', () => { + it('invokes registerCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.registerCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.registerCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.registerCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.registerCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.registerCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.registerCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.registerCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.registerCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRegisterCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkRegisterCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRegisterCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkRegisterCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('pauseCollector', () => { + it('invokes pauseCollector without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.pauseCollector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.pauseCollector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseCollector without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.pauseCollector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseCollector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.rapidmigrationassessment.v1.ICollector, + protos.google.cloud.rapidmigrationassessment.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseCollector with call error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseCollector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.pauseCollector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseCollector with LRO error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseCollector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.pauseCollector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseCollector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPauseCollectorProgress without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkPauseCollectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPauseCollectorProgress with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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.checkPauseCollectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCollectors', () => { + it('invokes listCollectors without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + ]; + client.innerApiCalls.listCollectors = stubSimpleCall(expectedResponse); + const [response] = await client.listCollectors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCollectors without error using callback', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + ]; + client.innerApiCalls.listCollectors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCollectors( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.rapidmigrationassessment.v1.ICollector[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCollectors with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCollectors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCollectors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCollectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCollectorsStream without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + ]; + client.descriptors.page.listCollectors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCollectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.rapidmigrationassessment.v1.Collector[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.rapidmigrationassessment.v1.Collector + ) => { + 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.listCollectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCollectors, request) + ); + assert( + (client.descriptors.page.listCollectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCollectorsStream with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCollectors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCollectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.rapidmigrationassessment.v1.Collector[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.rapidmigrationassessment.v1.Collector + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCollectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCollectors, request) + ); + assert( + (client.descriptors.page.listCollectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCollectors without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.Collector() + ), + ]; + client.descriptors.page.listCollectors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.rapidmigrationassessment.v1.ICollector[] = + []; + const iterable = client.listCollectorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCollectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCollectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCollectors with error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCollectors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCollectorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.rapidmigrationassessment.v1.ICollector[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCollectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCollectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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 rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + annotation: 'annotationValue', + }; + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('collector', () => { + const fakePath = '/rendered/path/collector'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collector: 'collectorValue', + }; + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.collectorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.collectorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('collectorPath', () => { + const result = client.collectorPath( + 'projectValue', + 'locationValue', + 'collectorValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.collectorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCollectorName', () => { + const result = client.matchProjectFromCollectorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.collectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCollectorName', () => { + const result = client.matchLocationFromCollectorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.collectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectorFromCollectorName', () => { + const result = client.matchCollectorFromCollectorName(fakePath); + assert.strictEqual(result, 'collectorValue'); + assert( + (client.pathTemplates.collectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new rapidmigrationassessmentModule.v1.RapidMigrationAssessmentClient({ + 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) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-rapidmigrationassessment/tsconfig.json b/packages/google-cloud-rapidmigrationassessment/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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-rapidmigrationassessment/webpack.config.js b/packages/google-cloud-rapidmigrationassessment/webpack.config.js new file mode 100644 index 000000000000..5fa69fb9e97a --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/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: 'RapidMigrationAssessment', + filename: './rapid-migration-assessment.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 7a4bd793f1d7..23f4e35cb946 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -141,7 +141,8 @@ "packages/google-ai-generativelanguage": {}, "packages/google-cloud-storageinsights": {}, "packages/google-cloud-support": {}, - "packages/google-maps-places": {} + "packages/google-maps-places": {}, + "packages/google-cloud-rapidmigrationassessment": {} }, "plugins": [ { From 342a28c3e06848325744e9d80a046ca1ed4dbc5f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:42:16 +0000 Subject: [PATCH 35/46] feat: [alloydb] Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY (#4336) - [ ] Regenerate this pull request now. feat: Added support for continuous backups feat: Added support for cross-region replication (secondary clusters/instances and promotion) feat: Added users API feat: Added fault injection API fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539728978 Source-Link: https://togithub.com/googleapis/googleapis/commit/cd897429336a508c2410ef810ed6380ec5a4c44a Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/87e91452dce13c3e176a2093065b3e38e2b0dc90 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6Ijg3ZTkxNDUyZGNlMTNjM2UxNzZhMjA5MzA2NWIzZTM4ZTJiMGRjOTAifQ== BEGIN_NESTED_COMMIT feat: [alloydb] Added ClusterView supporting more granular view of continuous backups feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added users API feat: Added fault injection API feat: Added instance update policy feat: Added cluster network config fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539728897 Source-Link: https://togithub.com/googleapis/googleapis/commit/3fcf0b3edb1b9444f330242c386277ae67de7121 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8001a897d463c95bbcf6e795dcc93c58180c0622 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjgwMDFhODk3ZDQ2M2M5NWJiY2Y2ZTc5NWRjYzkzYzU4MTgwYzA2MjIifQ== END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: [alloydb] Added ClusterView supporting more granular view of continuous backups feat: Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY feat: Added users API feat: Added fault injection API feat: Added instance update policy feat: Added cluster network config fix: Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA PiperOrigin-RevId: 539726243 Source-Link: https://togithub.com/googleapis/googleapis/commit/277df0ec41d2f78e21998b3241223e148f8b3eb1 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/e7ec1f4788e628c686dfe4b5096bd4894c0cc54c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6ImU3ZWMxZjQ3ODhlNjI4YzY4NmRmZTRiNTA5NmJkNDg5NGMwY2M1NGMifQ== END_NESTED_COMMIT --- packages/google-cloud-alloydb/README.md | 168 +- .../google/cloud/alloydb/v1/resources.proto | 175 +- .../google/cloud/alloydb/v1/service.proto | 417 +- .../cloud/alloydb/v1alpha/resources.proto | 173 +- .../cloud/alloydb/v1alpha/service.proto | 271 +- .../cloud/alloydb/v1beta/resources.proto | 173 +- .../google/cloud/alloydb/v1beta/service.proto | 271 +- .../google-cloud-alloydb/protos/protos.d.ts | 20378 +++-- .../google-cloud-alloydb/protos/protos.js | 75575 +++++++++------- .../google-cloud-alloydb/protos/protos.json | 1974 +- .../google-cloud-alloydb/samples/README.md | 376 +- .../v1/alloy_d_b_admin.create_cluster.js | 2 +- ...lloy_d_b_admin.create_secondary_cluster.js | 93 + ...loy_d_b_admin.create_secondary_instance.js | 93 + .../v1/alloy_d_b_admin.create_user.js | 90 + .../v1/alloy_d_b_admin.delete_user.js | 81 + .../v1/alloy_d_b_admin.get_cluster.js | 5 + .../generated/v1/alloy_d_b_admin.get_user.js | 62 + .../v1/alloy_d_b_admin.inject_fault.js | 88 + .../v1/alloy_d_b_admin.list_users.js | 80 + .../v1/alloy_d_b_admin.promote_cluster.js | 88 + .../v1/alloy_d_b_admin.restore_cluster.js | 5 + .../v1/alloy_d_b_admin.update_user.js | 92 + ...ppet_metadata.google.cloud.alloydb.v1.json | 486 +- .../v1alpha/alloy_d_b_admin.create_cluster.js | 2 +- ...lloy_d_b_admin.create_secondary_cluster.js | 4 +- .../v1alpha/alloy_d_b_admin.create_user.js | 90 + .../v1alpha/alloy_d_b_admin.delete_user.js | 81 + ...y_d_b_admin.generate_client_certificate.js | 4 + .../v1alpha/alloy_d_b_admin.get_cluster.js | 5 + .../v1alpha/alloy_d_b_admin.get_user.js | 62 + .../v1alpha/alloy_d_b_admin.inject_fault.js | 88 + .../v1alpha/alloy_d_b_admin.list_users.js | 80 + .../v1alpha/alloy_d_b_admin.update_user.js | 92 + ...metadata.google.cloud.alloydb.v1alpha.json | 322 +- .../v1beta/alloy_d_b_admin.create_cluster.js | 2 +- ...lloy_d_b_admin.create_secondary_cluster.js | 4 +- .../v1beta/alloy_d_b_admin.create_user.js | 90 + .../v1beta/alloy_d_b_admin.delete_user.js | 81 + ...y_d_b_admin.generate_client_certificate.js | 4 + .../v1beta/alloy_d_b_admin.get_cluster.js | 5 + .../v1beta/alloy_d_b_admin.get_user.js | 62 + .../v1beta/alloy_d_b_admin.inject_fault.js | 88 + .../v1beta/alloy_d_b_admin.list_users.js | 80 + .../v1beta/alloy_d_b_admin.update_user.js | 92 + ..._metadata.google.cloud.alloydb.v1beta.json | 322 +- .../src/v1/alloy_d_b_admin_client.ts | 1986 +- .../src/v1/alloy_d_b_admin_client_config.json | 45 + .../src/v1/gapic_metadata.json | 94 + .../src/v1alpha/alloy_d_b_admin_client.ts | 961 +- .../alloy_d_b_admin_client_config.json | 30 + .../src/v1alpha/gapic_metadata.json | 64 + .../src/v1beta/alloy_d_b_admin_client.ts | 959 +- .../v1beta/alloy_d_b_admin_client_config.json | 30 + .../src/v1beta/gapic_metadata.json | 64 + .../test/gapic_alloy_d_b_admin_v1.ts | 3778 +- .../test/gapic_alloy_d_b_admin_v1alpha.ts | 3439 +- .../test/gapic_alloy_d_b_admin_v1beta.ts | 3425 +- 58 files changed, 73261 insertions(+), 44490 deletions(-) create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js create mode 100644 packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js diff --git a/packages/google-cloud-alloydb/README.md b/packages/google-cloud-alloydb/README.md index ed0432d71d23..6dac32808a38 100644 --- a/packages/google-cloud-alloydb/README.md +++ b/packages/google-cloud-alloydb/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [AlloyDB API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [AlloyDB API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-alloydb) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/alloydb.svg)](https://www.npmjs.org/package/@google-cloud/alloydb) @@ -111,82 +111,102 @@ callListSupportedDatabaseFlags(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-alloydb/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js,samples/README.md) | -| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js,samples/README.md) | -| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js,samples/README.md) | -| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js,samples/README.md) | -| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js,samples/README.md) | -| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js,samples/README.md) | -| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js,samples/README.md) | -| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js,samples/README.md) | -| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js,samples/README.md) | -| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js,samples/README.md) | -| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js,samples/README.md) | -| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js,samples/README.md) | -| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js,samples/README.md) | -| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js,samples/README.md) | -| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js,samples/README.md) | -| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js,samples/README.md) | -| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js,samples/README.md) | -| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_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-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js,samples/README.md) | -| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js,samples/README.md) | -| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js,samples/README.md) | -| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js,samples/README.md) | -| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js,samples/README.md) | -| Alloy_d_b_admin.create_secondary_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js,samples/README.md) | -| Alloy_d_b_admin.create_secondary_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js,samples/README.md) | -| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js,samples/README.md) | -| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js,samples/README.md) | -| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js,samples/README.md) | -| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js,samples/README.md) | -| Alloy_d_b_admin.generate_client_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js,samples/README.md) | -| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js,samples/README.md) | -| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js,samples/README.md) | -| Alloy_d_b_admin.get_connection_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js,samples/README.md) | -| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js,samples/README.md) | -| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js,samples/README.md) | -| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js,samples/README.md) | -| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js,samples/README.md) | -| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js,samples/README.md) | -| Alloy_d_b_admin.promote_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js,samples/README.md) | -| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js,samples/README.md) | -| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js,samples/README.md) | -| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js,samples/README.md) | -| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js,samples/README.md) | -| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js,samples/README.md) | -| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js,samples/README.md) | -| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js,samples/README.md) | -| Alloy_d_b_admin.create_secondary_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js,samples/README.md) | -| Alloy_d_b_admin.create_secondary_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js,samples/README.md) | -| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js,samples/README.md) | -| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js,samples/README.md) | -| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js,samples/README.md) | -| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js,samples/README.md) | -| Alloy_d_b_admin.generate_client_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js,samples/README.md) | -| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js,samples/README.md) | -| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js,samples/README.md) | -| Alloy_d_b_admin.get_connection_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js,samples/README.md) | -| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js,samples/README.md) | -| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js,samples/README.md) | -| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js,samples/README.md) | -| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js,samples/README.md) | -| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js,samples/README.md) | -| Alloy_d_b_admin.promote_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js,samples/README.md) | -| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js,samples/README.md) | -| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js,samples/README.md) | -| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js,samples/README.md) | -| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/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-alloydb/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/test/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-alloydb/samples/test/quickstart.js,samples/README.md) | +| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.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-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.inject_fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.promote_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_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-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.generate_client_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_connection_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.inject_fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.promote_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.batch_create_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_secondary_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.create_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.delete_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.failover_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.generate_client_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_connection_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.get_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.inject_fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_supported_database_flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.list_users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.promote_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restart_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.restore_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.update_user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js) | [![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/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-alloydb/samples/quickstart.js,packages/google-cloud-alloydb/samples/README.md) | diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto index 65d71d77c7c5..22b82d56d0fb 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + CLUSTER_VIEW_UNSPECIFIED = 0; + + // BASIC server responses include all the relevant cluster details, excluding + // Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + // fields. The default value. + CLUSTER_VIEW_BASIC = 1; + + // CONTINUOUS_BACKUP response returns all the fields from BASIC plus + // the earliest restorable time if continuous backups are enabled. + // May increase latency. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -279,6 +302,48 @@ message AutomatedBackupPolicy { map labels = 7; } +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // The number of days backups and logs will be retained, which determines the + // window of time that data is recoverable for. If not set, it defaults to 14 + // days. + int32 recovery_window_days = 4; + + // The encryption config can be specified to encrypt the + // backups with a customer-managed encryption key (CMEK). When this field is + // not specified, the backup will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Message describing a BackupSource. message BackupSource { // Output only. The system-generated UID of the backup which was used to @@ -294,6 +359,18 @@ message BackupSource { ]; } +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // Required. The source cluster from which to restore. This cluster must have + // continuous backup enabled for this operation to succeed. For the required + // format, see the comment on the Cluster.name field. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // A cluster is a collection of regional AlloyDB resources. It can include a // primary instance and one or more read pool instances. // All cluster resources share a storage layer, which scales as needed. @@ -470,8 +547,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -485,6 +562,14 @@ message Cluster { EncryptionInfo encryption_info = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Cross Region replication config specific to SECONDARY cluster. SecondaryConfig secondary_config = 22; @@ -610,10 +695,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -669,8 +755,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // If empty, defaults to REGIONAL for primary instances. + // For read pools, availability_type is always UNSPECIFIED. Instances in the + // read pools are evenly distributed across available zones within the region + // (i.e. read pools with more than one node will have a node in at + // least two zones). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -822,7 +911,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -943,3 +1032,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto index ddc8ad705d04..4b4a87231da8 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -98,6 +98,23 @@ service AlloyDBAdmin { }; } + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + // Creates a new Cluster in a given project and location, with a volume // restored from the provided source, either a backup ID or a point-in-time // and a source cluster. @@ -113,6 +130,21 @@ service AlloyDBAdmin { }; } + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + // Lists Instances in a given project and location. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { option (google.api.http) = { @@ -143,6 +175,20 @@ service AlloyDBAdmin { }; } + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Creates new instances under the given project, location and cluster. // There can be only one primary instance in a cluster. If the primary // instance exists in the cluster as well as this request, then API will @@ -208,6 +254,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -285,6 +345,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -334,11 +436,52 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message CreateSecondaryClusterRequest { + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; } // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -449,6 +592,40 @@ message DeleteClusterRequest { bool force = 5 [(google.api.field_behavior) = OPTIONAL]; } +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The current etag of the Cluster. + // If an etag is provided and does not match the current etag of the Cluster, + // deletion will be blocked and an ABORTED error will be returned. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + // Message for restoring a Cluster from a backup or another cluster at a given // point in time. message RestoreClusterRequest { @@ -457,6 +634,10 @@ message RestoreClusterRequest { oneof source { // Backup source. BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; } // Required. The name of the parent resource. For the required format, see the @@ -589,6 +770,44 @@ message CreateInstanceRequest { bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; } +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the create + // request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + // See usage below for notes. message CreateInstanceRequests { // Required. Primary and read replica instances to be created. This list @@ -633,6 +852,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // The instances being created in the API call. Each string in this list // is the server defined resource path for target instances in the request @@ -660,6 +880,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -819,6 +1040,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1070,3 +1336,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // User resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto index bfc100ad7e77..34355dc8391a 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + CLUSTER_VIEW_UNSPECIFIED = 0; + + // BASIC server responses include all the relevant cluster details, excluding + // Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + // fields. The default value. + CLUSTER_VIEW_BASIC = 1; + + // CONTINUOUS_BACKUP response returns all the fields from BASIC plus + // the earliest restorable time if continuous backups are enabled. + // May increase latency. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -314,6 +337,11 @@ message ContinuousBackupInfo { // only field. Ignored if passed into the request. repeated google.type.DayOfWeek schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Message describing a BackupSource. @@ -353,6 +381,32 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // Required. The resource link for the VPC network in which cluster + // resources are created and from which they are accessible via Private IP. + // The network must belong to the same project as the cluster. It is + // specified in the form: + // "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. It can be updated, but it cannot be + // removed. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. The name of the allocated IP range for the private IP AlloyDB + // cluster. For example: "google-managed-services-default". If set, the + // instance IPs for this cluster will be created in the allocated range. The + // range name must comply with RFC 1035. Specifically, the name must be 1-63 + // characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Field name is intended to be consistent with CloudSQL. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -481,6 +535,8 @@ message Cluster { DatabaseVersion database_version = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the @@ -519,8 +575,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -610,6 +666,25 @@ message Instance { int32 node_count = 1; } + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum Mode { + // Mode is unknown. + MODE_UNSPECIFIED = 0; + + // Least disruptive way to apply the update. + DEFAULT = 1; + + // Performs a forced update when applicable. This will be fast but may + // incur a downtime. + FORCE_APPLY = 2; + } + + // Mode for updating the instance. + Mode mode = 1; + } + // Instance State enum State { // The state of the instance is unknown. @@ -667,10 +742,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -726,8 +802,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // If empty, defaults to REGIONAL for primary instances. + // For read pools, availability_type is always UNSPECIFIED. Instances in the + // read pools are evenly distributed across available zones within the region + // (i.e. read pools with more than one node will have a node in at + // least two zones). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -786,6 +865,12 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // Update policy that will be applied during instance update. + // This field is not persisted when you update the instance. + // To use a non-default update policy, you must + // specify explicitly specify the value in each update request. + UpdatePolicy update_policy = 22; } // ConnectionInfo singleton resource. @@ -808,7 +893,7 @@ message ConnectionInfo { // Output only. The pem-encoded chain that may be used to verify the X.509 // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The unique ID of the Instance. string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -905,7 +990,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -1026,3 +1111,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto index d733e961cbda..296f4d2d26a7 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -255,6 +255,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -354,6 +368,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -403,11 +459,15 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; } message CreateSecondaryClusterRequest { - // Required. The name of the parent resource (the primary cluster). For the - // required format, see the comment on the Cluster.name field. + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -444,7 +504,7 @@ message CreateSecondaryClusterRequest { // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -815,6 +875,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // The instances being created in the API call. Each string in this list // is the server defined resource path for target instances in the request @@ -842,6 +903,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -1001,6 +1063,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1242,7 +1349,8 @@ message GenerateClientCertificateRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. An optional hint to the endpoint to generate the client // certificate with the requested duration. The duration can be from 1 hour to @@ -1251,6 +1359,9 @@ message GenerateClientCertificateRequest { // default duration. google.protobuf.Duration cert_duration = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; } // Message returned by a GenerateClientCertificate operation. @@ -1262,6 +1373,9 @@ message GenerateClientCertificateResponse { // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for GetConnectionInfo. @@ -1327,3 +1441,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // User resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto index be1ce9a80301..eb98358425e6 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -40,18 +40,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/global/networks/{network}" }; -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // The database version is Postgres 14. - POSTGRES_14 = 2; -} - // View on Instance. Pass this enum to rpcs that returns an Instance message to // control which subsets of fields to get. enum InstanceView { @@ -68,6 +56,35 @@ enum InstanceView { INSTANCE_VIEW_FULL = 2; } +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum ClusterView { + // CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + CLUSTER_VIEW_UNSPECIFIED = 0; + + // BASIC server responses include all the relevant cluster details, excluding + // Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + // fields. The default value. + CLUSTER_VIEW_BASIC = 1; + + // CONTINUOUS_BACKUP response returns all the fields from BASIC plus + // the earliest restorable time if continuous backups are enabled. + // May increase latency. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // The database version is Postgres 14. + POSTGRES_14 = 2; +} + // The username/password for a database user. Used for specifying initial // users at cluster creation time. message UserPassword { @@ -141,25 +158,31 @@ message EncryptionInfo { ]; } -// SSL configuration for an AlloyDB Cluster. +// SSL configuration. message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to SSL_MODE_ALLOW. + // SSL mode not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1; + SSL_MODE_ALLOW = 1 [deprecated = true]; // SSL connections are required. CA verification not enforced. // Clients may use locally self-signed certificates (default psql client // behavior). - SSL_MODE_REQUIRE = 2; + SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. // Clients must have certificates signed by a Cluster CA, e.g. via // GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3; + SSL_MODE_VERIFY_CA = 3 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; } // Certificate Authority (CA) source for SSL/TLS certificates. @@ -314,6 +337,11 @@ message ContinuousBackupInfo { // only field. Ignored if passed into the request. repeated google.type.DayOfWeek schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Message describing a BackupSource. @@ -353,6 +381,32 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // Required. The resource link for the VPC network in which cluster + // resources are created and from which they are accessible via Private IP. + // The network must belong to the same project as the cluster. It is + // specified in the form: + // "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. It can be updated, but it cannot be + // removed. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. The name of the allocated IP range for the private IP AlloyDB + // cluster. For example: "google-managed-services-default". If set, the + // instance IPs for this cluster will be created in the allocated range. The + // range name must comply with RFC 1035. Specifically, the name must be 1-63 + // characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Field name is intended to be consistent with CloudSQL. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -481,6 +535,8 @@ message Cluster { DatabaseVersion database_version = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the @@ -519,8 +575,8 @@ message Cluster { // documentation for the message type. AutomatedBackupPolicy automated_backup_policy = 17; - // SSL configuration for this AlloyDB Cluster. - SslConfig ssl_config = 18; + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; // Optional. The encryption config can be specified to encrypt the data disks // and other persistent data resources of a cluster with a @@ -610,6 +666,25 @@ message Instance { int32 node_count = 1; } + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum Mode { + // Mode is unknown. + MODE_UNSPECIFIED = 0; + + // Least disruptive way to apply the update. + DEFAULT = 1; + + // Performs a forced update when applicable. This will be fast but may + // incur a downtime. + FORCE_APPLY = 2; + } + + // Mode for updating the instance. + Mode mode = 1; + } + // Instance State enum State { // The state of the instance is unknown. @@ -667,10 +742,11 @@ message Instance { } // The Availability type of an instance. Potential values: + // // - ZONAL: The instance serves data from only one zone. Outages in that - // zone affect instance availability. + // zone affect instance availability. // - REGIONAL: The instance can serve data from more than one zone in a - // region (it is highly available). + // region (it is highly available). enum AvailabilityType { // This is an unknown Availability type. AVAILABILITY_TYPE_UNSPECIFIED = 0; @@ -726,8 +802,11 @@ message Instance { MachineConfig machine_config = 10; // Availability type of an Instance. - // Defaults to REGIONAL for both primary and read instances. - // Note that primary and read instances can have different availability types. + // If empty, defaults to REGIONAL for primary instances. + // For read pools, availability_type is always UNSPECIFIED. Instances in the + // read pools are evenly distributed across available zones within the region + // (i.e. read pools with more than one node will have a node in at + // least two zones). AvailabilityType availability_type = 11; // The Compute Engine zone that the instance should serve from, per @@ -786,6 +865,12 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // Update policy that will be applied during instance update. + // This field is not persisted when you update the instance. + // To use a non-default update policy, you must + // specify explicitly specify the value in each update request. + UpdatePolicy update_policy = 22; } // ConnectionInfo singleton resource. @@ -808,7 +893,7 @@ message ConnectionInfo { // Output only. The pem-encoded chain that may be used to verify the X.509 // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The unique ID of the Instance. string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -905,7 +990,7 @@ message Backup { string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The full resource name of the backup source cluster - // (e.g., projects//locations//clusters/). + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). string cluster_name = 10 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } @@ -1026,3 +1111,39 @@ message SupportedDatabaseFlag { // availability SLO's). bool requires_db_restart = 6; } + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum UserType { + // Unspecified user type. + USER_TYPE_UNSPECIFIED = 0; + + // The default user type that authenticates via password-based + // authentication. + ALLOYDB_BUILT_IN = 1; + + // Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto index ff38b08c46b8..f262636186f4 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -255,6 +255,20 @@ service AlloyDBAdmin { }; } + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + // Restart an Instance in a cluster. // Imperative only. rpc RestartInstance(RestartInstanceRequest) @@ -354,6 +368,48 @@ service AlloyDBAdmin { }; option (google.api.method_signature) = "parent"; } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } } // Message for requesting list of Clusters @@ -403,11 +459,15 @@ message GetClusterRequest { (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; } message CreateSecondaryClusterRequest { - // Required. The name of the parent resource (the primary cluster). For the - // required format, see the comment on the Cluster.name field. + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -444,7 +504,7 @@ message CreateSecondaryClusterRequest { // Message for creating a Cluster message CreateClusterRequest { - // Required. The name of the parent resource. For the required format, see the + // Required. The location of the new cluster. For the required format, see the // comment on the Cluster.name field. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -815,6 +875,7 @@ message BatchCreateInstancesResponse { } // Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 message BatchCreateInstancesMetadata { // The instances being created in the API call. Each string in this list // is the server defined resource path for target instances in the request @@ -842,6 +903,7 @@ message BatchCreateInstancesMetadata { // 2. Instance2 = ROLLED_BACK // 3. Instance3 = FAILED // 4. Instance4 = FAILED +// // However, while the operation is running, the instance might be in other // states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states // / do not get further updated once the operation is done. @@ -1001,6 +1063,51 @@ message FailoverInstanceRequest { bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message RestartInstanceRequest { // Required. The name of the resource. For the required format, see the // comment on the Instance.name field. @@ -1242,7 +1349,8 @@ message GenerateClientCertificateRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. A pem-encoded X.509 certificate signing request (CSR). - string pem_csr = 3 [(google.api.field_behavior) = OPTIONAL]; + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. An optional hint to the endpoint to generate the client // certificate with the requested duration. The duration can be from 1 hour to @@ -1251,6 +1359,9 @@ message GenerateClientCertificateRequest { // default duration. google.protobuf.Duration cert_duration = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; } // Message returned by a GenerateClientCertificate operation. @@ -1262,6 +1373,9 @@ message GenerateClientCertificateResponse { // certificate. Expected to be in issuer-to-root order according to RFC 5246. repeated string pem_certificate_chain = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for GetConnectionInfo. @@ -1327,3 +1441,150 @@ message OperationMetadata { // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // User resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 36076b5f03ca..0f8160323839 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -26,13 +26,6 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2 - } - /** InstanceView enum. */ enum InstanceView { INSTANCE_VIEW_UNSPECIFIED = 0, @@ -40,6 +33,20 @@ export namespace google { INSTANCE_VIEW_FULL = 2 } + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } + + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2 + } + /** Properties of a UserPassword. */ interface IUserPassword { @@ -581,7 +588,9 @@ export namespace google { SSL_MODE_UNSPECIFIED = 0, SSL_MODE_ALLOW = 1, SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3 + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 } /** CaSource enum. */ @@ -1039,6 +1048,233 @@ export namespace google { } } + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { + + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); + + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + } + + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { + + /** + * Constructs a new ContinuousBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig); + + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; + + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Verifies a ContinuousBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { + + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); + + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { + + /** + * Constructs a new ContinuousBackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo); + + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Verifies a ContinuousBackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a BackupSource. */ interface IBackupSource { @@ -1142,32 +1378,135 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { - /** Cluster name */ - name?: (string|null); + /** ContinuousBackupSource cluster */ + cluster?: (string|null); - /** Cluster displayName */ - displayName?: (string|null); + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); + } - /** Cluster uid */ - uid?: (string|null); + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new ContinuousBackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupSource); - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** ContinuousBackupSource cluster. */ + public cluster: string; - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupSource): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Verifies a ContinuousBackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); + + /** Cluster name */ + name?: (string|null); + + /** Cluster displayName */ + displayName?: (string|null); + + /** Cluster uid */ + uid?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); /** Cluster labels */ labels?: ({ [k: string]: string }|null); @@ -1208,6 +1547,12 @@ export namespace google { /** Cluster encryptionInfo */ encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); + /** Cluster secondaryConfig */ secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); @@ -1287,6 +1632,12 @@ export namespace google { /** Cluster encryptionInfo. */ public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); + /** Cluster secondaryConfig. */ public secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); @@ -2852,6 +3203,131 @@ export namespace google { } } + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType); + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUser): google.cloud.alloydb.v1.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 + } + } + /** Represents an AlloyDBAdmin */ class AlloyDBAdmin extends $protobuf.rpc.Service { @@ -2942,6 +3418,20 @@ export namespace google { */ public deleteCluster(request: google.cloud.alloydb.v1.IDeleteClusterRequest): Promise; + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback): void; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @returns Promise + */ + public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest): Promise; + /** * Calls RestoreCluster. * @param request RestoreClusterRequest message or plain object @@ -2956,6 +3446,20 @@ export namespace google { */ public restoreCluster(request: google.cloud.alloydb.v1.IRestoreClusterRequest): Promise; + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): Promise; + /** * Calls ListInstances. * @param request ListInstancesRequest message or plain object @@ -2998,6 +3502,20 @@ export namespace google { */ public createInstance(request: google.cloud.alloydb.v1.ICreateInstanceRequest): Promise; + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): Promise; + /** * Calls BatchCreateInstances. * @param request BatchCreateInstancesRequest message or plain object @@ -3054,6 +3572,20 @@ export namespace google { */ public failoverInstance(request: google.cloud.alloydb.v1.IFailoverInstanceRequest): Promise; + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback): void; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest): Promise; + /** * Calls RestartInstance. * @param request RestartInstanceRequest message or plain object @@ -3151,51 +3683,135 @@ export namespace google { * @returns Promise */ public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest): Promise; - } - namespace AlloyDBAdmin { + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback): void; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListClustersResponse) => void; + public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest): Promise; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Cluster) => void; + public getUser(request: google.cloud.alloydb.v1.IGetUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback): void; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public getUser(request: google.cloud.alloydb.v1.IGetUserRequest): Promise; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback): void; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest): Promise; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest): Promise; + } + + namespace AlloyDBAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. @@ -3218,6 +3834,13 @@ export namespace google { */ type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. * @param error Error, if any @@ -3246,6 +3869,13 @@ export namespace google { */ type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. * @param error Error, if any @@ -3294,6 +3924,41 @@ export namespace google { * @param [response] ListSupportedDatabaseFlagsResponse */ type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListUsersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of a ListClustersRequest. */ @@ -3531,6 +4196,9 @@ export namespace google { /** GetClusterRequest name */ name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView|null); } /** Represents a GetClusterRequest. */ @@ -3545,6 +4213,9 @@ export namespace google { /** GetClusterRequest name. */ public name: string; + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView); + /** * Creates a new GetClusterRequest instance using the specified properties. * @param [properties] Properties to set @@ -3623,6 +4294,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CreateClusterRequest. */ interface ICreateClusterRequest { @@ -3986,47 +4778,168 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** RestoreClusterRequest parent */ - parent?: (string|null); - - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); + /** PromoteClusterRequest name */ + name?: (string|null); - /** RestoreClusterRequest requestId */ + /** PromoteClusterRequest requestId */ requestId?: (string|null); - /** RestoreClusterRequest validateOnly */ + /** PromoteClusterRequest etag */ + etag?: (string|null); + + /** PromoteClusterRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { /** - * Constructs a new RestoreClusterRequest. + * Constructs a new PromoteClusterRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest); + constructor(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest); - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + /** PromoteClusterRequest name. */ + public name: string; - /** RestoreClusterRequest parent. */ - public parent: string; + /** PromoteClusterRequest requestId. */ + public requestId: string; - /** RestoreClusterRequest clusterId. */ - public clusterId: string; + /** PromoteClusterRequest etag. */ + public etag: string; - /** RestoreClusterRequest cluster. */ + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Verifies a PromoteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { + + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { + + /** + * Constructs a new RestoreClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest); + + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ public cluster?: (google.cloud.alloydb.v1.ICluster|null); /** RestoreClusterRequest requestId. */ @@ -4036,7 +4949,7 @@ export namespace google { public validateOnly: boolean; /** RestoreClusterRequest source. */ - public source?: "backupSource"; + public source?: ("backupSource"|"continuousBackupSource"); /** * Creates a new RestoreClusterRequest instance using the specified properties. @@ -4570,6 +5483,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { + + /** CreateSecondaryInstanceRequest parent */ + parent?: (string|null); + + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest); + + /** CreateSecondaryInstanceRequest parent. */ + public parent: string; + + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; + + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CreateInstanceRequests. */ interface ICreateInstanceRequests { @@ -5450,72 +6484,196 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { - /** RestartInstanceRequest name */ + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null); + + /** InjectFaultRequest name */ name?: (string|null); - /** RestartInstanceRequest requestId */ + /** InjectFaultRequest requestId */ requestId?: (string|null); - /** RestartInstanceRequest validateOnly */ + /** InjectFaultRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { /** - * Constructs a new RestartInstanceRequest. + * Constructs a new InjectFaultRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1.IInjectFaultRequest); - /** RestartInstanceRequest name. */ + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType); + + /** InjectFaultRequest name. */ public name: string; - /** RestartInstanceRequest requestId. */ + /** InjectFaultRequest requestId. */ public requestId: string; - /** RestartInstanceRequest validateOnly. */ + /** InjectFaultRequest validateOnly. */ public validateOnly: boolean; /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * Creates a new InjectFaultRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestartInstanceRequest instance + * @returns InjectFaultRequest instance */ - public static create(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest): google.cloud.alloydb.v1.RestartInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1.IInjectFaultRequest): google.cloud.alloydb.v1.InjectFaultRequest; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestartInstanceRequest + * @returns InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestartInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.InjectFaultRequest; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Verifies an InjectFaultRequest message. + * @param message Plain 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 InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InjectFaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InjectFaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InjectFaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InjectFaultRequest { + + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** RestartInstanceRequest requestId. */ + public requestId: string; + + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer @@ -6596,15631 +7754,18925 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Namespace v1alpha. */ - namespace v1alpha { + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2 - } + /** ListUsersRequest parent */ + parent?: (string|null); - /** InstanceView enum. */ - enum InstanceView { - INSTANCE_VIEW_UNSPECIFIED = 0, - INSTANCE_VIEW_BASIC = 1, - INSTANCE_VIEW_FULL = 2 - } + /** ListUsersRequest pageSize */ + pageSize?: (number|null); - /** Properties of a UserPassword. */ - interface IUserPassword { + /** ListUsersRequest pageToken */ + pageToken?: (string|null); - /** UserPassword user */ - user?: (string|null); + /** ListUsersRequest filter */ + filter?: (string|null); - /** UserPassword password */ - password?: (string|null); + /** ListUsersRequest orderBy */ + orderBy?: (string|null); } - /** Represents a UserPassword. */ - class UserPassword implements IUserPassword { + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { /** - * Constructs a new UserPassword. + * Constructs a new ListUsersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUserPassword); + constructor(properties?: google.cloud.alloydb.v1.IListUsersRequest); - /** UserPassword user. */ - public user: string; + /** ListUsersRequest parent. */ + public parent: string; - /** UserPassword password. */ - public password: string; + /** ListUsersRequest pageSize. */ + public pageSize: number; + + /** ListUsersRequest pageToken. */ + public pageToken: string; + + /** ListUsersRequest filter. */ + public filter: string; + + /** ListUsersRequest orderBy. */ + public orderBy: string; /** - * Creates a new UserPassword instance using the specified properties. + * Creates a new ListUsersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserPassword instance + * @returns ListUsersRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUserPassword): google.cloud.alloydb.v1alpha.UserPassword; + public static create(properties?: google.cloud.alloydb.v1.IListUsersRequest): google.cloud.alloydb.v1.ListUsersRequest; /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserPassword message from the specified reader or buffer. + * Decodes a ListUsersRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserPassword + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UserPassword; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersRequest; /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserPassword + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UserPassword; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersRequest; /** - * Verifies a UserPassword message. + * Verifies a ListUsersRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserPassword + * @returns ListUsersRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UserPassword; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersRequest; /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @param message UserPassword + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserPassword to JSON. + * Converts this ListUsersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UserPassword + * Gets the default type url for ListUsersRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MigrationSource. */ - interface IMigrationSource { + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { - /** MigrationSource hostPort */ - hostPort?: (string|null); + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1.IUser[]|null); - /** MigrationSource referenceId */ - referenceId?: (string|null); + /** ListUsersResponse nextPageToken */ + nextPageToken?: (string|null); - /** MigrationSource sourceType */ - sourceType?: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null); + /** ListUsersResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a MigrationSource. */ - class MigrationSource implements IMigrationSource { + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { /** - * Constructs a new MigrationSource. + * Constructs a new ListUsersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IMigrationSource); + constructor(properties?: google.cloud.alloydb.v1.IListUsersResponse); - /** MigrationSource hostPort. */ - public hostPort: string; + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1.IUser[]; - /** MigrationSource referenceId. */ - public referenceId: string; + /** ListUsersResponse nextPageToken. */ + public nextPageToken: string; - /** MigrationSource sourceType. */ - public sourceType: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType); + /** ListUsersResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new MigrationSource instance using the specified properties. + * Creates a new ListUsersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MigrationSource instance + * @returns ListUsersResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IMigrationSource): google.cloud.alloydb.v1alpha.MigrationSource; + public static create(properties?: google.cloud.alloydb.v1.IListUsersResponse): google.cloud.alloydb.v1.ListUsersResponse; /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MigrationSource message from the specified reader or buffer. + * Decodes a ListUsersResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MigrationSource + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MigrationSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersResponse; /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MigrationSource + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MigrationSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersResponse; /** - * Verifies a MigrationSource message. + * Verifies a ListUsersResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MigrationSource + * @returns ListUsersResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MigrationSource; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersResponse; /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @param message MigrationSource + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MigrationSource to JSON. + * Converts this ListUsersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MigrationSource + * Gets the default type url for ListUsersResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MigrationSource { - - /** MigrationSourceType enum. */ - enum MigrationSourceType { - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, - DMS = 1 - } - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); + /** GetUserRequest name */ + name?: (string|null); } - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { /** - * Constructs a new EncryptionConfig. + * Constructs a new GetUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig); + constructor(properties?: google.cloud.alloydb.v1.IGetUserRequest); - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; + /** GetUserRequest name. */ + public name: string; /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new GetUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionConfig instance + * @returns GetUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig): google.cloud.alloydb.v1alpha.EncryptionConfig; + public static create(properties?: google.cloud.alloydb.v1.IGetUserRequest): google.cloud.alloydb.v1.GetUserRequest; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a GetUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionConfig + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetUserRequest; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionConfig + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetUserRequest; /** - * Verifies an EncryptionConfig message. + * Verifies a GetUserRequest message. * @param message Plain 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionConfig + * @returns GetUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetUserRequest; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionConfig to JSON. + * Converts this GetUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for GetUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { - /** EncryptionInfo encryptionType */ - encryptionType?: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null); + /** CreateUserRequest parent */ + parent?: (string|null); - /** EncryptionInfo kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1.IUser|null); + + /** CreateUserRequest requestId */ + requestId?: (string|null); + + /** CreateUserRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { /** - * Constructs a new EncryptionInfo. + * Constructs a new CreateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo); + constructor(properties?: google.cloud.alloydb.v1.ICreateUserRequest); - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type); + /** CreateUserRequest parent. */ + public parent: string; - /** EncryptionInfo kmsKeyVersions. */ - public kmsKeyVersions: string[]; + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1.IUser|null); + + /** CreateUserRequest requestId. */ + public requestId: string; + + /** CreateUserRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new EncryptionInfo instance using the specified properties. + * Creates a new CreateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionInfo instance + * @returns CreateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo): google.cloud.alloydb.v1alpha.EncryptionInfo; + public static create(properties?: google.cloud.alloydb.v1.ICreateUserRequest): google.cloud.alloydb.v1.CreateUserRequest; /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionInfo message from the specified reader or buffer. + * Decodes a CreateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionInfo + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateUserRequest; /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionInfo + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateUserRequest; /** - * Verifies an EncryptionInfo message. + * Verifies a CreateUserRequest message. * @param message Plain 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 EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionInfo + * @returns CreateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateUserRequest; /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionInfo to JSON. + * Converts this CreateUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionInfo + * Gets the default type url for CreateUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace EncryptionInfo { + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** Properties of a SslConfig. */ - interface ISslConfig { + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1.IUser|null); - /** SslConfig sslMode */ - sslMode?: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode|null); + /** UpdateUserRequest requestId */ + requestId?: (string|null); - /** SslConfig caSource */ - caSource?: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource|null); + /** UpdateUserRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateUserRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { /** - * Constructs a new SslConfig. + * Constructs a new UpdateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISslConfig); + constructor(properties?: google.cloud.alloydb.v1.IUpdateUserRequest); - /** SslConfig sslMode. */ - public sslMode: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode); + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** SslConfig caSource. */ - public caSource: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource); + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1.IUser|null); + + /** UpdateUserRequest requestId. */ + public requestId: string; + + /** UpdateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateUserRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new SslConfig instance using the specified properties. + * Creates a new UpdateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SslConfig instance + * @returns UpdateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISslConfig): google.cloud.alloydb.v1alpha.SslConfig; + public static create(properties?: google.cloud.alloydb.v1.IUpdateUserRequest): google.cloud.alloydb.v1.UpdateUserRequest; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes an UpdateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SslConfig + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SslConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateUserRequest; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SslConfig + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SslConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateUserRequest; /** - * Verifies a SslConfig message. + * Verifies an UpdateUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SslConfig + * @returns UpdateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SslConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateUserRequest; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SslConfig to JSON. + * Converts this UpdateUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SslConfig + * Gets the default type url for UpdateUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SslConfig { - - /** SslMode enum. */ - enum SslMode { - SSL_MODE_UNSPECIFIED = 0, - SSL_MODE_ALLOW = 1, - SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3 - } - - /** CaSource enum. */ - enum CaSource { - CA_SOURCE_UNSPECIFIED = 0, - CA_SOURCE_MANAGED = 1 - } - } - - /** Properties of an AutomatedBackupPolicy. */ - interface IAutomatedBackupPolicy { - - /** AutomatedBackupPolicy weeklySchedule */ - weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention */ - timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention */ - quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled */ - enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow */ - backupWindow?: (google.protobuf.IDuration|null); + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { - /** AutomatedBackupPolicy encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + /** DeleteUserRequest name */ + name?: (string|null); - /** AutomatedBackupPolicy location */ - location?: (string|null); + /** DeleteUserRequest requestId */ + requestId?: (string|null); - /** AutomatedBackupPolicy labels */ - labels?: ({ [k: string]: string }|null); + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents an AutomatedBackupPolicy. */ - class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { /** - * Constructs a new AutomatedBackupPolicy. + * Constructs a new DeleteUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy); - - /** AutomatedBackupPolicy weeklySchedule. */ - public weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); + constructor(properties?: google.cloud.alloydb.v1.IDeleteUserRequest); - /** AutomatedBackupPolicy timeBasedRetention. */ - public timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention. */ - public quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled. */ - public enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow. */ - public backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location. */ - public location: string; - - /** AutomatedBackupPolicy labels. */ - public labels: { [k: string]: string }; - - /** AutomatedBackupPolicy schedule. */ - public schedule?: "weeklySchedule"; + /** DeleteUserRequest name. */ + public name: string; - /** AutomatedBackupPolicy retention. */ - public retention?: ("timeBasedRetention"|"quantityBasedRetention"); + /** DeleteUserRequest requestId. */ + public requestId: string; - /** AutomatedBackupPolicy _enabled. */ - public _enabled?: "enabled"; + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. + * Creates a new DeleteUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AutomatedBackupPolicy instance + * @returns DeleteUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + public static create(properties?: google.cloud.alloydb.v1.IDeleteUserRequest): google.cloud.alloydb.v1.DeleteUserRequest; /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * Decodes a DeleteUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutomatedBackupPolicy + * @returns DeleteUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteUserRequest; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutomatedBackupPolicy + * @returns DeleteUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteUserRequest; /** - * Verifies an AutomatedBackupPolicy message. + * Verifies a DeleteUserRequest message. * @param message Plain 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 AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutomatedBackupPolicy + * @returns DeleteUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteUserRequest; /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @param message AutomatedBackupPolicy + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutomatedBackupPolicy to JSON. + * Converts this DeleteUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutomatedBackupPolicy + * Gets the default type url for DeleteUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - namespace AutomatedBackupPolicy { + /** Namespace v1alpha. */ + namespace v1alpha { - /** Properties of a WeeklySchedule. */ - interface IWeeklySchedule { + /** InstanceView enum. */ + enum InstanceView { + INSTANCE_VIEW_UNSPECIFIED = 0, + INSTANCE_VIEW_BASIC = 1, + INSTANCE_VIEW_FULL = 2 + } - /** WeeklySchedule startTimes */ - startTimes?: (google.type.ITimeOfDay[]|null); + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } - /** WeeklySchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); - } + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2 + } - /** Represents a WeeklySchedule. */ - class WeeklySchedule implements IWeeklySchedule { + /** Properties of a UserPassword. */ + interface IUserPassword { - /** - * Constructs a new WeeklySchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule); + /** UserPassword user */ + user?: (string|null); - /** WeeklySchedule startTimes. */ - public startTimes: google.type.ITimeOfDay[]; + /** UserPassword password */ + password?: (string|null); + } - /** WeeklySchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns WeeklySchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUserPassword); - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + /** UserPassword user. */ + public user: string; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + /** UserPassword password. */ + public password: string; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUserPassword): google.cloud.alloydb.v1alpha.UserPassword; - /** - * Verifies a WeeklySchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeeklySchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @param message WeeklySchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UserPassword; - /** - * Converts this WeeklySchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UserPassword; - /** - * Gets the default type url for WeeklySchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Verifies a UserPassword message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a TimeBasedRetention. */ - interface ITimeBasedRetention { + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UserPassword; - /** TimeBasedRetention retentionPeriod */ - retentionPeriod?: (google.protobuf.IDuration|null); - } + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a TimeBasedRetention. */ - class TimeBasedRetention implements ITimeBasedRetention { + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Constructs a new TimeBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention); + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** TimeBasedRetention retentionPeriod. */ - public retentionPeriod?: (google.protobuf.IDuration|null); + /** Properties of a MigrationSource. */ + interface IMigrationSource { - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + /** MigrationSource hostPort */ + hostPort?: (string|null); - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + /** MigrationSource referenceId */ + referenceId?: (string|null); - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + /** MigrationSource sourceType */ + sourceType?: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null); + } - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + /** Represents a MigrationSource. */ + class MigrationSource implements IMigrationSource { - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + /** + * Constructs a new MigrationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IMigrationSource); - /** - * Verifies a TimeBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MigrationSource hostPort. */ + public hostPort: string; - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + /** MigrationSource referenceId. */ + public referenceId: string; - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @param message TimeBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MigrationSource sourceType. */ + public sourceType: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType); - /** - * Converts this TimeBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QuantityBasedRetention. */ - interface IQuantityBasedRetention { - - /** QuantityBasedRetention count */ - count?: (number|null); - } - - /** Represents a QuantityBasedRetention. */ - class QuantityBasedRetention implements IQuantityBasedRetention { - - /** - * Constructs a new QuantityBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention); - - /** QuantityBasedRetention count. */ - public count: number; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Verifies a QuantityBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @param message QuantityBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ContinuousBackupConfig. */ - interface IContinuousBackupConfig { - - /** ContinuousBackupConfig enabled */ - enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays */ - recoveryWindowDays?: (number|null); - - /** ContinuousBackupConfig encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - } - - /** Represents a ContinuousBackupConfig. */ - class ContinuousBackupConfig implements IContinuousBackupConfig { - - /** - * Constructs a new ContinuousBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig); - - /** ContinuousBackupConfig enabled. */ - public enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays. */ - public recoveryWindowDays: number; - - /** ContinuousBackupConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** ContinuousBackupConfig _enabled. */ - public _enabled?: "enabled"; - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + /** + * Creates a new MigrationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IMigrationSource): google.cloud.alloydb.v1alpha.MigrationSource; /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * Decodes a MigrationSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContinuousBackupConfig + * @returns MigrationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MigrationSource; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContinuousBackupConfig + * @returns MigrationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MigrationSource; /** - * Verifies a ContinuousBackupConfig message. + * Verifies a MigrationSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContinuousBackupConfig + * @returns MigrationSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MigrationSource; /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @param message ContinuousBackupConfig + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @param message MigrationSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContinuousBackupConfig to JSON. + * Converts this MigrationSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ContinuousBackupConfig + * Gets the default type url for MigrationSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ContinuousBackupInfo. */ - interface IContinuousBackupInfo { + namespace MigrationSource { - /** ContinuousBackupInfo encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + /** MigrationSourceType enum. */ + enum MigrationSourceType { + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, + DMS = 1 + } + } - /** ContinuousBackupInfo enabledTime */ - enabledTime?: (google.protobuf.ITimestamp|null); + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { - /** ContinuousBackupInfo schedule */ - schedule?: (google.type.DayOfWeek[]|null); + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); } - /** Represents a ContinuousBackupInfo. */ - class ContinuousBackupInfo implements IContinuousBackupInfo { + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { /** - * Constructs a new ContinuousBackupInfo. + * Constructs a new EncryptionConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo); - - /** ContinuousBackupInfo encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime. */ - public enabledTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig); - /** ContinuousBackupInfo schedule. */ - public schedule: google.type.DayOfWeek[]; + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; /** - * Creates a new ContinuousBackupInfo instance using the specified properties. + * Creates a new EncryptionConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ContinuousBackupInfo instance + * @returns EncryptionConfig instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig): google.cloud.alloydb.v1alpha.EncryptionConfig; /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * Decodes an EncryptionConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContinuousBackupInfo + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionConfig; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContinuousBackupInfo + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionConfig; /** - * Verifies a ContinuousBackupInfo message. + * Verifies an EncryptionConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContinuousBackupInfo + * @returns EncryptionConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionConfig; /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @param message ContinuousBackupInfo + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContinuousBackupInfo to JSON. + * Converts this EncryptionConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ContinuousBackupInfo + * Gets the default type url for EncryptionConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BackupSource. */ - interface IBackupSource { + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { - /** BackupSource backupUid */ - backupUid?: (string|null); + /** EncryptionInfo encryptionType */ + encryptionType?: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null); - /** BackupSource backupName */ - backupName?: (string|null); + /** EncryptionInfo kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); } - /** Represents a BackupSource. */ - class BackupSource implements IBackupSource { + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { /** - * Constructs a new BackupSource. + * Constructs a new EncryptionInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBackupSource); + constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo); - /** BackupSource backupUid. */ - public backupUid: string; + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type); - /** BackupSource backupName. */ - public backupName: string; + /** EncryptionInfo kmsKeyVersions. */ + public kmsKeyVersions: string[]; /** - * Creates a new BackupSource instance using the specified properties. + * Creates a new EncryptionInfo instance using the specified properties. * @param [properties] Properties to set - * @returns BackupSource instance + * @returns EncryptionInfo instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBackupSource): google.cloud.alloydb.v1alpha.BackupSource; + public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo): google.cloud.alloydb.v1alpha.EncryptionInfo; /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BackupSource message from the specified reader or buffer. + * Decodes an EncryptionInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BackupSource + * @returns EncryptionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BackupSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionInfo; /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BackupSource + * @returns EncryptionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BackupSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionInfo; /** - * Verifies a BackupSource message. + * Verifies an EncryptionInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BackupSource + * @returns EncryptionInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BackupSource; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionInfo; /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @param message BackupSource + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BackupSource to JSON. + * Converts this EncryptionInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BackupSource + * Gets the default type url for EncryptionInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ContinuousBackupSource. */ - interface IContinuousBackupSource { + namespace EncryptionInfo { - /** ContinuousBackupSource cluster */ - cluster?: (string|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } - /** ContinuousBackupSource pointInTime */ - pointInTime?: (google.protobuf.ITimestamp|null); + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig sslMode */ + sslMode?: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode|null); + + /** SslConfig caSource */ + caSource?: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource|null); } - /** Represents a ContinuousBackupSource. */ - class ContinuousBackupSource implements IContinuousBackupSource { + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { /** - * Constructs a new ContinuousBackupSource. + * Constructs a new SslConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource); + constructor(properties?: google.cloud.alloydb.v1alpha.ISslConfig); - /** ContinuousBackupSource cluster. */ - public cluster: string; + /** SslConfig sslMode. */ + public sslMode: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode); - /** ContinuousBackupSource pointInTime. */ - public pointInTime?: (google.protobuf.ITimestamp|null); + /** SslConfig caSource. */ + public caSource: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource); /** - * Creates a new ContinuousBackupSource instance using the specified properties. + * Creates a new SslConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ContinuousBackupSource instance + * @returns SslConfig instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + public static create(properties?: google.cloud.alloydb.v1alpha.ISslConfig): google.cloud.alloydb.v1alpha.SslConfig; /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * Decodes a SslConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContinuousBackupSource + * @returns SslConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SslConfig; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * Decodes a SslConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContinuousBackupSource + * @returns SslConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SslConfig; /** - * Verifies a ContinuousBackupSource message. + * Verifies a SslConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContinuousBackupSource + * @returns SslConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SslConfig; /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @param message ContinuousBackupSource + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContinuousBackupSource to JSON. + * Converts this SslConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ContinuousBackupSource + * Gets the default type url for SslConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Cluster. */ - interface ICluster { + namespace SslConfig { - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + /** SslMode enum. */ + enum SslMode { + SSL_MODE_UNSPECIFIED = 0, + SSL_MODE_ALLOW = 1, + SSL_MODE_REQUIRE = 2, + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 + } - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); + /** CaSource enum. */ + enum CaSource { + CA_SOURCE_UNSPECIFIED = 0, + CA_SOURCE_MANAGED = 1 + } + } - /** Cluster name */ - name?: (string|null); + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { - /** Cluster displayName */ - displayName?: (string|null); + /** AutomatedBackupPolicy weeklySchedule */ + weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); - /** Cluster uid */ - uid?: (string|null); + /** AutomatedBackupPolicy timeBasedRetention */ + timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** AutomatedBackupPolicy quantityBasedRetention */ + quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** AutomatedBackupPolicy enabled */ + enabled?: (boolean|null); - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** AutomatedBackupPolicy backupWindow */ + backupWindow?: (google.protobuf.IDuration|null); - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); + /** AutomatedBackupPolicy encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - /** Cluster state */ - state?: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State|null); + /** AutomatedBackupPolicy location */ + location?: (string|null); - /** Cluster clusterType */ - clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); + /** AutomatedBackupPolicy labels */ + labels?: ({ [k: string]: string }|null); + } - /** Cluster databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { - /** Cluster network */ - network?: (string|null); + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy); - /** Cluster etag */ - etag?: (string|null); + /** AutomatedBackupPolicy weeklySchedule. */ + public weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); - /** Cluster annotations */ - annotations?: ({ [k: string]: string }|null); + /** AutomatedBackupPolicy timeBasedRetention. */ + public timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - /** Cluster reconciling */ - reconciling?: (boolean|null); + /** AutomatedBackupPolicy quantityBasedRetention. */ + public quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - /** Cluster initialUser */ - initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - - /** Cluster automatedBackupPolicy */ - automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig */ - sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - - /** Cluster encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** Cluster encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig */ - continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo */ - continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig */ - secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig */ - primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); - } - - /** Represents a Cluster. */ - class Cluster implements ICluster { - - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICluster); - - /** Cluster backupSource. */ - public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** Cluster migrationSource. */ - public migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); - - /** Cluster name. */ - public name: string; - - /** Cluster displayName. */ - public displayName: string; - - /** Cluster uid. */ - public uid: string; - - /** Cluster createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels. */ - public labels: { [k: string]: string }; - - /** Cluster state. */ - public state: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State); - - /** Cluster clusterType. */ - public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); - - /** Cluster databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** Cluster network. */ - public network: string; - - /** Cluster etag. */ - public etag: string; - - /** Cluster annotations. */ - public annotations: { [k: string]: string }; - - /** Cluster reconciling. */ - public reconciling: boolean; - - /** Cluster initialUser. */ - public initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - - /** Cluster automatedBackupPolicy. */ - public automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); + /** AutomatedBackupPolicy enabled. */ + public enabled?: (boolean|null); - /** Cluster sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + /** AutomatedBackupPolicy backupWindow. */ + public backupWindow?: (google.protobuf.IDuration|null); - /** Cluster encryptionConfig. */ + /** AutomatedBackupPolicy encryptionConfig. */ public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - /** Cluster encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig. */ - public continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); + /** AutomatedBackupPolicy location. */ + public location: string; - /** Cluster continuousBackupInfo. */ - public continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); + /** AutomatedBackupPolicy labels. */ + public labels: { [k: string]: string }; - /** Cluster secondaryConfig. */ - public secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); + /** AutomatedBackupPolicy schedule. */ + public schedule?: "weeklySchedule"; - /** Cluster primaryConfig. */ - public primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); + /** AutomatedBackupPolicy retention. */ + public retention?: ("timeBasedRetention"|"quantityBasedRetention"); - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"); + /** AutomatedBackupPolicy _enabled. */ + public _enabled?: "enabled"; /** - * Creates a new Cluster instance using the specified properties. + * Creates a new AutomatedBackupPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns Cluster instance + * @returns AutomatedBackupPolicy instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICluster): google.cloud.alloydb.v1alpha.Cluster; + public static create(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Cluster message from the specified reader or buffer. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Cluster + * @returns AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Cluster + * @returns AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; /** - * Verifies a Cluster message. + * Verifies an AutomatedBackupPolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Cluster + * @returns AutomatedBackupPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Cluster to JSON. + * Converts this AutomatedBackupPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Cluster + * Gets the default type url for AutomatedBackupPolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Cluster { + namespace AutomatedBackupPolicy { - /** Properties of a SecondaryConfig. */ - interface ISecondaryConfig { + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { - /** SecondaryConfig primaryClusterName */ - primaryClusterName?: (string|null); + /** WeeklySchedule startTimes */ + startTimes?: (google.type.ITimeOfDay[]|null); + + /** WeeklySchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); } - /** Represents a SecondaryConfig. */ - class SecondaryConfig implements ISecondaryConfig { + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { /** - * Constructs a new SecondaryConfig. + * Constructs a new WeeklySchedule. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig); + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule); - /** SecondaryConfig primaryClusterName. */ - public primaryClusterName: string; + /** WeeklySchedule startTimes. */ + public startTimes: google.type.ITimeOfDay[]; + + /** WeeklySchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; /** - * Creates a new SecondaryConfig instance using the specified properties. + * Creates a new WeeklySchedule instance using the specified properties. * @param [properties] Properties to set - * @returns SecondaryConfig instance + * @returns WeeklySchedule instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecondaryConfig message from the specified reader or buffer. + * Decodes a WeeklySchedule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecondaryConfig + * @returns WeeklySchedule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecondaryConfig + * @returns WeeklySchedule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; /** - * Verifies a SecondaryConfig message. + * Verifies a WeeklySchedule message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecondaryConfig + * @returns WeeklySchedule */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @param message SecondaryConfig + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecondaryConfig to JSON. + * Converts this WeeklySchedule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SecondaryConfig + * Gets the default type url for WeeklySchedule * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrimaryConfig. */ - interface IPrimaryConfig { + /** Properties of a TimeBasedRetention. */ + interface ITimeBasedRetention { - /** PrimaryConfig secondaryClusterNames */ - secondaryClusterNames?: (string[]|null); + /** TimeBasedRetention retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); } - /** Represents a PrimaryConfig. */ - class PrimaryConfig implements IPrimaryConfig { + /** Represents a TimeBasedRetention. */ + class TimeBasedRetention implements ITimeBasedRetention { /** - * Constructs a new PrimaryConfig. + * Constructs a new TimeBasedRetention. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig); + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention); - /** PrimaryConfig secondaryClusterNames. */ - public secondaryClusterNames: string[]; + /** TimeBasedRetention retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); /** - * Creates a new PrimaryConfig instance using the specified properties. + * Creates a new TimeBasedRetention instance using the specified properties. * @param [properties] Properties to set - * @returns PrimaryConfig instance + * @returns TimeBasedRetention instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrimaryConfig message from the specified reader or buffer. + * Decodes a TimeBasedRetention message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrimaryConfig + * @returns TimeBasedRetention * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrimaryConfig + * @returns TimeBasedRetention * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; /** - * Verifies a PrimaryConfig message. + * Verifies a TimeBasedRetention message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrimaryConfig + * @returns TimeBasedRetention */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @param message PrimaryConfig + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @param message TimeBasedRetention * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrimaryConfig to JSON. + * Converts this TimeBasedRetention to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrimaryConfig + * Gets the default type url for TimeBasedRetention * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - EMPTY = 3, - CREATING = 4, - DELETING = 5, - FAILED = 6, - BOOTSTRAPPING = 7, - MAINTENANCE = 8, - PROMOTING = 9 - } + /** Properties of a QuantityBasedRetention. */ + interface IQuantityBasedRetention { - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - SECONDARY = 2 + /** QuantityBasedRetention count */ + count?: (number|null); } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Represents a QuantityBasedRetention. */ + class QuantityBasedRetention implements IQuantityBasedRetention { - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new QuantityBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention); - /** Instance labels */ - labels?: ({ [k: string]: string }|null); + /** QuantityBasedRetention count. */ + public count: number; - /** Instance state */ - state?: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State|null); + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - /** Instance instanceType */ - instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance machineConfig */ - machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance availabilityType */ - availabilityType?: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null); + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - /** Instance gceZone */ - gceZone?: (string|null); + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - /** Instance databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); + /** + * Verifies a QuantityBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Instance writableNode */ - writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - /** Instance nodes */ - nodes?: (google.cloud.alloydb.v1alpha.Instance.INode[]|null); + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @param message QuantityBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Instance queryInsightsConfig */ - queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + /** + * Converts this QuantityBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Instance readPoolConfig */ - readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + /** + * Gets the default type url for QuantityBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } - /** Instance ipAddress */ - ipAddress?: (string|null); + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { - /** Instance reconciling */ - reconciling?: (boolean|null); + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); - /** Instance etag */ - etag?: (string|null); + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); } - /** Represents an Instance. */ - class Instance implements IInstance { + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { /** - * Constructs a new Instance. + * Constructs a new ContinuousBackupConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IInstance); + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig); - /** Instance name. */ - public name: string; + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); - /** Instance displayName. */ - public displayName: string; + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; - /** Instance uid. */ - public uid: string; + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance labels. */ - public labels: { [k: string]: string }; + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance state. */ - public state: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State); + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - /** Instance instanceType. */ - public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - /** Instance machineConfig. */ - public machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + /** + * Verifies a ContinuousBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Instance availabilityType. */ - public availabilityType: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType); + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - /** Instance gceZone. */ - public gceZone: string; + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Instance databaseFlags. */ - public databaseFlags: { [k: string]: string }; + /** + * Converts this ContinuousBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Instance writableNode. */ - public writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + /** + * Gets the default type url for ContinuousBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Instance nodes. */ - public nodes: google.cloud.alloydb.v1alpha.Instance.INode[]; + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { - /** Instance queryInsightsConfig. */ - public queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - /** Instance readPoolConfig. */ - public readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); - /** Instance ipAddress. */ - public ipAddress: string; + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); - /** Instance reconciling. */ - public reconciling: boolean; + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); + } - /** Instance etag. */ - public etag: string; + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { - /** Instance annotations. */ - public annotations: { [k: string]: string }; + /** + * Constructs a new ContinuousBackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo); + + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new Instance instance using the specified properties. + * Creates a new ContinuousBackupInfo instance using the specified properties. * @param [properties] Properties to set - * @returns Instance instance + * @returns ContinuousBackupInfo instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IInstance): google.cloud.alloydb.v1alpha.Instance; + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Instance + * @returns ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Instance + * @returns ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; /** - * Verifies an Instance message. + * Verifies a ContinuousBackupInfo message. * @param message Plain 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. + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Instance + * @returns ContinuousBackupInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Instance to JSON. + * Converts this ContinuousBackupInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Instance + * Gets the default type url for ContinuousBackupInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Instance { + /** Properties of a BackupSource. */ + interface IBackupSource { - /** Properties of a MachineConfig. */ - interface IMachineConfig { + /** BackupSource backupUid */ + backupUid?: (string|null); - /** MachineConfig cpuCount */ - cpuCount?: (number|null); - } + /** BackupSource backupName */ + backupName?: (string|null); + } - /** Represents a MachineConfig. */ - class MachineConfig implements IMachineConfig { + /** Represents a BackupSource. */ + class BackupSource implements IBackupSource { - /** - * Constructs a new MachineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig); + /** + * Constructs a new BackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBackupSource); - /** MachineConfig cpuCount. */ - public cpuCount: number; + /** BackupSource backupUid. */ + public backupUid: string; - /** - * Creates a new MachineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MachineConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + /** BackupSource backupName. */ + public backupName: string; - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new BackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBackupSource): google.cloud.alloydb.v1alpha.BackupSource; - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BackupSource; - /** - * Verifies a MachineConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BackupSource; - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MachineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + /** + * Verifies a BackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @param message MachineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BackupSource; - /** - * Converts this MachineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @param message BackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for MachineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this BackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a Node. */ - interface INode { + /** + * Gets the default type url for BackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Node zoneId */ - zoneId?: (string|null); + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { - /** Node id */ - id?: (string|null); + /** ContinuousBackupSource cluster */ + cluster?: (string|null); - /** Node ip */ - ip?: (string|null); + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); + } - /** Node state */ - state?: (string|null); - } + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { - /** Represents a Node. */ - class Node implements INode { + /** + * Constructs a new ContinuousBackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource); - /** - * Constructs a new Node. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.INode); + /** ContinuousBackupSource cluster. */ + public cluster: string; - /** Node zoneId. */ - public zoneId: string; + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); - /** Node id. */ - public id: string; + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - /** Node ip. */ - public ip: string; + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Node state. */ - public state: string; + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new Node instance using the specified properties. - * @param [properties] Properties to set - * @returns Node instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.INode): google.cloud.alloydb.v1alpha.Instance.Node; + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ContinuousBackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a Node message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.Node; + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.Node; + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a Node message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this ContinuousBackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Node - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.Node; + /** + * Gets the default type url for ContinuousBackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @param message Node - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a Cluster. */ + interface ICluster { - /** - * Converts this Node to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - /** - * Gets the default type url for Node - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); - /** Properties of a QueryInsightsInstanceConfig. */ - interface IQueryInsightsInstanceConfig { + /** Cluster name */ + name?: (string|null); - /** QueryInsightsInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); + /** Cluster displayName */ + displayName?: (string|null); - /** QueryInsightsInstanceConfig recordClientAddress */ - recordClientAddress?: (boolean|null); + /** Cluster uid */ + uid?: (string|null); - /** QueryInsightsInstanceConfig queryStringLength */ - queryStringLength?: (number|null); + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** QueryInsightsInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - } + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** Represents a QueryInsightsInstanceConfig. */ - class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); - /** - * Constructs a new QueryInsightsInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig); + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); - /** QueryInsightsInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); + /** Cluster state */ + state?: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State|null); - /** QueryInsightsInstanceConfig recordClientAddress. */ - public recordClientAddress?: (boolean|null); + /** Cluster clusterType */ + clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); - /** QueryInsightsInstanceConfig queryStringLength. */ - public queryStringLength: number; + /** Cluster databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - /** QueryInsightsInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); - /** QueryInsightsInstanceConfig _recordApplicationTags. */ - public _recordApplicationTags?: "recordApplicationTags"; + /** Cluster network */ + network?: (string|null); - /** QueryInsightsInstanceConfig _recordClientAddress. */ - public _recordClientAddress?: "recordClientAddress"; + /** Cluster etag */ + etag?: (string|null); - /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ - public _queryPlansPerMinute?: "queryPlansPerMinute"; + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryInsightsInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + /** Cluster reconciling */ + reconciling?: (boolean|null); - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** Cluster initialUser */ + initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** Cluster automatedBackupPolicy */ + automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + /** Cluster sslConfig */ + sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + /** Cluster encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - /** - * Verifies a QueryInsightsInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Cluster encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInsightsInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @param message QueryInsightsInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Cluster secondaryConfig */ + secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Cluster primaryConfig */ + primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); + } - /** Properties of a ReadPoolConfig. */ - interface IReadPoolConfig { + /** Represents a Cluster. */ + class Cluster implements ICluster { - /** ReadPoolConfig nodeCount */ - nodeCount?: (number|null); - } + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICluster); - /** Represents a ReadPoolConfig. */ - class ReadPoolConfig implements IReadPoolConfig { + /** Cluster backupSource. */ + public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - /** - * Constructs a new ReadPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig); + /** Cluster migrationSource. */ + public migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); - /** ReadPoolConfig nodeCount. */ - public nodeCount: number; + /** Cluster name. */ + public name: string; - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + /** Cluster displayName. */ + public displayName: string; - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** Cluster uid. */ + public uid: string; - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + /** Cluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a ReadPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Cluster labels. */ + public labels: { [k: string]: string }; - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + /** Cluster state. */ + public state: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State); - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @param message ReadPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Cluster clusterType. */ + public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); - /** - * Converts this ReadPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Cluster databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - /** - * Gets the default type url for ReadPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - CREATING = 3, - DELETING = 4, - MAINTENANCE = 5, - FAILED = 6, - BOOTSTRAPPING = 8, - PROMOTING = 9 - } + /** Cluster network. */ + public network: string; - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - READ_POOL = 2, - SECONDARY = 3 - } + /** Cluster etag. */ + public etag: string; - /** AvailabilityType enum. */ - enum AvailabilityType { - AVAILABILITY_TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2 - } - } + /** Cluster annotations. */ + public annotations: { [k: string]: string }; - /** Properties of a ConnectionInfo. */ - interface IConnectionInfo { + /** Cluster reconciling. */ + public reconciling: boolean; - /** ConnectionInfo name */ - name?: (string|null); + /** Cluster initialUser. */ + public initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - /** ConnectionInfo ipAddress */ - ipAddress?: (string|null); + /** Cluster automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); - /** ConnectionInfo pemCertificateChain */ - pemCertificateChain?: (string[]|null); + /** Cluster sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - /** ConnectionInfo instanceUid */ - instanceUid?: (string|null); - } + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - /** Represents a ConnectionInfo. */ - class ConnectionInfo implements IConnectionInfo { + /** Cluster encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - /** - * Constructs a new ConnectionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo); + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); - /** ConnectionInfo name. */ - public name: string; + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); - /** ConnectionInfo ipAddress. */ - public ipAddress: string; + /** Cluster secondaryConfig. */ + public secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); - /** ConnectionInfo pemCertificateChain. */ - public pemCertificateChain: string[]; + /** Cluster primaryConfig. */ + public primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); - /** ConnectionInfo instanceUid. */ - public instanceUid: string; + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"); /** - * Creates a new ConnectionInfo instance using the specified properties. + * Creates a new Cluster instance using the specified properties. * @param [properties] Properties to set - * @returns ConnectionInfo instance + * @returns Cluster instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo): google.cloud.alloydb.v1alpha.ConnectionInfo; + public static create(properties?: google.cloud.alloydb.v1alpha.ICluster): google.cloud.alloydb.v1alpha.Cluster; /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ConnectionInfo message from the specified reader or buffer. + * Decodes a Cluster message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ConnectionInfo + * @returns Cluster * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ConnectionInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster; /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * Decodes a Cluster message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ConnectionInfo + * @returns Cluster * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ConnectionInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster; /** - * Verifies a ConnectionInfo message. + * Verifies a Cluster message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ConnectionInfo + * @returns Cluster */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ConnectionInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster; /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @param message ConnectionInfo + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ConnectionInfo to JSON. + * Converts this Cluster to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ConnectionInfo + * Gets the default type url for Cluster * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); + namespace Cluster { - /** Backup displayName */ - displayName?: (string|null); + /** Properties of a NetworkConfig. */ + interface INetworkConfig { - /** Backup uid */ - uid?: (string|null); + /** NetworkConfig network */ + network?: (string|null); - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { - /** Backup deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig); - /** Backup labels */ - labels?: ({ [k: string]: string }|null); + /** NetworkConfig network. */ + public network: string; - /** Backup state */ - state?: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State|null); + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; - /** Backup type */ - type?: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type|null); + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - /** Backup description */ - description?: (string|null); + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup clusterUid */ - clusterUid?: (string|null); + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup clusterName */ - clusterName?: (string|null); + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - /** Backup reconciling */ - reconciling?: (boolean|null); + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - /** Backup encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Backup encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - /** Backup etag */ - etag?: (string|null); + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Backup annotations */ - annotations?: ({ [k: string]: string }|null); + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Backup expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - } + /** Properties of a SecondaryConfig. */ + interface ISecondaryConfig { - /** Represents a Backup. */ - class Backup implements IBackup { + /** SecondaryConfig primaryClusterName */ + primaryClusterName?: (string|null); + } - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBackup); + /** Represents a SecondaryConfig. */ + class SecondaryConfig implements ISecondaryConfig { - /** Backup name. */ - public name: string; + /** + * Constructs a new SecondaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig); - /** Backup displayName. */ - public displayName: string; + /** SecondaryConfig primaryClusterName. */ + public primaryClusterName: string; - /** Backup uid. */ - public uid: string; + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecondaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup state. */ - public state: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State); + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup type. */ - public type: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type); + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - /** Backup description. */ - public description: string; + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - /** Backup clusterUid. */ - public clusterUid: string; + /** + * Verifies a SecondaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Backup clusterName. */ - public clusterName: string; + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecondaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - /** Backup reconciling. */ - public reconciling: boolean; + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @param message SecondaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Backup encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + /** + * Converts this SecondaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + /** + * Gets the default type url for SecondaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Backup etag. */ - public etag: string; + /** Properties of a PrimaryConfig. */ + interface IPrimaryConfig { - /** Backup annotations. */ - public annotations: { [k: string]: string }; + /** PrimaryConfig secondaryClusterNames */ + secondaryClusterNames?: (string[]|null); + } - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); + /** Represents a PrimaryConfig. */ + class PrimaryConfig implements IPrimaryConfig { - /** Backup expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new PrimaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig); - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBackup): google.cloud.alloydb.v1alpha.Backup; + /** PrimaryConfig secondaryClusterNames. */ + public secondaryClusterNames: string[]; - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup; + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup; + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup; + /** + * Verifies a PrimaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @param message PrimaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this PrimaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - namespace Backup { + /** + * Gets the default type url for PrimaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } /** State enum. */ enum State { STATE_UNSPECIFIED = 0, READY = 1, - CREATING = 2, - FAILED = 3, - DELETING = 4 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ON_DEMAND = 1, - AUTOMATED = 2, - CONTINUOUS = 3 + STOPPED = 2, + EMPTY = 3, + CREATING = 4, + DELETING = 5, + FAILED = 6, + BOOTSTRAPPING = 7, + MAINTENANCE = 8, + PROMOTING = 9 + } + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + SECONDARY = 2 } } - /** Properties of a SupportedDatabaseFlag. */ - interface ISupportedDatabaseFlag { + /** Properties of an Instance. */ + interface IInstance { - /** SupportedDatabaseFlag stringRestrictions */ - stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + /** Instance name */ + name?: (string|null); - /** SupportedDatabaseFlag integerRestrictions */ - integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + /** Instance displayName */ + displayName?: (string|null); - /** SupportedDatabaseFlag name */ - name?: (string|null); + /** Instance uid */ + uid?: (string|null); - /** SupportedDatabaseFlag flagName */ - flagName?: (string|null); + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag valueType */ - valueType?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null); + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag acceptsMultipleValues */ - acceptsMultipleValues?: (boolean|null); + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag supportedDbVersions */ - supportedDbVersions?: (google.cloud.alloydb.v1alpha.DatabaseVersion[]|null); + /** Instance labels */ + labels?: ({ [k: string]: string }|null); - /** SupportedDatabaseFlag requiresDbRestart */ - requiresDbRestart?: (boolean|null); + /** Instance state */ + state?: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State|null); + + /** Instance instanceType */ + instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + + /** Instance machineConfig */ + machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + + /** Instance availabilityType */ + availabilityType?: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null); + + /** Instance gceZone */ + gceZone?: (string|null); + + /** Instance databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** Instance writableNode */ + writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + + /** Instance nodes */ + nodes?: (google.cloud.alloydb.v1alpha.Instance.INode[]|null); + + /** Instance queryInsightsConfig */ + queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance readPoolConfig */ + readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + + /** Instance ipAddress */ + ipAddress?: (string|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance updatePolicy */ + updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); } - /** Represents a SupportedDatabaseFlag. */ - class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + /** Represents an Instance. */ + class Instance implements IInstance { /** - * Constructs a new SupportedDatabaseFlag. + * Constructs a new Instance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag); + constructor(properties?: google.cloud.alloydb.v1alpha.IInstance); - /** SupportedDatabaseFlag stringRestrictions. */ - public stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + /** Instance name. */ + public name: string; - /** SupportedDatabaseFlag integerRestrictions. */ - public integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + /** Instance displayName. */ + public displayName: string; - /** SupportedDatabaseFlag name. */ - public name: string; + /** Instance uid. */ + public uid: string; - /** SupportedDatabaseFlag flagName. */ - public flagName: string; + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag valueType. */ - public valueType: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType); + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag acceptsMultipleValues. */ - public acceptsMultipleValues: boolean; + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); - /** SupportedDatabaseFlag supportedDbVersions. */ - public supportedDbVersions: google.cloud.alloydb.v1alpha.DatabaseVersion[]; + /** Instance labels. */ + public labels: { [k: string]: string }; - /** SupportedDatabaseFlag requiresDbRestart. */ - public requiresDbRestart: boolean; + /** Instance state. */ + public state: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State); - /** SupportedDatabaseFlag restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); + /** Instance instanceType. */ + public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + + /** Instance machineConfig. */ + public machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + + /** Instance availabilityType. */ + public availabilityType: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType); + + /** Instance gceZone. */ + public gceZone: string; + + /** Instance databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** Instance writableNode. */ + public writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + + /** Instance nodes. */ + public nodes: google.cloud.alloydb.v1alpha.Instance.INode[]; + + /** Instance queryInsightsConfig. */ + public queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance readPoolConfig. */ + public readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + + /** Instance ipAddress. */ + public ipAddress: string; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance updatePolicy. */ + public updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. + * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set - * @returns SupportedDatabaseFlag instance + * @returns Instance instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + public static create(properties?: google.cloud.alloydb.v1alpha.IInstance): google.cloud.alloydb.v1alpha.Instance; /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * 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 SupportedDatabaseFlag + * @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.alloydb.v1alpha.SupportedDatabaseFlag; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SupportedDatabaseFlag + * @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.alloydb.v1alpha.SupportedDatabaseFlag; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance; /** - * Verifies a SupportedDatabaseFlag message. + * 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 a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SupportedDatabaseFlag + * @returns Instance */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance; /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @param message SupportedDatabaseFlag + * 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.alloydb.v1alpha.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SupportedDatabaseFlag to JSON. + * Converts this Instance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SupportedDatabaseFlag + * 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 SupportedDatabaseFlag { + namespace Instance { - /** Properties of a StringRestrictions. */ - interface IStringRestrictions { + /** Properties of a MachineConfig. */ + interface IMachineConfig { - /** StringRestrictions allowedValues */ - allowedValues?: (string[]|null); + /** MachineConfig cpuCount */ + cpuCount?: (number|null); } - /** Represents a StringRestrictions. */ - class StringRestrictions implements IStringRestrictions { + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { /** - * Constructs a new StringRestrictions. + * Constructs a new MachineConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions); + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig); - /** StringRestrictions allowedValues. */ - public allowedValues: string[]; + /** MachineConfig cpuCount. */ + public cpuCount: number; /** - * Creates a new StringRestrictions instance using the specified properties. + * Creates a new MachineConfig instance using the specified properties. * @param [properties] Properties to set - * @returns StringRestrictions instance + * @returns MachineConfig instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig): google.cloud.alloydb.v1alpha.Instance.MachineConfig; /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StringRestrictions message from the specified reader or buffer. + * Decodes a MachineConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StringRestrictions + * @returns MachineConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.MachineConfig; /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StringRestrictions + * @returns MachineConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.MachineConfig; /** - * Verifies a StringRestrictions message. + * Verifies a MachineConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StringRestrictions + * @returns MachineConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.MachineConfig; /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @param message StringRestrictions + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StringRestrictions to JSON. + * Converts this MachineConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for StringRestrictions + * Gets the default type url for MachineConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an IntegerRestrictions. */ - interface IIntegerRestrictions { + /** Properties of a Node. */ + interface INode { - /** IntegerRestrictions minValue */ - minValue?: (google.protobuf.IInt64Value|null); + /** Node zoneId */ + zoneId?: (string|null); - /** IntegerRestrictions maxValue */ - maxValue?: (google.protobuf.IInt64Value|null); + /** Node id */ + id?: (string|null); + + /** Node ip */ + ip?: (string|null); + + /** Node state */ + state?: (string|null); } - /** Represents an IntegerRestrictions. */ - class IntegerRestrictions implements IIntegerRestrictions { + /** Represents a Node. */ + class Node implements INode { /** - * Constructs a new IntegerRestrictions. + * Constructs a new Node. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions); + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.INode); - /** IntegerRestrictions minValue. */ - public minValue?: (google.protobuf.IInt64Value|null); + /** Node zoneId. */ + public zoneId: string; - /** IntegerRestrictions maxValue. */ - public maxValue?: (google.protobuf.IInt64Value|null); + /** Node id. */ + public id: string; + + /** Node ip. */ + public ip: string; + + /** Node state. */ + public state: string; /** - * Creates a new IntegerRestrictions instance using the specified properties. + * Creates a new Node instance using the specified properties. * @param [properties] Properties to set - * @returns IntegerRestrictions instance + * @returns Node instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.INode): google.cloud.alloydb.v1alpha.Instance.Node; /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. + * Decodes a Node message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IntegerRestrictions + * @returns Node * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.Node; /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * Decodes a Node message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IntegerRestrictions + * @returns Node * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.Node; /** - * Verifies an IntegerRestrictions message. + * Verifies a Node message. * @param message Plain 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 IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * Creates a Node message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IntegerRestrictions + * @returns Node */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.Node; /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @param message IntegerRestrictions + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IntegerRestrictions to JSON. + * Converts this Node to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for IntegerRestrictions + * Gets the default type url for Node * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - FLOAT = 3, - NONE = 4 - } - } + /** Properties of a QueryInsightsInstanceConfig. */ + interface IQueryInsightsInstanceConfig { - /** Represents an AlloyDBAdmin */ - class AlloyDBAdmin extends $protobuf.rpc.Service { + /** QueryInsightsInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); - /** - * Constructs a new AlloyDBAdmin 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); + /** QueryInsightsInstanceConfig recordClientAddress */ + recordClientAddress?: (boolean|null); - /** - * Creates new AlloyDBAdmin 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): AlloyDBAdmin; + /** QueryInsightsInstanceConfig queryStringLength */ + queryStringLength?: (number|null); - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse - */ - public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback): void; + /** QueryInsightsInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + } - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise - */ - public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest): Promise; + /** Represents a QueryInsightsInstanceConfig. */ + class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster - */ - public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback): void; + /** + * Constructs a new QueryInsightsInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig); - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise - */ - public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest): Promise; + /** QueryInsightsInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback): void; + /** QueryInsightsInstanceConfig recordClientAddress. */ + public recordClientAddress?: (boolean|null); - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise - */ - public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest): Promise; + /** QueryInsightsInstanceConfig queryStringLength. */ + public queryStringLength: number; - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback): void; + /** QueryInsightsInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise - */ - public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): Promise; + /** QueryInsightsInstanceConfig _recordApplicationTags. */ + public _recordApplicationTags?: "recordApplicationTags"; - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback): void; + /** QueryInsightsInstanceConfig _recordClientAddress. */ + public _recordClientAddress?: "recordClientAddress"; - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise - */ - public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): Promise; + /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ + public _queryPlansPerMinute?: "queryPlansPerMinute"; - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback): void; + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInsightsInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; - /** + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInsightsInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @param message QueryInsightsInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadPoolConfig. */ + interface IReadPoolConfig { + + /** ReadPoolConfig nodeCount */ + nodeCount?: (number|null); + } + + /** Represents a ReadPoolConfig. */ + class ReadPoolConfig implements IReadPoolConfig { + + /** + * Constructs a new ReadPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig); + + /** ReadPoolConfig nodeCount. */ + public nodeCount: number; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Verifies a ReadPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @param message ReadPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePolicy. */ + interface IUpdatePolicy { + + /** UpdatePolicy mode */ + mode?: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null); + } + + /** Represents an UpdatePolicy. */ + class UpdatePolicy implements IUpdatePolicy { + + /** + * Constructs a new UpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy); + + /** UpdatePolicy mode. */ + public mode: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode); + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Verifies an UpdatePolicy message. + * @param message Plain 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 UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @param message UpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpdatePolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DEFAULT = 1, + FORCE_APPLY = 2 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + CREATING = 3, + DELETING = 4, + MAINTENANCE = 5, + FAILED = 6, + BOOTSTRAPPING = 8, + PROMOTING = 9 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + READ_POOL = 2, + SECONDARY = 3 + } + + /** AvailabilityType enum. */ + enum AvailabilityType { + AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 + } + } + + /** Properties of a ConnectionInfo. */ + interface IConnectionInfo { + + /** ConnectionInfo name */ + name?: (string|null); + + /** ConnectionInfo ipAddress */ + ipAddress?: (string|null); + + /** ConnectionInfo pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** ConnectionInfo instanceUid */ + instanceUid?: (string|null); + } + + /** Represents a ConnectionInfo. */ + class ConnectionInfo implements IConnectionInfo { + + /** + * Constructs a new ConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo); + + /** ConnectionInfo name. */ + public name: string; + + /** ConnectionInfo ipAddress. */ + public ipAddress: string; + + /** ConnectionInfo pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** ConnectionInfo instanceUid. */ + public instanceUid: string; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Verifies a ConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @param message ConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup displayName */ + displayName?: (string|null); + + /** Backup uid */ + uid?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup state */ + state?: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State|null); + + /** Backup type */ + type?: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type|null); + + /** Backup description */ + description?: (string|null); + + /** Backup clusterUid */ + clusterUid?: (string|null); + + /** Backup clusterName */ + clusterName?: (string|null); + + /** Backup reconciling */ + reconciling?: (boolean|null); + + /** Backup encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup displayName. */ + public displayName: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup state. */ + public state: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State); + + /** Backup type. */ + public type: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type); + + /** Backup description. */ + public description: string; + + /** Backup clusterUid. */ + public clusterUid: string; + + /** Backup clusterName. */ + public clusterName: string; + + /** Backup reconciling. */ + public reconciling: boolean; + + /** Backup encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Backup etag. */ + public etag: string; + + /** Backup annotations. */ + public annotations: { [k: string]: string }; + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBackup): google.cloud.alloydb.v1alpha.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + CREATING = 2, + FAILED = 3, + DELETING = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + AUTOMATED = 2, + CONTINUOUS = 3 + } + } + + /** Properties of a SupportedDatabaseFlag. */ + interface ISupportedDatabaseFlag { + + /** SupportedDatabaseFlag stringRestrictions */ + stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions */ + integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag name */ + name?: (string|null); + + /** SupportedDatabaseFlag flagName */ + flagName?: (string|null); + + /** SupportedDatabaseFlag valueType */ + valueType?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null); + + /** SupportedDatabaseFlag acceptsMultipleValues */ + acceptsMultipleValues?: (boolean|null); + + /** SupportedDatabaseFlag supportedDbVersions */ + supportedDbVersions?: (google.cloud.alloydb.v1alpha.DatabaseVersion[]|null); + + /** SupportedDatabaseFlag requiresDbRestart */ + requiresDbRestart?: (boolean|null); + } + + /** Represents a SupportedDatabaseFlag. */ + class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + + /** + * Constructs a new SupportedDatabaseFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag); + + /** SupportedDatabaseFlag stringRestrictions. */ + public stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions. */ + public integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag name. */ + public name: string; + + /** SupportedDatabaseFlag flagName. */ + public flagName: string; + + /** SupportedDatabaseFlag valueType. */ + public valueType: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType); + + /** SupportedDatabaseFlag acceptsMultipleValues. */ + public acceptsMultipleValues: boolean; + + /** SupportedDatabaseFlag supportedDbVersions. */ + public supportedDbVersions: google.cloud.alloydb.v1alpha.DatabaseVersion[]; + + /** SupportedDatabaseFlag requiresDbRestart. */ + public requiresDbRestart: boolean; + + /** SupportedDatabaseFlag restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedDatabaseFlag instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Verifies a SupportedDatabaseFlag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedDatabaseFlag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @param message SupportedDatabaseFlag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupportedDatabaseFlag { + + /** Properties of a StringRestrictions. */ + interface IStringRestrictions { + + /** StringRestrictions allowedValues */ + allowedValues?: (string[]|null); + } + + /** Represents a StringRestrictions. */ + class StringRestrictions implements IStringRestrictions { + + /** + * Constructs a new StringRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions); + + /** StringRestrictions allowedValues. */ + public allowedValues: string[]; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns StringRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Verifies a StringRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @param message StringRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntegerRestrictions. */ + interface IIntegerRestrictions { + + /** IntegerRestrictions minValue */ + minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue */ + maxValue?: (google.protobuf.IInt64Value|null); + } + + /** Represents an IntegerRestrictions. */ + class IntegerRestrictions implements IIntegerRestrictions { + + /** + * Constructs a new IntegerRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions); + + /** IntegerRestrictions minValue. */ + public minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue. */ + public maxValue?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Verifies an IntegerRestrictions message. + * @param message Plain 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 IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @param message IntegerRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + FLOAT = 3, + NONE = 4 + } + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType); + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUser): google.cloud.alloydb.v1alpha.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 + } + } + + /** Represents an AlloyDBAdmin */ + class AlloyDBAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBAdmin 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 AlloyDBAdmin 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): AlloyDBAdmin; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): Promise; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback): void; + + /** * Calls PromoteCluster. * @param request PromoteClusterRequest message or plain object * @returns Promise */ - public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): Promise; + public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): Promise; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback): void; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @returns Promise + */ + public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): Promise; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest): 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.alloydb.v1alpha.IGetInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest): Promise; + + /** + * 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.alloydb.v1alpha.ICreateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): Promise; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): Promise; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback): void; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @returns Promise + */ + public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): 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.alloydb.v1alpha.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): Promise; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback): void; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @returns Promise + */ + public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): Promise; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback): void; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): Promise; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @returns Promise + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): Promise; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + */ + public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback): void; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @returns Promise + */ + public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): Promise; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionInfo + */ + public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback): void; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @returns Promise + */ + public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): Promise; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback): void; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise + */ + public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest): Promise; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback): void; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise + */ + public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest): Promise; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback): void; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise + */ + public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest): Promise; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest): Promise; + } + + namespace AlloyDBAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Instance) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|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.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|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.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Backup) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @param error Error, if any + * @param [response] ListSupportedDatabaseFlagsResponse + */ + type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. + * @param error Error, if any + * @param [response] GenerateClientCertificateResponse + */ + type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. + * @param error Error, if any + * @param [response] ConnectionInfo + */ + type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ConnectionInfo) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListUsersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.alloydb.v1alpha.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.alloydb.v1alpha.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView); + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateClusterRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain 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 UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + + /** DeleteClusterRequest etag */ + etag?: (string|null); + + /** DeleteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** DeleteClusterRequest etag. */ + public etag: string; + + /** DeleteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteClusterRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { + + /** PromoteClusterRequest name */ + name?: (string|null); + + /** PromoteClusterRequest requestId */ + requestId?: (string|null); + + /** PromoteClusterRequest etag */ + etag?: (string|null); + + /** PromoteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { + + /** + * Constructs a new PromoteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest); + + /** PromoteClusterRequest name. */ + public name: string; + + /** PromoteClusterRequest requestId. */ + public requestId: string; + + /** PromoteClusterRequest etag. */ + public etag: string; + + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.PromoteClusterRequest; /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.PromoteClusterRequest; /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @returns Promise + * Verifies a PromoteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterRequest */ - public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterRequest; /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @returns Promise + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1alpha.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + * Converts this PromoteClusterRequest to JSON. + * @returns JSON object */ - public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise + * Gets the default type url for PromoteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { + + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance + * Constructs a new RestoreClusterRequest. + * @param [properties] Properties to set */ - public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback): void; + constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest); + + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** RestoreClusterRequest requestId. */ + public requestId: string; + + /** RestoreClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** RestoreClusterRequest source. */ + public source?: ("backupSource"|"continuousBackupSource"); /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise + * Creates a new RestoreClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreClusterRequest instance */ - public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest): Promise; + public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): google.cloud.alloydb.v1alpha.RestoreClusterRequest; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback): void; + public static encode(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): Promise; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreClusterRequest; /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @returns Promise + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreClusterRequest; /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies a RestoreClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @returns Promise + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreClusterRequest */ - public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreClusterRequest; /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @param message RestoreClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback): void; + public static toObject(message: google.cloud.alloydb.v1alpha.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise + * Converts this RestoreClusterRequest to JSON. + * @returns JSON object */ - public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for RestoreClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest): google.cloud.alloydb.v1alpha.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): Promise; + public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback): void; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @returns Promise + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesRequest; /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesRequest; /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @returns Promise + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest */ - public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesRequest; /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object */ - public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup + * Converts this ListInstancesRequest to JSON. + * @returns JSON object */ - public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback): void; + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set */ - public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest): Promise; + constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1alpha.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance */ - public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback): void; + public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse): google.cloud.alloydb.v1alpha.ListInstancesResponse; /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): Promise; + public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback): void; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesResponse; /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesResponse; /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @returns Promise + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse */ - public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesResponse; /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @returns Promise + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object */ - public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ConnectionInfo + * Converts this ListInstancesResponse to JSON. + * @returns JSON object */ - public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @returns Promise + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AlloyDBAdmin { + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListClustersResponse) => void; + /** GetInstanceRequest name */ + name?: (string|null); - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster - */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Cluster) => void; + /** GetInstanceRequest view */ + view?: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView|null); + } - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest view. */ + public view: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView); /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest): google.cloud.alloydb.v1alpha.GetInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse + * 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 */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListInstancesResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Instance) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.alloydb.v1alpha.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. - * @param error Error, if any - * @param [response] Operation + * Converts this GetInstanceRequest to JSON. + * @returns JSON object */ - type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateInstanceRequest requestId. */ + public requestId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. - * @param error Error, if any - * @param [response] Operation + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance */ - type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): google.cloud.alloydb.v1alpha.CreateInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListBackupsResponse) => void; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup + * 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 */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Backup) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Operation + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Operation + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @param error Error, if any - * @param [response] ListSupportedDatabaseFlagsResponse + * 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 */ - type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) => void; + public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. - * @param error Error, if any - * @param [response] GenerateClientCertificateResponse + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object */ - type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. - * @param error Error, if any - * @param [response] ConnectionInfo + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ConnectionInfo) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { - /** ListClustersRequest parent */ + /** CreateSecondaryInstanceRequest parent */ parent?: (string|null); - /** ListClustersRequest pageSize */ - pageSize?: (number|null); + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); - /** ListClustersRequest pageToken */ - pageToken?: (string|null); + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - /** ListClustersRequest filter */ - filter?: (string|null); + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); - /** ListClustersRequest orderBy */ - orderBy?: (string|null); + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { /** - * Constructs a new ListClustersRequest. + * Constructs a new CreateSecondaryInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest); - /** ListClustersRequest parent. */ + /** CreateSecondaryInstanceRequest parent. */ public parent: string; - /** ListClustersRequest pageSize. */ - public pageSize: number; + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; - /** ListClustersRequest pageToken. */ - public pageToken: string; + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - /** ListClustersRequest filter. */ - public filter: string; + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; - /** ListClustersRequest orderBy. */ - public orderBy: string; + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new ListClustersRequest instance using the specified properties. + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersRequest instance + * @returns CreateSecondaryInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest): google.cloud.alloydb.v1alpha.ListClustersRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListClustersRequest + * @returns CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersRequest + * @returns CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; /** - * Verifies a ListClustersRequest message. + * Verifies a CreateSecondaryInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersRequest + * @returns CreateSecondaryInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersRequest to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListClustersRequest + * Gets the default type url for CreateSecondaryInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { - - /** ListClustersResponse clusters */ - clusters?: (google.cloud.alloydb.v1alpha.ICluster[]|null); - - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a CreateInstanceRequests. */ + interface ICreateInstanceRequests { - /** ListClustersResponse unreachable */ - unreachable?: (string[]|null); + /** CreateInstanceRequests createInstanceRequests */ + createInstanceRequests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]|null); } - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { + /** Represents a CreateInstanceRequests. */ + class CreateInstanceRequests implements ICreateInstanceRequests { /** - * Constructs a new ListClustersResponse. + * Constructs a new CreateInstanceRequests. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse); - - /** ListClustersResponse clusters. */ - public clusters: google.cloud.alloydb.v1alpha.ICluster[]; - - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests); - /** ListClustersResponse unreachable. */ - public unreachable: string[]; + /** CreateInstanceRequests createInstanceRequests. */ + public createInstanceRequests: google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]; /** - * Creates a new ListClustersResponse instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersResponse instance + * @returns CreateInstanceRequests instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse): google.cloud.alloydb.v1alpha.ListClustersResponse; + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests): google.cloud.alloydb.v1alpha.CreateInstanceRequests; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListClustersResponse + * @returns CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequests; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersResponse + * @returns CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequests; /** - * Verifies a ListClustersResponse message. + * Verifies a CreateInstanceRequests message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersResponse + * @returns CreateInstanceRequests */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequests; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @param message CreateInstanceRequests * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersResponse to JSON. + * Converts this CreateInstanceRequests to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for CreateInstanceRequests * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { + /** Properties of a BatchCreateInstancesRequest. */ + interface IBatchCreateInstancesRequest { - /** GetClusterRequest name */ - name?: (string|null); + /** BatchCreateInstancesRequest parent */ + parent?: (string|null); + + /** BatchCreateInstancesRequest requests */ + requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId */ + requestId?: (string|null); } - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { + /** Represents a BatchCreateInstancesRequest. */ + class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { /** - * Constructs a new GetClusterRequest. + * Constructs a new BatchCreateInstancesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest); - /** GetClusterRequest name. */ - public name: string; + /** BatchCreateInstancesRequest parent. */ + public parent: string; + + /** BatchCreateInstancesRequest requests. */ + public requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId. */ + public requestId: string; /** - * Creates a new GetClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetClusterRequest instance + * @returns BatchCreateInstancesRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest): google.cloud.alloydb.v1alpha.GetClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetClusterRequest + * @returns BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetClusterRequest + * @returns BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; /** - * Verifies a GetClusterRequest message. + * Verifies a BatchCreateInstancesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetClusterRequest + * @returns BatchCreateInstancesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @param message BatchCreateInstancesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetClusterRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetClusterRequest + * Gets the default type url for BatchCreateInstancesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSecondaryClusterRequest. */ - interface ICreateSecondaryClusterRequest { - - /** CreateSecondaryClusterRequest parent */ - parent?: (string|null); - - /** CreateSecondaryClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateSecondaryClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateSecondaryClusterRequest requestId */ - requestId?: (string|null); + /** Properties of a BatchCreateInstancesResponse. */ + interface IBatchCreateInstancesResponse { - /** CreateSecondaryClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** BatchCreateInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); } - /** Represents a CreateSecondaryClusterRequest. */ - class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + /** Represents a BatchCreateInstancesResponse. */ + class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { /** - * Constructs a new CreateSecondaryClusterRequest. + * Constructs a new BatchCreateInstancesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest); - - /** CreateSecondaryClusterRequest parent. */ - public parent: string; - - /** CreateSecondaryClusterRequest clusterId. */ - public clusterId: string; - - /** CreateSecondaryClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateSecondaryClusterRequest requestId. */ - public requestId: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse); - /** CreateSecondaryClusterRequest validateOnly. */ - public validateOnly: boolean; + /** BatchCreateInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1alpha.IInstance[]; /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSecondaryClusterRequest instance + * @returns BatchCreateInstancesResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSecondaryClusterRequest + * @returns BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSecondaryClusterRequest + * @returns BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; /** - * Verifies a CreateSecondaryClusterRequest message. + * Verifies a BatchCreateInstancesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSecondaryClusterRequest + * @returns BatchCreateInstancesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryClusterRequest + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @param message BatchCreateInstancesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSecondaryClusterRequest to JSON. + * Converts this BatchCreateInstancesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSecondaryClusterRequest + * Gets the default type url for BatchCreateInstancesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest parent */ - parent?: (string|null); - - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + /** Properties of a BatchCreateInstancesMetadata. */ + interface IBatchCreateInstancesMetadata { - /** CreateClusterRequest requestId */ - requestId?: (string|null); + /** BatchCreateInstancesMetadata instanceTargets */ + instanceTargets?: (string[]|null); - /** CreateClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** BatchCreateInstancesMetadata instanceStatuses */ + instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }|null); } - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { + /** Represents a BatchCreateInstancesMetadata. */ + class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { /** - * Constructs a new CreateClusterRequest. + * Constructs a new BatchCreateInstancesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest); - - /** CreateClusterRequest parent. */ - public parent: string; - - /** CreateClusterRequest clusterId. */ - public clusterId: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata); - /** CreateClusterRequest requestId. */ - public requestId: string; + /** BatchCreateInstancesMetadata instanceTargets. */ + public instanceTargets: string[]; - /** CreateClusterRequest validateOnly. */ - public validateOnly: boolean; + /** BatchCreateInstancesMetadata instanceStatuses. */ + public instanceStatuses: { [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }; /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateClusterRequest instance + * @returns BatchCreateInstancesMetadata instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest): google.cloud.alloydb.v1alpha.CreateClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateClusterRequest + * @returns BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest + * @returns BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; /** - * Verifies a CreateClusterRequest message. + * Verifies a BatchCreateInstancesMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateClusterRequest + * @returns BatchCreateInstancesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @param message BatchCreateInstancesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateClusterRequest to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateClusterRequest + * Gets the default type url for BatchCreateInstancesMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateClusterRequest. */ - interface IUpdateClusterRequest { - - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a BatchCreateInstanceStatus. */ + interface IBatchCreateInstanceStatus { - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + /** BatchCreateInstanceStatus state */ + state?: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null); - /** UpdateClusterRequest requestId */ - requestId?: (string|null); + /** BatchCreateInstanceStatus errorMsg */ + errorMsg?: (string|null); - /** UpdateClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** BatchCreateInstanceStatus error */ + error?: (google.rpc.IStatus|null); - /** UpdateClusterRequest allowMissing */ - allowMissing?: (boolean|null); + /** BatchCreateInstanceStatus type */ + type?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); } - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { + /** Represents a BatchCreateInstanceStatus. */ + class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { /** - * Constructs a new UpdateClusterRequest. + * Constructs a new BatchCreateInstanceStatus. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest); - - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus); - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + /** BatchCreateInstanceStatus state. */ + public state: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State); - /** UpdateClusterRequest requestId. */ - public requestId: string; + /** BatchCreateInstanceStatus errorMsg. */ + public errorMsg: string; - /** UpdateClusterRequest validateOnly. */ - public validateOnly: boolean; + /** BatchCreateInstanceStatus error. */ + public error?: (google.rpc.IStatus|null); - /** UpdateClusterRequest allowMissing. */ - public allowMissing: boolean; + /** BatchCreateInstanceStatus type. */ + public type: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); /** - * Creates a new UpdateClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstanceStatus instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateClusterRequest instance + * @returns BatchCreateInstanceStatus instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateClusterRequest + * @returns BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest + * @returns BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; /** - * Verifies an UpdateClusterRequest message. + * Verifies a BatchCreateInstanceStatus message. * @param message Plain 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 UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateClusterRequest + * @returns BatchCreateInstanceStatus */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @param message BatchCreateInstanceStatus * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateClusterRequest to JSON. + * Converts this BatchCreateInstanceStatus to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateClusterRequest + * Gets the default type url for BatchCreateInstanceStatus * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { + namespace BatchCreateInstanceStatus { - /** DeleteClusterRequest name */ - name?: (string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING_CREATE = 1, + READY = 2, + CREATING = 3, + DELETING = 4, + FAILED = 5, + ROLLED_BACK = 6 + } + } - /** DeleteClusterRequest requestId */ - requestId?: (string|null); + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - /** DeleteClusterRequest etag */ - etag?: (string|null); + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); - /** DeleteClusterRequest validateOnly */ + /** UpdateInstanceRequest validateOnly */ validateOnly?: (boolean|null); - /** DeleteClusterRequest force */ - force?: (boolean|null); + /** UpdateInstanceRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { /** - * Constructs a new DeleteClusterRequest. + * Constructs a new UpdateInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest); - /** DeleteClusterRequest name. */ - public name: string; + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** DeleteClusterRequest requestId. */ - public requestId: string; + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - /** DeleteClusterRequest etag. */ - public etag: string; + /** UpdateInstanceRequest requestId. */ + public requestId: string; - /** DeleteClusterRequest validateOnly. */ + /** UpdateInstanceRequest validateOnly. */ public validateOnly: boolean; - /** DeleteClusterRequest force. */ - public force: boolean; + /** UpdateInstanceRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Creates a new UpdateInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteClusterRequest instance + * @returns UpdateInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest + * @returns UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest + * @returns UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; /** - * Verifies a DeleteClusterRequest message. + * Verifies an UpdateInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteClusterRequest + * @returns UpdateInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteClusterRequest to JSON. + * Converts this UpdateInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteClusterRequest + * Gets the default type url for UpdateInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PromoteClusterRequest. */ - interface IPromoteClusterRequest { + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { - /** PromoteClusterRequest name */ + /** DeleteInstanceRequest name */ name?: (string|null); - /** PromoteClusterRequest requestId */ + /** DeleteInstanceRequest requestId */ requestId?: (string|null); - /** PromoteClusterRequest etag */ + /** DeleteInstanceRequest etag */ etag?: (string|null); - /** PromoteClusterRequest validateOnly */ + /** DeleteInstanceRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a PromoteClusterRequest. */ - class PromoteClusterRequest implements IPromoteClusterRequest { + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { /** - * Constructs a new PromoteClusterRequest. + * Constructs a new DeleteInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest); - /** PromoteClusterRequest name. */ + /** DeleteInstanceRequest name. */ public name: string; - /** PromoteClusterRequest requestId. */ + /** DeleteInstanceRequest requestId. */ public requestId: string; - /** PromoteClusterRequest etag. */ + /** DeleteInstanceRequest etag. */ public etag: string; - /** PromoteClusterRequest validateOnly. */ + /** DeleteInstanceRequest validateOnly. */ public validateOnly: boolean; /** - * Creates a new PromoteClusterRequest instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PromoteClusterRequest instance + * @returns DeleteInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * 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 PromoteClusterRequest + * @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.alloydb.v1alpha.PromoteClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PromoteClusterRequest + * @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.alloydb.v1alpha.PromoteClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; /** - * Verifies a PromoteClusterRequest message. + * 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 PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PromoteClusterRequest + * @returns DeleteInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @param message PromoteClusterRequest + * 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.alloydb.v1alpha.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PromoteClusterRequest to JSON. + * Converts this DeleteInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PromoteClusterRequest + * 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 RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource */ - continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent */ - parent?: (string|null); - - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); + /** Properties of a FailoverInstanceRequest. */ + interface IFailoverInstanceRequest { - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + /** FailoverInstanceRequest name */ + name?: (string|null); - /** RestoreClusterRequest requestId */ + /** FailoverInstanceRequest requestId */ requestId?: (string|null); - /** RestoreClusterRequest validateOnly */ + /** FailoverInstanceRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { + /** Represents a FailoverInstanceRequest. */ + class FailoverInstanceRequest implements IFailoverInstanceRequest { /** - * Constructs a new RestoreClusterRequest. + * Constructs a new FailoverInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest); - - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource. */ - public continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent. */ - public parent: string; - - /** RestoreClusterRequest clusterId. */ - public clusterId: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest); - /** RestoreClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + /** FailoverInstanceRequest name. */ + public name: string; - /** RestoreClusterRequest requestId. */ + /** FailoverInstanceRequest requestId. */ public requestId: string; - /** RestoreClusterRequest validateOnly. */ + /** FailoverInstanceRequest validateOnly. */ public validateOnly: boolean; - /** RestoreClusterRequest source. */ - public source?: ("backupSource"|"continuousBackupSource"); - /** - * Creates a new RestoreClusterRequest instance using the specified properties. + * Creates a new FailoverInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestoreClusterRequest instance + * @returns FailoverInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestoreClusterRequest + * @returns FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestoreClusterRequest + * @returns FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; /** - * Verifies a RestoreClusterRequest message. + * Verifies a FailoverInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestoreClusterRequest + * @returns FailoverInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @param message RestoreClusterRequest + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @param message FailoverInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestoreClusterRequest to JSON. + * Converts this FailoverInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestoreClusterRequest + * Gets the default type url for FailoverInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null); - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); + /** InjectFaultRequest name */ + name?: (string|null); - /** ListInstancesRequest filter */ - filter?: (string|null); + /** InjectFaultRequest requestId */ + requestId?: (string|null); - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); + /** InjectFaultRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { /** - * Constructs a new ListInstancesRequest. + * Constructs a new InjectFaultRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest); - /** ListInstancesRequest pageSize. */ - public pageSize: number; + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType); - /** ListInstancesRequest pageToken. */ - public pageToken: string; + /** InjectFaultRequest name. */ + public name: string; - /** ListInstancesRequest filter. */ - public filter: string; + /** InjectFaultRequest requestId. */ + public requestId: string; - /** ListInstancesRequest orderBy. */ - public orderBy: string; + /** InjectFaultRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new InjectFaultRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesRequest instance + * @returns InjectFaultRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest): google.cloud.alloydb.v1alpha.ListInstancesRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest): google.cloud.alloydb.v1alpha.InjectFaultRequest; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListInstancesRequest + * @returns InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.InjectFaultRequest; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest + * @returns InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.InjectFaultRequest; /** - * Verifies a ListInstancesRequest message. + * Verifies an InjectFaultRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesRequest + * @returns InjectFaultRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.InjectFaultRequest; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this InjectFaultRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for InjectFaultRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { + namespace InjectFaultRequest { - /** ListInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } + } - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { /** - * Constructs a new ListInstancesResponse. + * Constructs a new RestartInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse); + constructor(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest); - /** ListInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1alpha.IInstance[]; + /** RestartInstanceRequest name. */ + public name: string; - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; + /** RestartInstanceRequest requestId. */ + public requestId: string; - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new RestartInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesResponse instance + * @returns RestartInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse): google.cloud.alloydb.v1alpha.ListInstancesResponse; + public static create(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): google.cloud.alloydb.v1alpha.RestartInstanceRequest; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListInstancesResponse + * @returns RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestartInstanceRequest; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse + * @returns RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestartInstanceRequest; /** - * Verifies a ListInstancesResponse message. + * Verifies a RestartInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesResponse + * @returns RestartInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestartInstanceRequest; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this RestartInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for RestartInstanceRequest * @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 { + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { - /** GetInstanceRequest name */ - name?: (string|null); + /** ListBackupsRequest parent */ + parent?: (string|null); - /** GetInstanceRequest view */ - view?: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView|null); + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); } - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { /** - * Constructs a new GetInstanceRequest. + * Constructs a new ListBackupsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest); - /** GetInstanceRequest name. */ - public name: string; + /** ListBackupsRequest parent. */ + public parent: string; - /** GetInstanceRequest view. */ - public view: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView); + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new ListBackupsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetInstanceRequest instance + * @returns ListBackupsRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest): google.cloud.alloydb.v1alpha.GetInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest): google.cloud.alloydb.v1alpha.ListBackupsRequest; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a ListBackupsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetInstanceRequest + * @returns ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsRequest; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest + * @returns ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsRequest; /** - * Verifies a GetInstanceRequest message. + * Verifies a ListBackupsRequest message. * @param message Plain object 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. + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetInstanceRequest + * @returns ListBackupsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsRequest; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this ListBackupsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for ListBackupsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { - /** CreateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + /** ListBackupsResponse backups */ + backups?: (google.cloud.alloydb.v1alpha.IBackup[]|null); - /** CreateInstanceRequest requestId */ - requestId?: (string|null); + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { /** - * Constructs a new CreateInstanceRequest. + * Constructs a new ListBackupsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse); - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + /** ListBackupsResponse backups. */ + public backups: google.cloud.alloydb.v1alpha.IBackup[]; - /** CreateInstanceRequest requestId. */ - public requestId: string; + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new ListBackupsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequest instance + * @returns ListBackupsResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse): google.cloud.alloydb.v1alpha.ListBackupsResponse; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes a ListBackupsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest + * @returns ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsResponse; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest + * @returns ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsResponse; /** - * Verifies a CreateInstanceRequest message. + * Verifies a ListBackupsResponse message. * @param message Plain object 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. + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceRequest + * @returns ListBackupsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsResponse; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this ListBackupsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for ListBackupsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSecondaryInstanceRequest. */ - interface ICreateSecondaryInstanceRequest { - - /** CreateSecondaryInstanceRequest parent */ - parent?: (string|null); - - /** CreateSecondaryInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateSecondaryInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId */ - requestId?: (string|null); + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { - /** CreateSecondaryInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** GetBackupRequest name */ + name?: (string|null); } - /** Represents a CreateSecondaryInstanceRequest. */ - class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { /** - * Constructs a new CreateSecondaryInstanceRequest. + * Constructs a new GetBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest); - - /** CreateSecondaryInstanceRequest parent. */ - public parent: string; - - /** CreateSecondaryInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateSecondaryInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId. */ - public requestId: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest); - /** CreateSecondaryInstanceRequest validateOnly. */ - public validateOnly: boolean; + /** GetBackupRequest name. */ + public name: string; /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * Creates a new GetBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSecondaryInstanceRequest instance + * @returns GetBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest): google.cloud.alloydb.v1alpha.GetBackupRequest; /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * Decodes a GetBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSecondaryInstanceRequest + * @returns GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetBackupRequest; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSecondaryInstanceRequest + * @returns GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetBackupRequest; /** - * Verifies a CreateSecondaryInstanceRequest message. + * Verifies a GetBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSecondaryInstanceRequest + * @returns GetBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetBackupRequest; /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryInstanceRequest + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSecondaryInstanceRequest to JSON. + * Converts this GetBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSecondaryInstanceRequest + * Gets the default type url for GetBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateInstanceRequests. */ - interface ICreateInstanceRequests { + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { - /** CreateInstanceRequests createInstanceRequests */ - createInstanceRequests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]|null); + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** CreateBackupRequest requestId */ + requestId?: (string|null); + + /** CreateBackupRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a CreateInstanceRequests. */ - class CreateInstanceRequests implements ICreateInstanceRequests { + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { /** - * Constructs a new CreateInstanceRequests. + * Constructs a new CreateBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests); + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest); - /** CreateInstanceRequests createInstanceRequests. */ - public createInstanceRequests: google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]; + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** CreateBackupRequest requestId. */ + public requestId: string; + + /** CreateBackupRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * Creates a new CreateBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequests instance + * @returns CreateBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest): google.cloud.alloydb.v1alpha.CreateBackupRequest; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a CreateBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateInstanceRequests + * @returns CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateBackupRequest; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequests + * @returns CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateBackupRequest; /** - * Verifies a CreateInstanceRequests message. + * Verifies a CreateBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceRequests + * @returns CreateBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateBackupRequest; /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @param message CreateInstanceRequests + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequests to JSON. + * Converts this CreateBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for CreateBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesRequest. */ - interface IBatchCreateInstancesRequest { + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { - /** BatchCreateInstancesRequest parent */ - parent?: (string|null); + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** BatchCreateInstancesRequest requests */ - requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + /** UpdateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - /** BatchCreateInstancesRequest requestId */ + /** UpdateBackupRequest requestId */ requestId?: (string|null); + + /** UpdateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a BatchCreateInstancesRequest. */ - class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { /** - * Constructs a new BatchCreateInstancesRequest. + * Constructs a new UpdateBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest); - /** BatchCreateInstancesRequest parent. */ - public parent: string; + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** BatchCreateInstancesRequest requests. */ - public requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - /** BatchCreateInstancesRequest requestId. */ + /** UpdateBackupRequest requestId. */ public requestId: string; + /** UpdateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupRequest allowMissing. */ + public allowMissing: boolean; + /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * Creates a new UpdateBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesRequest instance + * @returns UpdateBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): google.cloud.alloydb.v1alpha.UpdateBackupRequest; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes an UpdateBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesRequest + * @returns UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateBackupRequest; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesRequest + * @returns UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateBackupRequest; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies an UpdateBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesRequest + * @returns UpdateBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateBackupRequest; /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @param message BatchCreateInstancesRequest + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesRequest to JSON. + * Converts this UpdateBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for UpdateBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesResponse. */ - interface IBatchCreateInstancesResponse { + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { - /** BatchCreateInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupRequest etag */ + etag?: (string|null); } - /** Represents a BatchCreateInstancesResponse. */ - class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { /** - * Constructs a new BatchCreateInstancesResponse. + * Constructs a new DeleteBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse); + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest); - /** BatchCreateInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1alpha.IInstance[]; + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** DeleteBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupRequest etag. */ + public etag: string; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * Creates a new DeleteBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesResponse instance + * @returns DeleteBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): google.cloud.alloydb.v1alpha.DeleteBackupRequest; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes a DeleteBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesResponse + * @returns DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteBackupRequest; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesResponse + * @returns DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteBackupRequest; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies a DeleteBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesResponse + * @returns DeleteBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteBackupRequest; /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @param message BatchCreateInstancesResponse + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesResponse to JSON. + * Converts this DeleteBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for DeleteBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesMetadata. */ - interface IBatchCreateInstancesMetadata { + /** Properties of a ListSupportedDatabaseFlagsRequest. */ + interface IListSupportedDatabaseFlagsRequest { - /** BatchCreateInstancesMetadata instanceTargets */ - instanceTargets?: (string[]|null); + /** ListSupportedDatabaseFlagsRequest parent */ + parent?: (string|null); - /** BatchCreateInstancesMetadata instanceStatuses */ - instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }|null); + /** ListSupportedDatabaseFlagsRequest pageSize */ + pageSize?: (number|null); + + /** ListSupportedDatabaseFlagsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a BatchCreateInstancesMetadata. */ - class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { + /** Represents a ListSupportedDatabaseFlagsRequest. */ + class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { /** - * Constructs a new BatchCreateInstancesMetadata. + * Constructs a new ListSupportedDatabaseFlagsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata); + constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest); - /** BatchCreateInstancesMetadata instanceTargets. */ - public instanceTargets: string[]; + /** ListSupportedDatabaseFlagsRequest parent. */ + public parent: string; - /** BatchCreateInstancesMetadata instanceStatuses. */ - public instanceStatuses: { [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }; + /** ListSupportedDatabaseFlagsRequest pageSize. */ + public pageSize: number; + + /** ListSupportedDatabaseFlagsRequest pageToken. */ + public pageToken: string; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesMetadata instance + * @returns ListSupportedDatabaseFlagsRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesMetadata + * @returns ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesMetadata + * @returns ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a ListSupportedDatabaseFlagsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesMetadata + * @returns ListSupportedDatabaseFlagsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @param message BatchCreateInstancesMetadata + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesMetadata to JSON. + * Converts this ListSupportedDatabaseFlagsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for ListSupportedDatabaseFlagsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstanceStatus. */ - interface IBatchCreateInstanceStatus { - - /** BatchCreateInstanceStatus state */ - state?: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null); - - /** BatchCreateInstanceStatus errorMsg */ - errorMsg?: (string|null); + /** Properties of a ListSupportedDatabaseFlagsResponse. */ + interface IListSupportedDatabaseFlagsResponse { - /** BatchCreateInstanceStatus error */ - error?: (google.rpc.IStatus|null); + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ + supportedDatabaseFlags?: (google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null); - /** BatchCreateInstanceStatus type */ - type?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + /** ListSupportedDatabaseFlagsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a BatchCreateInstanceStatus. */ - class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { + /** Represents a ListSupportedDatabaseFlagsResponse. */ + class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new ListSupportedDatabaseFlagsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus); - - /** BatchCreateInstanceStatus state. */ - public state: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State); - - /** BatchCreateInstanceStatus errorMsg. */ - public errorMsg: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse); - /** BatchCreateInstanceStatus error. */ - public error?: (google.rpc.IStatus|null); + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ + public supportedDatabaseFlags: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]; - /** BatchCreateInstanceStatus type. */ - public type: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + /** ListSupportedDatabaseFlagsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstanceStatus instance + * @returns ListSupportedDatabaseFlagsResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstanceStatus + * @returns ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstanceStatus + * @returns ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies a ListSupportedDatabaseFlagsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstanceStatus + * @returns ListSupportedDatabaseFlagsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @param message BatchCreateInstanceStatus + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstanceStatus to JSON. + * Converts this ListSupportedDatabaseFlagsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for ListSupportedDatabaseFlagsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace BatchCreateInstanceStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING_CREATE = 1, - READY = 2, - CREATING = 3, - DELETING = 4, - FAILED = 5, - ROLLED_BACK = 6 - } - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a GenerateClientCertificateRequest. */ + interface IGenerateClientCertificateRequest { - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + /** GenerateClientCertificateRequest parent */ + parent?: (string|null); - /** UpdateInstanceRequest requestId */ + /** GenerateClientCertificateRequest requestId */ requestId?: (string|null); - /** UpdateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** GenerateClientCertificateRequest pemCsr */ + pemCsr?: (string|null); - /** UpdateInstanceRequest allowMissing */ - allowMissing?: (boolean|null); + /** GenerateClientCertificateRequest certDuration */ + certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey */ + publicKey?: (string|null); } - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { + /** Represents a GenerateClientCertificateRequest. */ + class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new GenerateClientCertificateRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest); - - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest); - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + /** GenerateClientCertificateRequest parent. */ + public parent: string; - /** UpdateInstanceRequest requestId. */ + /** GenerateClientCertificateRequest requestId. */ public requestId: string; - /** UpdateInstanceRequest validateOnly. */ - public validateOnly: boolean; + /** GenerateClientCertificateRequest pemCsr. */ + public pemCsr: string; - /** UpdateInstanceRequest allowMissing. */ - public allowMissing: boolean; + /** GenerateClientCertificateRequest certDuration. */ + public certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey. */ + public publicKey: string; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new GenerateClientCertificateRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance + * @returns GenerateClientCertificateRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest + * @returns GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest + * @returns GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a GenerateClientCertificateRequest message. * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateInstanceRequest + * @returns GenerateClientCertificateRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @param message GenerateClientCertificateRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this GenerateClientCertificateRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for GenerateClientCertificateRequest * @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); + /** Properties of a GenerateClientCertificateResponse. */ + interface IGenerateClientCertificateResponse { - /** DeleteInstanceRequest requestId */ - requestId?: (string|null); + /** GenerateClientCertificateResponse pemCertificate */ + pemCertificate?: (string|null); - /** DeleteInstanceRequest etag */ - etag?: (string|null); + /** GenerateClientCertificateResponse pemCertificateChain */ + pemCertificateChain?: (string[]|null); - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** GenerateClientCertificateResponse caCert */ + caCert?: (string|null); } - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { + /** Represents a GenerateClientCertificateResponse. */ + class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new GenerateClientCertificateResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest requestId. */ - public requestId: string; + constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse); - /** DeleteInstanceRequest etag. */ - public etag: string; + /** GenerateClientCertificateResponse pemCertificate. */ + public pemCertificate: string; - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; + /** GenerateClientCertificateResponse pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** GenerateClientCertificateResponse caCert. */ + public caCert: string; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new GenerateClientCertificateResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance + * @returns GenerateClientCertificateResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest + * @returns GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest + * @returns GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a GenerateClientCertificateResponse message. * @param message Plain object 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. + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteInstanceRequest + * @returns GenerateClientCertificateResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @param message GenerateClientCertificateResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this GenerateClientCertificateResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for GenerateClientCertificateResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FailoverInstanceRequest. */ - interface IFailoverInstanceRequest { + /** Properties of a GetConnectionInfoRequest. */ + interface IGetConnectionInfoRequest { - /** FailoverInstanceRequest name */ - name?: (string|null); + /** GetConnectionInfoRequest parent */ + parent?: (string|null); - /** FailoverInstanceRequest requestId */ + /** GetConnectionInfoRequest requestId */ requestId?: (string|null); - - /** FailoverInstanceRequest validateOnly */ - validateOnly?: (boolean|null); } - /** Represents a FailoverInstanceRequest. */ - class FailoverInstanceRequest implements IFailoverInstanceRequest { + /** Represents a GetConnectionInfoRequest. */ + class GetConnectionInfoRequest implements IGetConnectionInfoRequest { /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new GetConnectionInfoRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest); - /** FailoverInstanceRequest name. */ - public name: string; + /** GetConnectionInfoRequest parent. */ + public parent: string; - /** FailoverInstanceRequest requestId. */ + /** GetConnectionInfoRequest requestId. */ public requestId: string; - /** FailoverInstanceRequest validateOnly. */ - public validateOnly: boolean; - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * Creates a new GetConnectionInfoRequest instance using the specified properties. * @param [properties] Properties to set - * @returns FailoverInstanceRequest instance + * @returns GetConnectionInfoRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FailoverInstanceRequest + * @returns GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FailoverInstanceRequest + * @returns GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; /** - * Verifies a FailoverInstanceRequest message. + * Verifies a GetConnectionInfoRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FailoverInstanceRequest + * @returns GetConnectionInfoRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @param message FailoverInstanceRequest + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @param message GetConnectionInfoRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FailoverInstanceRequest to JSON. + * Converts this GetConnectionInfoRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for GetConnectionInfoRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { - /** RestartInstanceRequest name */ - name?: (string|null); + /** OperationMetadata batchCreateInstancesMetadata */ + batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); - /** RestartInstanceRequest requestId */ - requestId?: (string|null); + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** RestartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); } - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { /** - * Constructs a new RestartInstanceRequest. + * Constructs a new OperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata); - /** RestartInstanceRequest name. */ - public name: string; + /** OperationMetadata batchCreateInstancesMetadata. */ + public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); - /** RestartInstanceRequest requestId. */ - public requestId: string; + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** RestartInstanceRequest validateOnly. */ - public validateOnly: boolean; + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata requestSpecific. */ + public requestSpecific?: "batchCreateInstancesMetadata"; /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * Creates a new OperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RestartInstanceRequest instance + * @returns OperationMetadata instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata): google.cloud.alloydb.v1alpha.OperationMetadata; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * 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 RestartInstanceRequest + * @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.alloydb.v1alpha.RestartInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.OperationMetadata; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestartInstanceRequest + * @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.alloydb.v1alpha.RestartInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.OperationMetadata; /** - * Verifies a RestartInstanceRequest message. + * 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 a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestartInstanceRequest + * @returns OperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.OperationMetadata; /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @param message RestartInstanceRequest + * 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.alloydb.v1alpha.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestartInstanceRequest to JSON. + * Converts this OperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestartInstanceRequest + * Gets the default type url for OperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { - /** ListBackupsRequest parent */ + /** ListUsersRequest parent */ parent?: (string|null); - /** ListBackupsRequest pageSize */ + /** ListUsersRequest pageSize */ pageSize?: (number|null); - /** ListBackupsRequest pageToken */ + /** ListUsersRequest pageToken */ pageToken?: (string|null); - /** ListBackupsRequest filter */ + /** ListUsersRequest filter */ filter?: (string|null); - /** ListBackupsRequest orderBy */ + /** ListUsersRequest orderBy */ orderBy?: (string|null); } - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { /** - * Constructs a new ListBackupsRequest. + * Constructs a new ListUsersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest); - /** ListBackupsRequest parent. */ + /** ListUsersRequest parent. */ public parent: string; - /** ListBackupsRequest pageSize. */ + /** ListUsersRequest pageSize. */ public pageSize: number; - /** ListBackupsRequest pageToken. */ + /** ListUsersRequest pageToken. */ public pageToken: string; - /** ListBackupsRequest filter. */ + /** ListUsersRequest filter. */ public filter: string; - /** ListBackupsRequest orderBy. */ + /** ListUsersRequest orderBy. */ public orderBy: string; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListUsersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsRequest instance + * @returns ListUsersRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest): google.cloud.alloydb.v1alpha.ListBackupsRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest): google.cloud.alloydb.v1alpha.ListUsersRequest; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListUsersRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsRequest + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersRequest; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersRequest; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListUsersRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsRequest + * @returns ListUsersRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersRequest; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListUsersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListUsersRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { - /** ListBackupsResponse backups */ - backups?: (google.cloud.alloydb.v1alpha.IBackup[]|null); + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1alpha.IUser[]|null); - /** ListBackupsResponse nextPageToken */ + /** ListUsersResponse nextPageToken */ nextPageToken?: (string|null); - /** ListBackupsResponse unreachable */ + /** ListUsersResponse unreachable */ unreachable?: (string[]|null); } - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { /** - * Constructs a new ListBackupsResponse. + * Constructs a new ListUsersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse); + constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse); - /** ListBackupsResponse backups. */ - public backups: google.cloud.alloydb.v1alpha.IBackup[]; + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1alpha.IUser[]; - /** ListBackupsResponse nextPageToken. */ + /** ListUsersResponse nextPageToken. */ public nextPageToken: string; - /** ListBackupsResponse unreachable. */ + /** ListUsersResponse unreachable. */ public unreachable: string[]; /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new ListUsersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsResponse instance + * @returns ListUsersResponse instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse): google.cloud.alloydb.v1alpha.ListBackupsResponse; + public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse): google.cloud.alloydb.v1alpha.ListUsersResponse; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes a ListUsersResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsResponse + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersResponse; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersResponse; /** - * Verifies a ListBackupsResponse message. + * Verifies a ListUsersResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsResponse + * @returns ListUsersResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersResponse; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this ListUsersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for ListUsersResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { - /** GetBackupRequest name */ + /** GetUserRequest name */ name?: (string|null); } - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { /** - * Constructs a new GetBackupRequest. + * Constructs a new GetUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest); - /** GetBackupRequest name. */ + /** GetUserRequest name. */ public name: string; /** - * Creates a new GetBackupRequest instance using the specified properties. + * Creates a new GetUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetBackupRequest instance + * @returns GetUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest): google.cloud.alloydb.v1alpha.GetBackupRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest): google.cloud.alloydb.v1alpha.GetUserRequest; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a GetUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetBackupRequest + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetUserRequest; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetBackupRequest + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetUserRequest; /** - * Verifies a GetBackupRequest message. + * Verifies a GetUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetBackupRequest + * @returns GetUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetUserRequest; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetBackupRequest to JSON. + * Converts this GetUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for GetUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { - /** CreateBackupRequest parent */ + /** CreateUserRequest parent */ parent?: (string|null); - /** CreateBackupRequest backupId */ - backupId?: (string|null); + /** CreateUserRequest userId */ + userId?: (string|null); - /** CreateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1alpha.IUser|null); - /** CreateBackupRequest requestId */ + /** CreateUserRequest requestId */ requestId?: (string|null); - /** CreateBackupRequest validateOnly */ + /** CreateUserRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { /** - * Constructs a new CreateBackupRequest. + * Constructs a new CreateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest); - /** CreateBackupRequest parent. */ + /** CreateUserRequest parent. */ public parent: string; - /** CreateBackupRequest backupId. */ - public backupId: string; + /** CreateUserRequest userId. */ + public userId: string; - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1alpha.IUser|null); - /** CreateBackupRequest requestId. */ + /** CreateUserRequest requestId. */ public requestId: string; - /** CreateBackupRequest validateOnly. */ + /** CreateUserRequest validateOnly. */ public validateOnly: boolean; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new CreateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateBackupRequest instance + * @returns CreateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest): google.cloud.alloydb.v1alpha.CreateBackupRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest): google.cloud.alloydb.v1alpha.CreateUserRequest; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a CreateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateBackupRequest + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateUserRequest; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateUserRequest; /** - * Verifies a CreateBackupRequest message. + * Verifies a CreateUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateBackupRequest + * @returns CreateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateUserRequest; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this CreateUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for CreateUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { - /** UpdateBackupRequest updateMask */ + /** UpdateUserRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); - /** UpdateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1alpha.IUser|null); - /** UpdateBackupRequest requestId */ + /** UpdateUserRequest requestId */ requestId?: (string|null); - /** UpdateBackupRequest validateOnly */ + /** UpdateUserRequest validateOnly */ validateOnly?: (boolean|null); - /** UpdateBackupRequest allowMissing */ + /** UpdateUserRequest allowMissing */ allowMissing?: (boolean|null); } - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { /** - * Constructs a new UpdateBackupRequest. + * Constructs a new UpdateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest); + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest); - /** UpdateBackupRequest updateMask. */ + /** UpdateUserRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1alpha.IUser|null); - /** UpdateBackupRequest requestId. */ + /** UpdateUserRequest requestId. */ public requestId: string; - /** UpdateBackupRequest validateOnly. */ + /** UpdateUserRequest validateOnly. */ public validateOnly: boolean; - /** UpdateBackupRequest allowMissing. */ + /** UpdateUserRequest allowMissing. */ public allowMissing: boolean; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new UpdateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateBackupRequest instance + * @returns UpdateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest): google.cloud.alloydb.v1alpha.UpdateUserRequest; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes an UpdateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateUserRequest; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateUserRequest; /** - * Verifies an UpdateBackupRequest message. + * Verifies an UpdateUserRequest message. * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateBackupRequest + * @returns UpdateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateUserRequest; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this UpdateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { + + /** DeleteUserRequest name */ + name?: (string|null); + + /** DeleteUserRequest requestId */ + requestId?: (string|null); + + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { + + /** + * Constructs a new DeleteUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest); + + /** DeleteUserRequest name. */ + public name: string; + + /** DeleteUserRequest requestId. */ + public requestId: string; + + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Verifies a DeleteUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for DeleteUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { + /** Namespace v1beta. */ + namespace v1beta { - /** DeleteBackupRequest name */ - name?: (string|null); + /** InstanceView enum. */ + enum InstanceView { + INSTANCE_VIEW_UNSPECIFIED = 0, + INSTANCE_VIEW_BASIC = 1, + INSTANCE_VIEW_FULL = 2 + } - /** DeleteBackupRequest requestId */ - requestId?: (string|null); + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } - /** DeleteBackupRequest validateOnly */ - validateOnly?: (boolean|null); + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2 + } - /** DeleteBackupRequest etag */ - etag?: (string|null); + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword user */ + user?: (string|null); + + /** UserPassword password */ + password?: (string|null); } - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { /** - * Constructs a new DeleteBackupRequest. + * Constructs a new UserPassword. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** DeleteBackupRequest requestId. */ - public requestId: string; + constructor(properties?: google.cloud.alloydb.v1beta.IUserPassword); - /** DeleteBackupRequest validateOnly. */ - public validateOnly: boolean; + /** UserPassword user. */ + public user: string; - /** DeleteBackupRequest etag. */ - public etag: string; + /** UserPassword password. */ + public password: string; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new UserPassword instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteBackupRequest instance + * @returns UserPassword instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IUserPassword): google.cloud.alloydb.v1beta.UserPassword; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes a UserPassword message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest + * @returns UserPassword * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UserPassword; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a UserPassword message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest + * @returns UserPassword * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UserPassword; /** - * Verifies a DeleteBackupRequest message. + * Verifies a UserPassword message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteBackupRequest + * @returns UserPassword */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UserPassword; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this UserPassword to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for UserPassword * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSupportedDatabaseFlagsRequest. */ - interface IListSupportedDatabaseFlagsRequest { + /** Properties of a MigrationSource. */ + interface IMigrationSource { - /** ListSupportedDatabaseFlagsRequest parent */ - parent?: (string|null); + /** MigrationSource hostPort */ + hostPort?: (string|null); - /** ListSupportedDatabaseFlagsRequest pageSize */ - pageSize?: (number|null); + /** MigrationSource referenceId */ + referenceId?: (string|null); - /** ListSupportedDatabaseFlagsRequest pageToken */ - pageToken?: (string|null); + /** MigrationSource sourceType */ + sourceType?: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null); } - /** Represents a ListSupportedDatabaseFlagsRequest. */ - class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { + /** Represents a MigrationSource. */ + class MigrationSource implements IMigrationSource { /** - * Constructs a new ListSupportedDatabaseFlagsRequest. + * Constructs a new MigrationSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IMigrationSource); - /** ListSupportedDatabaseFlagsRequest parent. */ - public parent: string; + /** MigrationSource hostPort. */ + public hostPort: string; - /** ListSupportedDatabaseFlagsRequest pageSize. */ - public pageSize: number; + /** MigrationSource referenceId. */ + public referenceId: string; - /** ListSupportedDatabaseFlagsRequest pageToken. */ - public pageToken: string; + /** MigrationSource sourceType. */ + public sourceType: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType); /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * Creates a new MigrationSource instance using the specified properties. * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsRequest instance + * @returns MigrationSource instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IMigrationSource): google.cloud.alloydb.v1beta.MigrationSource; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * Decodes a MigrationSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsRequest + * @returns MigrationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MigrationSource; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsRequest + * @returns MigrationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MigrationSource; /** - * Verifies a ListSupportedDatabaseFlagsRequest message. + * Verifies a MigrationSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSupportedDatabaseFlagsRequest + * @returns MigrationSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MigrationSource; /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsRequest + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @param message MigrationSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * Converts this MigrationSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest + * Gets the default type url for MigrationSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSupportedDatabaseFlagsResponse. */ - interface IListSupportedDatabaseFlagsResponse { + namespace MigrationSource { - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ - supportedDatabaseFlags?: (google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null); + /** MigrationSourceType enum. */ + enum MigrationSourceType { + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, + DMS = 1 + } + } - /** ListSupportedDatabaseFlagsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); } - /** Represents a ListSupportedDatabaseFlagsResponse. */ - class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { /** - * Constructs a new ListSupportedDatabaseFlagsResponse. + * Constructs a new EncryptionConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse); - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ - public supportedDatabaseFlags: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]; + constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig); - /** ListSupportedDatabaseFlagsResponse nextPageToken. */ - public nextPageToken: string; + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * Creates a new EncryptionConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsResponse instance + * @returns EncryptionConfig instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig): google.cloud.alloydb.v1beta.EncryptionConfig; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * Decodes an EncryptionConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsResponse + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionConfig; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsResponse + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionConfig; /** - * Verifies a ListSupportedDatabaseFlagsResponse message. + * Verifies an EncryptionConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSupportedDatabaseFlagsResponse + * @returns EncryptionConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionConfig; /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsResponse + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * Converts this EncryptionConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse + * Gets the default type url for EncryptionConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GenerateClientCertificateRequest. */ - interface IGenerateClientCertificateRequest { - - /** GenerateClientCertificateRequest parent */ - parent?: (string|null); - - /** GenerateClientCertificateRequest requestId */ - requestId?: (string|null); + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { - /** GenerateClientCertificateRequest pemCsr */ - pemCsr?: (string|null); + /** EncryptionInfo encryptionType */ + encryptionType?: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type|null); - /** GenerateClientCertificateRequest certDuration */ - certDuration?: (google.protobuf.IDuration|null); + /** EncryptionInfo kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); } - /** Represents a GenerateClientCertificateRequest. */ - class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { /** - * Constructs a new GenerateClientCertificateRequest. + * Constructs a new EncryptionInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest); - - /** GenerateClientCertificateRequest parent. */ - public parent: string; - - /** GenerateClientCertificateRequest requestId. */ - public requestId: string; + constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo); - /** GenerateClientCertificateRequest pemCsr. */ - public pemCsr: string; + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type); - /** GenerateClientCertificateRequest certDuration. */ - public certDuration?: (google.protobuf.IDuration|null); + /** EncryptionInfo kmsKeyVersions. */ + public kmsKeyVersions: string[]; /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * Creates a new EncryptionInfo instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateClientCertificateRequest instance + * @returns EncryptionInfo instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo): google.cloud.alloydb.v1beta.EncryptionInfo; /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * Decodes an EncryptionInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateRequest + * @returns EncryptionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionInfo; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateRequest + * @returns EncryptionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionInfo; /** - * Verifies a GenerateClientCertificateRequest message. + * Verifies an EncryptionInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateClientCertificateRequest + * @returns EncryptionInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionInfo; /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @param message GenerateClientCertificateRequest + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateClientCertificateRequest to JSON. + * Converts this EncryptionInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GenerateClientCertificateRequest + * Gets the default type url for EncryptionInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GenerateClientCertificateResponse. */ - interface IGenerateClientCertificateResponse { + namespace EncryptionInfo { - /** GenerateClientCertificateResponse pemCertificate */ - pemCertificate?: (string|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } - /** GenerateClientCertificateResponse pemCertificateChain */ - pemCertificateChain?: (string[]|null); + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig sslMode */ + sslMode?: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode|null); + + /** SslConfig caSource */ + caSource?: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource|null); } - /** Represents a GenerateClientCertificateResponse. */ - class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { /** - * Constructs a new GenerateClientCertificateResponse. + * Constructs a new SslConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse); + constructor(properties?: google.cloud.alloydb.v1beta.ISslConfig); - /** GenerateClientCertificateResponse pemCertificate. */ - public pemCertificate: string; + /** SslConfig sslMode. */ + public sslMode: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode); - /** GenerateClientCertificateResponse pemCertificateChain. */ - public pemCertificateChain: string[]; + /** SslConfig caSource. */ + public caSource: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource); /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * Creates a new SslConfig instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateClientCertificateResponse instance + * @returns SslConfig instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + public static create(properties?: google.cloud.alloydb.v1beta.ISslConfig): google.cloud.alloydb.v1beta.SslConfig; /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * Decodes a SslConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateResponse + * @returns SslConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SslConfig; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * Decodes a SslConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateResponse + * @returns SslConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SslConfig; /** - * Verifies a GenerateClientCertificateResponse message. + * Verifies a SslConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateClientCertificateResponse + * @returns SslConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SslConfig; /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @param message GenerateClientCertificateResponse + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateClientCertificateResponse to JSON. + * Converts this SslConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GenerateClientCertificateResponse + * Gets the default type url for SslConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetConnectionInfoRequest. */ - interface IGetConnectionInfoRequest { + namespace SslConfig { + + /** SslMode enum. */ + enum SslMode { + SSL_MODE_UNSPECIFIED = 0, + SSL_MODE_ALLOW = 1, + SSL_MODE_REQUIRE = 2, + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 + } + + /** CaSource enum. */ + enum CaSource { + CA_SOURCE_UNSPECIFIED = 0, + CA_SOURCE_MANAGED = 1 + } + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy weeklySchedule */ + weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention */ + timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention */ + quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled */ + enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow */ + backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location */ + location?: (string|null); + + /** AutomatedBackupPolicy labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy weeklySchedule. */ + public weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention. */ + public timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention. */ + public quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled. */ + public enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow. */ + public backupWindow?: (google.protobuf.IDuration|null); - /** GetConnectionInfoRequest parent */ - parent?: (string|null); + /** AutomatedBackupPolicy encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - /** GetConnectionInfoRequest requestId */ - requestId?: (string|null); - } + /** AutomatedBackupPolicy location. */ + public location: string; - /** Represents a GetConnectionInfoRequest. */ - class GetConnectionInfoRequest implements IGetConnectionInfoRequest { + /** AutomatedBackupPolicy labels. */ + public labels: { [k: string]: string }; - /** - * Constructs a new GetConnectionInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest); + /** AutomatedBackupPolicy schedule. */ + public schedule?: "weeklySchedule"; - /** GetConnectionInfoRequest parent. */ - public parent: string; + /** AutomatedBackupPolicy retention. */ + public retention?: ("timeBasedRetention"|"quantityBasedRetention"); - /** GetConnectionInfoRequest requestId. */ - public requestId: string; + /** AutomatedBackupPolicy _enabled. */ + public _enabled?: "enabled"; /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. + * Creates a new AutomatedBackupPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns GetConnectionInfoRequest instance + * @returns AutomatedBackupPolicy instance */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetConnectionInfoRequest + * @returns AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetConnectionInfoRequest + * @returns AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; /** - * Verifies a GetConnectionInfoRequest message. + * Verifies an AutomatedBackupPolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetConnectionInfoRequest + * @returns AutomatedBackupPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @param message GetConnectionInfoRequest + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetConnectionInfoRequest to JSON. + * Converts this AutomatedBackupPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetConnectionInfoRequest + * Gets the default type url for AutomatedBackupPolicy * @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 batchCreateInstancesMetadata */ - batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); + namespace AutomatedBackupPolicy { - /** OperationMetadata verb */ - verb?: (string|null); + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** WeeklySchedule startTimes */ + startTimes?: (google.type.ITimeOfDay[]|null); - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); + /** WeeklySchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + } - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** + * Constructs a new WeeklySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule); - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata); + /** WeeklySchedule startTimes. */ + public startTimes: google.type.ITimeOfDay[]; - /** OperationMetadata batchCreateInstancesMetadata. */ - public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); + /** WeeklySchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklySchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** OperationMetadata target. */ - public target: string; + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** OperationMetadata verb. */ - public verb: string; + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - /** OperationMetadata statusMessage. */ - public statusMessage: string; + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + /** + * Verifies a WeeklySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - /** OperationMetadata requestSpecific. */ - public requestSpecific?: "batchCreateInstancesMetadata"; + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata): google.cloud.alloydb.v1alpha.OperationMetadata; + /** + * Converts this WeeklySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Gets the default type url for WeeklySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a TimeBasedRetention. */ + interface ITimeBasedRetention { - /** - * 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.alloydb.v1alpha.OperationMetadata; + /** TimeBasedRetention retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } - /** - * 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.alloydb.v1alpha.OperationMetadata; + /** Represents a TimeBasedRetention. */ + class TimeBasedRetention implements ITimeBasedRetention { - /** - * 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); + /** + * Constructs a new TimeBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention); - /** - * 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.alloydb.v1alpha.OperationMetadata; + /** TimeBasedRetention retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); - /** - * 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.alloydb.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; - } - } + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** Namespace v1beta. */ - namespace v1beta { + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2 - } + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - /** InstanceView enum. */ - enum InstanceView { - INSTANCE_VIEW_UNSPECIFIED = 0, - INSTANCE_VIEW_BASIC = 1, - INSTANCE_VIEW_FULL = 2 - } + /** + * Verifies a TimeBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a UserPassword. */ - interface IUserPassword { + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - /** UserPassword user */ - user?: (string|null); + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @param message TimeBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserPassword password */ - password?: (string|null); - } + /** + * Converts this TimeBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a UserPassword. */ - class UserPassword implements IUserPassword { + /** + * Gets the default type url for TimeBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new UserPassword. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUserPassword); + /** Properties of a QuantityBasedRetention. */ + interface IQuantityBasedRetention { - /** UserPassword user. */ - public user: string; + /** QuantityBasedRetention count */ + count?: (number|null); + } - /** UserPassword password. */ - public password: string; + /** Represents a QuantityBasedRetention. */ + class QuantityBasedRetention implements IQuantityBasedRetention { - /** - * Creates a new UserPassword instance using the specified properties. - * @param [properties] Properties to set - * @returns UserPassword instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUserPassword): google.cloud.alloydb.v1beta.UserPassword; + /** + * Constructs a new QuantityBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention); - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + /** QuantityBasedRetention count. */ + public count: number; - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UserPassword; + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UserPassword; + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a UserPassword message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserPassword - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UserPassword; + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @param message UserPassword - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a QuantityBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - /** - * Converts this UserPassword to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @param message QuantityBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for UserPassword - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Converts this QuantityBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Properties of a MigrationSource. */ - interface IMigrationSource { + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { - /** MigrationSource hostPort */ - hostPort?: (string|null); + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); - /** MigrationSource referenceId */ - referenceId?: (string|null); + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); - /** MigrationSource sourceType */ - sourceType?: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null); + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); } - /** Represents a MigrationSource. */ - class MigrationSource implements IMigrationSource { + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { /** - * Constructs a new MigrationSource. + * Constructs a new ContinuousBackupConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IMigrationSource); + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig); - /** MigrationSource hostPort. */ - public hostPort: string; + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); - /** MigrationSource referenceId. */ - public referenceId: string; + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; - /** MigrationSource sourceType. */ - public sourceType: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType); + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; /** - * Creates a new MigrationSource instance using the specified properties. + * Creates a new ContinuousBackupConfig instance using the specified properties. * @param [properties] Properties to set - * @returns MigrationSource instance + * @returns ContinuousBackupConfig instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IMigrationSource): google.cloud.alloydb.v1beta.MigrationSource; + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig): google.cloud.alloydb.v1beta.ContinuousBackupConfig; /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MigrationSource message from the specified reader or buffer. + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MigrationSource + * @returns ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MigrationSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupConfig; /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MigrationSource + * @returns ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MigrationSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupConfig; /** - * Verifies a MigrationSource message. + * Verifies a ContinuousBackupConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MigrationSource + * @returns ContinuousBackupConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MigrationSource; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupConfig; /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @param message MigrationSource + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MigrationSource to JSON. + * Converts this ContinuousBackupConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MigrationSource + * Gets the default type url for ContinuousBackupConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MigrationSource { + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { - /** MigrationSourceType enum. */ - enum MigrationSourceType { - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, - DMS = 1 - } - } + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); + + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); } - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { /** - * Constructs a new EncryptionConfig. + * Constructs a new ContinuousBackupInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig); + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo); - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new ContinuousBackupInfo instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionConfig instance + * @returns ContinuousBackupInfo instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig): google.cloud.alloydb.v1beta.EncryptionConfig; + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo): google.cloud.alloydb.v1beta.ContinuousBackupInfo; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionConfig + * @returns ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupInfo; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionConfig + * @returns ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupInfo; /** - * Verifies an EncryptionConfig message. + * Verifies a ContinuousBackupInfo message. * @param message Plain 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionConfig + * @returns ContinuousBackupInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupInfo; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionConfig to JSON. + * Converts this ContinuousBackupInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for ContinuousBackupInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { + /** Properties of a BackupSource. */ + interface IBackupSource { - /** EncryptionInfo encryptionType */ - encryptionType?: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type|null); + /** BackupSource backupUid */ + backupUid?: (string|null); - /** EncryptionInfo kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); + /** BackupSource backupName */ + backupName?: (string|null); } - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { + /** Represents a BackupSource. */ + class BackupSource implements IBackupSource { /** - * Constructs a new EncryptionInfo. + * Constructs a new BackupSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo); + constructor(properties?: google.cloud.alloydb.v1beta.IBackupSource); - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type); + /** BackupSource backupUid. */ + public backupUid: string; - /** EncryptionInfo kmsKeyVersions. */ - public kmsKeyVersions: string[]; + /** BackupSource backupName. */ + public backupName: string; /** - * Creates a new EncryptionInfo instance using the specified properties. + * Creates a new BackupSource instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionInfo instance + * @returns BackupSource instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo): google.cloud.alloydb.v1beta.EncryptionInfo; + public static create(properties?: google.cloud.alloydb.v1beta.IBackupSource): google.cloud.alloydb.v1beta.BackupSource; /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionInfo message from the specified reader or buffer. + * Decodes a BackupSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionInfo + * @returns BackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BackupSource; /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * Decodes a BackupSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionInfo + * @returns BackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BackupSource; /** - * Verifies an EncryptionInfo message. + * Verifies a BackupSource message. * @param message Plain 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 EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionInfo + * @returns BackupSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BackupSource; /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @param message BackupSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionInfo to JSON. + * Converts this BackupSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionInfo + * Gets the default type url for BackupSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** Properties of a SslConfig. */ - interface ISslConfig { + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { - /** SslConfig sslMode */ - sslMode?: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode|null); + /** ContinuousBackupSource cluster */ + cluster?: (string|null); - /** SslConfig caSource */ - caSource?: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource|null); + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); } - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { /** - * Constructs a new SslConfig. + * Constructs a new ContinuousBackupSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ISslConfig); + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource); - /** SslConfig sslMode. */ - public sslMode: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode); + /** ContinuousBackupSource cluster. */ + public cluster: string; - /** SslConfig caSource. */ - public caSource: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource); + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new SslConfig instance using the specified properties. + * Creates a new ContinuousBackupSource instance using the specified properties. * @param [properties] Properties to set - * @returns SslConfig instance + * @returns ContinuousBackupSource instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ISslConfig): google.cloud.alloydb.v1beta.SslConfig; + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource): google.cloud.alloydb.v1beta.ContinuousBackupSource; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes a ContinuousBackupSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SslConfig + * @returns ContinuousBackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SslConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupSource; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SslConfig + * @returns ContinuousBackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SslConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupSource; /** - * Verifies a SslConfig message. + * Verifies a ContinuousBackupSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SslConfig + * @returns ContinuousBackupSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SslConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupSource; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SslConfig to JSON. + * Converts this ContinuousBackupSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SslConfig + * Gets the default type url for ContinuousBackupSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SslConfig { + /** Properties of a Cluster. */ + interface ICluster { - /** SslMode enum. */ - enum SslMode { - SSL_MODE_UNSPECIFIED = 0, - SSL_MODE_ALLOW = 1, - SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3 - } + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - /** CaSource enum. */ - enum CaSource { - CA_SOURCE_UNSPECIFIED = 0, - CA_SOURCE_MANAGED = 1 - } - } + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); - /** Properties of an AutomatedBackupPolicy. */ - interface IAutomatedBackupPolicy { + /** Cluster name */ + name?: (string|null); - /** AutomatedBackupPolicy weeklySchedule */ - weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + /** Cluster displayName */ + displayName?: (string|null); - /** AutomatedBackupPolicy timeBasedRetention */ - timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + /** Cluster uid */ + uid?: (string|null); - /** AutomatedBackupPolicy quantityBasedRetention */ - quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** AutomatedBackupPolicy enabled */ - enabled?: (boolean|null); + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** AutomatedBackupPolicy backupWindow */ - backupWindow?: (google.protobuf.IDuration|null); + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); - /** AutomatedBackupPolicy encryptionConfig */ + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster state */ + state?: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State|null); + + /** Cluster clusterType */ + clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); + + /** Cluster databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); + + /** Cluster network */ + network?: (string|null); + + /** Cluster etag */ + etag?: (string|null); + + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Cluster reconciling */ + reconciling?: (boolean|null); + + /** Cluster initialUser */ + initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); + + /** Cluster automatedBackupPolicy */ + automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig */ + sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** Cluster encryptionConfig */ encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - /** AutomatedBackupPolicy location */ - location?: (string|null); + /** Cluster encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - /** AutomatedBackupPolicy labels */ - labels?: ({ [k: string]: string }|null); + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig */ + secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig */ + primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); } - /** Represents an AutomatedBackupPolicy. */ - class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + /** Represents a Cluster. */ + class Cluster implements ICluster { /** - * Constructs a new AutomatedBackupPolicy. + * Constructs a new Cluster. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy); + constructor(properties?: google.cloud.alloydb.v1beta.ICluster); + + /** Cluster backupSource. */ + public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** Cluster migrationSource. */ + public migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); + + /** Cluster name. */ + public name: string; + + /** Cluster displayName. */ + public displayName: string; + + /** Cluster uid. */ + public uid: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster state. */ + public state: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State); + + /** Cluster clusterType. */ + public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); + + /** Cluster databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); + + /** Cluster network. */ + public network: string; - /** AutomatedBackupPolicy weeklySchedule. */ - public weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + /** Cluster etag. */ + public etag: string; - /** AutomatedBackupPolicy timeBasedRetention. */ - public timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + /** Cluster annotations. */ + public annotations: { [k: string]: string }; - /** AutomatedBackupPolicy quantityBasedRetention. */ - public quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + /** Cluster reconciling. */ + public reconciling: boolean; - /** AutomatedBackupPolicy enabled. */ - public enabled?: (boolean|null); + /** Cluster initialUser. */ + public initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); - /** AutomatedBackupPolicy backupWindow. */ - public backupWindow?: (google.protobuf.IDuration|null); + /** Cluster automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); - /** AutomatedBackupPolicy encryptionConfig. */ + /** Cluster sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** Cluster encryptionConfig. */ public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - /** AutomatedBackupPolicy location. */ - public location: string; + /** Cluster encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - /** AutomatedBackupPolicy labels. */ - public labels: { [k: string]: string }; + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); - /** AutomatedBackupPolicy schedule. */ - public schedule?: "weeklySchedule"; + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); - /** AutomatedBackupPolicy retention. */ - public retention?: ("timeBasedRetention"|"quantityBasedRetention"); + /** Cluster secondaryConfig. */ + public secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); - /** AutomatedBackupPolicy _enabled. */ - public _enabled?: "enabled"; + /** Cluster primaryConfig. */ + public primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); + + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"); /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. + * Creates a new Cluster instance using the specified properties. * @param [properties] Properties to set - * @returns AutomatedBackupPolicy instance + * @returns Cluster instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + public static create(properties?: google.cloud.alloydb.v1beta.ICluster): google.cloud.alloydb.v1beta.Cluster; /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * Decodes a Cluster message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutomatedBackupPolicy + * @returns Cluster * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * Decodes a Cluster message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutomatedBackupPolicy + * @returns Cluster * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster; /** - * Verifies an AutomatedBackupPolicy message. + * Verifies a Cluster message. * @param message Plain 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 AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutomatedBackupPolicy + * @returns Cluster */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster; /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @param message AutomatedBackupPolicy + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutomatedBackupPolicy to JSON. + * Converts this Cluster to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutomatedBackupPolicy + * Gets the default type url for Cluster * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutomatedBackupPolicy { + namespace Cluster { - /** Properties of a WeeklySchedule. */ - interface IWeeklySchedule { + /** Properties of a NetworkConfig. */ + interface INetworkConfig { - /** WeeklySchedule startTimes */ - startTimes?: (google.type.ITimeOfDay[]|null); + /** NetworkConfig network */ + network?: (string|null); - /** WeeklySchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); } - /** Represents a WeeklySchedule. */ - class WeeklySchedule implements IWeeklySchedule { + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { /** - * Constructs a new WeeklySchedule. + * Constructs a new NetworkConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule); + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig); - /** WeeklySchedule startTimes. */ - public startTimes: google.type.ITimeOfDay[]; + /** NetworkConfig network. */ + public network: string; - /** WeeklySchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; /** - * Creates a new WeeklySchedule instance using the specified properties. + * Creates a new NetworkConfig instance using the specified properties. * @param [properties] Properties to set - * @returns WeeklySchedule instance + * @returns NetworkConfig instance */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WeeklySchedule message from the specified reader or buffer. + * Decodes a NetworkConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WeeklySchedule + * @returns NetworkConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WeeklySchedule + * @returns NetworkConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; /** - * Verifies a WeeklySchedule message. + * Verifies a NetworkConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WeeklySchedule + * @returns NetworkConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @param message WeeklySchedule + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WeeklySchedule to JSON. + * Converts this NetworkConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WeeklySchedule + * Gets the default type url for NetworkConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TimeBasedRetention. */ - interface ITimeBasedRetention { + /** Properties of a SecondaryConfig. */ + interface ISecondaryConfig { - /** TimeBasedRetention retentionPeriod */ - retentionPeriod?: (google.protobuf.IDuration|null); + /** SecondaryConfig primaryClusterName */ + primaryClusterName?: (string|null); } - /** Represents a TimeBasedRetention. */ - class TimeBasedRetention implements ITimeBasedRetention { + /** Represents a SecondaryConfig. */ + class SecondaryConfig implements ISecondaryConfig { /** - * Constructs a new TimeBasedRetention. + * Constructs a new SecondaryConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention); + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig); - /** TimeBasedRetention retentionPeriod. */ - public retentionPeriod?: (google.protobuf.IDuration|null); + /** SecondaryConfig primaryClusterName. */ + public primaryClusterName: string; /** - * Creates a new TimeBasedRetention instance using the specified properties. + * Creates a new SecondaryConfig instance using the specified properties. * @param [properties] Properties to set - * @returns TimeBasedRetention instance + * @returns SecondaryConfig instance */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. + * Decodes a SecondaryConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeBasedRetention + * @returns SecondaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeBasedRetention + * @returns SecondaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; /** - * Verifies a TimeBasedRetention message. + * Verifies a SecondaryConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeBasedRetention + * @returns SecondaryConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @param message TimeBasedRetention + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @param message SecondaryConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeBasedRetention to JSON. + * Converts this SecondaryConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TimeBasedRetention + * Gets the default type url for SecondaryConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a QuantityBasedRetention. */ - interface IQuantityBasedRetention { + /** Properties of a PrimaryConfig. */ + interface IPrimaryConfig { - /** QuantityBasedRetention count */ - count?: (number|null); + /** PrimaryConfig secondaryClusterNames */ + secondaryClusterNames?: (string[]|null); } - /** Represents a QuantityBasedRetention. */ - class QuantityBasedRetention implements IQuantityBasedRetention { + /** Represents a PrimaryConfig. */ + class PrimaryConfig implements IPrimaryConfig { /** - * Constructs a new QuantityBasedRetention. + * Constructs a new PrimaryConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention); + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig); - /** QuantityBasedRetention count. */ - public count: number; + /** PrimaryConfig secondaryClusterNames. */ + public secondaryClusterNames: string[]; /** - * Creates a new QuantityBasedRetention instance using the specified properties. + * Creates a new PrimaryConfig instance using the specified properties. * @param [properties] Properties to set - * @returns QuantityBasedRetention instance + * @returns PrimaryConfig instance */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * Decodes a PrimaryConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QuantityBasedRetention + * @returns PrimaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QuantityBasedRetention + * @returns PrimaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; /** - * Verifies a QuantityBasedRetention message. + * Verifies a PrimaryConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QuantityBasedRetention + * @returns PrimaryConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @param message QuantityBasedRetention + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @param message PrimaryConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QuantityBasedRetention to JSON. + * Converts this PrimaryConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for QuantityBasedRetention + * Gets the default type url for PrimaryConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - - /** Properties of a ContinuousBackupConfig. */ - interface IContinuousBackupConfig { - - /** ContinuousBackupConfig enabled */ - enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays */ - recoveryWindowDays?: (number|null); - - /** ContinuousBackupConfig encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - } - - /** Represents a ContinuousBackupConfig. */ - class ContinuousBackupConfig implements IContinuousBackupConfig { - - /** - * Constructs a new ContinuousBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig); - - /** ContinuousBackupConfig enabled. */ - public enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays. */ - public recoveryWindowDays: number; - - /** ContinuousBackupConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** ContinuousBackupConfig _enabled. */ - public _enabled?: "enabled"; - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Verifies a ContinuousBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @param message ContinuousBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ContinuousBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + EMPTY = 3, + CREATING = 4, + DELETING = 5, + FAILED = 6, + BOOTSTRAPPING = 7, + MAINTENANCE = 8, + PROMOTING = 9 + } - /** - * Gets the default type url for ContinuousBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + SECONDARY = 2 + } } - /** Properties of a ContinuousBackupInfo. */ - interface IContinuousBackupInfo { - - /** ContinuousBackupInfo encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + /** Properties of an Instance. */ + interface IInstance { - /** ContinuousBackupInfo enabledTime */ - enabledTime?: (google.protobuf.ITimestamp|null); + /** Instance name */ + name?: (string|null); - /** ContinuousBackupInfo schedule */ - schedule?: (google.type.DayOfWeek[]|null); - } + /** Instance displayName */ + displayName?: (string|null); - /** Represents a ContinuousBackupInfo. */ - class ContinuousBackupInfo implements IContinuousBackupInfo { + /** Instance uid */ + uid?: (string|null); - /** - * Constructs a new ContinuousBackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo); + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** ContinuousBackupInfo encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** ContinuousBackupInfo enabledTime. */ - public enabledTime?: (google.protobuf.ITimestamp|null); + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); - /** ContinuousBackupInfo schedule. */ - public schedule: google.type.DayOfWeek[]; + /** Instance labels */ + labels?: ({ [k: string]: string }|null); - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + /** Instance state */ + state?: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State|null); - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** Instance instanceType */ + instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** Instance machineConfig */ + machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + /** Instance availabilityType */ + availabilityType?: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType|null); - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + /** Instance gceZone */ + gceZone?: (string|null); - /** - * Verifies a ContinuousBackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Instance databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + /** Instance writableNode */ + writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @param message ContinuousBackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Instance nodes */ + nodes?: (google.cloud.alloydb.v1beta.Instance.INode[]|null); - /** - * Converts this ContinuousBackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Instance queryInsightsConfig */ + queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); - /** - * Gets the default type url for ContinuousBackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Instance readPoolConfig */ + readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); - /** Properties of a BackupSource. */ - interface IBackupSource { + /** Instance ipAddress */ + ipAddress?: (string|null); - /** BackupSource backupUid */ - backupUid?: (string|null); + /** Instance reconciling */ + reconciling?: (boolean|null); - /** BackupSource backupName */ - backupName?: (string|null); + /** Instance etag */ + etag?: (string|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance updatePolicy */ + updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); } - /** Represents a BackupSource. */ - class BackupSource implements IBackupSource { + /** Represents an Instance. */ + class Instance implements IInstance { /** - * Constructs a new BackupSource. + * Constructs a new Instance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IBackupSource); + constructor(properties?: google.cloud.alloydb.v1beta.IInstance); - /** BackupSource backupUid. */ - public backupUid: string; + /** Instance name. */ + public name: string; - /** BackupSource backupName. */ - public backupName: string; + /** Instance displayName. */ + public displayName: string; - /** - * Creates a new BackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBackupSource): google.cloud.alloydb.v1beta.BackupSource; + /** Instance uid. */ + public uid: string; - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BackupSource; + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BackupSource; + /** Instance labels. */ + public labels: { [k: string]: string }; - /** - * Verifies a BackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Instance state. */ + public state: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State); - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BackupSource; + /** Instance instanceType. */ + public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @param message BackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Instance machineConfig. */ + public machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); - /** - * Converts this BackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Instance availabilityType. */ + public availabilityType: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType); - /** - * Gets the default type url for BackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Instance gceZone. */ + public gceZone: string; - /** Properties of a ContinuousBackupSource. */ - interface IContinuousBackupSource { + /** Instance databaseFlags. */ + public databaseFlags: { [k: string]: string }; - /** ContinuousBackupSource cluster */ - cluster?: (string|null); + /** Instance writableNode. */ + public writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); - /** ContinuousBackupSource pointInTime */ - pointInTime?: (google.protobuf.ITimestamp|null); - } + /** Instance nodes. */ + public nodes: google.cloud.alloydb.v1beta.Instance.INode[]; - /** Represents a ContinuousBackupSource. */ - class ContinuousBackupSource implements IContinuousBackupSource { + /** Instance queryInsightsConfig. */ + public queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); - /** - * Constructs a new ContinuousBackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource); + /** Instance readPoolConfig. */ + public readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); - /** ContinuousBackupSource cluster. */ - public cluster: string; + /** Instance ipAddress. */ + public ipAddress: string; - /** ContinuousBackupSource pointInTime. */ - public pointInTime?: (google.protobuf.ITimestamp|null); + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance updatePolicy. */ + public updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); /** - * Creates a new ContinuousBackupSource instance using the specified properties. + * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set - * @returns ContinuousBackupSource instance + * @returns Instance instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource): google.cloud.alloydb.v1beta.ContinuousBackupSource; + public static create(properties?: google.cloud.alloydb.v1beta.IInstance): google.cloud.alloydb.v1beta.Instance; /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * 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 ContinuousBackupSource + * @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.alloydb.v1beta.ContinuousBackupSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContinuousBackupSource + * @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.alloydb.v1beta.ContinuousBackupSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance; /** - * Verifies a ContinuousBackupSource message. + * 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 a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContinuousBackupSource + * @returns Instance */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupSource; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance; /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @param message ContinuousBackupSource + * 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.alloydb.v1beta.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContinuousBackupSource to JSON. + * Converts this Instance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ContinuousBackupSource + * 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; } - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); - - /** Cluster name */ - name?: (string|null); - - /** Cluster displayName */ - displayName?: (string|null); + namespace Instance { - /** Cluster uid */ - uid?: (string|null); + /** Properties of a MachineConfig. */ + interface IMachineConfig { - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** MachineConfig cpuCount */ + cpuCount?: (number|null); + } - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new MachineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig); - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); + /** MachineConfig cpuCount. */ + public cpuCount: number; - /** Cluster state */ - state?: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State|null); + /** + * Creates a new MachineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig): google.cloud.alloydb.v1beta.Instance.MachineConfig; - /** Cluster clusterType */ - clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Cluster databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Cluster network */ - network?: (string|null); + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.MachineConfig; - /** Cluster etag */ - etag?: (string|null); + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.MachineConfig; - /** Cluster annotations */ - annotations?: ({ [k: string]: string }|null); + /** + * Verifies a MachineConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Cluster reconciling */ - reconciling?: (boolean|null); + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.MachineConfig; - /** Cluster initialUser */ - initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Cluster automatedBackupPolicy */ - automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); + /** + * Converts this MachineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Cluster sslConfig */ - sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + /** + * Gets the default type url for MachineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Cluster encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + /** Properties of a Node. */ + interface INode { - /** Cluster encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + /** Node zoneId */ + zoneId?: (string|null); - /** Cluster continuousBackupConfig */ - continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); + /** Node id */ + id?: (string|null); - /** Cluster continuousBackupInfo */ - continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); + /** Node ip */ + ip?: (string|null); - /** Cluster secondaryConfig */ - secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); + /** Node state */ + state?: (string|null); + } - /** Cluster primaryConfig */ - primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); - } + /** Represents a Node. */ + class Node implements INode { - /** Represents a Cluster. */ - class Cluster implements ICluster { + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.INode); - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICluster); + /** Node zoneId. */ + public zoneId: string; - /** Cluster backupSource. */ - public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + /** Node id. */ + public id: string; - /** Cluster migrationSource. */ - public migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); + /** Node ip. */ + public ip: string; - /** Cluster name. */ - public name: string; + /** Node state. */ + public state: string; - /** Cluster displayName. */ - public displayName: string; + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.INode): google.cloud.alloydb.v1beta.Instance.Node; - /** Cluster uid. */ - public uid: string; + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - /** Cluster createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - /** Cluster updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.Node; - /** Cluster deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.Node; - /** Cluster labels. */ - public labels: { [k: string]: string }; + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Cluster state. */ - public state: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State); + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.Node; - /** Cluster clusterType. */ - public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Cluster databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Cluster network. */ - public network: string; + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Cluster etag. */ - public etag: string; + /** Properties of a QueryInsightsInstanceConfig. */ + interface IQueryInsightsInstanceConfig { - /** Cluster annotations. */ - public annotations: { [k: string]: string }; + /** QueryInsightsInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); - /** Cluster reconciling. */ - public reconciling: boolean; + /** QueryInsightsInstanceConfig recordClientAddress */ + recordClientAddress?: (boolean|null); - /** Cluster initialUser. */ - public initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); + /** QueryInsightsInstanceConfig queryStringLength */ + queryStringLength?: (number|null); - /** Cluster automatedBackupPolicy. */ - public automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); + /** QueryInsightsInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + } - /** Cluster sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + /** Represents a QueryInsightsInstanceConfig. */ + class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - /** Cluster encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + /** + * Constructs a new QueryInsightsInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig); - /** Cluster encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + /** QueryInsightsInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); - /** Cluster continuousBackupConfig. */ - public continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); + /** QueryInsightsInstanceConfig recordClientAddress. */ + public recordClientAddress?: (boolean|null); - /** Cluster continuousBackupInfo. */ - public continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); + /** QueryInsightsInstanceConfig queryStringLength. */ + public queryStringLength: number; - /** Cluster secondaryConfig. */ - public secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); + /** QueryInsightsInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); - /** Cluster primaryConfig. */ - public primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); + /** QueryInsightsInstanceConfig _recordApplicationTags. */ + public _recordApplicationTags?: "recordApplicationTags"; - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"); + /** QueryInsightsInstanceConfig _recordClientAddress. */ + public _recordClientAddress?: "recordClientAddress"; - /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICluster): google.cloud.alloydb.v1beta.Cluster; + /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ + public _queryPlansPerMinute?: "queryPlansPerMinute"; - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInsightsInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Cluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster; + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster; + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster; + /** + * Verifies a QueryInsightsInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInsightsInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - /** - * Converts this Cluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @param message QueryInsightsInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for Cluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - namespace Cluster { + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Properties of a SecondaryConfig. */ - interface ISecondaryConfig { + /** Properties of a ReadPoolConfig. */ + interface IReadPoolConfig { - /** SecondaryConfig primaryClusterName */ - primaryClusterName?: (string|null); + /** ReadPoolConfig nodeCount */ + nodeCount?: (number|null); } - /** Represents a SecondaryConfig. */ - class SecondaryConfig implements ISecondaryConfig { + /** Represents a ReadPoolConfig. */ + class ReadPoolConfig implements IReadPoolConfig { /** - * Constructs a new SecondaryConfig. + * Constructs a new ReadPoolConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig); + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig); - /** SecondaryConfig primaryClusterName. */ - public primaryClusterName: string; + /** ReadPoolConfig nodeCount. */ + public nodeCount: number; /** - * Creates a new SecondaryConfig instance using the specified properties. + * Creates a new ReadPoolConfig instance using the specified properties. * @param [properties] Properties to set - * @returns SecondaryConfig instance + * @returns ReadPoolConfig instance */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecondaryConfig message from the specified reader or buffer. + * Decodes a ReadPoolConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecondaryConfig + * @returns ReadPoolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecondaryConfig + * @returns ReadPoolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; /** - * Verifies a SecondaryConfig message. + * Verifies a ReadPoolConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecondaryConfig + * @returns ReadPoolConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @param message SecondaryConfig + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @param message ReadPoolConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecondaryConfig to JSON. + * Converts this ReadPoolConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SecondaryConfig + * Gets the default type url for ReadPoolConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrimaryConfig. */ - interface IPrimaryConfig { + /** Properties of an UpdatePolicy. */ + interface IUpdatePolicy { - /** PrimaryConfig secondaryClusterNames */ - secondaryClusterNames?: (string[]|null); + /** UpdatePolicy mode */ + mode?: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null); } - /** Represents a PrimaryConfig. */ - class PrimaryConfig implements IPrimaryConfig { + /** Represents an UpdatePolicy. */ + class UpdatePolicy implements IUpdatePolicy { /** - * Constructs a new PrimaryConfig. + * Constructs a new UpdatePolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig); + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy); - /** PrimaryConfig secondaryClusterNames. */ - public secondaryClusterNames: string[]; + /** UpdatePolicy mode. */ + public mode: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode); /** - * Creates a new PrimaryConfig instance using the specified properties. + * Creates a new UpdatePolicy instance using the specified properties. * @param [properties] Properties to set - * @returns PrimaryConfig instance + * @returns UpdatePolicy instance */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrimaryConfig message from the specified reader or buffer. + * Decodes an UpdatePolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrimaryConfig + * @returns UpdatePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrimaryConfig + * @returns UpdatePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; /** - * Verifies a PrimaryConfig message. + * Verifies an UpdatePolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrimaryConfig + * @returns UpdatePolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @param message PrimaryConfig + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @param message UpdatePolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrimaryConfig to JSON. + * Converts this UpdatePolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrimaryConfig + * Gets the default type url for UpdatePolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace UpdatePolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DEFAULT = 1, + FORCE_APPLY = 2 + } + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, READY = 1, STOPPED = 2, - EMPTY = 3, - CREATING = 4, - DELETING = 5, + CREATING = 3, + DELETING = 4, + MAINTENANCE = 5, FAILED = 6, - BOOTSTRAPPING = 7, - MAINTENANCE = 8, + BOOTSTRAPPING = 8, PROMOTING = 9 } - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, PRIMARY = 1, - SECONDARY = 2 + READ_POOL = 2, + SECONDARY = 3 + } + + /** AvailabilityType enum. */ + enum AvailabilityType { + AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 } } - /** Properties of an Instance. */ - interface IInstance { + /** Properties of a ConnectionInfo. */ + interface IConnectionInfo { - /** Instance name */ + /** ConnectionInfo name */ name?: (string|null); - /** Instance displayName */ + /** ConnectionInfo ipAddress */ + ipAddress?: (string|null); + + /** ConnectionInfo pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** ConnectionInfo instanceUid */ + instanceUid?: (string|null); + } + + /** Represents a ConnectionInfo. */ + class ConnectionInfo implements IConnectionInfo { + + /** + * Constructs a new ConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IConnectionInfo); + + /** ConnectionInfo name. */ + public name: string; + + /** ConnectionInfo ipAddress. */ + public ipAddress: string; + + /** ConnectionInfo pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** ConnectionInfo instanceUid. */ + public instanceUid: string; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IConnectionInfo): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Verifies a ConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @param message ConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup displayName */ displayName?: (string|null); - /** Instance uid */ + /** Backup uid */ uid?: (string|null); - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup state */ + state?: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State|null); + + /** Backup type */ + type?: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type|null); + + /** Backup description */ + description?: (string|null); + + /** Backup clusterUid */ + clusterUid?: (string|null); + + /** Backup clusterName */ + clusterName?: (string|null); + + /** Backup reconciling */ + reconciling?: (boolean|null); + + /** Backup encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup displayName. */ + public displayName: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup state. */ + public state: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State); + + /** Backup type. */ + public type: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type); - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Backup description. */ + public description: string; - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** Backup clusterUid. */ + public clusterUid: string; - /** Instance labels */ - labels?: ({ [k: string]: string }|null); + /** Backup clusterName. */ + public clusterName: string; - /** Instance state */ - state?: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State|null); + /** Backup reconciling. */ + public reconciling: boolean; - /** Instance instanceType */ - instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); + /** Backup encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - /** Instance machineConfig */ - machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - /** Instance availabilityType */ - availabilityType?: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType|null); + /** Backup etag. */ + public etag: string; - /** Instance gceZone */ - gceZone?: (string|null); + /** Backup annotations. */ + public annotations: { [k: string]: string }; - /** Instance databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); - /** Instance writableNode */ - writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); + /** Backup expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); - /** Instance nodes */ - nodes?: (google.cloud.alloydb.v1beta.Instance.INode[]|null); + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBackup): google.cloud.alloydb.v1beta.Backup; - /** Instance queryInsightsConfig */ - queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance readPoolConfig */ - readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - /** Instance ipAddress */ - ipAddress?: (string|null); + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup; - /** Instance reconciling */ - reconciling?: (boolean|null); + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup; - /** Instance etag */ - etag?: (string|null); + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - } + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup; - /** Represents an Instance. */ - class Instance implements IInstance { + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new Instance. - * @param [properties] Properties to set + * Converts this Backup to JSON. + * @returns JSON object */ - constructor(properties?: google.cloud.alloydb.v1beta.IInstance); + public toJSON(): { [k: string]: any }; - /** Instance name. */ - public name: string; + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Instance displayName. */ - public displayName: string; + namespace Backup { - /** Instance uid. */ - public uid: string; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + CREATING = 2, + FAILED = 3, + DELETING = 4 + } - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + AUTOMATED = 2, + CONTINUOUS = 3 + } + } - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** Properties of a SupportedDatabaseFlag. */ + interface ISupportedDatabaseFlag { - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); + /** SupportedDatabaseFlag stringRestrictions */ + stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); - /** Instance labels. */ - public labels: { [k: string]: string }; + /** SupportedDatabaseFlag integerRestrictions */ + integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); - /** Instance state. */ - public state: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State); + /** SupportedDatabaseFlag name */ + name?: (string|null); - /** Instance instanceType. */ - public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); + /** SupportedDatabaseFlag flagName */ + flagName?: (string|null); - /** Instance machineConfig. */ - public machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); + /** SupportedDatabaseFlag valueType */ + valueType?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null); - /** Instance availabilityType. */ - public availabilityType: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType); + /** SupportedDatabaseFlag acceptsMultipleValues */ + acceptsMultipleValues?: (boolean|null); - /** Instance gceZone. */ - public gceZone: string; + /** SupportedDatabaseFlag supportedDbVersions */ + supportedDbVersions?: (google.cloud.alloydb.v1beta.DatabaseVersion[]|null); - /** Instance databaseFlags. */ - public databaseFlags: { [k: string]: string }; + /** SupportedDatabaseFlag requiresDbRestart */ + requiresDbRestart?: (boolean|null); + } - /** Instance writableNode. */ - public writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); + /** Represents a SupportedDatabaseFlag. */ + class SupportedDatabaseFlag implements ISupportedDatabaseFlag { - /** Instance nodes. */ - public nodes: google.cloud.alloydb.v1beta.Instance.INode[]; + /** + * Constructs a new SupportedDatabaseFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag); - /** Instance queryInsightsConfig. */ - public queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); + /** SupportedDatabaseFlag stringRestrictions. */ + public stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); - /** Instance readPoolConfig. */ - public readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); + /** SupportedDatabaseFlag integerRestrictions. */ + public integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); - /** Instance ipAddress. */ - public ipAddress: string; + /** SupportedDatabaseFlag name. */ + public name: string; - /** Instance reconciling. */ - public reconciling: boolean; + /** SupportedDatabaseFlag flagName. */ + public flagName: string; - /** Instance etag. */ - public etag: string; + /** SupportedDatabaseFlag valueType. */ + public valueType: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType); - /** Instance annotations. */ - public annotations: { [k: string]: string }; + /** SupportedDatabaseFlag acceptsMultipleValues. */ + public acceptsMultipleValues: boolean; + + /** SupportedDatabaseFlag supportedDbVersions. */ + public supportedDbVersions: google.cloud.alloydb.v1beta.DatabaseVersion[]; + + /** SupportedDatabaseFlag requiresDbRestart. */ + public requiresDbRestart: boolean; + + /** SupportedDatabaseFlag restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); /** - * Creates a new Instance instance using the specified properties. + * Creates a new SupportedDatabaseFlag instance using the specified properties. * @param [properties] Properties to set - * @returns Instance instance + * @returns SupportedDatabaseFlag instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IInstance): google.cloud.alloydb.v1beta.Instance; + public static create(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Instance + * @returns SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Instance + * @returns SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; /** - * Verifies an Instance message. + * Verifies a SupportedDatabaseFlag message. * @param message Plain 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. + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Instance + * @returns SupportedDatabaseFlag */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @param message SupportedDatabaseFlag * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Instance to JSON. + * Converts this SupportedDatabaseFlag to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Instance + * Gets the default type url for SupportedDatabaseFlag * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Instance { - - /** Properties of a MachineConfig. */ - interface IMachineConfig { - - /** MachineConfig cpuCount */ - cpuCount?: (number|null); - } - - /** Represents a MachineConfig. */ - class MachineConfig implements IMachineConfig { - - /** - * Constructs a new MachineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig); - - /** MachineConfig cpuCount. */ - public cpuCount: number; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MachineConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Verifies a MachineConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MachineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @param message MachineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MachineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MachineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Node. */ - interface INode { - - /** Node zoneId */ - zoneId?: (string|null); - - /** Node id */ - id?: (string|null); + namespace SupportedDatabaseFlag { - /** Node ip */ - ip?: (string|null); + /** Properties of a StringRestrictions. */ + interface IStringRestrictions { - /** Node state */ - state?: (string|null); + /** StringRestrictions allowedValues */ + allowedValues?: (string[]|null); } - /** Represents a Node. */ - class Node implements INode { + /** Represents a StringRestrictions. */ + class StringRestrictions implements IStringRestrictions { /** - * Constructs a new Node. + * Constructs a new StringRestrictions. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.INode); - - /** Node zoneId. */ - public zoneId: string; - - /** Node id. */ - public id: string; - - /** Node ip. */ - public ip: string; + constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions); - /** Node state. */ - public state: string; + /** StringRestrictions allowedValues. */ + public allowedValues: string[]; /** - * Creates a new Node instance using the specified properties. + * Creates a new StringRestrictions instance using the specified properties. * @param [properties] Properties to set - * @returns Node instance + * @returns StringRestrictions instance */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.INode): google.cloud.alloydb.v1beta.Instance.Node; + public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Node message from the specified reader or buffer. + * Decodes a StringRestrictions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Node + * @returns StringRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.Node; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; /** - * Decodes a Node message from the specified reader or buffer, length delimited. + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Node + * @returns StringRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.Node; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; /** - * Verifies a Node message. + * Verifies a StringRestrictions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Node + * @returns StringRestrictions */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.Node; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @param message Node + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @param message StringRestrictions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Node to JSON. + * Converts this StringRestrictions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Node + * Gets the default type url for StringRestrictions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a QueryInsightsInstanceConfig. */ - interface IQueryInsightsInstanceConfig { - - /** QueryInsightsInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress */ - recordClientAddress?: (boolean|null); + /** Properties of an IntegerRestrictions. */ + interface IIntegerRestrictions { - /** QueryInsightsInstanceConfig queryStringLength */ - queryStringLength?: (number|null); + /** IntegerRestrictions minValue */ + minValue?: (google.protobuf.IInt64Value|null); - /** QueryInsightsInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); + /** IntegerRestrictions maxValue */ + maxValue?: (google.protobuf.IInt64Value|null); } - /** Represents a QueryInsightsInstanceConfig. */ - class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig); - - /** QueryInsightsInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress. */ - public recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength. */ - public queryStringLength: number; - - /** QueryInsightsInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** QueryInsightsInstanceConfig _recordApplicationTags. */ - public _recordApplicationTags?: "recordApplicationTags"; + /** Represents an IntegerRestrictions. */ + class IntegerRestrictions implements IIntegerRestrictions { - /** QueryInsightsInstanceConfig _recordClientAddress. */ - public _recordClientAddress?: "recordClientAddress"; + /** + * Constructs a new IntegerRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions); - /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ - public _queryPlansPerMinute?: "queryPlansPerMinute"; + /** IntegerRestrictions minValue. */ + public minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue. */ + public maxValue?: (google.protobuf.IInt64Value|null); /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * Creates a new IntegerRestrictions instance using the specified properties. * @param [properties] Properties to set - * @returns QueryInsightsInstanceConfig instance + * @returns IntegerRestrictions instance */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * Decodes an IntegerRestrictions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryInsightsInstanceConfig + * @returns IntegerRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryInsightsInstanceConfig + * @returns IntegerRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; /** - * Verifies a QueryInsightsInstanceConfig message. + * Verifies an IntegerRestrictions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryInsightsInstanceConfig + * @returns IntegerRestrictions */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @param message QueryInsightsInstanceConfig + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @param message IntegerRestrictions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryInsightsInstanceConfig to JSON. + * Converts this IntegerRestrictions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for QueryInsightsInstanceConfig + * Gets the default type url for IntegerRestrictions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadPoolConfig. */ - interface IReadPoolConfig { + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + FLOAT = 3, + NONE = 4 + } + } - /** ReadPoolConfig nodeCount */ - nodeCount?: (number|null); + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType); + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUser): google.cloud.alloydb.v1beta.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 } + } - /** Represents a ReadPoolConfig. */ - class ReadPoolConfig implements IReadPoolConfig { + /** Represents an AlloyDBAdmin */ + class AlloyDBAdmin extends $protobuf.rpc.Service { - /** - * Constructs a new ReadPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig); + /** + * Constructs a new AlloyDBAdmin 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); - /** ReadPoolConfig nodeCount. */ - public nodeCount: number; + /** + * Creates new AlloyDBAdmin 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): AlloyDBAdmin; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest): Promise; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback): void; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @returns Promise + */ + public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest): Promise; - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback): void; - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @returns Promise + */ + public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest): Promise; - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback): void; - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): Promise; - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback): void; - /** - * Verifies a ReadPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest): Promise; - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + /** + * 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.alloydb.v1beta.IGetInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback): void; - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @param message ReadPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest): Promise; - /** - * Converts this ReadPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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.alloydb.v1beta.ICreateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback): void; - /** - * Gets the default type url for ReadPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest): Promise; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - CREATING = 3, - DELETING = 4, - MAINTENANCE = 5, - FAILED = 6, - BOOTSTRAPPING = 8, - PROMOTING = 9 - } + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - READ_POOL = 2, - SECONDARY = 3 - } + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): Promise; - /** AvailabilityType enum. */ - enum AvailabilityType { - AVAILABILITY_TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2 - } - } + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback): void; - /** Properties of a ConnectionInfo. */ - interface IConnectionInfo { + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @returns Promise + */ + public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): Promise; - /** ConnectionInfo name */ - name?: (string|null); + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback): void; - /** ConnectionInfo ipAddress */ - ipAddress?: (string|null); + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): Promise; - /** ConnectionInfo pemCertificateChain */ - pemCertificateChain?: (string[]|null); + /** + * 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.alloydb.v1beta.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback): void; - /** ConnectionInfo instanceUid */ - instanceUid?: (string|null); - } + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): Promise; - /** Represents a ConnectionInfo. */ - class ConnectionInfo implements IConnectionInfo { + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback): void; /** - * Constructs a new ConnectionInfo. - * @param [properties] Properties to set + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.alloydb.v1beta.IConnectionInfo); + public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): Promise; - /** ConnectionInfo name. */ - public name: string; + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback): void; - /** ConnectionInfo ipAddress. */ - public ipAddress: string; + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest): Promise; - /** ConnectionInfo pemCertificateChain. */ - public pemCertificateChain: string[]; + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback): void; - /** ConnectionInfo instanceUid. */ - public instanceUid: string; + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest): Promise; /** - * Creates a new ConnectionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionInfo instance + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse */ - public static create(properties?: google.cloud.alloydb.v1beta.IConnectionInfo): google.cloud.alloydb.v1beta.ConnectionInfo; + public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback): void; /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest): Promise; /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback): void; /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ConnectionInfo; + public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest): Promise; /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ConnectionInfo; + public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback): void; /** - * Verifies a ConnectionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest): Promise; /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionInfo + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ConnectionInfo; + public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback): void; /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @param message ConnectionInfo - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.alloydb.v1beta.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest): Promise; /** - * Converts this ConnectionInfo to JSON. - * @returns JSON object + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; + public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback): void; /** - * Gets the default type url for ConnectionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); - - /** Backup displayName */ - displayName?: (string|null); - - /** Backup uid */ - uid?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels */ - labels?: ({ [k: string]: string }|null); - - /** Backup state */ - state?: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State|null); - - /** Backup type */ - type?: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type|null); - - /** Backup description */ - description?: (string|null); - - /** Backup clusterUid */ - clusterUid?: (string|null); - - /** Backup clusterName */ - clusterName?: (string|null); - - /** Backup reconciling */ - reconciling?: (boolean|null); - - /** Backup encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** Backup etag */ - etag?: (string|null); - - /** Backup annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { + public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest): Promise; /** - * Constructs a new Backup. - * @param [properties] Properties to set + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse */ - constructor(properties?: google.cloud.alloydb.v1beta.IBackup); - - /** Backup name. */ - public name: string; - - /** Backup displayName. */ - public displayName: string; - - /** Backup uid. */ - public uid: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; - - /** Backup state. */ - public state: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State); - - /** Backup type. */ - public type: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type); - - /** Backup description. */ - public description: string; - - /** Backup clusterUid. */ - public clusterUid: string; - - /** Backup clusterName. */ - public clusterName: string; - - /** Backup reconciling. */ - public reconciling: boolean; - - /** Backup encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; - /** Backup etag. */ - public etag: string; + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @returns Promise + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): Promise; - /** Backup annotations. */ - public annotations: { [k: string]: string }; + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + */ + public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback): void; - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @returns Promise + */ + public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): Promise; - /** Backup expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionInfo + */ + public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback): void; /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.alloydb.v1beta.IBackup): google.cloud.alloydb.v1beta.Backup; + public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): Promise; /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse */ - public static encode(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback): void; /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest): Promise; /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup; + public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback): void; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup; + public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest): Promise; /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - public static verify(message: { [k: string]: any }): (string|null); + public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback): void; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup; + public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest): Promise; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User */ - public static toObject(message: google.cloud.alloydb.v1beta.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback): void; /** - * Converts this Backup to JSON. - * @returns JSON object + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; + public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest): Promise; /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback): void; - namespace Backup { + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest): Promise; + } - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - CREATING = 2, - FAILED = 3, - DELETING = 4 - } + namespace AlloyDBAdmin { - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ON_DEMAND = 1, - AUTOMATED = 2, - CONTINUOUS = 3 - } - } + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListClustersResponse) => void; - /** Properties of a SupportedDatabaseFlag. */ - interface ISupportedDatabaseFlag { + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Cluster) => void; - /** SupportedDatabaseFlag stringRestrictions */ - stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag integerRestrictions */ - integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag name */ - name?: (string|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag flagName */ - flagName?: (string|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag valueType */ - valueType?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag acceptsMultipleValues */ - acceptsMultipleValues?: (boolean|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag supportedDbVersions */ - supportedDbVersions?: (google.cloud.alloydb.v1beta.DatabaseVersion[]|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListInstancesResponse) => void; - /** SupportedDatabaseFlag requiresDbRestart */ - requiresDbRestart?: (boolean|null); - } + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Instance) => void; - /** Represents a SupportedDatabaseFlag. */ - class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Constructs a new SupportedDatabaseFlag. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation */ - constructor(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag); + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag stringRestrictions. */ - public stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag integerRestrictions. */ - public integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag name. */ - public name: string; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag flagName. */ - public flagName: string; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag valueType. */ - public valueType: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag acceptsMultipleValues. */ - public acceptsMultipleValues: boolean; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** SupportedDatabaseFlag supportedDbVersions. */ - public supportedDbVersions: google.cloud.alloydb.v1beta.DatabaseVersion[]; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListBackupsResponse) => void; - /** SupportedDatabaseFlag requiresDbRestart. */ - public requiresDbRestart: boolean; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Backup) => void; - /** SupportedDatabaseFlag restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @param [properties] Properties to set - * @returns SupportedDatabaseFlag instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Operation */ - public static create(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Operation */ - public static encode(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @param error Error, if any + * @param [response] ListSupportedDatabaseFlagsResponse */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) => void; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. + * @param error Error, if any + * @param [response] GenerateClientCertificateResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) => void; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. + * @param error Error, if any + * @param [response] ConnectionInfo */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ConnectionInfo) => void; /** - * Verifies a SupportedDatabaseFlag message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse */ - public static verify(message: { [k: string]: any }): (string|null); + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListUsersResponse) => void; /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SupportedDatabaseFlag + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @param message SupportedDatabaseFlag - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; /** - * Converts this SupportedDatabaseFlag to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User */ - public toJSON(): { [k: string]: any }; + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; /** - * Gets the default type url for SupportedDatabaseFlag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - namespace SupportedDatabaseFlag { - - /** Properties of a StringRestrictions. */ - interface IStringRestrictions { - - /** StringRestrictions allowedValues */ - allowedValues?: (string[]|null); - } - - /** Represents a StringRestrictions. */ - class StringRestrictions implements IStringRestrictions { - - /** - * Constructs a new StringRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions); - - /** StringRestrictions allowedValues. */ - public allowedValues: string[]; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns StringRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Verifies a StringRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @param message StringRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IntegerRestrictions. */ - interface IIntegerRestrictions { - - /** IntegerRestrictions minValue */ - minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue */ - maxValue?: (google.protobuf.IInt64Value|null); - } - - /** Represents an IntegerRestrictions. */ - class IntegerRestrictions implements IIntegerRestrictions { - - /** - * Constructs a new IntegerRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions); - - /** IntegerRestrictions minValue. */ - public minValue?: (google.protobuf.IInt64Value|null); + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { - /** IntegerRestrictions maxValue. */ - public maxValue?: (google.protobuf.IInt64Value|null); + /** ListClustersRequest parent */ + parent?: (string|null); - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + /** ListClustersRequest pageSize */ + pageSize?: (number|null); - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListClustersRequest pageToken */ + pageToken?: (string|null); - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListClustersRequest filter */ + filter?: (string|null); - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { - /** - * Verifies an IntegerRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListClustersRequest); - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + /** ListClustersRequest parent. */ + public parent: string; - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @param message IntegerRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListClustersRequest pageSize. */ + public pageSize: number; - /** - * Converts this IntegerRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** ListClustersRequest pageToken. */ + public pageToken: string; - /** - * Gets the default type url for IntegerRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** ListClustersRequest filter. */ + public filter: string; - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - FLOAT = 3, - NONE = 4 - } - } + /** ListClustersRequest orderBy. */ + public orderBy: string; - /** Represents an AlloyDBAdmin */ - class AlloyDBAdmin extends $protobuf.rpc.Service { + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListClustersRequest): google.cloud.alloydb.v1beta.ListClustersRequest; /** - * Constructs a new AlloyDBAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static encode(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Creates new AlloyDBAdmin 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. + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersRequest; /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersRequest; /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest */ - public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersRequest; /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object */ - public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback): void; + public static toObject(message: google.cloud.alloydb.v1beta.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise + * Converts this ListClustersRequest to JSON. + * @returns JSON object */ - public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.alloydb.v1beta.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set */ - public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest): Promise; + constructor(properties?: google.cloud.alloydb.v1beta.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.alloydb.v1beta.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance */ - public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback): void; + public static create(properties?: google.cloud.alloydb.v1beta.IListClustersResponse): google.cloud.alloydb.v1beta.ListClustersResponse; /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest): Promise; + public static encode(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback): void; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @returns Promise + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersResponse; /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersResponse; /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @returns Promise + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse */ - public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersResponse; /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @returns Promise + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object */ - public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1beta.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + * Converts this ListClustersResponse to JSON. + * @returns JSON object */ - public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set */ - public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback): void; + constructor(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView); /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest): google.cloud.alloydb.v1beta.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest): Promise; + public static encode(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback): void; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetClusterRequest; /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetClusterRequest; /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @returns Promise + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest */ - public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetClusterRequest; /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @returns Promise + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1beta.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this GetClusterRequest to JSON. + * @returns JSON object */ - public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set */ - public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback): void; + constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance */ - public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): Promise; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback): void; + public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @returns Promise + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): Promise; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @returns Promise + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest */ - public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback): void; + public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object */ - public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set */ - public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest): Promise; + constructor(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance */ - public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback): void; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest): google.cloud.alloydb.v1beta.CreateClusterRequest; /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest): Promise; + public static encode(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback): void; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateClusterRequest; /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateClusterRequest; /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @returns Promise + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest */ - public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateClusterRequest; /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @returns Promise + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): Promise; + public static toObject(message: google.cloud.alloydb.v1beta.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ConnectionInfo + * Converts this CreateClusterRequest to JSON. + * @returns JSON object */ - public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @returns Promise + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AlloyDBAdmin { + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListClustersResponse) => void; + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Cluster) => void; + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateClusterRequest allowMissing. */ + public allowMissing: boolean; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest): google.cloud.alloydb.v1beta.UpdateClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. - * @param error Error, if any - * @param [response] Operation + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListInstancesResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Instance) => void; + public static toObject(message: google.cloud.alloydb.v1beta.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + + /** DeleteClusterRequest etag */ + etag?: (string|null); + + /** DeleteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set */ - type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** DeleteClusterRequest etag. */ + public etag: string; - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** DeleteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteClusterRequest force. */ + public force: boolean; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. - * @param error Error, if any - * @param [response] Operation + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance */ - type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest): google.cloud.alloydb.v1beta.DeleteClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListBackupsResponse) => void; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Backup) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Operation + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Operation + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteClusterRequest; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @param error Error, if any - * @param [response] ListSupportedDatabaseFlagsResponse + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object */ - type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) => void; + public static toObject(message: google.cloud.alloydb.v1beta.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. - * @param error Error, if any - * @param [response] GenerateClientCertificateResponse + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object */ - type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. - * @param error Error, if any - * @param [response] ConnectionInfo + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ConnectionInfo) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest parent */ - parent?: (string|null); + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { - /** ListClustersRequest pageSize */ - pageSize?: (number|null); + /** PromoteClusterRequest name */ + name?: (string|null); - /** ListClustersRequest pageToken */ - pageToken?: (string|null); + /** PromoteClusterRequest requestId */ + requestId?: (string|null); - /** ListClustersRequest filter */ - filter?: (string|null); + /** PromoteClusterRequest etag */ + etag?: (string|null); - /** ListClustersRequest orderBy */ - orderBy?: (string|null); + /** PromoteClusterRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { /** - * Constructs a new ListClustersRequest. + * Constructs a new PromoteClusterRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListClustersRequest); - - /** ListClustersRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest); - /** ListClustersRequest pageSize. */ - public pageSize: number; + /** PromoteClusterRequest name. */ + public name: string; - /** ListClustersRequest pageToken. */ - public pageToken: string; + /** PromoteClusterRequest requestId. */ + public requestId: string; - /** ListClustersRequest filter. */ - public filter: string; + /** PromoteClusterRequest etag. */ + public etag: string; - /** ListClustersRequest orderBy. */ - public orderBy: string; + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new ListClustersRequest instance using the specified properties. + * Creates a new PromoteClusterRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersRequest instance + * @returns PromoteClusterRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListClustersRequest): google.cloud.alloydb.v1beta.ListClustersRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest): google.cloud.alloydb.v1beta.PromoteClusterRequest; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a PromoteClusterRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListClustersRequest + * @returns PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterRequest; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersRequest + * @returns PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterRequest; /** - * Verifies a ListClustersRequest message. + * Verifies a PromoteClusterRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersRequest + * @returns PromoteClusterRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterRequest; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersRequest to JSON. + * Converts this PromoteClusterRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListClustersRequest + * Gets the default type url for PromoteClusterRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { - /** ListClustersResponse clusters */ - clusters?: (google.cloud.alloydb.v1beta.ICluster[]|null); + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); - /** ListClustersResponse unreachable */ - unreachable?: (string[]|null); + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { /** - * Constructs a new ListClustersResponse. + * Constructs a new RestoreClusterRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListClustersResponse); + constructor(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest); - /** ListClustersResponse clusters. */ - public clusters: google.cloud.alloydb.v1beta.ICluster[]; + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; + /** RestoreClusterRequest requestId. */ + public requestId: string; - /** ListClustersResponse unreachable. */ - public unreachable: string[]; + /** RestoreClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** RestoreClusterRequest source. */ + public source?: ("backupSource"|"continuousBackupSource"); /** - * Creates a new ListClustersResponse instance using the specified properties. + * Creates a new RestoreClusterRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListClustersResponse instance + * @returns RestoreClusterRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListClustersResponse): google.cloud.alloydb.v1beta.ListClustersResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest): google.cloud.alloydb.v1beta.RestoreClusterRequest; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes a RestoreClusterRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListClustersResponse + * @returns RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreClusterRequest; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListClustersResponse + * @returns RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreClusterRequest; /** - * Verifies a ListClustersResponse message. + * Verifies a RestoreClusterRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListClustersResponse + * @returns RestoreClusterRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreClusterRequest; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @param message RestoreClusterRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClustersResponse to JSON. + * Converts this RestoreClusterRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for RestoreClusterRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { - /** GetClusterRequest name */ - name?: (string|null); + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); } - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { /** - * Constructs a new GetClusterRequest. + * Constructs a new ListInstancesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest); - /** GetClusterRequest name. */ - public name: string; + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; /** - * Creates a new GetClusterRequest instance using the specified properties. + * Creates a new ListInstancesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetClusterRequest instance + * @returns ListInstancesRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest): google.cloud.alloydb.v1beta.GetClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest): google.cloud.alloydb.v1beta.ListInstancesRequest; /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetClusterRequest + * @returns ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesRequest; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetClusterRequest + * @returns ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesRequest; /** - * Verifies a GetClusterRequest message. + * Verifies a ListInstancesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetClusterRequest + * @returns ListInstancesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesRequest; /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetClusterRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetClusterRequest + * Gets the default type url for ListInstancesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSecondaryClusterRequest. */ - interface ICreateSecondaryClusterRequest { - - /** CreateSecondaryClusterRequest parent */ - parent?: (string|null); - - /** CreateSecondaryClusterRequest clusterId */ - clusterId?: (string|null); + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { - /** CreateSecondaryClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** ListInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); - /** CreateSecondaryClusterRequest requestId */ - requestId?: (string|null); + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); - /** CreateSecondaryClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a CreateSecondaryClusterRequest. */ - class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { /** - * Constructs a new CreateSecondaryClusterRequest. + * Constructs a new ListInstancesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest); - - /** CreateSecondaryClusterRequest parent. */ - public parent: string; - - /** CreateSecondaryClusterRequest clusterId. */ - public clusterId: string; + constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse); - /** CreateSecondaryClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** ListInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1beta.IInstance[]; - /** CreateSecondaryClusterRequest requestId. */ - public requestId: string; + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; - /** CreateSecondaryClusterRequest validateOnly. */ - public validateOnly: boolean; + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * Creates a new ListInstancesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSecondaryClusterRequest instance + * @returns ListInstancesResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse): google.cloud.alloydb.v1beta.ListInstancesResponse; /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSecondaryClusterRequest + * @returns ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesResponse; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSecondaryClusterRequest + * @returns ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesResponse; /** - * Verifies a CreateSecondaryClusterRequest message. + * Verifies a ListInstancesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSecondaryClusterRequest + * @returns ListInstancesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesResponse; /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryClusterRequest + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSecondaryClusterRequest to JSON. + * Converts this ListInstancesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSecondaryClusterRequest + * Gets the default type url for ListInstancesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest parent */ - parent?: (string|null); - - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { - /** CreateClusterRequest requestId */ - requestId?: (string|null); + /** GetInstanceRequest name */ + name?: (string|null); - /** CreateClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** GetInstanceRequest view */ + view?: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView|null); } - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { /** - * Constructs a new CreateClusterRequest. + * Constructs a new GetInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest); - - /** CreateClusterRequest parent. */ - public parent: string; - - /** CreateClusterRequest clusterId. */ - public clusterId: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + constructor(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest); - /** CreateClusterRequest requestId. */ - public requestId: string; + /** GetInstanceRequest name. */ + public name: string; - /** CreateClusterRequest validateOnly. */ - public validateOnly: boolean; + /** GetInstanceRequest view. */ + public view: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView); /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new GetInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateClusterRequest instance + * @returns GetInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest): google.cloud.alloydb.v1beta.CreateClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest): google.cloud.alloydb.v1beta.GetInstanceRequest; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * 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 CreateClusterRequest + * @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.alloydb.v1beta.CreateClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetInstanceRequest; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest + * @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.alloydb.v1beta.CreateClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetInstanceRequest; /** - * Verifies a CreateClusterRequest message. + * 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 CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateClusterRequest + * @returns GetInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetInstanceRequest; /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest + * 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.alloydb.v1beta.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateClusterRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateClusterRequest + * 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 UpdateClusterRequest. */ - interface IUpdateClusterRequest { + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** CreateInstanceRequest parent */ + parent?: (string|null); - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); - /** UpdateClusterRequest requestId */ + /** CreateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateInstanceRequest requestId */ requestId?: (string|null); - /** UpdateClusterRequest validateOnly */ + /** CreateInstanceRequest validateOnly */ validateOnly?: (boolean|null); - - /** UpdateClusterRequest allowMissing */ - allowMissing?: (boolean|null); } - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { /** - * Constructs a new UpdateClusterRequest. + * Constructs a new CreateInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest); + constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest); - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** CreateInstanceRequest parent. */ + public parent: string; - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** CreateInstanceRequest instanceId. */ + public instanceId: string; - /** UpdateClusterRequest requestId. */ + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateInstanceRequest requestId. */ public requestId: string; - /** UpdateClusterRequest validateOnly. */ + /** CreateInstanceRequest validateOnly. */ public validateOnly: boolean; - /** UpdateClusterRequest allowMissing. */ - public allowMissing: boolean; - /** - * Creates a new UpdateClusterRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateClusterRequest instance + * @returns CreateInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest): google.cloud.alloydb.v1beta.UpdateClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest): google.cloud.alloydb.v1beta.CreateInstanceRequest; /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * 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 UpdateClusterRequest + * @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.alloydb.v1beta.UpdateClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequest; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest + * @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.alloydb.v1beta.UpdateClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequest; /** - * Verifies an UpdateClusterRequest message. + * 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 an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateClusterRequest + * @returns CreateInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequest; /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest + * 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.alloydb.v1beta.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateClusterRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateClusterRequest + * 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 DeleteClusterRequest. */ - interface IDeleteClusterRequest { + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { - /** DeleteClusterRequest name */ - name?: (string|null); + /** CreateSecondaryInstanceRequest parent */ + parent?: (string|null); - /** DeleteClusterRequest requestId */ - requestId?: (string|null); + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); - /** DeleteClusterRequest etag */ - etag?: (string|null); + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1beta.IInstance|null); - /** DeleteClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); - /** DeleteClusterRequest force */ - force?: (boolean|null); + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { /** - * Constructs a new DeleteClusterRequest. + * Constructs a new CreateSecondaryInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest); + constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest); - /** DeleteClusterRequest name. */ - public name: string; + /** CreateSecondaryInstanceRequest parent. */ + public parent: string; - /** DeleteClusterRequest requestId. */ - public requestId: string; + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; - /** DeleteClusterRequest etag. */ - public etag: string; + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - /** DeleteClusterRequest validateOnly. */ - public validateOnly: boolean; + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; - /** DeleteClusterRequest force. */ - public force: boolean; + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteClusterRequest instance + * @returns CreateSecondaryInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest): google.cloud.alloydb.v1beta.DeleteClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest + * @returns CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest + * @returns CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; /** - * Verifies a DeleteClusterRequest message. + * Verifies a CreateSecondaryInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteClusterRequest + * @returns CreateSecondaryInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteClusterRequest to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteClusterRequest + * Gets the default type url for CreateSecondaryInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PromoteClusterRequest. */ - interface IPromoteClusterRequest { - - /** PromoteClusterRequest name */ - name?: (string|null); - - /** PromoteClusterRequest requestId */ - requestId?: (string|null); - - /** PromoteClusterRequest etag */ - etag?: (string|null); + /** Properties of a CreateInstanceRequests. */ + interface ICreateInstanceRequests { - /** PromoteClusterRequest validateOnly */ - validateOnly?: (boolean|null); + /** CreateInstanceRequests createInstanceRequests */ + createInstanceRequests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequest[]|null); } - /** Represents a PromoteClusterRequest. */ - class PromoteClusterRequest implements IPromoteClusterRequest { + /** Represents a CreateInstanceRequests. */ + class CreateInstanceRequests implements ICreateInstanceRequests { /** - * Constructs a new PromoteClusterRequest. + * Constructs a new CreateInstanceRequests. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest); - - /** PromoteClusterRequest name. */ - public name: string; - - /** PromoteClusterRequest requestId. */ - public requestId: string; - - /** PromoteClusterRequest etag. */ - public etag: string; + constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests); - /** PromoteClusterRequest validateOnly. */ - public validateOnly: boolean; + /** CreateInstanceRequests createInstanceRequests. */ + public createInstanceRequests: google.cloud.alloydb.v1beta.ICreateInstanceRequest[]; /** - * Creates a new PromoteClusterRequest instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @param [properties] Properties to set - * @returns PromoteClusterRequest instance + * @returns CreateInstanceRequests instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest): google.cloud.alloydb.v1beta.PromoteClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests): google.cloud.alloydb.v1beta.CreateInstanceRequests; /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PromoteClusterRequest + * @returns CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequests; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PromoteClusterRequest + * @returns CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequests; /** - * Verifies a PromoteClusterRequest message. + * Verifies a CreateInstanceRequests message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PromoteClusterRequest + * @returns CreateInstanceRequests */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequests; /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @param message PromoteClusterRequest + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @param message CreateInstanceRequests * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PromoteClusterRequest to JSON. + * Converts this CreateInstanceRequests to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PromoteClusterRequest + * Gets the default type url for CreateInstanceRequests * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource */ - continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); + /** Properties of a BatchCreateInstancesRequest. */ + interface IBatchCreateInstancesRequest { - /** RestoreClusterRequest parent */ + /** BatchCreateInstancesRequest parent */ parent?: (string|null); - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); - - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** BatchCreateInstancesRequest requests */ + requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); - /** RestoreClusterRequest requestId */ + /** BatchCreateInstancesRequest requestId */ requestId?: (string|null); - - /** RestoreClusterRequest validateOnly */ - validateOnly?: (boolean|null); } - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { + /** Represents a BatchCreateInstancesRequest. */ + class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { /** - * Constructs a new RestoreClusterRequest. + * Constructs a new BatchCreateInstancesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest); - - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource. */ - public continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest); - /** RestoreClusterRequest parent. */ + /** BatchCreateInstancesRequest parent. */ public parent: string; - /** RestoreClusterRequest clusterId. */ - public clusterId: string; - - /** RestoreClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + /** BatchCreateInstancesRequest requests. */ + public requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); - /** RestoreClusterRequest requestId. */ + /** BatchCreateInstancesRequest requestId. */ public requestId: string; - /** RestoreClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** RestoreClusterRequest source. */ - public source?: ("backupSource"|"continuousBackupSource"); - /** - * Creates a new RestoreClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestoreClusterRequest instance + * @returns BatchCreateInstancesRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest): google.cloud.alloydb.v1beta.RestoreClusterRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestoreClusterRequest + * @returns BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreClusterRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestoreClusterRequest + * @returns BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreClusterRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; /** - * Verifies a RestoreClusterRequest message. + * Verifies a BatchCreateInstancesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestoreClusterRequest + * @returns BatchCreateInstancesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreClusterRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @param message RestoreClusterRequest + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @param message BatchCreateInstancesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestoreClusterRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestoreClusterRequest + * Gets the default type url for BatchCreateInstancesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); + /** Properties of a BatchCreateInstancesResponse. */ + interface IBatchCreateInstancesResponse { - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); + /** BatchCreateInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); } - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { + /** Represents a BatchCreateInstancesResponse. */ + class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { /** - * Constructs a new ListInstancesRequest. + * Constructs a new BatchCreateInstancesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse); - /** ListInstancesRequest orderBy. */ - public orderBy: string; + /** BatchCreateInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1beta.IInstance[]; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesRequest instance + * @returns BatchCreateInstancesResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest): google.cloud.alloydb.v1beta.ListInstancesRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListInstancesRequest + * @returns BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest + * @returns BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; /** - * Verifies a ListInstancesRequest message. + * Verifies a BatchCreateInstancesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesRequest + * @returns BatchCreateInstancesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @param message BatchCreateInstancesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this BatchCreateInstancesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for BatchCreateInstancesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); + /** Properties of a BatchCreateInstancesMetadata. */ + interface IBatchCreateInstancesMetadata { - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); + /** BatchCreateInstancesMetadata instanceTargets */ + instanceTargets?: (string[]|null); - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); + /** BatchCreateInstancesMetadata instanceStatuses */ + instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }|null); } - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { + /** Represents a BatchCreateInstancesMetadata. */ + class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { /** - * Constructs a new ListInstancesResponse. + * Constructs a new BatchCreateInstancesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1beta.IInstance[]; + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata); - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; + /** BatchCreateInstancesMetadata instanceTargets. */ + public instanceTargets: string[]; - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; + /** BatchCreateInstancesMetadata instanceStatuses. */ + public instanceStatuses: { [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesResponse instance + * @returns BatchCreateInstancesMetadata instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse): google.cloud.alloydb.v1beta.ListInstancesResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListInstancesResponse + * @returns BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse + * @returns BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; /** - * Verifies a ListInstancesResponse message. + * Verifies a BatchCreateInstancesMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesResponse + * @returns BatchCreateInstancesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @param message BatchCreateInstancesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for BatchCreateInstancesMetadata * @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 { + /** Properties of a BatchCreateInstanceStatus. */ + interface IBatchCreateInstanceStatus { - /** GetInstanceRequest name */ - name?: (string|null); + /** BatchCreateInstanceStatus state */ + state?: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null); - /** GetInstanceRequest view */ - view?: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView|null); + /** BatchCreateInstanceStatus errorMsg */ + errorMsg?: (string|null); + + /** BatchCreateInstanceStatus error */ + error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type */ + type?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); } - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { + /** Represents a BatchCreateInstanceStatus. */ + class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { /** - * Constructs a new GetInstanceRequest. + * Constructs a new BatchCreateInstanceStatus. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus); - /** GetInstanceRequest name. */ - public name: string; + /** BatchCreateInstanceStatus state. */ + public state: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State); - /** GetInstanceRequest view. */ - public view: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView); + /** BatchCreateInstanceStatus errorMsg. */ + public errorMsg: string; + + /** BatchCreateInstanceStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type. */ + public type: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new BatchCreateInstanceStatus instance using the specified properties. * @param [properties] Properties to set - * @returns GetInstanceRequest instance + * @returns BatchCreateInstanceStatus instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest): google.cloud.alloydb.v1beta.GetInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetInstanceRequest + * @returns BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest + * @returns BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; /** - * Verifies a GetInstanceRequest message. + * Verifies a BatchCreateInstanceStatus message. * @param message Plain object 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. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetInstanceRequest + * @returns BatchCreateInstanceStatus */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @param message BatchCreateInstanceStatus * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this BatchCreateInstanceStatus to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for BatchCreateInstanceStatus * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { + namespace BatchCreateInstanceStatus { - /** CreateInstanceRequest parent */ - parent?: (string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING_CREATE = 1, + READY = 2, + CREATING = 3, + DELETING = 4, + FAILED = 5, + ROLLED_BACK = 6 + } + } - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { - /** CreateInstanceRequest instance */ + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ instance?: (google.cloud.alloydb.v1beta.IInstance|null); - /** CreateInstanceRequest requestId */ + /** UpdateInstanceRequest requestId */ requestId?: (string|null); - /** CreateInstanceRequest validateOnly */ + /** UpdateInstanceRequest validateOnly */ validateOnly?: (boolean|null); + + /** UpdateInstanceRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { /** - * Constructs a new CreateInstanceRequest. + * Constructs a new UpdateInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest); - /** CreateInstanceRequest instanceId. */ - public instanceId: string; + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** CreateInstanceRequest instance. */ + /** UpdateInstanceRequest instance. */ public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - /** CreateInstanceRequest requestId. */ + /** UpdateInstanceRequest requestId. */ public requestId: string; - /** CreateInstanceRequest validateOnly. */ + /** UpdateInstanceRequest validateOnly. */ public validateOnly: boolean; + /** UpdateInstanceRequest allowMissing. */ + public allowMissing: boolean; + /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new UpdateInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequest instance + * @returns UpdateInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest): google.cloud.alloydb.v1beta.CreateInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): google.cloud.alloydb.v1beta.UpdateInstanceRequest; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest + * @returns UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateInstanceRequest; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest + * @returns UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateInstanceRequest; /** - * Verifies a CreateInstanceRequest message. + * Verifies an UpdateInstanceRequest message. * @param message Plain object 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. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceRequest + * @returns UpdateInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateInstanceRequest; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this UpdateInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for UpdateInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSecondaryInstanceRequest. */ - interface ICreateSecondaryInstanceRequest { - - /** CreateSecondaryInstanceRequest parent */ - parent?: (string|null); - - /** CreateSecondaryInstanceRequest instanceId */ - instanceId?: (string|null); + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { - /** CreateSecondaryInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1beta.IInstance|null); + /** DeleteInstanceRequest name */ + name?: (string|null); - /** CreateSecondaryInstanceRequest requestId */ + /** DeleteInstanceRequest requestId */ requestId?: (string|null); - /** CreateSecondaryInstanceRequest validateOnly */ + /** DeleteInstanceRequest etag */ + etag?: (string|null); + + /** DeleteInstanceRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a CreateSecondaryInstanceRequest. */ - class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { /** - * Constructs a new CreateSecondaryInstanceRequest. + * Constructs a new DeleteInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest); - - /** CreateSecondaryInstanceRequest parent. */ - public parent: string; - - /** CreateSecondaryInstanceRequest instanceId. */ - public instanceId: string; + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest); - /** CreateSecondaryInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1beta.IInstance|null); + /** DeleteInstanceRequest name. */ + public name: string; - /** CreateSecondaryInstanceRequest requestId. */ + /** DeleteInstanceRequest requestId. */ public requestId: string; - /** CreateSecondaryInstanceRequest validateOnly. */ + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** DeleteInstanceRequest validateOnly. */ public validateOnly: boolean; /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSecondaryInstanceRequest instance + * @returns DeleteInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): google.cloud.alloydb.v1beta.DeleteInstanceRequest; /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * 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 CreateSecondaryInstanceRequest + * @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.alloydb.v1beta.CreateSecondaryInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteInstanceRequest; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSecondaryInstanceRequest + * @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.alloydb.v1beta.CreateSecondaryInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteInstanceRequest; /** - * Verifies a CreateSecondaryInstanceRequest message. + * 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 CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSecondaryInstanceRequest + * @returns DeleteInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteInstanceRequest; /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryInstanceRequest + * 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.alloydb.v1beta.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSecondaryInstanceRequest to JSON. + * Converts this DeleteInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSecondaryInstanceRequest + * 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 CreateInstanceRequests. */ - interface ICreateInstanceRequests { + /** Properties of a FailoverInstanceRequest. */ + interface IFailoverInstanceRequest { - /** CreateInstanceRequests createInstanceRequests */ - createInstanceRequests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequest[]|null); + /** FailoverInstanceRequest name */ + name?: (string|null); + + /** FailoverInstanceRequest requestId */ + requestId?: (string|null); + + /** FailoverInstanceRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a CreateInstanceRequests. */ - class CreateInstanceRequests implements ICreateInstanceRequests { + /** Represents a FailoverInstanceRequest. */ + class FailoverInstanceRequest implements IFailoverInstanceRequest { /** - * Constructs a new CreateInstanceRequests. + * Constructs a new FailoverInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests); + constructor(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest); - /** CreateInstanceRequests createInstanceRequests. */ - public createInstanceRequests: google.cloud.alloydb.v1beta.ICreateInstanceRequest[]; + /** FailoverInstanceRequest name. */ + public name: string; + + /** FailoverInstanceRequest requestId. */ + public requestId: string; + + /** FailoverInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * Creates a new FailoverInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequests instance + * @returns FailoverInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests): google.cloud.alloydb.v1beta.CreateInstanceRequests; + public static create(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): google.cloud.alloydb.v1beta.FailoverInstanceRequest; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateInstanceRequests + * @returns FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequests; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.FailoverInstanceRequest; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequests + * @returns FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequests; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.FailoverInstanceRequest; /** - * Verifies a CreateInstanceRequests message. + * Verifies a FailoverInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateInstanceRequests + * @returns FailoverInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequests; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.FailoverInstanceRequest; /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @param message CreateInstanceRequests + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @param message FailoverInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequests to JSON. + * Converts this FailoverInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for FailoverInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesRequest. */ - interface IBatchCreateInstancesRequest { + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { - /** BatchCreateInstancesRequest parent */ - parent?: (string|null); + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null); - /** BatchCreateInstancesRequest requests */ - requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); + /** InjectFaultRequest name */ + name?: (string|null); - /** BatchCreateInstancesRequest requestId */ + /** InjectFaultRequest requestId */ requestId?: (string|null); + + /** InjectFaultRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a BatchCreateInstancesRequest. */ - class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { /** - * Constructs a new BatchCreateInstancesRequest. + * Constructs a new InjectFaultRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest); - /** BatchCreateInstancesRequest parent. */ - public parent: string; + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType); - /** BatchCreateInstancesRequest requests. */ - public requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); + /** InjectFaultRequest name. */ + public name: string; - /** BatchCreateInstancesRequest requestId. */ + /** InjectFaultRequest requestId. */ public requestId: string; + /** InjectFaultRequest validateOnly. */ + public validateOnly: boolean; + /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * Creates a new InjectFaultRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesRequest instance + * @returns InjectFaultRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest): google.cloud.alloydb.v1beta.InjectFaultRequest; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesRequest + * @returns InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.InjectFaultRequest; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesRequest + * @returns InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.InjectFaultRequest; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies an InjectFaultRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesRequest + * @returns InjectFaultRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.InjectFaultRequest; /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @param message BatchCreateInstancesRequest + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesRequest to JSON. + * Converts this InjectFaultRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for InjectFaultRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesResponse. */ - interface IBatchCreateInstancesResponse { + namespace InjectFaultRequest { - /** BatchCreateInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } } - /** Represents a BatchCreateInstancesResponse. */ - class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { /** - * Constructs a new BatchCreateInstancesResponse. + * Constructs a new RestartInstanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse); + constructor(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest); - /** BatchCreateInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1beta.IInstance[]; + /** RestartInstanceRequest name. */ + public name: string; + + /** RestartInstanceRequest requestId. */ + public requestId: string; + + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * Creates a new RestartInstanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesResponse instance + * @returns RestartInstanceRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest): google.cloud.alloydb.v1beta.RestartInstanceRequest; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesResponse + * @returns RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestartInstanceRequest; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesResponse + * @returns RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestartInstanceRequest; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies a RestartInstanceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesResponse + * @returns RestartInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestartInstanceRequest; /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @param message BatchCreateInstancesResponse + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesResponse to JSON. + * Converts this RestartInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for RestartInstanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstancesMetadata. */ - interface IBatchCreateInstancesMetadata { + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { - /** BatchCreateInstancesMetadata instanceTargets */ - instanceTargets?: (string[]|null); + /** ListBackupsRequest parent */ + parent?: (string|null); - /** BatchCreateInstancesMetadata instanceStatuses */ - instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }|null); + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); } - /** Represents a BatchCreateInstancesMetadata. */ - class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { /** - * Constructs a new BatchCreateInstancesMetadata. + * Constructs a new ListBackupsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata); + constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest); - /** BatchCreateInstancesMetadata instanceTargets. */ - public instanceTargets: string[]; + /** ListBackupsRequest parent. */ + public parent: string; - /** BatchCreateInstancesMetadata instanceStatuses. */ - public instanceStatuses: { [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }; + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * Creates a new ListBackupsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstancesMetadata instance + * @returns ListBackupsRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest): google.cloud.alloydb.v1beta.ListBackupsRequest; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a ListBackupsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesMetadata + * @returns ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsRequest; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesMetadata + * @returns ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsRequest; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a ListBackupsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstancesMetadata + * @returns ListBackupsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsRequest; /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @param message BatchCreateInstancesMetadata + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstancesMetadata to JSON. + * Converts this ListBackupsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for ListBackupsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateInstanceStatus. */ - interface IBatchCreateInstanceStatus { - - /** BatchCreateInstanceStatus state */ - state?: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null); + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { - /** BatchCreateInstanceStatus errorMsg */ - errorMsg?: (string|null); + /** ListBackupsResponse backups */ + backups?: (google.cloud.alloydb.v1beta.IBackup[]|null); - /** BatchCreateInstanceStatus error */ - error?: (google.rpc.IStatus|null); + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); - /** BatchCreateInstanceStatus type */ - type?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a BatchCreateInstanceStatus. */ - class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new ListBackupsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus); - - /** BatchCreateInstanceStatus state. */ - public state: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State); + constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse); - /** BatchCreateInstanceStatus errorMsg. */ - public errorMsg: string; + /** ListBackupsResponse backups. */ + public backups: google.cloud.alloydb.v1beta.IBackup[]; - /** BatchCreateInstanceStatus error. */ - public error?: (google.rpc.IStatus|null); + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; - /** BatchCreateInstanceStatus type. */ - public type: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * Creates a new ListBackupsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateInstanceStatus instance + * @returns ListBackupsResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse): google.cloud.alloydb.v1beta.ListBackupsResponse; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes a ListBackupsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateInstanceStatus + * @returns ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsResponse; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateInstanceStatus + * @returns ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsResponse; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies a ListBackupsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateInstanceStatus + * @returns ListBackupsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsResponse; /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @param message BatchCreateInstanceStatus + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateInstanceStatus to JSON. + * Converts this ListBackupsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for ListBackupsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace BatchCreateInstanceStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING_CREATE = 1, - READY = 2, - CREATING = 3, - DELETING = 4, - FAILED = 5, - ROLLED_BACK = 6 - } - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** UpdateInstanceRequest requestId */ - requestId?: (string|null); - - /** UpdateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { - /** UpdateInstanceRequest allowMissing */ - allowMissing?: (boolean|null); + /** GetBackupRequest name */ + name?: (string|null); } - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new GetBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest); - - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** UpdateInstanceRequest requestId. */ - public requestId: string; - - /** UpdateInstanceRequest validateOnly. */ - public validateOnly: boolean; + constructor(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest); - /** UpdateInstanceRequest allowMissing. */ - public allowMissing: boolean; + /** GetBackupRequest name. */ + public name: string; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new GetBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance + * @returns GetBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest): google.cloud.alloydb.v1beta.GetBackupRequest; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a GetBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest + * @returns GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetBackupRequest; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest + * @returns GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetBackupRequest; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a GetBackupRequest message. * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateInstanceRequest + * @returns GetBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetBackupRequest; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this GetBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for GetBackupRequest * @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 { + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { - /** DeleteInstanceRequest name */ - name?: (string|null); + /** CreateBackupRequest parent */ + parent?: (string|null); - /** DeleteInstanceRequest requestId */ - requestId?: (string|null); + /** CreateBackupRequest backupId */ + backupId?: (string|null); - /** DeleteInstanceRequest etag */ - etag?: (string|null); + /** CreateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1beta.IBackup|null); - /** DeleteInstanceRequest validateOnly */ + /** CreateBackupRequest requestId */ + requestId?: (string|null); + + /** CreateBackupRequest validateOnly */ validateOnly?: (boolean|null); } - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new CreateBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest); - /** DeleteInstanceRequest name. */ - public name: string; + /** CreateBackupRequest parent. */ + public parent: string; - /** DeleteInstanceRequest requestId. */ - public requestId: string; + /** CreateBackupRequest backupId. */ + public backupId: string; - /** DeleteInstanceRequest etag. */ - public etag: string; + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1beta.IBackup|null); - /** DeleteInstanceRequest validateOnly. */ + /** CreateBackupRequest requestId. */ + public requestId: string; + + /** CreateBackupRequest validateOnly. */ public validateOnly: boolean; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new CreateBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance + * @returns CreateBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest): google.cloud.alloydb.v1beta.CreateBackupRequest; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a CreateBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest + * @returns CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateBackupRequest; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest + * @returns CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateBackupRequest; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a CreateBackupRequest message. * @param message Plain object 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. + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteInstanceRequest + * @returns CreateBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateBackupRequest; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this CreateBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for CreateBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FailoverInstanceRequest. */ - interface IFailoverInstanceRequest { + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { - /** FailoverInstanceRequest name */ - name?: (string|null); + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** FailoverInstanceRequest requestId */ + /** UpdateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** UpdateBackupRequest requestId */ requestId?: (string|null); - /** FailoverInstanceRequest validateOnly */ + /** UpdateBackupRequest validateOnly */ validateOnly?: (boolean|null); + + /** UpdateBackupRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a FailoverInstanceRequest. */ - class FailoverInstanceRequest implements IFailoverInstanceRequest { + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new UpdateBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest); - /** FailoverInstanceRequest name. */ - public name: string; + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** FailoverInstanceRequest requestId. */ + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** UpdateBackupRequest requestId. */ public requestId: string; - /** FailoverInstanceRequest validateOnly. */ + /** UpdateBackupRequest validateOnly. */ public validateOnly: boolean; + /** UpdateBackupRequest allowMissing. */ + public allowMissing: boolean; + /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * Creates a new UpdateBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns FailoverInstanceRequest instance + * @returns UpdateBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest): google.cloud.alloydb.v1beta.UpdateBackupRequest; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes an UpdateBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FailoverInstanceRequest + * @returns UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateBackupRequest; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FailoverInstanceRequest + * @returns UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateBackupRequest; /** - * Verifies a FailoverInstanceRequest message. + * Verifies an UpdateBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FailoverInstanceRequest + * @returns UpdateBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateBackupRequest; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @param message FailoverInstanceRequest + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FailoverInstanceRequest to JSON. + * Converts this UpdateBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for UpdateBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { - /** RestartInstanceRequest name */ + /** DeleteBackupRequest name */ name?: (string|null); - /** RestartInstanceRequest requestId */ + /** DeleteBackupRequest requestId */ requestId?: (string|null); - /** RestartInstanceRequest validateOnly */ + /** DeleteBackupRequest validateOnly */ validateOnly?: (boolean|null); + + /** DeleteBackupRequest etag */ + etag?: (string|null); } - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { /** - * Constructs a new RestartInstanceRequest. + * Constructs a new DeleteBackupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest); - /** RestartInstanceRequest name. */ + /** DeleteBackupRequest name. */ public name: string; - /** RestartInstanceRequest requestId. */ + /** DeleteBackupRequest requestId. */ public requestId: string; - /** RestartInstanceRequest validateOnly. */ + /** DeleteBackupRequest validateOnly. */ public validateOnly: boolean; + /** DeleteBackupRequest etag. */ + public etag: string; + /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * Creates a new DeleteBackupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestartInstanceRequest instance + * @returns DeleteBackupRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest): google.cloud.alloydb.v1beta.RestartInstanceRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest): google.cloud.alloydb.v1beta.DeleteBackupRequest; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteBackupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestartInstanceRequest + * @returns DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestartInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteBackupRequest; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestartInstanceRequest + * @returns DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestartInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteBackupRequest; /** - * Verifies a RestartInstanceRequest message. + * Verifies a DeleteBackupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestartInstanceRequest + * @returns DeleteBackupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestartInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteBackupRequest; /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @param message RestartInstanceRequest + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestartInstanceRequest to JSON. + * Converts this DeleteBackupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestartInstanceRequest + * Gets the default type url for DeleteBackupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { + /** Properties of a ListSupportedDatabaseFlagsRequest. */ + interface IListSupportedDatabaseFlagsRequest { - /** ListBackupsRequest parent */ + /** ListSupportedDatabaseFlagsRequest parent */ parent?: (string|null); - /** ListBackupsRequest pageSize */ + /** ListSupportedDatabaseFlagsRequest pageSize */ pageSize?: (number|null); - /** ListBackupsRequest pageToken */ + /** ListSupportedDatabaseFlagsRequest pageToken */ pageToken?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); } - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { + /** Represents a ListSupportedDatabaseFlagsRequest. */ + class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { /** - * Constructs a new ListBackupsRequest. + * Constructs a new ListSupportedDatabaseFlagsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest); - /** ListBackupsRequest parent. */ + /** ListSupportedDatabaseFlagsRequest parent. */ public parent: string; - /** ListBackupsRequest pageSize. */ + /** ListSupportedDatabaseFlagsRequest pageSize. */ public pageSize: number; - /** ListBackupsRequest pageToken. */ + /** ListSupportedDatabaseFlagsRequest pageToken. */ public pageToken: string; - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest orderBy. */ - public orderBy: string; - /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsRequest instance + * @returns ListSupportedDatabaseFlagsRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest): google.cloud.alloydb.v1beta.ListBackupsRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsRequest + * @returns ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest + * @returns ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListSupportedDatabaseFlagsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsRequest + * @returns ListSupportedDatabaseFlagsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListSupportedDatabaseFlagsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListSupportedDatabaseFlagsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { + /** Properties of a ListSupportedDatabaseFlagsResponse. */ + interface IListSupportedDatabaseFlagsResponse { - /** ListBackupsResponse backups */ - backups?: (google.cloud.alloydb.v1beta.IBackup[]|null); + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ + supportedDatabaseFlags?: (google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null); - /** ListBackupsResponse nextPageToken */ + /** ListSupportedDatabaseFlagsResponse nextPageToken */ nextPageToken?: (string|null); - - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); } - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { + /** Represents a ListSupportedDatabaseFlagsResponse. */ + class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { /** - * Constructs a new ListBackupsResponse. + * Constructs a new ListSupportedDatabaseFlagsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse); + constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse); - /** ListBackupsResponse backups. */ - public backups: google.cloud.alloydb.v1beta.IBackup[]; + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ + public supportedDatabaseFlags: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]; - /** ListBackupsResponse nextPageToken. */ + /** ListSupportedDatabaseFlagsResponse nextPageToken. */ public nextPageToken: string; - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; - /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsResponse instance + * @returns ListSupportedDatabaseFlagsResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse): google.cloud.alloydb.v1beta.ListBackupsResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsResponse + * @returns ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse + * @returns ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; /** - * Verifies a ListBackupsResponse message. + * Verifies a ListSupportedDatabaseFlagsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsResponse + * @returns ListSupportedDatabaseFlagsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this ListSupportedDatabaseFlagsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for ListSupportedDatabaseFlagsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { + /** Properties of a GenerateClientCertificateRequest. */ + interface IGenerateClientCertificateRequest { - /** GetBackupRequest name */ - name?: (string|null); + /** GenerateClientCertificateRequest parent */ + parent?: (string|null); + + /** GenerateClientCertificateRequest requestId */ + requestId?: (string|null); + + /** GenerateClientCertificateRequest pemCsr */ + pemCsr?: (string|null); + + /** GenerateClientCertificateRequest certDuration */ + certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey */ + publicKey?: (string|null); } - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { + /** Represents a GenerateClientCertificateRequest. */ + class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { /** - * Constructs a new GetBackupRequest. + * Constructs a new GenerateClientCertificateRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest); - /** GetBackupRequest name. */ - public name: string; + /** GenerateClientCertificateRequest parent. */ + public parent: string; + + /** GenerateClientCertificateRequest requestId. */ + public requestId: string; + + /** GenerateClientCertificateRequest pemCsr. */ + public pemCsr: string; + + /** GenerateClientCertificateRequest certDuration. */ + public certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey. */ + public publicKey: string; /** - * Creates a new GetBackupRequest instance using the specified properties. + * Creates a new GenerateClientCertificateRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetBackupRequest instance + * @returns GenerateClientCertificateRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest): google.cloud.alloydb.v1beta.GetBackupRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetBackupRequest + * @returns GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetBackupRequest + * @returns GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; /** - * Verifies a GetBackupRequest message. + * Verifies a GenerateClientCertificateRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetBackupRequest + * @returns GenerateClientCertificateRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @param message GenerateClientCertificateRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetBackupRequest to JSON. + * Converts this GenerateClientCertificateRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for GenerateClientCertificateRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); + /** Properties of a GenerateClientCertificateResponse. */ + interface IGenerateClientCertificateResponse { - /** CreateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1beta.IBackup|null); + /** GenerateClientCertificateResponse pemCertificate */ + pemCertificate?: (string|null); - /** CreateBackupRequest requestId */ - requestId?: (string|null); + /** GenerateClientCertificateResponse pemCertificateChain */ + pemCertificateChain?: (string[]|null); - /** CreateBackupRequest validateOnly */ - validateOnly?: (boolean|null); + /** GenerateClientCertificateResponse caCert */ + caCert?: (string|null); } - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { + /** Represents a GenerateClientCertificateResponse. */ + class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { /** - * Constructs a new CreateBackupRequest. + * Constructs a new GenerateClientCertificateResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; + constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse); - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1beta.IBackup|null); + /** GenerateClientCertificateResponse pemCertificate. */ + public pemCertificate: string; - /** CreateBackupRequest requestId. */ - public requestId: string; + /** GenerateClientCertificateResponse pemCertificateChain. */ + public pemCertificateChain: string[]; - /** CreateBackupRequest validateOnly. */ - public validateOnly: boolean; + /** GenerateClientCertificateResponse caCert. */ + public caCert: string; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new GenerateClientCertificateResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateBackupRequest instance + * @returns GenerateClientCertificateResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest): google.cloud.alloydb.v1beta.CreateBackupRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateBackupRequest + * @returns GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest + * @returns GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; /** - * Verifies a CreateBackupRequest message. + * Verifies a GenerateClientCertificateResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateBackupRequest + * @returns GenerateClientCertificateResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @param message GenerateClientCertificateResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this GenerateClientCertificateResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for GenerateClientCertificateResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1beta.IBackup|null); - - /** UpdateBackupRequest requestId */ - requestId?: (string|null); + /** Properties of a GetConnectionInfoRequest. */ + interface IGetConnectionInfoRequest { - /** UpdateBackupRequest validateOnly */ - validateOnly?: (boolean|null); + /** GetConnectionInfoRequest parent */ + parent?: (string|null); - /** UpdateBackupRequest allowMissing */ - allowMissing?: (boolean|null); + /** GetConnectionInfoRequest requestId */ + requestId?: (string|null); } - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { + /** Represents a GetConnectionInfoRequest. */ + class GetConnectionInfoRequest implements IGetConnectionInfoRequest { /** - * Constructs a new UpdateBackupRequest. + * Constructs a new GetConnectionInfoRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest); - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1beta.IBackup|null); + /** GetConnectionInfoRequest parent. */ + public parent: string; - /** UpdateBackupRequest requestId. */ + /** GetConnectionInfoRequest requestId. */ public requestId: string; - /** UpdateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateBackupRequest allowMissing. */ - public allowMissing: boolean; - /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new GetConnectionInfoRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateBackupRequest instance + * @returns GetConnectionInfoRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest): google.cloud.alloydb.v1beta.UpdateBackupRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest + * @returns GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest + * @returns GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; /** - * Verifies an UpdateBackupRequest message. + * Verifies a GetConnectionInfoRequest message. * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateBackupRequest + * @returns GetConnectionInfoRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @param message GetConnectionInfoRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this GetConnectionInfoRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for GetConnectionInfoRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { - /** DeleteBackupRequest name */ - name?: (string|null); + /** OperationMetadata batchCreateInstancesMetadata */ + batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); - /** DeleteBackupRequest requestId */ - requestId?: (string|null); + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** DeleteBackupRequest validateOnly */ - validateOnly?: (boolean|null); + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** DeleteBackupRequest etag */ - etag?: (string|null); + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); } - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { /** - * Constructs a new DeleteBackupRequest. + * Constructs a new OperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IOperationMetadata); - /** DeleteBackupRequest name. */ - public name: string; + /** OperationMetadata batchCreateInstancesMetadata. */ + public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); - /** DeleteBackupRequest requestId. */ - public requestId: string; + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** DeleteBackupRequest validateOnly. */ - public validateOnly: boolean; + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** DeleteBackupRequest etag. */ - public etag: string; + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata requestSpecific. */ + public requestSpecific?: "batchCreateInstancesMetadata"; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new OperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteBackupRequest instance + * @returns OperationMetadata instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest): google.cloud.alloydb.v1beta.DeleteBackupRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IOperationMetadata): google.cloud.alloydb.v1beta.OperationMetadata; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.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.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * 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 DeleteBackupRequest + * @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.alloydb.v1beta.DeleteBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.OperationMetadata; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest + * @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.alloydb.v1beta.DeleteBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.OperationMetadata; /** - * Verifies a DeleteBackupRequest message. + * 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 a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteBackupRequest + * @returns OperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.OperationMetadata; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest + * 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.alloydb.v1beta.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this OperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for OperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSupportedDatabaseFlagsRequest. */ - interface IListSupportedDatabaseFlagsRequest { + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { - /** ListSupportedDatabaseFlagsRequest parent */ + /** ListUsersRequest parent */ parent?: (string|null); - /** ListSupportedDatabaseFlagsRequest pageSize */ + /** ListUsersRequest pageSize */ pageSize?: (number|null); - /** ListSupportedDatabaseFlagsRequest pageToken */ + /** ListUsersRequest pageToken */ pageToken?: (string|null); + + /** ListUsersRequest filter */ + filter?: (string|null); + + /** ListUsersRequest orderBy */ + orderBy?: (string|null); } - /** Represents a ListSupportedDatabaseFlagsRequest. */ - class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { /** - * Constructs a new ListSupportedDatabaseFlagsRequest. + * Constructs a new ListUsersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IListUsersRequest); - /** ListSupportedDatabaseFlagsRequest parent. */ + /** ListUsersRequest parent. */ public parent: string; - /** ListSupportedDatabaseFlagsRequest pageSize. */ + /** ListUsersRequest pageSize. */ public pageSize: number; - /** ListSupportedDatabaseFlagsRequest pageToken. */ + /** ListUsersRequest pageToken. */ public pageToken: string; + /** ListUsersRequest filter. */ + public filter: string; + + /** ListUsersRequest orderBy. */ + public orderBy: string; + /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * Creates a new ListUsersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsRequest instance + * @returns ListUsersRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IListUsersRequest): google.cloud.alloydb.v1beta.ListUsersRequest; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * Decodes a ListUsersRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsRequest + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersRequest; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsRequest + * @returns ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersRequest; /** - * Verifies a ListSupportedDatabaseFlagsRequest message. + * Verifies a ListUsersRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSupportedDatabaseFlagsRequest + * @returns ListUsersRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersRequest; /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsRequest + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * Converts this ListUsersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest + * Gets the default type url for ListUsersRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSupportedDatabaseFlagsResponse. */ - interface IListSupportedDatabaseFlagsResponse { + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ - supportedDatabaseFlags?: (google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null); + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1beta.IUser[]|null); - /** ListSupportedDatabaseFlagsResponse nextPageToken */ + /** ListUsersResponse nextPageToken */ nextPageToken?: (string|null); + + /** ListUsersResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a ListSupportedDatabaseFlagsResponse. */ - class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { /** - * Constructs a new ListSupportedDatabaseFlagsResponse. + * Constructs a new ListUsersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse); + constructor(properties?: google.cloud.alloydb.v1beta.IListUsersResponse); - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ - public supportedDatabaseFlags: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]; + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1beta.IUser[]; - /** ListSupportedDatabaseFlagsResponse nextPageToken. */ + /** ListUsersResponse nextPageToken. */ public nextPageToken: string; + /** ListUsersResponse unreachable. */ + public unreachable: string[]; + /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * Creates a new ListUsersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsResponse instance + * @returns ListUsersResponse instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + public static create(properties?: google.cloud.alloydb.v1beta.IListUsersResponse): google.cloud.alloydb.v1beta.ListUsersResponse; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * Decodes a ListUsersResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsResponse + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersResponse; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsResponse + * @returns ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersResponse; /** - * Verifies a ListSupportedDatabaseFlagsResponse message. + * Verifies a ListUsersResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSupportedDatabaseFlagsResponse + * @returns ListUsersResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersResponse; /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsResponse + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * Converts this ListUsersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse + * Gets the default type url for ListUsersResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GenerateClientCertificateRequest. */ - interface IGenerateClientCertificateRequest { - - /** GenerateClientCertificateRequest parent */ - parent?: (string|null); - - /** GenerateClientCertificateRequest requestId */ - requestId?: (string|null); - - /** GenerateClientCertificateRequest pemCsr */ - pemCsr?: (string|null); + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { - /** GenerateClientCertificateRequest certDuration */ - certDuration?: (google.protobuf.IDuration|null); + /** GetUserRequest name */ + name?: (string|null); } - /** Represents a GenerateClientCertificateRequest. */ - class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { /** - * Constructs a new GenerateClientCertificateRequest. + * Constructs a new GetUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest); - - /** GenerateClientCertificateRequest parent. */ - public parent: string; - - /** GenerateClientCertificateRequest requestId. */ - public requestId: string; - - /** GenerateClientCertificateRequest pemCsr. */ - public pemCsr: string; + constructor(properties?: google.cloud.alloydb.v1beta.IGetUserRequest); - /** GenerateClientCertificateRequest certDuration. */ - public certDuration?: (google.protobuf.IDuration|null); + /** GetUserRequest name. */ + public name: string; /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * Creates a new GetUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateClientCertificateRequest instance + * @returns GetUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IGetUserRequest): google.cloud.alloydb.v1beta.GetUserRequest; /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * Decodes a GetUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateRequest + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetUserRequest; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateRequest + * @returns GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetUserRequest; /** - * Verifies a GenerateClientCertificateRequest message. + * Verifies a GetUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateClientCertificateRequest + * @returns GetUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetUserRequest; /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @param message GenerateClientCertificateRequest + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateClientCertificateRequest to JSON. + * Converts this GetUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GenerateClientCertificateRequest + * Gets the default type url for GetUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GenerateClientCertificateResponse. */ - interface IGenerateClientCertificateResponse { + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { - /** GenerateClientCertificateResponse pemCertificate */ - pemCertificate?: (string|null); + /** CreateUserRequest parent */ + parent?: (string|null); - /** GenerateClientCertificateResponse pemCertificateChain */ - pemCertificateChain?: (string[]|null); + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** CreateUserRequest requestId */ + requestId?: (string|null); + + /** CreateUserRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a GenerateClientCertificateResponse. */ - class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { /** - * Constructs a new GenerateClientCertificateResponse. + * Constructs a new CreateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse); + constructor(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest); - /** GenerateClientCertificateResponse pemCertificate. */ - public pemCertificate: string; + /** CreateUserRequest parent. */ + public parent: string; - /** GenerateClientCertificateResponse pemCertificateChain. */ - public pemCertificateChain: string[]; + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** CreateUserRequest requestId. */ + public requestId: string; + + /** CreateUserRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * Creates a new CreateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GenerateClientCertificateResponse instance + * @returns CreateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + public static create(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest): google.cloud.alloydb.v1beta.CreateUserRequest; /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * Decodes a CreateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateResponse + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateUserRequest; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateResponse + * @returns CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateUserRequest; /** - * Verifies a GenerateClientCertificateResponse message. + * Verifies a CreateUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GenerateClientCertificateResponse + * @returns CreateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateUserRequest; /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @param message GenerateClientCertificateResponse + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GenerateClientCertificateResponse to JSON. + * Converts this CreateUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GenerateClientCertificateResponse + * Gets the default type url for CreateUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetConnectionInfoRequest. */ - interface IGetConnectionInfoRequest { + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { - /** GetConnectionInfoRequest parent */ - parent?: (string|null); + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** GetConnectionInfoRequest requestId */ + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** UpdateUserRequest requestId */ requestId?: (string|null); + + /** UpdateUserRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateUserRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a GetConnectionInfoRequest. */ - class GetConnectionInfoRequest implements IGetConnectionInfoRequest { + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { /** - * Constructs a new GetConnectionInfoRequest. + * Constructs a new UpdateUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest); + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest); - /** GetConnectionInfoRequest parent. */ - public parent: string; + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** GetConnectionInfoRequest requestId. */ + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** UpdateUserRequest requestId. */ public requestId: string; + /** UpdateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateUserRequest allowMissing. */ + public allowMissing: boolean; + /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. + * Creates a new UpdateUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetConnectionInfoRequest instance + * @returns UpdateUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest): google.cloud.alloydb.v1beta.UpdateUserRequest; /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * Decodes an UpdateUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetConnectionInfoRequest + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateUserRequest; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetConnectionInfoRequest + * @returns UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateUserRequest; /** - * Verifies a GetConnectionInfoRequest message. + * Verifies an UpdateUserRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetConnectionInfoRequest + * @returns UpdateUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateUserRequest; /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @param message GetConnectionInfoRequest + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetConnectionInfoRequest to JSON. + * Converts this UpdateUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetConnectionInfoRequest + * Gets the default type url for UpdateUserRequest * @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 batchCreateInstancesMetadata */ - batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** DeleteUserRequest name */ + name?: (string|null); - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); + /** DeleteUserRequest requestId */ + requestId?: (string|null); - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { /** - * Constructs a new OperationMetadata. + * Constructs a new DeleteUserRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.alloydb.v1beta.IOperationMetadata); - - /** OperationMetadata batchCreateInstancesMetadata. */ - public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest); - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + /** DeleteUserRequest name. */ + public name: string; - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** DeleteUserRequest requestId. */ + public requestId: string; - /** OperationMetadata requestSpecific. */ - public requestSpecific?: "batchCreateInstancesMetadata"; + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new DeleteUserRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns DeleteUserRequest instance */ - public static create(properties?: google.cloud.alloydb.v1beta.IOperationMetadata): google.cloud.alloydb.v1beta.OperationMetadata; + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest): google.cloud.alloydb.v1beta.DeleteUserRequest; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a DeleteUserRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns DeleteUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteUserRequest; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns DeleteUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteUserRequest; /** - * Verifies an OperationMetadata message. + * Verifies a DeleteUserRequest message. * @param message Plain 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. + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns DeleteUserRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteUserRequest; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.alloydb.v1beta.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.alloydb.v1beta.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this DeleteUserRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for DeleteUserRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index b283681c63b5..bb3461366611 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -66,22 +66,6 @@ */ var v1 = {}; - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - */ - v1.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - return values; - })(); - /** * InstanceView enum. * @name google.cloud.alloydb.v1.InstanceView @@ -98,6 +82,38 @@ return values; })(); + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + */ + v1.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + return values; + })(); + v1.UserPassword = (function() { /** @@ -1248,6 +1264,8 @@ case 1: case 2: case 3: + case 4: + case 5: break; } if (message.caSource != null && message.hasOwnProperty("caSource")) @@ -1296,6 +1314,14 @@ case 3: message.sslMode = 3; break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; } switch (object.caSource) { default: @@ -1374,6 +1400,8 @@ * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value */ SslConfig.SslMode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -1381,6 +1409,8 @@ values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; return values; })(); @@ -2617,25 +2647,26 @@ return AutomatedBackupPolicy; })(); - v1.BackupSource = (function() { + v1.ContinuousBackupConfig = (function() { /** - * Properties of a BackupSource. + * Properties of a ContinuousBackupConfig. * @memberof google.cloud.alloydb.v1 - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig */ /** - * Constructs a new BackupSource. + * Constructs a new ContinuousBackupConfig. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BackupSource. - * @implements IBackupSource + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig * @constructor - * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set */ - function BackupSource(properties) { + function ContinuousBackupConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2643,89 +2674,117 @@ } /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1.BackupSource + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @instance */ - BackupSource.prototype.backupUid = ""; + ContinuousBackupConfig.prototype.enabled = null; /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1.BackupSource + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @instance */ - BackupSource.prototype.backupName = ""; + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; /** - * Creates a new BackupSource instance using the specified properties. + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static - * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource instance + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig instance */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); }; /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static - * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encode = function encode(message, writer) { + ContinuousBackupConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); return writer; }; /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static - * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BackupSource message from the specified reader or buffer. + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BackupSource.decode = function decode(reader, length) { + ContinuousBackupConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BackupSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); + case 1: { + message.enabled = reader.bool(); break; } - case 1: { - message.backupName = reader.string(); + case 4: { + message.recoveryWindowDays = reader.int32(); + break; + } + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); break; } default: @@ -2737,155 +2796,153 @@ }; /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BackupSource message. + * Verifies a ContinuousBackupConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BackupSource.verify = function verify(message) { + ContinuousBackupConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } return null; }; /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BackupSource) + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupConfig) return object; - var message = new $root.google.cloud.alloydb.v1.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } return message; }; /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static - * @param {google.cloud.alloydb.v1.BackupSource} message BackupSource + * @param {google.cloud.alloydb.v1.ContinuousBackupConfig} message ContinuousBackupConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupSource.toObject = function toObject(message, options) { + ContinuousBackupConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; + object.encryptionConfig = null; + object.recoveryWindowDays = 0; } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; return object; }; /** - * Converts this BackupSource to JSON. + * Converts this ContinuousBackupConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @instance * @returns {Object.} JSON object */ - BackupSource.prototype.toJSON = function toJSON() { + ContinuousBackupConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BackupSource + * Gets the default type url for ContinuousBackupConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BackupSource + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupConfig"; }; - return BackupSource; + return ContinuousBackupConfig; })(); - v1.Cluster = (function() { + v1.ContinuousBackupInfo = (function() { /** - * Properties of a Cluster. + * Properties of a ContinuousBackupInfo. * @memberof google.cloud.alloydb.v1 - * @interface ICluster - * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime */ /** - * Constructs a new Cluster. + * Constructs a new ContinuousBackupInfo. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a Cluster. - * @implements ICluster + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo * @constructor - * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; + function ContinuousBackupInfo(properties) { + this.schedule = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2893,437 +2950,448 @@ } /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.backupSource = null; - - /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.migrationSource = null; - - /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.name = ""; - - /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.displayName = ""; - - /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.uid = ""; - - /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.createTime = null; - - /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Cluster + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo * @instance */ - Cluster.prototype.updateTime = null; + ContinuousBackupInfo.prototype.encryptionInfo = null; /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Cluster + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo * @instance */ - Cluster.prototype.deleteTime = null; + ContinuousBackupInfo.prototype.enabledTime = null; /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Cluster + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo * @instance */ - Cluster.prototype.labels = $util.emptyObject; + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; /** - * Cluster state. - * @member {google.cloud.alloydb.v1.Cluster.State} state - * @memberof google.cloud.alloydb.v1.Cluster + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo * @instance */ - Cluster.prototype.state = 0; + ContinuousBackupInfo.prototype.earliestRestorableTime = null; /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo instance */ - Cluster.prototype.clusterType = 0; + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); + }; /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.databaseVersion = 0; + ContinuousBackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); + writer.ldelim(); + } + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.network = ""; + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.etag = ""; + ContinuousBackupInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schedule && message.schedule.length)) + message.schedule = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.schedule.push(reader.int32()); + } else + message.schedule.push(reader.int32()); + break; + } + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.annotations = $util.emptyObject; + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Verifies a ContinuousBackupInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.prototype.reconciling = false; + ContinuousBackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { + default: + return "schedule: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } + return null; + }; /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo */ - Cluster.prototype.initialUser = null; - - /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupInfo) + return object; + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); + } + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { + default: + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.schedule[i] = 0; + break; + case "MONDAY": + case 1: + message.schedule[i] = 1; + break; + case "TUESDAY": + case 2: + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; + break; + } + } + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Cluster.prototype.automatedBackupPolicy = null; + ContinuousBackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedule = []; + if (options.defaults) { + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); + return object; + }; /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1.Cluster + * Converts this ContinuousBackupInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo * @instance + * @returns {Object.} JSON object */ - Cluster.prototype.sslConfig = null; + ContinuousBackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Gets the default type url for ContinuousBackupInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Cluster.prototype.encryptionConfig = null; + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupInfo"; + }; + + return ContinuousBackupInfo; + })(); + + v1.BackupSource = (function() { /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1 + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName */ - Cluster.prototype.encryptionInfo = null; /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set */ - Cluster.prototype.secondaryConfig = null; + function BackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1.Cluster + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1.BackupSource * @instance */ - Cluster.prototype.primaryConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + BackupSource.prototype.backupUid = ""; /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1.Cluster + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1.BackupSource * @instance */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + BackupSource.prototype.backupName = ""; /** - * Creates a new Cluster instance using the specified properties. + * Creates a new BackupSource instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static - * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster} Cluster instance + * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource instance */ - Cluster.create = function create(properties) { - return new Cluster(properties); + BackupSource.create = function create(properties) { + return new BackupSource(properties); }; /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static - * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encode = function encode(message, writer) { + BackupSource.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); return writer; }; /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static - * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Cluster message from the specified reader or buffer. + * Decodes a BackupSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decode = function decode(reader, length) { + BackupSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BackupSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - 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; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + message.backupUid = reader.string(); break; } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + case 1: { + message.backupName = reader.string(); break; } default: @@ -3335,1196 +3403,631 @@ }; /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. + * Decodes a BackupSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decodeDelimited = function decodeDelimited(reader) { + BackupSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Cluster message. + * Verifies a BackupSource message. * @function verify - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.BackupSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.verify = function verify(message) { + BackupSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } - } - 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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {google.cloud.alloydb.v1.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; + + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { + return typeUrlPrefix + "/google.cloud.alloydb.v1.BackupSource"; + }; + + return BackupSource; + })(); + + v1.ContinuousBackupSource = (function() { + + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1 + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ + + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; + + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: + reader.skipType(tag & 7); break; } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; - } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify(message.primaryConfig); + return message; + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); if (error) - return "primaryConfig." + error; + return "pointInTime." + error; } return null; }; /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster) + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupSource) return object; - var message = new $root.google.cloud.alloydb.v1.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.fromObject(object.migrationSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.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.alloydb.v1.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.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]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); } return message; }; /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static - * @param {google.cloud.alloydb.v1.Cluster} message Cluster + * @param {google.cloud.alloydb.v1.ContinuousBackupSource} message ContinuousBackupSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Cluster.toObject = function toObject(message, options) { + ContinuousBackupSource.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.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - 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]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; + object.cluster = ""; + object.pointInTime = null; } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); return object; }; /** - * Converts this Cluster to JSON. + * Converts this ContinuousBackupSource to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @instance * @returns {Object.} JSON object */ - Cluster.prototype.toJSON = function toJSON() { + ContinuousBackupSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Cluster + * Gets the default type url for ContinuousBackupSource * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupSource"; }; - Cluster.SecondaryConfig = (function() { + return ContinuousBackupSource; + })(); - /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName - */ + v1.Cluster = (function() { - /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set - */ - function SecondaryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Cluster. + * @memberof google.cloud.alloydb.v1 + * @interface ICluster + * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + */ - /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @instance - */ - SecondaryConfig.prototype.primaryClusterName = ""; + /** + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set + */ + function Cluster(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]]; + } - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig instance - */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); - }; + /** + * Cluster backupSource. + * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.backupSource = null; - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); - return writer; - }; + /** + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.migrationSource = null; - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.name = ""; - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.primaryClusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.displayName = ""; - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.uid = ""; - /** - * Verifies a SecondaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecondaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; - return null; - }; + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); - return message; - }; + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.SecondaryConfig} message SecondaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecondaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; - return object; - }; + /** + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.deleteTime = null; - /** - * Converts this SecondaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @instance - * @returns {Object.} JSON object - */ - SecondaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; - /** - * Gets the default type url for SecondaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.SecondaryConfig"; - }; + /** + * Cluster state. + * @member {google.cloud.alloydb.v1.Cluster.State} state + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.state = 0; - return SecondaryConfig; - })(); + /** + * Cluster clusterType. + * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.clusterType = 0; - Cluster.PrimaryConfig = (function() { + /** + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.databaseVersion = 0; - /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames - */ + /** + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.network = ""; - /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set - */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.etag = ""; - /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @instance - */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig instance - */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); - }; + /** + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.reconciling = false; - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); - return writer; - }; + /** + * Cluster initialUser. + * @member {google.cloud.alloydb.v1.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.initialUser = null; - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.automatedBackupPolicy = null; - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.sslConfig = null; - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrimaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrimaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } - return null; - }; - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.PrimaryConfig} message PrimaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrimaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } - return object; - }; - - /** - * Converts this PrimaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @instance - * @returns {Object.} JSON object - */ - PrimaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrimaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PrimaryConfig"; - }; - - return PrimaryConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value - * @property {number} PROMOTING=9 PROMOTING value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * ClusterType enum. - * @name google.cloud.alloydb.v1.Cluster.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value - */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); - - return Cluster; - })(); - - v1.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.alloydb.v1 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; - 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]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance state. - * @member {google.cloud.alloydb.v1.Instance.State} state - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.machineConfig = null; - - /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.availabilityType = 0; - - /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.gceZone = ""; - - /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.databaseFlags = $util.emptyObject; - - /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.writableNode = null; + /** + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1.Instance + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.nodes = $util.emptyArray; + Cluster.prototype.encryptionInfo = null; /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1.Instance + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.queryInsightsConfig = null; + Cluster.prototype.continuousBackupConfig = null; /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1.Instance + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.readPoolConfig = null; + Cluster.prototype.continuousBackupInfo = null; /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1.Instance + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.ipAddress = ""; + Cluster.prototype.secondaryConfig = null; /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Instance + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.reconciling = false; + Cluster.prototype.primaryConfig = null; - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.etag = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Instance + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1.Cluster * @instance */ - Instance.prototype.annotations = $util.emptyObject; + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Instance instance using the specified properties. + * Creates a new Cluster instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static - * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance} Instance instance + * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster} Cluster instance */ - Instance.create = function create(properties) { - return new Instance(properties); + Cluster.create = function create(properties) { + return new Cluster(properties); }; /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static - * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encode = function encode(message, writer) { + Cluster.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -4544,69 +4047,83 @@ 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.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); return writer; }; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static - * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { + Cluster.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a Cluster message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance} Instance + * @returns {google.cloud.alloydb.v1.Cluster} Cluster * @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) { + Cluster.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.decode(reader, reader.uint32()); + break; + } case 1: { message.name = reader.string(); break; @@ -4658,25 +4175,25 @@ message.state = reader.int32(); break; } + case 24: { + message.clusterType = reader.int32(); + break; + } case 9: { - message.instanceType = reader.int32(); + message.databaseVersion = reader.int32(); break; } case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.decode(reader, reader.uint32()); + message.network = reader.string(); break; } case 11: { - message.availabilityType = reader.int32(); + message.etag = reader.string(); break; } case 12: { - message.gceZone = reader.string(); - break; - } - case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; + if (message.annotations === $util.emptyObject) + message.annotations = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; @@ -4694,60 +4211,47 @@ break; } } - message.databaseFlags[key] = value; + message.annotations[key] = value; break; } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32()); + case 13: { + message.reconciling = reader.bool(); break; } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32())); + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.decode(reader, reader.uint32()); break; } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.decode(reader, reader.uint32()); break; } - case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); break; } - case 15: { - message.ipAddress = reader.string(); + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); break; } - case 16: { - message.reconciling = reader.bool(); + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); break; } - case 17: { - message.etag = reader.string(); + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.decode(reader, reader.uint32()); break; } - case 18: { - 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; + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.decode(reader, reader.uint32()); break; } default: @@ -4759,32 +4263,51 @@ }; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a Cluster message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance} Instance + * @returns {google.cloud.alloydb.v1.Cluster} Cluster * @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) { + Cluster.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Instance message. + * Verifies a Cluster message. * @function verify - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @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) { + Cluster.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -4828,75 +4351,32 @@ case 4: case 5: case 6: + case 7: case 8: case 9: break; } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { default: - return "instanceType: enum value expected"; + return "clusterType: enum value expected"; case 0: case 1: case 2: - case 3: break; } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { default: - return "availabilityType: enum value expected"; + return "databaseVersion: enum value expected"; case 0: case 1: case 2: break; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); - if (error) - return "queryInsightsConfig." + error; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify(message.readPoolConfig); - if (error) - return "readPoolConfig." + error; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; @@ -4908,21 +4388,79 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } return null; }; /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance} Instance + * @returns {google.cloud.alloydb.v1.Cluster} Cluster */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance) + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster) return object; - var message = new $root.google.cloud.alloydb.v1.Instance(); + var message = new $root.google.cloud.alloydb.v1.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.fromObject(object.migrationSource); + } if (object.name != null) message.name = String(object.name); if (object.displayName != null) @@ -4931,22 +4469,22 @@ message.uid = String(object.uid); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.createTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Cluster.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.alloydb.v1.Instance.updateTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Cluster.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.deleteTime != null) { if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.deleteTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Cluster.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.labels: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Cluster.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]]); @@ -4970,15 +4508,15 @@ case 2: message.state = 2; break; - case "CREATING": + case "EMPTY": case 3: message.state = 3; break; - case "DELETING": + case "CREATING": case 4: message.state = 4; break; - case "MAINTENANCE": + case "DELETING": case 5: message.state = 5; break; @@ -4987,6 +4525,10 @@ message.state = 6; break; case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": case 8: message.state = 8; break; @@ -4995,123 +4537,122 @@ message.state = 9; break; } - switch (object.instanceType) { + switch (object.clusterType) { default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; break; } break; - case "INSTANCE_TYPE_UNSPECIFIED": + case "CLUSTER_TYPE_UNSPECIFIED": case 0: - message.instanceType = 0; + message.clusterType = 0; break; case "PRIMARY": case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; + message.clusterType = 1; break; case "SECONDARY": - case 3: - message.instanceType = 3; + case 2: + message.clusterType = 2; break; } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { + switch (object.databaseVersion) { default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; break; } break; - case "AVAILABILITY_TYPE_UNSPECIFIED": + case "DATABASE_VERSION_UNSPECIFIED": case 0: - message.availabilityType = 0; + message.databaseVersion = 0; break; - case "ZONAL": + case "POSTGRES_13": case 1: - message.availabilityType = 1; + message.databaseVersion = 1; break; - case "REGIONAL": + case "POSTGRES_14": case 2: - message.availabilityType = 2; + message.databaseVersion = 2; break; } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); + if (object.network != null) + message.network = String(object.network); if (object.etag != null) message.etag = String(object.etag); if (object.annotations) { if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.annotations: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Cluster.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]]); } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } return message; }; /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. + * Creates a plain object from a Cluster message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static - * @param {google.cloud.alloydb.v1.Instance} message Instance + * @param {google.cloud.alloydb.v1.Cluster} message Cluster * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Instance.toObject = function toObject(message, options) { + Cluster.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; if (options.objects || options.defaults) { object.labels = {}; - object.databaseFlags = {}; object.annotations = {}; } if (options.defaults) { @@ -5122,16 +4663,20 @@ object.updateTime = null; object.deleteTime = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; - object.reconciling = false; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5152,26 +4697,11 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { @@ -5179,62 +4709,85 @@ for (var j = 0; j < keys2.length; ++j) object.annotations[keys2[j]] = message.annotations[keys2[j]]; } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.nodes[j], options); + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); return object; }; /** - * Converts this Instance to JSON. + * Converts this Cluster to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @instance * @returns {Object.} JSON object */ - Instance.prototype.toJSON = function toJSON() { + Cluster.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Instance + * Gets the default type url for Cluster * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance + * @memberof google.cloud.alloydb.v1.Cluster * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; }; - Instance.MachineConfig = (function() { + Cluster.SecondaryConfig = (function() { /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName */ /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig * @constructor - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set */ - function MachineConfig(properties) { + function SecondaryConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5242,75 +4795,75 @@ } /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @instance */ - MachineConfig.prototype.cpuCount = 0; + SecondaryConfig.prototype.primaryClusterName = ""; /** - * Creates a new MachineConfig instance using the specified properties. + * Creates a new SecondaryConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig instance + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig instance */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); }; /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineConfig.encode = function encode(message, writer) { + SecondaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); return writer; }; /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MachineConfig message from the specified reader or buffer. + * Decodes a SecondaryConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineConfig.decode = function decode(reader, length) { + SecondaryConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cpuCount = reader.int32(); + message.primaryClusterName = reader.string(); break; } default: @@ -5322,125 +4875,123 @@ }; /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MachineConfig message. + * Verifies a SecondaryConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MachineConfig.verify = function verify(message) { + SecondaryConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; return null; }; /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.MachineConfig) + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig) return object; - var message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; + var message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); return message; }; /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.MachineConfig} message MachineConfig + * @param {google.cloud.alloydb.v1.Cluster.SecondaryConfig} message SecondaryConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MachineConfig.toObject = function toObject(message, options) { + SecondaryConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.cpuCount = 0; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; return object; }; /** - * Converts this MachineConfig to JSON. + * Converts this SecondaryConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @instance * @returns {Object.} JSON object */ - MachineConfig.prototype.toJSON = function toJSON() { + SecondaryConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MachineConfig + * Gets the default type url for SecondaryConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.MachineConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.SecondaryConfig"; }; - return MachineConfig; + return SecondaryConfig; })(); - Instance.Node = (function() { + Cluster.PrimaryConfig = (function() { /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames */ /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a Node. - * @implements INode + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig * @constructor - * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set */ - function Node(properties) { + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5448,117 +4999,78 @@ } /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; - - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.id = ""; - - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.ip = ""; - - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1.Instance.Node + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @instance */ - Node.prototype.state = ""; + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; /** - * Creates a new Node instance using the specified properties. + * Creates a new PrimaryConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.Node} Node instance + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig instance */ - Node.create = function create(properties) { - return new Node(properties); + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); }; /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Node.encode = function encode(message, writer) { + PrimaryConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); return writer; }; /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Node.encodeDelimited = function encodeDelimited(message, writer) { + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Node message from the specified reader or buffer. + * Decodes a PrimaryConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.Node} Node + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Node.decode = function decode(reader, length) { + PrimaryConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.Node(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); break; } default: @@ -5570,1009 +5082,482 @@ }; /** - * Decodes a Node message from the specified reader or buffer, length delimited. + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.Node} Node + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Node.decodeDelimited = function decodeDelimited(reader) { + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Node message. + * Verifies a PrimaryConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Node.verify = function verify(message) { + PrimaryConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } return null; }; /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.Node} Node + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.Node) + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig) return object; - var message = new $root.google.cloud.alloydb.v1.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); + var message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } return message; }; /** - * Creates a plain object from a Node message. Also converts values to other types if specified. + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static - * @param {google.cloud.alloydb.v1.Instance.Node} message Node + * @param {google.cloud.alloydb.v1.Cluster.PrimaryConfig} message PrimaryConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Node.toObject = function toObject(message, options) { + PrimaryConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; return object; }; /** - * Converts this Node to JSON. + * Converts this PrimaryConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @instance * @returns {Object.} JSON object */ - Node.prototype.toJSON = function toJSON() { + PrimaryConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Node + * Gets the default type url for PrimaryConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.Node + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.Node"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PrimaryConfig"; }; - return Node; + return PrimaryConfig; })(); - Instance.QueryInsightsInstanceConfig = (function() { - - /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute - */ + /** + * State enum. + * @name google.cloud.alloydb.v1.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); - /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - */ - function QueryInsightsInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value + */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); - /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; + return Cluster; + })(); - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + v1.Instance = (function() { - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + /** + * Properties of an Instance. + * @memberof google.cloud.alloydb.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + */ - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + /** + * Constructs a new Instance. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + 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]]; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.name = ""; - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.uid = ""; - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance - */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); - }; + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); - return writer; - }; + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.deleteTime = null; - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Instance state. + * @member {google.cloud.alloydb.v1.Instance.State} state + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.state = 0; - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Instance instanceType. + * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.instanceType = 0; - /** - * Verifies a QueryInsightsInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInsightsInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - return null; - }; + /** + * Instance machineConfig. + * @member {google.cloud.alloydb.v1.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.machineConfig = null; - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; - return message; - }; + /** + * Instance availabilityType. + * @member {google.cloud.alloydb.v1.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.availabilityType = 0; - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - return object; - }; + /** + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.gceZone = ""; - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.databaseFlags = $util.emptyObject; - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; - }; + /** + * Instance writableNode. + * @member {google.cloud.alloydb.v1.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.writableNode = null; - return QueryInsightsInstanceConfig; - })(); + /** + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.nodes = $util.emptyArray; - Instance.ReadPoolConfig = (function() { + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; - /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount - */ + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; - /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set - */ - function ReadPoolConfig(properties) { - if (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 ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.ipAddress = ""; - /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @instance - */ - ReadPoolConfig.prototype.nodeCount = 0; + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.reconciling = false; - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig instance - */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); - }; + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.etag = ""; - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - return writer; - }; + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + return writer; + }; - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - return null; - }; - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; - - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ReadPoolConfig"; - }; - - return ReadPoolConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * InstanceType enum. - * @name google.cloud.alloydb.v1.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; - return values; - })(); - - /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1.Instance.AvailabilityType - * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value - */ - Instance.AvailabilityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - return values; - })(); - - return Instance; - })(); - - v1.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1 - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime - */ - - /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set - */ - function Backup(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]]; - } - - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.displayName = ""; - - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.uid = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.deleteTime = null; - - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; - - /** - * Backup state. - * @member {google.cloud.alloydb.v1.Backup.State} state - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup type. - * @member {google.cloud.alloydb.v1.Backup.Type} type - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.type = 0; - - /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.description = ""; - - /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.clusterUid = ""; - - /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.clusterName = ""; - - /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.reconciling = false; - - /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.encryptionConfig = null; - - /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.etag = ""; - - /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.annotations = $util.emptyObject; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.expiryTime = null; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.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 a Backup message from the specified reader or buffer. + * Decodes an Instance message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.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.alloydb.v1.Backup} Backup + * @returns {google.cloud.alloydb.v1.Instance} Instance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decode = function decode(reader, length) { + 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.alloydb.v1.Backup(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6596,11 +5581,11 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 15: { + case 6: { message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 6: { + case 7: { if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; @@ -6623,43 +5608,80 @@ message.labels[key] = value; break; } - case 7: { - message.state = reader.int32(); - break; - } case 8: { - message.type = reader.int32(); + message.state = reader.int32(); break; } case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); + message.instanceType = reader.int32(); break; } case 10: { - message.clusterName = reader.string(); + message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.decode(reader, reader.uint32()); break; } case 11: { - message.reconciling = reader.bool(); + message.availabilityType = reader.int32(); break; } case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + message.gceZone = reader.string(); break; } case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); break; } case 14: { - message.etag = reader.string(); + message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); break; } case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { if (message.annotations === $util.emptyObject) message.annotations = {}; var end2 = reader.uint32() + reader.pos; @@ -6682,14 +5704,6 @@ message.annotations[key] = value; break; } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -6699,30 +5713,30 @@ }; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Backup} Backup + * @returns {google.cloud.alloydb.v1.Instance} Instance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decodeDelimited = function decodeDelimited(reader) { + Instance.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Backup message. + * Verifies an Instance message. * @function verify - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Backup.verify = function verify(message) { + Instance.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -6766,40 +5780,77 @@ case 2: case 3: case 4: + case 5: + case 6: + case 8: + case 9: break; } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { default: - return "type: enum value expected"; + return "instanceType: enum value expected"; case 0: case 1: case 2: case 3: break; } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.MachineConfig.verify(message.machineConfig); if (error) - return "encryptionConfig." + error; + return "machineConfig." + error; } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.writableNode); if (error) - return "encryptionInfo." + error; + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; @@ -6811,29 +5862,21 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } return null; }; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Backup} Backup + * @returns {google.cloud.alloydb.v1.Instance} Instance */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Backup) + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance) return object; - var message = new $root.google.cloud.alloydb.v1.Backup(); + var message = new $root.google.cloud.alloydb.v1.Instance(); if (object.name != null) message.name = String(object.name); if (object.displayName != null) @@ -6842,22 +5885,22 @@ message.uid = String(object.uid); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.createTime: object expected"); + throw TypeError(".google.cloud.alloydb.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.alloydb.v1.Backup.updateTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Instance.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.deleteTime != null) { if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.deleteTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Instance.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.labels: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Instance.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]]); @@ -6877,11 +5920,11 @@ case 1: message.state = 1; break; - case "CREATING": + case "STOPPED": case 2: message.state = 2; break; - case "FAILED": + case "CREATING": case 3: message.state = 3; break; @@ -6889,90 +5932,140 @@ case 4: message.state = 4; break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; } - switch (object.type) { + switch (object.instanceType) { default: - if (typeof object.type === "number") { - message.type = object.type; + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; break; } break; - case "TYPE_UNSPECIFIED": + case "INSTANCE_TYPE_UNSPECIFIED": case 0: - message.type = 0; + message.instanceType = 0; break; - case "ON_DEMAND": + case "PRIMARY": case 1: - message.type = 1; + message.instanceType = 1; break; - case "AUTOMATED": + case "READ_POOL": case 2: - message.type = 2; + message.instanceType = 2; break; - case "CONTINUOUS": + case "SECONDARY": case 3: - message.type = 3; + message.instanceType = 3; break; } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.fromObject(object.machineConfig); } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); if (object.etag != null) message.etag = String(object.etag); if (object.annotations) { if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.annotations: object expected"); + throw TypeError(".google.cloud.alloydb.v1.Instance.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]]); } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } return message; }; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. + * Creates a plain object from an Instance message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @static - * @param {google.cloud.alloydb.v1.Backup} message Backup + * @param {google.cloud.alloydb.v1.Instance} message Instance * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Backup.toObject = function toObject(message, options) { + Instance.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; if (options.objects || options.defaults) { object.labels = {}; + object.databaseFlags = {}; object.annotations = {}; } if (options.defaults) { @@ -6981,22 +6074,18 @@ object.uid = ""; object.createTime = null; object.updateTime = null; + object.deleteTime = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; object.reconciling = false; - object.encryptionConfig = null; - object.encryptionInfo = null; object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; + object.writableNode = null; + object.queryInsightsConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -7008,6 +6097,8 @@ 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -7015,687 +6106,165 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; if (message.reconciling != null && message.hasOwnProperty("reconciling")) object.reconciling = message.reconciling; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); 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]]; } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.nodes[j], options); + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); return object; }; /** - * Converts this Backup to JSON. + * Converts this Instance to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @instance * @returns {Object.} JSON object */ - Backup.prototype.toJSON = function toJSON() { + Instance.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Backup + * Gets the default type url for Instance * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.Instance * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance"; }; - /** - * State enum. - * @name google.cloud.alloydb.v1.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.alloydb.v1.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value - */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - - return Backup; - })(); + Instance.MachineConfig = (function() { - v1.SupportedDatabaseFlag = (function() { + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + */ - /** - * Properties of a SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1 - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart - */ + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag - * @constructor - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set - */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; - /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; - /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + return writer; + }; - /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.name = ""; - - /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.flagName = ""; - - /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.valueType = 0; - - /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - - /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - - /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance - */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); - }; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.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.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); - writer.ldelim(); - } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.flagName = reader.string(); - break; - } - case 3: { - message.valueType = reader.int32(); - break; - } - case 4: { - message.acceptsMultipleValues = reader.bool(); - break; - } - case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); - } else - message.supportedDbVersions.push(reader.int32()); - break; - } - case 6: { - message.requiresDbRestart = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SupportedDatabaseFlag message. - * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SupportedDatabaseFlag.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { - default: - return "supportedDbVersions: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - return null; - }; - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag) - return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); - } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; - } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { - default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; - break; - } - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.supportedDbVersions[i] = 0; - break; - case "POSTGRES_13": - case 1: - message.supportedDbVersions[i] = 1; - break; - case "POSTGRES_14": - case 2: - message.supportedDbVersions[i] = 2; - break; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - return message; - }; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDbVersions = []; - if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; - } - return object; - }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - * @returns {Object.} JSON object - */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; - }; - - SupportedDatabaseFlag.StringRestrictions = (function() { - - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ - - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Decodes a StringRestrictions message from the specified reader or buffer. + * Decodes a MachineConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StringRestrictions.decode = function decode(reader, length) { + MachineConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); + message.cpuCount = reader.int32(); break; } default: @@ -7707,135 +6276,125 @@ }; /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + MachineConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StringRestrictions message. + * Verifies a MachineConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StringRestrictions.verify = function verify(message) { + MachineConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; return null; }; /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.MachineConfig) return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } + var message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; return message; }; /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {google.cloud.alloydb.v1.Instance.MachineConfig} message MachineConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StringRestrictions.toObject = function toObject(message, options) { + MachineConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } + if (options.defaults) + object.cpuCount = 0; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; return object; }; /** - * Converts this StringRestrictions to JSON. + * Converts this MachineConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @instance * @returns {Object.} JSON object */ - StringRestrictions.prototype.toJSON = function toJSON() { + MachineConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StringRestrictions + * Gets the default type url for MachineConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.MachineConfig"; }; - return StringRestrictions; + return MachineConfig; })(); - SupportedDatabaseFlag.IntegerRestrictions = (function() { + Instance.Node = (function() { /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + * Properties of a Node. + * @memberof google.cloud.alloydb.v1.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state */ /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a Node. + * @implements INode * @constructor - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set */ - function IntegerRestrictions(properties) { + function Node(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7843,89 +6402,117 @@ } /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1.Instance.Node * @instance */ - IntegerRestrictions.prototype.minValue = null; + Node.prototype.zoneId = ""; /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1.Instance.Node * @instance */ - IntegerRestrictions.prototype.maxValue = null; + Node.prototype.id = ""; /** - * Creates a new IntegerRestrictions instance using the specified properties. + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.ip = ""; + + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.state = ""; + + /** + * Creates a new Node instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.Node} Node instance */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); + Node.create = function create(properties) { + return new Node(properties); }; /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntegerRestrictions.encode = function encode(message, writer) { + Node.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); return writer; }; /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + Node.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. + * Decodes a Node message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @returns {google.cloud.alloydb.v1.Instance.Node} Node * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IntegerRestrictions.decode = function decode(reader, length) { + Node.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.Node(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + message.zoneId = reader.string(); break; } case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); break; } default: @@ -7937,995 +6524,1124 @@ }; /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * Decodes a Node message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @returns {google.cloud.alloydb.v1.Instance.Node} Node * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + Node.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IntegerRestrictions message. + * Verifies a Node message. * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IntegerRestrictions.verify = function verify(message) { + Node.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); - if (error) - return "maxValue." + error; - } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; return null; }; /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * Creates a Node message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @returns {google.cloud.alloydb.v1.Instance.Node} Node */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.Node) return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); - } + var message = new $root.google.cloud.alloydb.v1.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); return message; }; /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * Creates a plain object from a Node message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {google.cloud.alloydb.v1.Instance.Node} message Node * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IntegerRestrictions.toObject = function toObject(message, options) { + Node.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.minValue = null; - object.maxValue = null; + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; return object; }; /** - * Converts this IntegerRestrictions to JSON. + * Converts this Node to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @instance * @returns {Object.} JSON object */ - IntegerRestrictions.prototype.toJSON = function toJSON() { + Node.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IntegerRestrictions + * Gets the default type url for Node * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @memberof google.cloud.alloydb.v1.Instance.Node * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.Node"; }; - return IntegerRestrictions; + return Node; })(); - /** - * ValueType enum. - * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value - */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); + Instance.QueryInsightsInstanceConfig = (function() { - return SupportedDatabaseFlag; - })(); + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ - v1.AlloyDBAdmin = (function() { + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new AlloyDBAdmin service. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an AlloyDBAdmin - * @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 AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListClustersResponse} [response] ListClustersResponse - */ + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1.ListClustersRequest, $root.google.cloud.alloydb.v1.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Cluster} [response] Cluster - */ + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1.GetClusterRequest, $root.google.cloud.alloydb.v1.Cluster, request, callback); - }, "name", { value: "GetCluster" }); + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + return null; + }; - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + return QueryInsightsInstanceConfig; + })(); - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); + Instance.ReadPoolConfig = (function() { - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + */ - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListInstancesResponse} [response] ListInstancesResponse - */ + /** + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set + */ + function ReadPoolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1.ListInstancesRequest, $root.google.cloud.alloydb.v1.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); + /** + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @instance + */ + ReadPoolConfig.prototype.nodeCount = 0; - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig instance + */ + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Instance} [response] Instance - */ + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + return writer; + }; - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1.GetInstanceRequest, $root.google.cloud.alloydb.v1.Instance, request, callback); - }, "name", { value: "GetInstance" }); + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); + /** + * Verifies a ReadPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + return null; + }; - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + */ + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + return message; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + return object; + }; - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); + /** + * Converts this ReadPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ReadPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Gets the default type url for ReadPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ReadPoolConfig"; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + return ReadPoolConfig; + })(); /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * State enum. + * @name google.cloud.alloydb.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * InstanceType enum. + * @name google.cloud.alloydb.v1.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * AvailabilityType enum. + * @name google.cloud.alloydb.v1.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); + return Instance; + })(); + + v1.Backup = (function() { /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a Backup. + * @memberof google.cloud.alloydb.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime */ /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new Backup. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set */ + function Backup(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]]; + } /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); + Backup.prototype.name = ""; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.displayName = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Backup uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.uid = ""; /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); + Backup.prototype.createTime = null; /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.updateTime = null; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListBackupsResponse} [response] ListBackupsResponse + * Backup deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.deleteTime = null; /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1.ListBackupsRequest, $root.google.cloud.alloydb.v1.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); + Backup.prototype.labels = $util.emptyObject; /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup state. + * @member {google.cloud.alloydb.v1.Backup.State} state + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.state = 0; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Backup} [response] Backup + * Backup type. + * @member {google.cloud.alloydb.v1.Backup.Type} type + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.type = 0; /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1.GetBackupRequest, $root.google.cloud.alloydb.v1.Backup, request, callback); - }, "name", { value: "GetBackup" }); + Backup.prototype.description = ""; /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.clusterUid = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.clusterName = ""; /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); + Backup.prototype.reconciling = false; /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.encryptionConfig = null; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.encryptionInfo = null; /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); + Backup.prototype.etag = ""; /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Backup.prototype.annotations = $util.emptyObject; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1.Backup + * @instance */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1.Backup * @instance - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); + Backup.prototype.expiryTime = null; /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Backup} Backup instance */ + Backup.create = function create(properties) { + return new Backup(properties); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse - */ - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBAdmin; - })(); - - v1.ListClustersRequest = (function() { - - /** - * Properties of a ListClustersRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy - */ - - /** - * Constructs a new ListClustersRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set - */ - function ListClustersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.parent = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageSize = 0; - - /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageToken = ""; - - /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.filter = ""; - - /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest instance - */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersRequest.encode = function encode(message, writer) { + Backup.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + Backup.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a Backup message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1.Backup} Backup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersRequest.decode = function decode(reader, length) { + Backup.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.displayName = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.uid = reader.string(); break; } case 4: { - message.filter = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 5: { - message.orderBy = reader.string(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); + break; + } + case 10: { + message.clusterName = reader.string(); + break; + } + case 11: { + message.reconciling = reader.bool(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 16: { + 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; + } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -8937,159 +7653,449 @@ }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a Backup message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1.Backup} Backup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + Backup.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersRequest message. + * Verifies a Backup message. * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListClustersRequest.verify = function verify(message) { + Backup.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } return null; }; /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Backup message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1.Backup} Backup */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersRequest) + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup) return object; - var message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + var message = new $root.google.cloud.alloydb.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - * @returns {Object.} JSON object - */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersRequest"; - }; - - return ListClustersRequest; + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "AUTOMATED": + case 2: + message.type = 2; + break; + case "CONTINUOUS": + case 3: + message.type = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.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]]); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.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.uid = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; + object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.etag = ""; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + 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]]; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.alloydb.v1.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); + + return Backup; })(); - v1.ListClustersResponse = (function() { + v1.SupportedDatabaseFlag = (function() { /** - * Properties of a ListClustersResponse. + * Properties of a SupportedDatabaseFlag. * @memberof google.cloud.alloydb.v1 - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart */ /** - * Constructs a new ListClustersResponse. + * Constructs a new SupportedDatabaseFlag. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag * @constructor - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9097,109 +8103,198 @@ } /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - ListClustersResponse.prototype.clusters = $util.emptyArray; + SupportedDatabaseFlag.prototype.stringRestrictions = null; /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - ListClustersResponse.prototype.nextPageToken = ""; + SupportedDatabaseFlag.prototype.integerRestrictions = null; /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; + SupportedDatabaseFlag.prototype.name = ""; /** - * Creates a new ListClustersResponse instance using the specified properties. + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.flagName = ""; + + /** + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.valueType = 0; + + /** + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + + /** + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse instance + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); }; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encode = function encode(message, writer) { + SupportedDatabaseFlag.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decode = function decode(reader, length) { + SupportedDatabaseFlag.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32())); + message.name = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.flagName = reader.string(); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.valueType = reader.int32(); + break; + } + case 4: { + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); break; } default: @@ -9211,376 +8306,753 @@ }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersResponse message. + * Verifies a SupportedDatabaseFlag message. * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListClustersResponse.verify = function verify(message) { + SupportedDatabaseFlag.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.clusters[i]); + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); if (error) - return "clusters." + error; + return "stringRestrictions." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; return null; }; /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersResponse) + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag) return object; - var message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.clusters[i]); + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } + if (object.name != null) + message.name = String(object.name); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + } } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); return message; }; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.ListClustersResponse} message ListClustersResponse + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersResponse.toObject = function toObject(message, options) { + SupportedDatabaseFlag.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; + if (options.defaults) { + object.name = ""; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1.Cluster.toObject(message.clusters[j], options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; } return object; }; /** - * Converts this ListClustersResponse to JSON. + * Converts this SupportedDatabaseFlag to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance * @returns {Object.} JSON object */ - ListClustersResponse.prototype.toJSON = function toJSON() { + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for SupportedDatabaseFlag * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; }; - return ListClustersResponse; - })(); - - v1.GetClusterRequest = (function() { + SupportedDatabaseFlag.StringRestrictions = (function() { - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - */ + /** + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues + */ - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions + * @constructor + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + */ + function StringRestrictions(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.name = ""; + /** + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @instance + */ + StringRestrictions.prototype.allowedValues = $util.emptyArray; - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; + /** + * Creates a new StringRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance + */ + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); + }; - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.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 StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + return writer; + }; - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.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; - }; + /** + * Verifies a StringRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + return null; + }; - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + */ + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + return message; + }; - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.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; - }; + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + return object; + }; - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this StringRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @instance + * @returns {Object.} JSON object + */ + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions"; + }; + + return StringRestrictions; + })(); + + SupportedDatabaseFlag.IntegerRestrictions = (function() { + + /** + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + */ + + /** + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions + * @constructor + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + */ + function IntegerRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.minValue = null; + + /** + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + */ + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); + }; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + return null; + }; + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * ValueType enum. + * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetClusterRequest"; - }; + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); - return GetClusterRequest; + return SupportedDatabaseFlag; })(); - v1.CreateClusterRequest = (function() { + v1.User = (function() { /** - * Properties of a CreateClusterRequest. + * Properties of a User. * @memberof google.cloud.alloydb.v1 - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1.User.UserType|null} [userType] User userType */ /** - * Constructs a new CreateClusterRequest. + * Constructs a new User. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest + * @classdesc Represents a User. + * @implements IUser * @constructor - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set */ - function CreateClusterRequest(properties) { + function User(properties) { + this.databaseRoles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9588,131 +9060,120 @@ } /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; - - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.User * @instance */ - CreateClusterRequest.prototype.clusterId = ""; + User.prototype.name = ""; /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1.User * @instance */ - CreateClusterRequest.prototype.cluster = null; + User.prototype.password = ""; /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1.User * @instance */ - CreateClusterRequest.prototype.requestId = ""; + User.prototype.databaseRoles = $util.emptyArray; /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * User userType. + * @member {google.cloud.alloydb.v1.User.UserType} userType + * @memberof google.cloud.alloydb.v1.User * @instance */ - CreateClusterRequest.prototype.validateOnly = false; + User.prototype.userType = 0; /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new User instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance + * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.User} User instance */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); + User.create = function create(properties) { + return new User(properties); }; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClusterRequest.encode = function encode(message, writer) { + User.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); return writer; }; /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + User.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClusterRequest.decode = function decode(reader, length) { + User.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.User(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + message.password = reader.string(); break; } case 4: { - message.requestId = reader.string(); + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); break; } case 5: { - message.validateOnly = reader.bool(); + message.userType = reader.int32(); break; } default: @@ -9724,1314 +9185,1395 @@ }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + User.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClusterRequest message. + * Verifies a User message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateClusterRequest.verify = function verify(message) { + User.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.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1.User} User */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.User) return object; - var message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + var message = new $root.google.cloud.alloydb.v1.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a User message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static - * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest + * @param {google.cloud.alloydb.v1.User} message User * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClusterRequest.toObject = function toObject(message, options) { + User.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; + } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1.User.UserType[message.userType] : message.userType; return object; }; /** - * Converts this CreateClusterRequest to JSON. + * Converts this User to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @instance * @returns {Object.} JSON object */ - CreateClusterRequest.prototype.toJSON = function toJSON() { + User.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateClusterRequest + * Gets the default type url for User * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.User * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.User"; }; - return CreateClusterRequest; - })(); - - v1.UpdateClusterRequest = (function() { - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing + * UserType enum. + * @name google.cloud.alloydb.v1.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; + })(); + + v1.AlloyDBAdmin = (function() { /** - * Constructs a new UpdateClusterRequest. + * Constructs a new AlloyDBAdmin service. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest + * @classdesc Represents an AlloyDBAdmin + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + * @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 UpdateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. */ - UpdateClusterRequest.prototype.cluster = null; + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListClustersResponse} [response] ListClustersResponse */ - UpdateClusterRequest.prototype.requestId = ""; /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 */ - UpdateClusterRequest.prototype.validateOnly = false; + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1.ListClustersRequest, $root.google.cloud.alloydb.v1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClusterRequest.prototype.allowMissing = false; /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Cluster} [response] Cluster */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 */ - UpdateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1.GetClusterRequest, $root.google.cloud.alloydb.v1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - UpdateClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); /** - * Verifies an UpdateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - UpdateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); /** - * Converts this UpdateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for UpdateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; - }; - - return UpdateClusterRequest; - })(); - v1.DeleteClusterRequest = (function() { + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); /** - * Properties of a DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function DeleteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClusterRequest.prototype.name = ""; + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClusterRequest.prototype.requestId = ""; /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClusterRequest.prototype.etag = ""; /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClusterRequest.prototype.validateOnly = false; + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClusterRequest.prototype.force = false; /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); - }; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClusterRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListInstancesResponse} [response] ListInstancesResponse */ - DeleteClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1.ListInstancesRequest, $root.google.cloud.alloydb.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); /** - * Verifies a DeleteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClusterRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Instance} [response] Instance */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 */ - DeleteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1.GetInstanceRequest, $root.google.cloud.alloydb.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); /** - * Converts this DeleteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for DeleteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; - }; - return DeleteClusterRequest; - })(); + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); - v1.RestoreClusterRequest = (function() { + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Properties of a RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - function RestoreClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.prototype.backupSource = null; /** - * RestoreClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.prototype.parent = ""; + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.prototype.clusterId = ""; /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.prototype.cluster = null; + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); /** - * RestoreClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.prototype.requestId = ""; /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.prototype.validateOnly = false; + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * RestoreClusterRequest source. - * @member {"backupSource"|undefined} source - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); - }; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - RestoreClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a RestoreClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListBackupsResponse} [response] ListBackupsResponse */ - RestoreClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; /** - * Converts this RestoreClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1.ListBackupsRequest, $root.google.cloud.alloydb.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); /** - * Gets the default type url for RestoreClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; - }; - return RestoreClusterRequest; - })(); + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Backup} [response] Backup + */ - v1.ListInstancesRequest = (function() { + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1.GetBackupRequest, $root.google.cloud.alloydb.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.prototype.parent = ""; + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.prototype.pageSize = 0; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesRequest.prototype.pageToken = ""; /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.prototype.filter = ""; + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.prototype.orderBy = ""; /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse */ - ListInstancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListUsersResponse} [response] ListUsersResponse */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1.ListUsersRequest, $root.google.cloud.alloydb.v1.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1.GetUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1.CreateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1.UpdateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBAdmin; + })(); + + v1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListClustersRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); + var message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) @@ -11046,15 +10588,15 @@ }; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.alloydb.v1.ListClustersRequest} message ListClustersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + ListClustersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -11079,55 +10621,55 @@ }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this ListClustersRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + ListClustersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for ListClustersRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersRequest"; }; - return ListInstancesRequest; + return ListClustersRequest; })(); - v1.ListInstancesResponse = (function() { + v1.ListClustersResponse = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a ListClustersResponse. * @memberof google.cloud.alloydb.v1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable */ /** - * Constructs a new ListInstancesResponse. + * Constructs a new ListClustersResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; + function ListClustersResponse(properties) { + this.clusters = []; this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -11136,56 +10678,56 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @instance */ - ListInstancesResponse.prototype.instances = $util.emptyArray; + ListClustersResponse.prototype.clusters = $util.emptyArray; /** - * ListInstancesResponse nextPageToken. + * ListClustersResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + ListClustersResponse.prototype.nextPageToken = ""; /** - * ListInstancesResponse unreachable. + * ListClustersResponse unreachable. * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + ListClustersResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new ListClustersResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + ListClustersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.unreachable != null && message.unreachable.length) @@ -11195,40 +10737,40 @@ }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a ListClustersResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decode = function decode(reader, length) { + ListClustersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32())); break; } case 2: { @@ -11250,39 +10792,39 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a ListClustersResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListInstancesResponse.verify = function verify(message) { + ListClustersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.clusters[i]); if (error) - return "instances." + error; + return "clusters." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -11299,32 +10841,32 @@ }; /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListClustersResponse) return object; - var message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); + var message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.clusters[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.unreachable) { if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.unreachable: array expected"); + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.unreachable: array expected"); message.unreachable = []; for (var i = 0; i < object.unreachable.length; ++i) message.unreachable[i] = String(object.unreachable[i]); @@ -11333,28 +10875,28 @@ }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.alloydb.v1.ListClustersResponse} message ListClustersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + ListClustersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.instances = []; + object.clusters = []; object.unreachable = []; } if (options.defaults) object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1.Cluster.toObject(message.clusters[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -11367,53 +10909,53 @@ }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this ListClustersResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + ListClustersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for ListClustersResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; }; - return ListInstancesResponse; + return ListClustersResponse; })(); - v1.GetInstanceRequest = (function() { + v1.GetClusterRequest = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of a GetClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1.ClusterView|null} [view] GetClusterRequest view */ /** - * Constructs a new GetInstanceRequest. + * Constructs a new GetClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function GetClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11421,43 +10963,43 @@ } /** - * GetInstanceRequest name. + * GetClusterRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @instance */ - GetInstanceRequest.prototype.name = ""; + GetClusterRequest.prototype.name = ""; /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1.InstanceView} view - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1.ClusterView} view + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @instance */ - GetInstanceRequest.prototype.view = 0; + GetClusterRequest.prototype.view = 0; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new GetClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encode = function encode(message, writer) { + GetClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -11468,33 +11010,33 @@ }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a GetClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest * @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) { + GetClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11515,30 +11057,30 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest * @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) { + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies a GetClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @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) { + GetClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -11557,17 +11099,17 @@ }; /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); if (object.name != null) message.name = String(object.name); switch (object.view) { @@ -11577,15 +11119,15 @@ break; } break; - case "INSTANCE_VIEW_UNSPECIFIED": + case "CLUSTER_VIEW_UNSPECIFIED": case 0: message.view = 0; break; - case "INSTANCE_VIEW_BASIC": + case "CLUSTER_VIEW_BASIC": case 1: message.view = 1; break; - case "INSTANCE_VIEW_FULL": + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": case 2: message.view = 2; break; @@ -11594,80 +11136,80 @@ }; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.alloydb.v1.GetClusterRequest} message GetClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + GetClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.InstanceView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.alloydb.v1.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.ClusterView[message.view] : message.view; return object; }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this GetClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + GetClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for GetClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetClusterRequest"; }; - return GetInstanceRequest; + return GetClusterRequest; })(); - v1.CreateInstanceRequest = (function() { + v1.CreateSecondaryClusterRequest = (function() { /** - * Properties of a CreateInstanceRequest. + * Properties of a CreateSecondaryClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly */ /** - * Constructs a new CreateInstanceRequest. + * Constructs a new CreateSecondaryClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set */ - function CreateInstanceRequest(properties) { + function CreateSecondaryClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11675,110 +11217,110 @@ } /** - * CreateInstanceRequest parent. + * CreateSecondaryClusterRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance */ - CreateInstanceRequest.prototype.parent = ""; + CreateSecondaryClusterRequest.prototype.parent = ""; /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance */ - CreateInstanceRequest.prototype.instanceId = ""; + CreateSecondaryClusterRequest.prototype.clusterId = ""; /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance */ - CreateInstanceRequest.prototype.instance = null; + CreateSecondaryClusterRequest.prototype.cluster = null; /** - * CreateInstanceRequest requestId. + * CreateSecondaryClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance */ - CreateInstanceRequest.prototype.requestId = ""; + CreateSecondaryClusterRequest.prototype.requestId = ""; /** - * CreateInstanceRequest validateOnly. + * CreateSecondaryClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance */ - CreateInstanceRequest.prototype.validateOnly = false; + CreateSecondaryClusterRequest.prototype.validateOnly = false; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encode = function encode(message, writer) { + CreateSecondaryClusterRequest.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.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest * @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) { + CreateSecondaryClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11787,18 +11329,18 @@ break; } case 2: { - message.instanceId = reader.string(); + message.clusterId = reader.string(); break; } case 3: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } - case 4: { + case 5: { message.requestId = reader.string(); break; } - case 5: { + case 6: { message.validateOnly = reader.bool(); break; } @@ -11811,42 +11353,42 @@ }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest * @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) { + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequest message. + * Verifies a CreateSecondaryClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @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) { + CreateSecondaryClusterRequest.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.alloydb.v1.Instance.verify(message.instance); + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); if (error) - return "instance." + error; + return "cluster." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) @@ -11858,25 +11400,25 @@ }; /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); 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.alloydb.v1.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); } if (object.requestId != null) message.requestId = String(object.requestId); @@ -11886,31 +11428,31 @@ }; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.instanceId = ""; - object.instance = null; + object.clusterId = ""; + object.cluster = null; object.requestId = ""; object.validateOnly = false; } 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.alloydb.v1.Instance.toObject(message.instance, options); + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) @@ -11919,53 +11461,56 @@ }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this CreateSecondaryClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for CreateSecondaryClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryClusterRequest"; }; - return CreateInstanceRequest; + return CreateSecondaryClusterRequest; })(); - v1.CreateInstanceRequests = (function() { + v1.CreateClusterRequest = (function() { /** - * Properties of a CreateInstanceRequests. + * Properties of a CreateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly */ /** - * Constructs a new CreateInstanceRequests. + * Constructs a new CreateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; + function CreateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11973,78 +11518,131 @@ } /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + CreateClusterRequest.prototype.parent = ""; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); }; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encode = function encode(message, writer) { + CreateClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a CreateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decode = function decode(reader, length) { + CreateClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1.CreateInstanceRequest.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); break; } default: @@ -12056,141 +11654,164 @@ }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequests message. + * Verifies a CreateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateInstanceRequests.verify = function verify(message) { + CreateClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1.CreateInstanceRequest.verify(message.createInstanceRequests[i]); - if (error) - return "createInstanceRequests." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); - } + var message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); } - return message; - }; + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests + * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequests.toObject = function toObject(message, options) { + CreateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateInstanceRequests to JSON. + * Converts this CreateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { + CreateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for CreateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; }; - return CreateInstanceRequests; + return CreateClusterRequest; })(); - v1.BatchCreateInstancesRequest = (function() { + v1.UpdateClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesRequest. + * Properties of an UpdateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing */ /** - * Constructs a new BatchCreateInstancesRequest. + * Constructs a new UpdateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesRequest(properties) { + function UpdateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12198,105 +11819,133 @@ } /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - BatchCreateInstancesRequest.prototype.parent = ""; + UpdateClusterRequest.prototype.updateMask = null; /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - BatchCreateInstancesRequest.prototype.requests = null; + UpdateClusterRequest.prototype.cluster = null; /** - * BatchCreateInstancesRequest requestId. + * UpdateClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - BatchCreateInstancesRequest.prototype.requestId = ""; + UpdateClusterRequest.prototype.requestId = ""; /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.validateOnly = false; + + /** + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { + UpdateClusterRequest.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.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes an UpdateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decode = function decode(reader, length) { + UpdateClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } case 3: { message.requestId = reader.string(); break; } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -12306,145 +11955,169 @@ }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies an UpdateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesRequest.verify = function verify(message) { + UpdateClusterRequest.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.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1.CreateInstanceRequests.verify(message.requests); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "requests." + error; + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.fromObject(object.requests); + var message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); } if (object.requestId != null) message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { + UpdateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.requests = null; + object.updateMask = null; + object.cluster = null; object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.toObject(message.requests, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this BatchCreateInstancesRequest to JSON. + * Converts this UpdateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + UpdateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for UpdateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; }; - return BatchCreateInstancesRequest; + return UpdateClusterRequest; })(); - v1.BatchCreateInstancesResponse = (function() { + v1.DeleteClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesResponse. + * Properties of a DeleteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force */ /** - * Constructs a new BatchCreateInstancesResponse. + * Constructs a new DeleteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; + function DeleteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12452,78 +12125,131 @@ } /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @instance */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + DeleteClusterRequest.prototype.name = ""; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.etag = ""; + + /** + * DeleteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.validateOnly = false; + + /** + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.force = false; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { + DeleteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); return writer; }; /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes a DeleteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decode = function decode(reader, length) { + DeleteClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); break; } default: @@ -12535,142 +12261,158 @@ }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies a DeleteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesResponse.verify = function verify(message) { + DeleteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); - } - } + var message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { + DeleteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; } - return object; - }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + DeleteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for DeleteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; }; - return BatchCreateInstancesResponse; + return DeleteClusterRequest; })(); - v1.BatchCreateInstancesMetadata = (function() { + v1.PromoteClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesMetadata. + * Properties of a PromoteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly */ /** - * Constructs a new BatchCreateInstancesMetadata. + * Constructs a new PromoteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; + function PromoteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12678,114 +12420,117 @@ } /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + PromoteClusterRequest.prototype.name = ""; /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + PromoteClusterRequest.prototype.requestId = ""; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.etag = ""; + + /** + * PromoteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest instance */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { + PromoteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a PromoteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decode = function decode(reader, length) { + PromoteClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); + message.name = reader.string(); break; } case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); break; } default: @@ -12797,165 +12542,153 @@ }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a PromoteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesMetadata.verify = function verify(message) { + PromoteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.PromoteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } - } + var message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {google.cloud.alloydb.v1.PromoteClusterRequest} message PromoteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + PromoteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this BatchCreateInstancesMetadata to JSON. + * Converts this PromoteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + PromoteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for PromoteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.PromoteClusterRequest"; }; - return BatchCreateInstancesMetadata; + return PromoteClusterRequest; })(); - v1.BatchCreateInstanceStatus = (function() { + v1.RestoreClusterRequest = (function() { /** - * Properties of a BatchCreateInstanceStatus. + * Properties of a RestoreClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly */ /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new RestoreClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set */ - function BatchCreateInstanceStatus(properties) { + function RestoreClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12963,117 +12696,173 @@ } /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.state = 0; + RestoreClusterRequest.prototype.backupSource = null; /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; + RestoreClusterRequest.prototype.continuousBackupSource = null; /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.error = null; + RestoreClusterRequest.prototype.parent = ""; /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.type = 0; + RestoreClusterRequest.prototype.clusterId = ""; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.requestId = ""; + + /** + * RestoreClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { + RestoreClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - 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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes a RestoreClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decode = function decode(reader, length) { + RestoreClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } case 1: { - message.state = reader.int32(); + message.parent = reader.string(); break; } case 2: { - message.errorMsg = reader.string(); + message.clusterId = reader.string(); break; } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } - case 3: { - message.type = reader.int32(); + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); break; } default: @@ -13085,253 +12874,203 @@ }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies a RestoreClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstanceStatus.verify = function verify(message) { + RestoreClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; } - return null; - }; - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); - 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 "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; + var message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.fromObject(object.continuousBackupSource); } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { + RestoreClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); return object; }; /** - * Converts this BatchCreateInstanceStatus to JSON. + * Converts this RestoreClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + RestoreClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for RestoreClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; }; - /** - * State enum. - * @name google.cloud.alloydb.v1.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; + return RestoreClusterRequest; })(); - v1.UpdateInstanceRequest = (function() { + v1.ListInstancesRequest = (function() { /** - * Properties of an UpdateInstanceRequest. + * Properties of a ListInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy */ /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new ListInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set */ - function UpdateInstanceRequest(properties) { + function ListInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13339,131 +13078,131 @@ } /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.updateMask = null; + ListInstancesRequest.prototype.parent = ""; /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.instance = null; + ListInstancesRequest.prototype.pageSize = 0; /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.requestId = ""; + ListInstancesRequest.prototype.pageToken = ""; /** - * UpdateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.validateOnly = false; + ListInstancesRequest.prototype.filter = ""; /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.allowMissing = false; + ListInstancesRequest.prototype.orderBy = ""; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new ListInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encode = function encode(message, writer) { + ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decode = function decode(reader, length) { + ListInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 3: { - message.requestId = reader.string(); + message.pageToken = reader.string(); break; } case 4: { - message.validateOnly = reader.bool(); + message.filter = reader.string(); break; } case 5: { - message.allowMissing = reader.bool(); + message.orderBy = reader.string(); break; } default: @@ -13475,168 +13214,159 @@ }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateInstanceRequest.verify = function verify(message) { + ListInstancesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + var message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + ListInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for ListInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; }; - return UpdateInstanceRequest; + return ListInstancesRequest; })(); - v1.DeleteInstanceRequest = (function() { + v1.ListInstancesResponse = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a ListInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new ListInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13644,117 +13374,109 @@ } /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - DeleteInstanceRequest.prototype.name = ""; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * DeleteInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.requestId = ""; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - DeleteInstanceRequest.prototype.etag = ""; + ListInstancesResponse.prototype.nextPageToken = ""; /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - DeleteInstanceRequest.prototype.validateOnly = false; + ListInstancesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new ListInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + ListInstancesResponse.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse * @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) { + ListInstancesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); break; } case 2: { - message.requestId = reader.string(); + message.nextPageToken = reader.string(); break; } case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -13766,149 +13488,170 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse * @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) { + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a ListInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @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) { + ListInstancesResponse.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + var message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; return object; }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this ListInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + ListInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for ListInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; }; - return DeleteInstanceRequest; + return ListInstancesResponse; })(); - v1.FailoverInstanceRequest = (function() { + v1.GetInstanceRequest = (function() { /** - * Properties of a FailoverInstanceRequest. + * Properties of a GetInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view */ /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new GetInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set */ - function FailoverInstanceRequest(properties) { + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13916,90 +13659,80 @@ } /** - * FailoverInstanceRequest name. + * GetInstanceRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.name = ""; - - /** - * FailoverInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance */ - FailoverInstanceRequest.prototype.requestId = ""; + GetInstanceRequest.prototype.name = ""; /** - * FailoverInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1.InstanceView} view + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance */ - FailoverInstanceRequest.prototype.validateOnly = false; + GetInstanceRequest.prototype.view = 0; /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * Creates a new GetInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); }; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encode = function encode(message, 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); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.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.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decode = function decode(reader, length) { + 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.alloydb.v1.FailoverInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14008,11 +13741,7 @@ break; } case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); + message.view = reader.int32(); break; } default: @@ -14024,141 +13753,159 @@ }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FailoverInstanceRequest message. + * Verifies a GetInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FailoverInstanceRequest.verify = function verify(message) { + 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"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; + } return message; }; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverInstanceRequest.toObject = function toObject(message, options) { + GetInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.requestId = ""; - object.validateOnly = false; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.InstanceView[message.view] : message.view; return object; }; /** - * Converts this FailoverInstanceRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance * @returns {Object.} JSON object */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { + GetInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for GetInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; }; - return FailoverInstanceRequest; + return GetInstanceRequest; })(); - v1.RestartInstanceRequest = (function() { + v1.CreateInstanceRequest = (function() { /** - * Properties of a RestartInstanceRequest. + * Properties of a CreateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly */ /** - * Constructs a new RestartInstanceRequest. + * Constructs a new CreateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set */ - function RestartInstanceRequest(properties) { + function CreateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14166,102 +13913,130 @@ } /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - RestartInstanceRequest.prototype.name = ""; + CreateInstanceRequest.prototype.parent = ""; /** - * RestartInstanceRequest requestId. + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - RestartInstanceRequest.prototype.requestId = ""; + CreateInstanceRequest.prototype.requestId = ""; /** - * RestartInstanceRequest validateOnly. + * CreateInstanceRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - RestartInstanceRequest.prototype.validateOnly = false; + CreateInstanceRequest.prototype.validateOnly = false; /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartInstanceRequest.encode = function encode(message, writer) { + CreateInstanceRequest.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.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.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.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.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartInstanceRequest.decode = function decode(reader, length) { + 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.alloydb.v1.RestartInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.instanceId = reader.string(); break; } case 3: { + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { message.validateOnly = reader.bool(); break; } @@ -14274,35 +14049,43 @@ }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestartInstanceRequest message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestartInstanceRequest.verify = function verify(message) { + CreateInstanceRequest.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.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.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; @@ -14313,19 +14096,26 @@ }; /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.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.alloydb.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) @@ -14334,25 +14124,31 @@ }; /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest + * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestartInstanceRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; + object.instanceId = ""; + object.instance = null; object.requestId = ""; object.validateOnly = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + 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.alloydb.v1.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) @@ -14361,56 +14157,56 @@ }; /** - * Converts this RestartInstanceRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestartInstanceRequest + * Gets the default type url for CreateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; }; - return RestartInstanceRequest; + return CreateInstanceRequest; })(); - v1.ListBackupsRequest = (function() { + v1.CreateSecondaryInstanceRequest = (function() { /** - * Properties of a ListBackupsRequest. + * Properties of a CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly */ /** - * Constructs a new ListBackupsRequest. + * Constructs a new CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set */ - function ListBackupsRequest(properties) { + function CreateSecondaryInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14418,110 +14214,110 @@ } /** - * ListBackupsRequest parent. + * CreateSecondaryInstanceRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListBackupsRequest.prototype.parent = ""; + CreateSecondaryInstanceRequest.prototype.parent = ""; /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListBackupsRequest.prototype.pageSize = 0; + CreateSecondaryInstanceRequest.prototype.instanceId = ""; /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListBackupsRequest.prototype.pageToken = ""; + CreateSecondaryInstanceRequest.prototype.instance = null; /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListBackupsRequest.prototype.filter = ""; + CreateSecondaryInstanceRequest.prototype.requestId = ""; /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListBackupsRequest.prototype.orderBy = ""; + CreateSecondaryInstanceRequest.prototype.validateOnly = false; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); }; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encode = function encode(message, writer) { + CreateSecondaryInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.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.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decode = function decode(reader, length) { + CreateSecondaryInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14530,19 +14326,19 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.instanceId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); + message.requestId = reader.string(); break; } case 5: { - message.orderBy = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -14554,159 +14350,161 @@ }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsRequest message. + * Verifies a CreateSecondaryInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsRequest.verify = function verify(message) { + CreateSecondaryInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.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.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsRequest) + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); + var message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.ListBackupsRequest} message ListBackupsRequest + * @param {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsRequest.toObject = function toObject(message, options) { + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance * @returns {Object.} JSON object */ - ListBackupsRequest.prototype.toJSON = function toJSON() { + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for CreateSecondaryInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryInstanceRequest"; }; - return ListBackupsRequest; + return CreateSecondaryInstanceRequest; })(); - v1.ListBackupsResponse = (function() { + v1.CreateInstanceRequests = (function() { /** - * Properties of a ListBackupsResponse. + * Properties of a CreateInstanceRequests. * @memberof google.cloud.alloydb.v1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests */ /** - * Constructs a new ListBackupsResponse. + * Constructs a new CreateInstanceRequests. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests * @constructor - * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14714,109 +14512,78 @@ } /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @instance */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); }; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encode = function encode(message, writer) { + CreateInstanceRequests.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decode = function decode(reader, length) { + CreateInstanceRequests.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1.CreateInstanceRequest.decode(reader, reader.uint32())); break; } default: @@ -14828,169 +14595,141 @@ }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsResponse message. + * Verifies a CreateInstanceRequests message. * @function verify - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsResponse.verify = function verify(message) { + CreateInstanceRequests.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backups[i]); + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1.CreateInstanceRequest.verify(message.createInstanceRequests[i]); if (error) - return "backups." + error; + return "createInstanceRequests." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } return null; }; /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsResponse) + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) return object; - var message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backups[i]); + var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } return message; }; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.ListBackupsResponse} message ListBackupsResponse + * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsResponse.toObject = function toObject(message, options) { + CreateInstanceRequests.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); } return object; }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this CreateInstanceRequests to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @instance * @returns {Object.} JSON object */ - ListBackupsResponse.prototype.toJSON = function toJSON() { + CreateInstanceRequests.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for CreateInstanceRequests * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; }; - return ListBackupsResponse; + return CreateInstanceRequests; })(); - v1.GetBackupRequest = (function() { + v1.BatchCreateInstancesRequest = (function() { /** - * Properties of a GetBackupRequest. + * Properties of a BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId */ /** - * Constructs a new GetBackupRequest. + * Constructs a new BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set */ - function GetBackupRequest(properties) { + function BatchCreateInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14998,75 +14737,103 @@ } /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * BatchCreateInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance */ - GetBackupRequest.prototype.name = ""; + BatchCreateInstancesRequest.prototype.parent = ""; /** - * Creates a new GetBackupRequest instance using the specified properties. + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requests = null; + + /** + * BatchCreateInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); }; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encode = function encode(message, writer) { + BatchCreateInstancesRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decode = function decode(reader, length) { + BatchCreateInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); break; } default: @@ -15078,126 +14845,145 @@ }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBackupRequest message. + * Verifies a BatchCreateInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBackupRequest.verify = function verify(message) { + BatchCreateInstancesRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1.CreateInstanceRequests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetBackupRequest) + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.fromObject(object.requests); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.GetBackupRequest} message GetBackupRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupRequest.toObject = function toObject(message, options) { + BatchCreateInstancesRequest.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; + if (options.defaults) { + object.parent = ""; + object.requests = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.toObject(message.requests, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this GetBackupRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance * @returns {Object.} JSON object */ - GetBackupRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for BatchCreateInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; }; - return GetBackupRequest; + return BatchCreateInstancesRequest; })(); - v1.CreateBackupRequest = (function() { + v1.BatchCreateInstancesResponse = (function() { /** - * Properties of a CreateBackupRequest. + * Properties of a BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances */ /** - * Constructs a new CreateBackupRequest. + * Constructs a new BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set */ - function CreateBackupRequest(properties) { + function BatchCreateInstancesResponse(properties) { + this.instances = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15205,131 +14991,78 @@ } /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.requestId = ""; - - /** - * CreateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @instance */ - CreateBackupRequest.prototype.validateOnly = false; + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); }; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encode = function encode(message, writer) { + BatchCreateInstancesResponse.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.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decode = function decode(reader, length) { + BatchCreateInstancesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); break; } default: @@ -15341,164 +15074,142 @@ }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBackupRequest message. + * Verifies a BatchCreateInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBackupRequest.verify = function verify(message) { + BatchCreateInstancesResponse.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.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; return null; }; /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateBackupRequest) + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); + } } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.CreateBackupRequest} message CreateBackupRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupRequest.toObject = function toObject(message, options) { + BatchCreateInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this BatchCreateInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @instance * @returns {Object.} JSON object */ - CreateBackupRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for BatchCreateInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; }; - return CreateBackupRequest; + return BatchCreateInstancesResponse; })(); - v1.UpdateBackupRequest = (function() { + v1.BatchCreateInstancesMetadata = (function() { /** - * Properties of an UpdateBackupRequest. + * Properties of a BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1 - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses */ /** - * Constructs a new UpdateBackupRequest. + * Constructs a new BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata * @constructor - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set */ - function UpdateBackupRequest(properties) { + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15506,131 +15217,114 @@ } /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.requestId = ""; - - /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @instance */ - UpdateBackupRequest.prototype.validateOnly = false; + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @instance */ - UpdateBackupRequest.prototype.allowMissing = false; + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); }; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encode = function encode(message, writer) { + BatchCreateInstancesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decode = function decode(reader, length) { + BatchCreateInstancesMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); break; } case 2: { - message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; break; } default: @@ -15642,168 +15336,165 @@ }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateBackupRequest message. + * Verifies a BatchCreateInstancesMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateBackupRequest.verify = function verify(message) { + BatchCreateInstancesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); + if (error) + return "instanceStatuses." + error; + } } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateBackupRequest) + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) return object; - var message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupRequest.toObject = function toObject(message, options) { + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; + } + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @instance * @returns {Object.} JSON object */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for BatchCreateInstancesMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; }; - return UpdateBackupRequest; + return BatchCreateInstancesMetadata; })(); - v1.DeleteBackupRequest = (function() { + v1.BatchCreateInstanceStatus = (function() { /** - * Properties of a DeleteBackupRequest. + * Properties of a BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type */ /** - * Constructs a new DeleteBackupRequest. + * Constructs a new BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus * @constructor - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set */ - function DeleteBackupRequest(properties) { + function BatchCreateInstanceStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15811,117 +15502,117 @@ } /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - DeleteBackupRequest.prototype.name = ""; + BatchCreateInstanceStatus.prototype.state = 0; /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - DeleteBackupRequest.prototype.requestId = ""; + BatchCreateInstanceStatus.prototype.errorMsg = ""; /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - DeleteBackupRequest.prototype.validateOnly = false; + BatchCreateInstanceStatus.prototype.error = null; /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - DeleteBackupRequest.prototype.etag = ""; + BatchCreateInstanceStatus.prototype.type = 0; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new BatchCreateInstanceStatus instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); }; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encode = function encode(message, writer) { + BatchCreateInstanceStatus.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + 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(); return writer; }; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decode = function decode(reader, length) { + BatchCreateInstanceStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.state = reader.int32(); break; } case 2: { - message.requestId = reader.string(); + message.errorMsg = reader.string(); break; } - case 3: { - message.validateOnly = reader.bool(); + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; } - case 4: { - message.etag = reader.string(); + case 3: { + message.type = reader.int32(); break; } default: @@ -15933,149 +15624,253 @@ }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteBackupRequest message. + * Verifies a BatchCreateInstanceStatus message. * @function verify - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteBackupRequest.verify = function verify(message) { + BatchCreateInstanceStatus.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteBackupRequest) + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) return object; - var message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); + 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 "PENDING_CREATE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for BatchCreateInstanceStatus * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; }; - return DeleteBackupRequest; + /** + * State enum. + * @name google.cloud.alloydb.v1.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; })(); - v1.ListSupportedDatabaseFlagsRequest = (function() { + v1.UpdateInstanceRequest = (function() { /** - * Properties of a ListSupportedDatabaseFlagsRequest. + * Properties of an UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing */ /** - * Constructs a new ListSupportedDatabaseFlagsRequest. + * Constructs a new UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsRequest(properties) { + function UpdateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16083,103 +15878,131 @@ } /** - * ListSupportedDatabaseFlagsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + UpdateInstanceRequest.prototype.updateMask = null; /** - * ListSupportedDatabaseFlagsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + UpdateInstanceRequest.prototype.instance = null; /** - * ListSupportedDatabaseFlagsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + UpdateInstanceRequest.prototype.requestId = ""; /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.validateOnly = false; + + /** + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + UpdateInstanceRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { + UpdateInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.pageSize = reader.int32(); + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); break; } default: @@ -16191,141 +16014,168 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsRequest message. + * Verifies an UpdateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + UpdateInstanceRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); - 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); + var message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + UpdateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.updateMask = null; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - 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.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * Converts this UpdateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + UpdateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest + * Gets the default type url for UpdateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; }; - return ListSupportedDatabaseFlagsRequest; + return UpdateInstanceRequest; })(); - v1.ListSupportedDatabaseFlagsResponse = (function() { + v1.DeleteInstanceRequest = (function() { /** - * Properties of a ListSupportedDatabaseFlagsResponse. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly */ /** - * Constructs a new ListSupportedDatabaseFlagsResponse. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16333,95 +16183,120 @@ } /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; + DeleteInstanceRequest.prototype.name = ""; /** - * ListSupportedDatabaseFlagsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + DeleteInstanceRequest.prototype.requestId = ""; /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.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.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { + 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.alloydb.v1.ListSupportedDatabaseFlagsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1.SupportedDatabaseFlag.decode(reader, reader.uint32())); + message.name = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.requestId = reader.string(); break; } - default: + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: reader.skipType(tag & 7); break; } @@ -16430,155 +16305,149 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsResponse message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + DeleteInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); - if (error) - return "supportedDatabaseFlags." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + DeleteInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse + * Gets the default type url for DeleteInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; }; - return ListSupportedDatabaseFlagsResponse; + return DeleteInstanceRequest; })(); - v1.OperationMetadata = (function() { + v1.FailoverInstanceRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a FailoverInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly */ /** - * Constructs a new OperationMetadata. + * Constructs a new FailoverInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function FailoverInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16586,187 +16455,103 @@ } /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1.OperationMetadata + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - OperationMetadata.prototype.requestedCancellation = false; + FailoverInstanceRequest.prototype.name = ""; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1.OperationMetadata + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + FailoverInstanceRequest.prototype.requestId = ""; /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1.OperationMetadata + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); + FailoverInstanceRequest.prototype.validateOnly = false; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new FailoverInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + FailoverInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest * @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) { + FailoverInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -16778,335 +16563,260 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest * @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) { + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a FailoverInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @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) { + FailoverInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.OperationMetadata) + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.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.alloydb.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + FailoverInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this FailoverInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + FailoverInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for FailoverInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.OperationMetadata + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; }; - return OperationMetadata; + return FailoverInstanceRequest; })(); - return v1; - })(); + v1.InjectFaultRequest = (function() { - alloydb.v1alpha = (function() { + /** + * Properties of an InjectFaultRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly + */ - /** - * Namespace v1alpha. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1alpha = {}; - - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1alpha.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - */ - v1alpha.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - return values; - })(); - - /** - * InstanceView enum. - * @name google.cloud.alloydb.v1alpha.InstanceView - * @enum {number} - * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value - * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value - * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value - */ - v1alpha.InstanceView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; - values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; - return values; - })(); - - v1alpha.UserPassword = (function() { + /** + * Constructs a new InjectFaultRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest + * @constructor + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + */ + function InjectFaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Properties of a UserPassword. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance */ + InjectFaultRequest.prototype.faultType = 0; /** - * Constructs a new UserPassword. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a UserPassword. - * @implements IUserPassword - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance */ - function UserPassword(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + InjectFaultRequest.prototype.name = ""; /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * InjectFaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UserPassword.prototype.user = ""; + InjectFaultRequest.prototype.requestId = ""; /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UserPassword.prototype.password = ""; + InjectFaultRequest.prototype.validateOnly = false; /** - * Creates a new UserPassword instance using the specified properties. + * Creates a new InjectFaultRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest instance */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); }; /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPassword.encode = function encode(message, writer) { + InjectFaultRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserPassword message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserPassword.decode = function decode(reader, length) { + InjectFaultRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.user = reader.string(); + message.faultType = reader.int32(); break; } case 2: { - message.password = reader.string(); + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); break; } default: @@ -17118,133 +16828,182 @@ }; /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserPassword message. + * Verifies an InjectFaultRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserPassword.verify = function verify(message) { + InjectFaultRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { + default: + return "faultType: enum value expected"; + case 0: + case 1: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UserPassword) + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.InjectFaultRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); - if (object.user != null) - message.user = String(object.user); - if (object.password != null) - message.password = String(object.password); + var message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); + switch (object.faultType) { + default: + if (typeof object.faultType === "number") { + message.faultType = object.faultType; + break; + } + break; + case "FAULT_TYPE_UNSPECIFIED": + case 0: + message.faultType = 0; + break; + case "STOP_VM": + case 1: + message.faultType = 1; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1alpha.UserPassword} message UserPassword + * @param {google.cloud.alloydb.v1.InjectFaultRequest} message InjectFaultRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserPassword.toObject = function toObject(message, options) { + InjectFaultRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.user = ""; - object.password = ""; + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this UserPassword to JSON. + * Converts this InjectFaultRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance * @returns {Object.} JSON object */ - UserPassword.prototype.toJSON = function toJSON() { + InjectFaultRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserPassword + * Gets the default type url for InjectFaultRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UserPassword"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.InjectFaultRequest"; }; - return UserPassword; + /** + * FaultType enum. + * @name google.cloud.alloydb.v1.InjectFaultRequest.FaultType + * @enum {number} + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value + */ + InjectFaultRequest.FaultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; + return values; + })(); + + return InjectFaultRequest; })(); - v1alpha.MigrationSource = (function() { + v1.RestartInstanceRequest = (function() { /** - * Properties of a MigrationSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IMigrationSource - * @property {string|null} [hostPort] MigrationSource hostPort - * @property {string|null} [referenceId] MigrationSource referenceId - * @property {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly */ /** - * Constructs a new MigrationSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set */ - function MigrationSource(properties) { + function RestartInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17252,103 +17011,103 @@ } /** - * MigrationSource hostPort. - * @member {string} hostPort - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - MigrationSource.prototype.hostPort = ""; + RestartInstanceRequest.prototype.name = ""; /** - * MigrationSource referenceId. - * @member {string} referenceId - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - MigrationSource.prototype.referenceId = ""; + RestartInstanceRequest.prototype.requestId = ""; /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - MigrationSource.prototype.sourceType = 0; + RestartInstanceRequest.prototype.validateOnly = false; /** - * Creates a new MigrationSource instance using the specified properties. + * Creates a new RestartInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); }; /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationSource.encode = function encode(message, writer) { + RestartInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrationSource message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationSource.decode = function decode(reader, length) { + RestartInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hostPort = reader.string(); + message.name = reader.string(); break; } case 2: { - message.referenceId = reader.string(); + message.requestId = reader.string(); break; } case 3: { - message.sourceType = reader.int32(); + message.validateOnly = reader.bool(); break; } default: @@ -17360,172 +17119,143 @@ }; /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrationSource message. + * Verifies a RestartInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrationSource.verify = function verify(message) { + RestartInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - if (!$util.isString(message.hostPort)) - return "hostPort: string expected"; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MigrationSource) + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); - if (object.hostPort != null) - message.hostPort = String(object.hostPort); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "DMS": - case 1: - message.sourceType = 1; - break; - } + var message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.MigrationSource} message MigrationSource + * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrationSource.toObject = function toObject(message, options) { + RestartInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.hostPort = ""; - object.referenceId = ""; - object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - object.hostPort = message.hostPort; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this MigrationSource to JSON. + * Converts this RestartInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance * @returns {Object.} JSON object */ - MigrationSource.prototype.toJSON = function toJSON() { + RestartInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrationSource + * Gets the default type url for RestartInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MigrationSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; }; - /** - * MigrationSourceType enum. - * @name google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType - * @enum {number} - * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value - * @property {number} DMS=1 DMS value - */ - MigrationSource.MigrationSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DMS"] = 1; - return values; - })(); - - return MigrationSource; + return RestartInstanceRequest; })(); - v1alpha.EncryptionConfig = (function() { + v1.ListBackupsRequest = (function() { /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * Properties of a ListBackupsRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy */ /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function ListBackupsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17533,75 +17263,131 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + ListBackupsRequest.prototype.parent = ""; /** - * Creates a new EncryptionConfig instance using the specified properties. + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig instance + * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); }; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encode = function encode(message, writer) { + ListBackupsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a ListBackupsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decode = function decode(reader, length) { + ListBackupsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.kmsKeyName = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -17613,124 +17399,159 @@ }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionConfig message. + * Verifies a ListBackupsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionConfig.verify = function verify(message) { + ListBackupsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionConfig) + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + var message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1alpha.EncryptionConfig} message EncryptionConfig + * @param {google.cloud.alloydb.v1.ListBackupsRequest} message ListBackupsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + ListBackupsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this EncryptionConfig to JSON. + * Converts this ListBackupsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @instance * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { + ListBackupsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for ListBackupsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @memberof google.cloud.alloydb.v1.ListBackupsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsRequest"; }; - return EncryptionConfig; + return ListBackupsRequest; })(); - v1alpha.EncryptionInfo = (function() { + v1.ListBackupsResponse = (function() { /** - * Properties of an EncryptionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + * Properties of a ListBackupsResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable */ /** - * Constructs a new EncryptionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17738,92 +17559,109 @@ } /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1alpha.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @instance */ - EncryptionInfo.prototype.encryptionType = 0; + ListBackupsResponse.prototype.backups = $util.emptyArray; /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @instance */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + ListBackupsResponse.prototype.nextPageToken = ""; /** - * Creates a new EncryptionInfo instance using the specified properties. + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo instance + * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse instance */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); }; /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionInfo.encode = function encode(message, writer) { + ListBackupsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer. + * Decodes a ListBackupsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionInfo.decode = function decode(reader, length) { + ListBackupsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.encryptionType = reader.int32(); + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32())); break; } case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -17835,184 +17673,169 @@ }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionInfo message. + * Verifies a ListBackupsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionInfo.verify = function verify(message) { + ListBackupsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } return null; }; /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionInfo) + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsResponse) return object; - var message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; + var message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backups[i]); } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.alloydb.v1alpha.EncryptionInfo.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } return message; }; /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1alpha.EncryptionInfo} message EncryptionInfo + * @param {google.cloud.alloydb.v1.ListBackupsResponse} message ListBackupsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionInfo.toObject = function toObject(message, options) { + ListBackupsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyVersions = []; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } if (options.defaults) - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } return object; }; /** - * Converts this EncryptionInfo to JSON. + * Converts this ListBackupsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @instance * @returns {Object.} JSON object */ - EncryptionInfo.prototype.toJSON = function toJSON() { + ListBackupsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionInfo + * Gets the default type url for ListBackupsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @memberof google.cloud.alloydb.v1.ListBackupsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsResponse"; }; - /** - * Type enum. - * @name google.cloud.alloydb.v1alpha.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; + return ListBackupsResponse; })(); - v1alpha.SslConfig = (function() { + v1.GetBackupRequest = (function() { /** - * Properties of a SslConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISslConfig - * @property {google.cloud.alloydb.v1alpha.SslConfig.SslMode|null} [sslMode] SslConfig sslMode - * @property {google.cloud.alloydb.v1alpha.SslConfig.CaSource|null} [caSource] SslConfig caSource + * Properties of a GetBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name */ /** - * Constructs a new SslConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SslConfig. - * @implements ISslConfig + * Constructs a new GetBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set */ - function SslConfig(properties) { + function GetBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18020,89 +17843,75 @@ } /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1alpha.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @instance - */ - SslConfig.prototype.sslMode = 0; - - /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1alpha.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @instance */ - SslConfig.prototype.caSource = 0; + GetBackupRequest.prototype.name = ""; /** - * Creates a new SslConfig instance using the specified properties. + * Creates a new GetBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig instance + * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest instance */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); }; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encode = function encode(message, writer) { + GetBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); - if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes a GetBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decode = function decode(reader, length) { + GetBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.sslMode = reader.int32(); - break; - } - case 2: { - message.caSource = reader.int32(); + message.name = reader.string(); break; } default: @@ -18114,219 +17923,126 @@ }; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SslConfig message. + * Verifies a GetBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SslConfig.verify = function verify(message) { + GetBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - switch (message.sslMode) { - default: - return "sslMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.caSource != null && message.hasOwnProperty("caSource")) - switch (message.caSource) { - default: - return "caSource: enum value expected"; - case 0: - case 1: - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SslConfig) + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); - switch (object.sslMode) { - default: - if (typeof object.sslMode === "number") { - message.sslMode = object.sslMode; - break; - } - break; - case "SSL_MODE_UNSPECIFIED": - case 0: - message.sslMode = 0; - break; - case "SSL_MODE_ALLOW": - case 1: - message.sslMode = 1; - break; - case "SSL_MODE_REQUIRE": - case 2: - message.sslMode = 2; - break; - case "SSL_MODE_VERIFY_CA": - case 3: - message.sslMode = 3; - break; - } - switch (object.caSource) { - default: - if (typeof object.caSource === "number") { - message.caSource = object.caSource; - break; - } - break; - case "CA_SOURCE_UNSPECIFIED": - case 0: - message.caSource = 0; - break; - case "CA_SOURCE_MANAGED": - case 1: - message.caSource = 1; - break; - } + var message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.SslConfig} message SslConfig + * @param {google.cloud.alloydb.v1.GetBackupRequest} message GetBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslConfig.toObject = function toObject(message, options) { + GetBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; - object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; - } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] : message.sslMode; - if (message.caSource != null && message.hasOwnProperty("caSource")) - object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] : message.caSource; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SslConfig to JSON. + * Converts this GetBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @instance * @returns {Object.} JSON object */ - SslConfig.prototype.toJSON = function toJSON() { + GetBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SslConfig + * Gets the default type url for GetBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @memberof google.cloud.alloydb.v1.GetBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SslConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetBackupRequest"; }; - /** - * SslMode enum. - * @name google.cloud.alloydb.v1alpha.SslConfig.SslMode - * @enum {number} - * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value - * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value - * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value - * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value - */ - SslConfig.SslMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; - values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; - values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; - return values; - })(); - - /** - * CaSource enum. - * @name google.cloud.alloydb.v1alpha.SslConfig.CaSource - * @enum {number} - * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value - * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value - */ - SslConfig.CaSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; - return values; - })(); - - return SslConfig; + return GetBackupRequest; })(); - v1alpha.AutomatedBackupPolicy = (function() { + v1.CreateBackupRequest = (function() { /** - * Properties of an AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1alpha - * @interface IAutomatedBackupPolicy - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention - * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled - * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig - * @property {string|null} [location] AutomatedBackupPolicy location - * @property {Object.|null} [labels] AutomatedBackupPolicy labels + * Properties of a CreateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly */ /** - * Constructs a new AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; + function CreateBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18334,229 +18050,131 @@ } /** - * AutomatedBackupPolicy weeklySchedule. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.weeklySchedule = null; - - /** - * AutomatedBackupPolicy timeBasedRetention. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.timeBasedRetention = null; - - /** - * AutomatedBackupPolicy quantityBasedRetention. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.quantityBasedRetention = null; - - /** - * AutomatedBackupPolicy enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.enabled = null; - - /** - * AutomatedBackupPolicy backupWindow. - * @member {google.protobuf.IDuration|null|undefined} backupWindow - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.backupWindow = null; - - /** - * AutomatedBackupPolicy encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.encryptionConfig = null; - - /** - * AutomatedBackupPolicy location. - * @member {string} location - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance */ - AutomatedBackupPolicy.prototype.location = ""; + CreateBackupRequest.prototype.parent = ""; /** - * AutomatedBackupPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance */ - AutomatedBackupPolicy.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateBackupRequest.prototype.backupId = ""; /** - * AutomatedBackupPolicy schedule. - * @member {"weeklySchedule"|undefined} schedule - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateBackupRequest.prototype.backup = null; /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateBackupRequest.prototype.requestId = ""; /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * CreateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateBackupRequest.prototype.validateOnly = false; /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. + * Creates a new CreateBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy instance + * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest instance */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); }; /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomatedBackupPolicy.encode = function encode(message, writer) { + CreateBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - 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.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * Decodes a CreateBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomatedBackupPolicy.decode = function decode(reader, length) { + CreateBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); - break; - } - case 4: { - message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); - break; - } - case 5: { - message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); - break; - } case 1: { - message.enabled = reader.bool(); + message.parent = reader.string(); break; } - case 3: { - message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + case 2: { + message.backupId = reader.string(); break; } - case 8: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + case 3: { + message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); break; } - case 6: { - message.location = reader.string(); + case 4: { + message.requestId = 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; + case 5: { + message.validateOnly = reader.bool(); break; } default: @@ -18568,975 +18186,741 @@ }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomatedBackupPolicy message. + * Verifies a CreateBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AutomatedBackupPolicy.verify = function verify(message) { + CreateBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - properties.schedule = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); - if (error) - return "weeklySchedule." + error; - } - } - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); - if (error) - return "timeBasedRetention." + error; - } - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - if (properties.retention === 1) - return "retention: multiple values"; - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); - if (error) - return "quantityBasedRetention." + error; - } - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.protobuf.Duration.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); if (error) - return "encryptionConfig." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: 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"; + return "backup." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(); - if (object.weeklySchedule != null) { - if (typeof object.weeklySchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.weeklySchedule: object expected"); - message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); - } - if (object.timeBasedRetention != null) { - if (typeof object.timeBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.timeBasedRetention: object expected"); - message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); - } - if (object.quantityBasedRetention != null) { - if (typeof object.quantityBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.quantityBasedRetention: object expected"); - message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); - } - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.backupWindow: object expected"); - message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.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]]); + var message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {google.cloud.alloydb.v1.CreateBackupRequest} message CreateBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { + CreateBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.backupWindow = null; - object.location = ""; - object.encryptionConfig = null; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - object.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); - if (options.oneofs) - object.schedule = "weeklySchedule"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - object.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); - if (options.oneofs) - object.retention = "timeBasedRetention"; - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - object.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); - if (options.oneofs) - object.retention = "quantityBasedRetention"; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - 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]]; + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this AutomatedBackupPolicy to JSON. + * Converts this CreateBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @instance * @returns {Object.} JSON object */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + CreateBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomatedBackupPolicy + * Gets the default type url for CreateBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.CreateBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateBackupRequest"; }; - AutomatedBackupPolicy.WeeklySchedule = (function() { + return CreateBackupRequest; + })(); - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ + v1.UpdateBackupRequest = (function() { - /** - * Constructs a new WeeklySchedule. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a WeeklySchedule. - * @implements IWeeklySchedule - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - */ - function WeeklySchedule(properties) { - this.startTimes = []; - this.daysOfWeek = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + */ - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance - */ - WeeklySchedule.create = function create(properties) { - return new WeeklySchedule(properties); - }; + /** + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimes != null && message.startTimes.length) - for (var i = 0; i < message.startTimes.length; ++i) - $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * UpdateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.validateOnly = false; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.startTimes && message.startTimes.length)) - message.startTimes = []; - message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.allowMissing = false; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; - /** - * Verifies a WeeklySchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeeklySchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimes != null && message.hasOwnProperty("startTimes")) { - if (!Array.isArray(message.startTimes)) - return "startTimes: array expected"; - for (var i = 0; i < message.startTimes.length; ++i) { - var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); - if (error) - return "startTimes." + error; - } - } - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); - if (object.startTimes) { - if (!Array.isArray(object.startTimes)) - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); - message.startTimes = []; - for (var i = 0; i < object.startTimes.length; ++i) { - if (typeof object.startTimes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); - message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; } + case 2: { + message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeeklySchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startTimes = []; - object.daysOfWeek = []; - } - if (message.startTimes && message.startTimes.length) { - object.startTimes = []; - for (var j = 0; j < message.startTimes.length; ++j) - object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); - } - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - return object; - }; - - /** - * Converts this WeeklySchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - * @returns {Object.} JSON object - */ - WeeklySchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for WeeklySchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule"; - }; + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; - return WeeklySchedule; - })(); + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; - AutomatedBackupPolicy.TimeBasedRetention = (function() { + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new TimeBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a TimeBasedRetention. - * @implements ITimeBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - */ - function TimeBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateBackupRequest"; + }; - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance - */ - TimeBasedRetention.create = function create(properties) { - return new TimeBasedRetention(properties); - }; + return UpdateBackupRequest; + })(); - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) - $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + v1.DeleteBackupRequest = (function() { - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag + */ - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; - /** - * Verifies a TimeBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); - if (error) - return "retentionPeriod." + error; - } - return null; - }; + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - */ - TimeBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); - if (object.retentionPeriod != null) { - if (typeof object.retentionPeriod !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); - message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); - } - return message; - }; + /** + * DeleteBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.validateOnly = false; - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionPeriod = null; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) - object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); - return object; - }; + /** + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; - /** - * Converts this TimeBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @instance - * @returns {Object.} JSON object - */ - TimeBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; - /** - * Gets the default type url for TimeBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention"; - }; + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; - return TimeBasedRetention; - })(); + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - AutomatedBackupPolicy.QuantityBasedRetention = (function() { + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ - - /** - * Constructs a new QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a QuantityBasedRetention. - * @implements IQuantityBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - */ - function QuantityBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance - */ - QuantityBasedRetention.create = function create(properties) { - return new QuantityBasedRetention(properties); - }; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - */ - QuantityBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteBackupRequest) return object; - }; + var message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; - /** - * Converts this QuantityBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; - /** - * Gets the default type url for QuantityBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention"; - }; + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return QuantityBasedRetention; - })(); + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteBackupRequest"; + }; - return AutomatedBackupPolicy; + return DeleteBackupRequest; })(); - v1alpha.ContinuousBackupConfig = (function() { + v1.ListSupportedDatabaseFlagsRequest = (function() { /** - * Properties of a ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupConfig - * @property {boolean|null} [enabled] ContinuousBackupConfig enabled - * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + * Properties of a ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken */ /** - * Constructs a new ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set */ - function ContinuousBackupConfig(properties) { + function ListSupportedDatabaseFlagsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19544,117 +18928,103 @@ } /** - * ContinuousBackupConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.enabled = null; - - /** - * ContinuousBackupConfig recoveryWindowDays. - * @member {number} recoveryWindowDays - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * ListSupportedDatabaseFlagsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @instance */ - ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; /** - * ContinuousBackupConfig encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * ListSupportedDatabaseFlagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @instance */ - ContinuousBackupConfig.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * ListSupportedDatabaseFlagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @instance */ - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; /** - * Creates a new ContinuousBackupConfig instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); }; /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupConfig.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupConfig.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); + message.parent = reader.string(); break; } - case 4: { - message.recoveryWindowDays = reader.int32(); + case 2: { + message.pageSize = reader.int32(); break; } case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } default: @@ -19666,152 +19036,141 @@ }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupConfig message. + * Verifies a ListSupportedDatabaseFlagsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupConfig.verify = function verify(message) { + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - if (!$util.isInteger(message.recoveryWindowDays)) - return "recoveryWindowDays: integer expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.recoveryWindowDays != null) - message.recoveryWindowDays = object.recoveryWindowDays | 0; - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } + var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupConfig.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.encryptionConfig = null; - object.recoveryWindowDays = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - object.recoveryWindowDays = message.recoveryWindowDays; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ContinuousBackupConfig to JSON. + * Converts this ListSupportedDatabaseFlagsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @instance * @returns {Object.} JSON object */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupConfig + * Gets the default type url for ListSupportedDatabaseFlagsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest"; }; - return ContinuousBackupConfig; + return ListSupportedDatabaseFlagsRequest; })(); - v1alpha.ContinuousBackupInfo = (function() { + v1.ListSupportedDatabaseFlagsResponse = (function() { /** - * Properties of a ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupInfo - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo - * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime - * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * Properties of a ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken */ /** - * Constructs a new ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set */ - function ContinuousBackupInfo(properties) { - this.schedule = []; + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19819,114 +19178,92 @@ } /** - * ContinuousBackupInfo encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.encryptionInfo = null; - - /** - * ContinuousBackupInfo enabledTime. - * @member {google.protobuf.ITimestamp|null|undefined} enabledTime - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @instance */ - ContinuousBackupInfo.prototype.enabledTime = null; + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; /** - * ContinuousBackupInfo schedule. - * @member {Array.} schedule - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * ListSupportedDatabaseFlagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @instance */ - ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; /** - * Creates a new ContinuousBackupInfo instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); }; /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupInfo.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) - $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schedule != null && message.schedule.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.schedule.length; ++i) - writer.int32(message.schedule[i]); - writer.ldelim(); - } + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[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 ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupInfo.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1.SupportedDatabaseFlag.decode(reader, reader.uint32())); break; } case 2: { - message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.schedule && message.schedule.length)) - message.schedule = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.schedule.push(reader.int32()); - } else - message.schedule.push(reader.int32()); + message.nextPageToken = reader.string(); break; } default: @@ -19938,212 +19275,155 @@ }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupInfo message. + * Verifies a ListSupportedDatabaseFlagsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupInfo.verify = function verify(message) { + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); - if (error) - return "enabledTime." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - if (!Array.isArray(message.schedule)) - return "schedule: array expected"; - for (var i = 0; i < message.schedule.length; ++i) - switch (message.schedule[i]) { - default: - return "schedule: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (error) + return "supportedDatabaseFlags." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.enabledTime != null) { - if (typeof object.enabledTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.enabledTime: object expected"); - message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); - } - if (object.schedule) { - if (!Array.isArray(object.schedule)) - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.schedule: array expected"); - message.schedule = []; - for (var i = 0; i < object.schedule.length; ++i) - switch (object.schedule[i]) { - default: - if (typeof object.schedule[i] === "number") { - message.schedule[i] = object.schedule[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.schedule[i] = 0; - break; - case "MONDAY": - case 1: - message.schedule[i] = 1; - break; - case "TUESDAY": - case 2: - message.schedule[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.schedule[i] = 3; - break; - case "THURSDAY": - case 4: - message.schedule[i] = 4; - break; - case "FRIDAY": - case 5: - message.schedule[i] = 5; - break; - case "SATURDAY": - case 6: - message.schedule[i] = 6; - break; - case "SUNDAY": - case 7: - message.schedule[i] = 7; - break; - } + var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupInfo.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.schedule = []; - if (options.defaults) { - object.encryptionInfo = null; - object.enabledTime = null; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) - object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); - if (message.schedule && message.schedule.length) { - object.schedule = []; - for (var j = 0; j < message.schedule.length; ++j) - object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + object.supportedDatabaseFlags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ContinuousBackupInfo to JSON. + * Converts this ListSupportedDatabaseFlagsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @instance * @returns {Object.} JSON object */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupInfo + * Gets the default type url for ListSupportedDatabaseFlagsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse"; }; - return ContinuousBackupInfo; + return ListSupportedDatabaseFlagsResponse; })(); - v1alpha.BackupSource = (function() { + v1.OperationMetadata = (function() { /** - * Properties of a BackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName + * Properties of an OperationMetadata. + * @memberof google.cloud.alloydb.v1 + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion */ /** - * Constructs a new BackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BackupSource. - * @implements IBackupSource + * Constructs a new OperationMetadata. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata * @constructor - * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set */ - function BackupSource(properties) { + function OperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20151,226 +19431,396 @@ } /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * OperationMetadata batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.OperationMetadata * @instance */ - BackupSource.prototype.backupUid = ""; + OperationMetadata.prototype.batchCreateInstancesMetadata = null; /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.OperationMetadata * @instance */ - BackupSource.prototype.backupName = ""; + OperationMetadata.prototype.createTime = null; /** - * Creates a new BackupSource instance using the specified properties. + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource instance + * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata instance */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); }; /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encode = function encode(message, writer) { + OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BackupSource message from the specified reader or buffer. + * Decodes an OperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.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.alloydb.v1alpha.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BackupSource.decode = function decode(reader, length) { + 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.alloydb.v1alpha.BackupSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.OperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); break; } case 1: { - message.backupName = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.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 a BackupSource message. + * Verifies an OperationMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BackupSource.verify = function verify(message) { + OperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; return null; }; /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BackupSource) + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.OperationMetadata) return object; - var message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); + var message = new $root.google.cloud.alloydb.v1.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.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.alloydb.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); return message; }; /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static - * @param {google.cloud.alloydb.v1alpha.BackupSource} message BackupSource + * @param {google.cloud.alloydb.v1.OperationMetadata} message OperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupSource.toObject = function toObject(message, options) { + OperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; return object; }; /** - * Converts this BackupSource to JSON. + * Converts this OperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @instance * @returns {Object.} JSON object */ - BackupSource.prototype.toJSON = function toJSON() { + OperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BackupSource + * Gets the default type url for OperationMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @memberof google.cloud.alloydb.v1.OperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.OperationMetadata"; }; - return BackupSource; + return OperationMetadata; })(); - v1alpha.ContinuousBackupSource = (function() { + v1.ListUsersRequest = (function() { /** - * Properties of a ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + * Properties of a ListUsersRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy */ /** - * Constructs a new ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource + * Constructs a new ListUsersRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set */ - function ContinuousBackupSource(properties) { + function ListUsersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20378,89 +19828,131 @@ } /** - * ContinuousBackupSource cluster. - * @member {string} cluster - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @instance */ - ContinuousBackupSource.prototype.cluster = ""; + ListUsersRequest.prototype.parent = ""; /** - * ContinuousBackupSource pointInTime. - * @member {google.protobuf.ITimestamp|null|undefined} pointInTime - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @instance */ - ContinuousBackupSource.prototype.pointInTime = null; + ListUsersRequest.prototype.pageSize = 0; /** - * Creates a new ContinuousBackupSource instance using the specified properties. + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource instance + * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest instance */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); }; /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupSource.encode = function encode(message, writer) { + ListUsersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); - if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * Decodes a ListUsersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupSource.decode = function decode(reader, length) { + ListUsersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cluster = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -20472,162 +19964,159 @@ }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupSource message. + * Verifies a ListUsersRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupSource.verify = function verify(message) { + ListUsersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) - if (!$util.isString(message.cluster)) - return "cluster: string expected"; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); - if (error) - return "pointInTime." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource) + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListUsersRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); - if (object.cluster != null) - message.cluster = String(object.cluster); - if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupSource.pointInTime: object expected"); - message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); - } + var message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} message ContinuousBackupSource + * @param {google.cloud.alloydb.v1.ListUsersRequest} message ListUsersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupSource.toObject = function toObject(message, options) { + ListUsersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.cluster = ""; - object.pointInTime = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = message.cluster; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this ContinuousBackupSource to JSON. + * Converts this ListUsersRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @instance * @returns {Object.} JSON object */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { + ListUsersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupSource + * Gets the default type url for ListUsersRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.ListUsersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersRequest"; }; - return ContinuousBackupSource; + return ListUsersRequest; })(); - v1alpha.Cluster = (function() { + v1.ListUsersResponse = (function() { /** - * Properties of a Cluster. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICluster - * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1alpha.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1alpha.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1alpha.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo - * @property {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * Properties of a ListUsersResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable */ /** - * Constructs a new Cluster. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a Cluster. - * @implements ICluster + * Constructs a new ListUsersResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20635,465 +20124,622 @@ } /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1alpha.Cluster + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1.ListUsersResponse * @instance */ - Cluster.prototype.backupSource = null; + ListUsersResponse.prototype.users = $util.emptyArray; /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1alpha.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1alpha.Cluster + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListUsersResponse * @instance */ - Cluster.prototype.migrationSource = null; + ListUsersResponse.prototype.nextPageToken = ""; /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Cluster + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListUsersResponse * @instance */ - Cluster.prototype.name = ""; + ListUsersResponse.prototype.unreachable = $util.emptyArray; /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse instance */ - Cluster.prototype.displayName = ""; + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.uid = ""; + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.createTime = null; + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.updateTime = null; + ListUsersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.deleteTime = null; + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.prototype.labels = $util.emptyObject; + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; /** - * Cluster state. - * @member {google.cloud.alloydb.v1alpha.Cluster.State} state - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse */ - Cluster.prototype.state = 0; + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListUsersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Cluster.prototype.clusterType = 0; + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1alpha.Cluster + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListUsersResponse * @instance + * @returns {Object.} JSON object */ - Cluster.prototype.databaseVersion = 0; + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Cluster.prototype.network = ""; + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1.GetUserRequest = (function() { /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Properties of a GetUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name */ - Cluster.prototype.etag = ""; /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Constructs a new GetUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set */ - Cluster.prototype.annotations = $util.emptyObject; + function GetUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Cluster + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetUserRequest * @instance */ - Cluster.prototype.reconciling = false; + GetUserRequest.prototype.name = ""; /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1alpha.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest instance */ - Cluster.prototype.initialUser = null; + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.automatedBackupPolicy = null; + GetUserRequest.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; + }; /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.sslConfig = null; + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.encryptionConfig = null; + GetUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetUserRequest(); + 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; + }; /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.encryptionInfo = null; + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Cluster continuousBackupConfig. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null|undefined} continuousBackupConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.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 GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.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 GetUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetUserRequest * @instance + * @returns {Object.} JSON object */ - Cluster.prototype.continuousBackupConfig = null; + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Cluster continuousBackupInfo. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null|undefined} continuousBackupInfo - * @memberof google.cloud.alloydb.v1alpha.Cluster + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @instance */ - Cluster.prototype.continuousBackupInfo = null; + CreateUserRequest.prototype.parent = ""; /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @instance */ - Cluster.prototype.secondaryConfig = null; + CreateUserRequest.prototype.userId = ""; /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @instance */ - Cluster.prototype.primaryConfig = null; + CreateUserRequest.prototype.user = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.Cluster + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @instance */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateUserRequest.prototype.validateOnly = false; /** - * Creates a new Cluster instance using the specified properties. + * Creates a new CreateUserRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster instance + * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest instance */ - Cluster.create = function create(properties) { - return new Cluster(properties); + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); }; /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encode = function encode(message, writer) { + CreateUserRequest.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1alpha.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1alpha.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); - if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Cluster message from the specified reader or buffer. + * Decodes a CreateUserRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decode = function decode(reader, length) { + CreateUserRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.decode(reader, reader.uint32()); - break; - } case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.displayName = reader.string(); + message.userId = reader.string(); break; } case 3: { - message.uid = reader.string(); + message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); break; } case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - 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; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 27: { - message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.decode(reader, reader.uint32()); - break; - } - case 28: { - message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + message.validateOnly = reader.bool(); break; } default: @@ -21105,1026 +20751,777 @@ }; /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decodeDelimited = function decodeDelimited(reader) { + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Cluster message. + * Verifies a CreateUserRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.verify = function verify(message) { + CreateUserRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } - } - 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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1alpha.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify(message.continuousBackupConfig); - if (error) - return "continuousBackupConfig." + error; - } - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify(message.continuousBackupInfo); - if (error) - return "continuousBackupInfo." + error; - } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; - } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.user); if (error) - return "primaryConfig." + error; + return "user." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster) + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateUserRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.fromObject(object.migrationSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.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.alloydb.v1alpha.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.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]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.continuousBackupConfig != null) { - if (typeof object.continuousBackupConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupConfig: object expected"); - message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); - } - if (object.continuousBackupInfo != null) { - if (typeof object.continuousBackupInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupInfo: object expected"); - message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + var message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1alpha.Cluster} message Cluster + * @param {google.cloud.alloydb.v1.CreateUserRequest} message CreateUserRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Cluster.toObject = function toObject(message, options) { + CreateUserRequest.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.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.continuousBackupConfig = null; - object.continuousBackupInfo = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - 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]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) - object.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) - object.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this Cluster to JSON. + * Converts this CreateUserRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @instance * @returns {Object.} JSON object */ - Cluster.prototype.toJSON = function toJSON() { + CreateUserRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Cluster + * Gets the default type url for CreateUserRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster + * @memberof google.cloud.alloydb.v1.CreateUserRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateUserRequest"; }; - Cluster.SecondaryConfig = (function() { + return CreateUserRequest; + })(); - /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName - */ + v1.UpdateUserRequest = (function() { - /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set - */ - function SecondaryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an UpdateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing + */ - /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @instance - */ - SecondaryConfig.prototype.primaryClusterName = ""; + /** + * Constructs a new UpdateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(properties) { + if (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 SecondaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig instance - */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); - }; + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); - return writer; - }; + /** + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * UpdateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.requestId = ""; - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.primaryClusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a SecondaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecondaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; - return null; - }; + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); - return message; - }; + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} message SecondaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecondaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateUserRequest) return object; - }; + var message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; - /** - * Converts this SecondaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @instance - * @returns {Object.} JSON object - */ - SecondaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; - /** - * Gets the default type url for SecondaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig"; - }; + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SecondaryConfig; - })(); + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateUserRequest"; + }; - Cluster.PrimaryConfig = (function() { + return UpdateUserRequest; + })(); - /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames - */ + v1.DeleteUserRequest = (function() { - /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set - */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a DeleteUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly + */ - /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @instance - */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + /** + * Constructs a new DeleteUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(properties) { + if (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 PrimaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig instance - */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); - }; + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); - return writer; - }; + /** + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.requestId = ""; - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.validateOnly = false; - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrimaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrimaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } - return null; - }; + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); - } - return message; - }; + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} message PrimaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrimaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteUserRequest) return object; - }; - - /** - * Converts this PrimaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @instance - * @returns {Object.} JSON object - */ - PrimaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrimaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig"; - }; + var message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; - return PrimaryConfig; - })(); + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value - * @property {number} PROMOTING=9 PROMOTING value + * Converts this DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + * @returns {Object.} JSON object */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ClusterType enum. - * @name google.cloud.alloydb.v1alpha.Cluster.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteUserRequest"; + }; - return Cluster; + return DeleteUserRequest; })(); - v1alpha.Instance = (function() { + return v1; + })(); + + alloydb.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1alpha = {}; + + /** + * InstanceView enum. + * @name google.cloud.alloydb.v1alpha.InstanceView + * @enum {number} + * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value + * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value + * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value + */ + v1alpha.InstanceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; + values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1alpha.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1alpha.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1alpha.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + */ + v1alpha.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + return values; + })(); + + v1alpha.UserPassword = (function() { /** - * Properties of an Instance. + * Properties of a UserPassword. * @memberof google.cloud.alloydb.v1alpha - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1alpha.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1alpha.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password */ /** - * Constructs a new Instance. + * Constructs a new UserPassword. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an Instance. - * @implements IInstance + * @classdesc Represents a UserPassword. + * @implements IUserPassword * @constructor - * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set */ - function Instance(properties) { - this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; - this.annotations = {}; + function UserPassword(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22132,418 +21529,331 @@ } /** - * Instance name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Instance + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1alpha.UserPassword * @instance */ - Instance.prototype.name = ""; + UserPassword.prototype.user = ""; /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Instance + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1alpha.UserPassword * @instance */ - Instance.prototype.displayName = ""; + UserPassword.prototype.password = ""; /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword instance */ - Instance.prototype.uid = ""; + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Instance.prototype.createTime = null; + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Instance.prototype.updateTime = null; + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Instance.prototype.deleteTime = null; + UserPassword.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Instance.prototype.labels = $util.emptyObject; + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Instance state. - * @member {google.cloud.alloydb.v1alpha.Instance.State} state - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Instance.prototype.state = 0; + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword */ - Instance.prototype.instanceType = 0; + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UserPassword) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + return message; + }; /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Instance.prototype.machineConfig = null; + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1alpha.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1alpha.Instance + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UserPassword * @instance + * @returns {Object.} JSON object */ - Instance.prototype.availabilityType = 0; - - /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.gceZone = ""; - - /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.databaseFlags = $util.emptyObject; + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1alpha.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Instance.prototype.writableNode = null; + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UserPassword"; + }; - /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.nodes = $util.emptyArray; + return UserPassword; + })(); - /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.queryInsightsConfig = null; + v1alpha.MigrationSource = (function() { /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Properties of a MigrationSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IMigrationSource + * @property {string|null} [hostPort] MigrationSource hostPort + * @property {string|null} [referenceId] MigrationSource referenceId + * @property {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType */ - Instance.prototype.readPoolConfig = null; /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance + * Constructs a new MigrationSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set */ - Instance.prototype.ipAddress = ""; + function MigrationSource(properties) { + if (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 reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Instance + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @instance */ - Instance.prototype.reconciling = false; + MigrationSource.prototype.hostPort = ""; /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Instance + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @instance */ - Instance.prototype.etag = ""; + MigrationSource.prototype.referenceId = ""; /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Instance + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @instance */ - Instance.prototype.annotations = $util.emptyObject; + MigrationSource.prototype.sourceType = 0; /** - * Creates a new Instance instance using the specified properties. + * Creates a new MigrationSource instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static - * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance instance + * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource instance */ - Instance.create = function create(properties) { - return new Instance(properties); + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); }; /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static - * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encode = function encode(message, writer) { + MigrationSource.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); - 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); return writer; }; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static - * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a MigrationSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource * @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) { + MigrationSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.hostPort = reader.string(); break; } case 2: { - message.displayName = reader.string(); + message.referenceId = reader.string(); break; } case 3: { - message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - message.instanceType = reader.int32(); - break; - } - case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.availabilityType = reader.int32(); - break; - } - case 12: { - message.gceZone = reader.string(); - break; - } - case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - 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.databaseFlags[key] = value; - break; - } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32()); - break; - } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.ipAddress = reader.string(); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - message.etag = reader.string(); - break; - } - case 18: { - 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; + message.sourceType = reader.int32(); break; } default: @@ -22555,1551 +21865,987 @@ }; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource * @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) { + MigrationSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Instance message. + * Verifies a MigrationSource message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @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) { + MigrationSource.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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (!$util.isString(message.hostPort)) + return "hostPort: string expected"; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { default: - return "availabilityType: enum value expected"; + return "sourceType: enum value expected"; case 0: case 1: - case 2: break; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); - if (error) - return "queryInsightsConfig." + error; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify(message.readPoolConfig); - if (error) - return "readPoolConfig." + error; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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 Instance message from a plain object. Also converts values to their respective internal types. + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance) + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MigrationSource) return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "MAINTENANCE": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { + var message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); + if (object.hostPort != null) + message.hostPort = String(object.hostPort); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + switch (object.sourceType) { default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; break; } break; - case "AVAILABILITY_TYPE_UNSPECIFIED": + case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": case 0: - message.availabilityType = 0; + message.sourceType = 0; break; - case "ZONAL": + case "DMS": case 1: - message.availabilityType = 1; - break; - case "REGIONAL": - case 2: - message.availabilityType = 2; + message.sourceType = 1; break; } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.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 Instance message. Also converts values to other types if specified. + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static - * @param {google.cloud.alloydb.v1alpha.Instance} message Instance + * @param {google.cloud.alloydb.v1alpha.MigrationSource} message MigrationSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Instance.toObject = function toObject(message, options) { + MigrationSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; - if (options.objects || options.defaults) { - object.labels = {}; - object.databaseFlags = {}; - object.annotations = {}; - } if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; - object.reconciling = false; - object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - 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]]; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.nodes[j], options); + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + object.hostPort = message.hostPort; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; return object; }; /** - * Converts this Instance to JSON. + * Converts this MigrationSource to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @instance * @returns {Object.} JSON object */ - Instance.prototype.toJSON = function toJSON() { + MigrationSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Instance + * Gets the default type url for MigrationSource * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance + * @memberof google.cloud.alloydb.v1alpha.MigrationSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MigrationSource"; }; - Instance.MachineConfig = (function() { + /** + * MigrationSourceType enum. + * @name google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType + * @enum {number} + * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DMS=1 DMS value + */ + MigrationSource.MigrationSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DMS"] = 1; + return values; + })(); - /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount - */ + return MigrationSource; + })(); - /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set - */ - function MachineConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1alpha.EncryptionConfig = (function() { - /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.cpuCount = 0; + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ - /** - * Creates a new MachineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig instance - */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); - }; + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - return writer; - }; + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a MachineConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MachineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - return null; - }; + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - return message; - }; + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.MachineConfig} message MachineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MachineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cpuCount = 0; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionConfig) return object; - }; - - /** - * Converts this MachineConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @instance - * @returns {Object.} JSON object - */ - MachineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; - /** - * Gets the default type url for MachineConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.MachineConfig"; - }; + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; - return MachineConfig; - })(); + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Instance.Node = (function() { + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionConfig"; + }; - /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state - */ + return EncryptionConfig; + })(); - /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1alpha.EncryptionInfo = (function() { - /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; + /** + * Properties of an EncryptionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @interface IEncryptionInfo + * @property {google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + */ - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.id = ""; + /** + * Constructs a new EncryptionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.ip = ""; + /** + * EncryptionInfo encryptionType. + * @member {google.cloud.alloydb.v1alpha.EncryptionInfo.Type} encryptionType + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.state = ""; + /** + * EncryptionInfo kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); - return writer; - }; + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + return writer; + }; - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - return null; - }; + } + return message; + }; - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.Node) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); - return message; - }; + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - return object; - }; + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.Node"; - }; - - return Node; - })(); + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.alloydb.v1alpha.EncryptionInfo.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; - Instance.QueryInsightsInstanceConfig = (function() { + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyVersions = []; + if (options.defaults) + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; - /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute - */ + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - */ - function QueryInsightsInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionInfo"; + }; - /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + /** + * Type enum. + * @name google.cloud.alloydb.v1alpha.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + return EncryptionInfo; + })(); - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + v1alpha.SslConfig = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Properties of a SslConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISslConfig + * @property {google.cloud.alloydb.v1alpha.SslConfig.SslMode|null} [sslMode] SslConfig sslMode + * @property {google.cloud.alloydb.v1alpha.SslConfig.CaSource|null} [caSource] SslConfig caSource + */ - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new SslConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * SslConfig sslMode. + * @member {google.cloud.alloydb.v1alpha.SslConfig.SslMode} sslMode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + */ + SslConfig.prototype.sslMode = 0; - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * SslConfig caSource. + * @member {google.cloud.alloydb.v1alpha.SslConfig.CaSource} caSource + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + */ + SslConfig.prototype.caSource = 0; - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance - */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); - }; + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); - return writer; - }; + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); + if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + return writer; + }; - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sslMode = reader.int32(); + break; + } + case 2: { + message.caSource = reader.int32(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a QueryInsightsInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInsightsInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + switch (message.sslMode) { + default: + return "sslMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; + if (message.caSource != null && message.hasOwnProperty("caSource")) + switch (message.caSource) { + default: + return "caSource: enum value expected"; + case 0: + case 1: + break; } - return null; - }; + return null; + }; - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; - return message; - }; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SslConfig) return object; - }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); + switch (object.sslMode) { + default: + if (typeof object.sslMode === "number") { + message.sslMode = object.sslMode; + break; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig"; - }; - - return QueryInsightsInstanceConfig; - })(); - - Instance.ReadPoolConfig = (function() { - - /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount - */ - - /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set - */ - function ReadPoolConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + break; + case "SSL_MODE_UNSPECIFIED": + case 0: + message.sslMode = 0; + break; + case "SSL_MODE_ALLOW": + case 1: + message.sslMode = 1; + break; + case "SSL_MODE_REQUIRE": + case 2: + message.sslMode = 2; + break; + case "SSL_MODE_VERIFY_CA": + case 3: + message.sslMode = 3; + break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; } - - /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @instance - */ - ReadPoolConfig.prototype.nodeCount = 0; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig instance - */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); - }; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - return writer; - }; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } + switch (object.caSource) { + default: + if (typeof object.caSource === "number") { + message.caSource = object.caSource; + break; } - return message; - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - return null; - }; - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; - - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + break; + case "CA_SOURCE_UNSPECIFIED": + case 0: + message.caSource = 0; + break; + case "CA_SOURCE_MANAGED": + case 1: + message.caSource = 1; + break; + } + return message; + }; - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig"; - }; + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; + object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + } + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] : message.sslMode; + if (message.caSource != null && message.hasOwnProperty("caSource")) + object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] : message.caSource; + return object; + }; - return ReadPoolConfig; - })(); + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SslConfig"; + }; /** - * InstanceType enum. - * @name google.cloud.alloydb.v1alpha.Instance.InstanceType + * SslMode enum. + * @name google.cloud.alloydb.v1alpha.SslConfig.SslMode * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value + * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value + * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value + * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value + * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value */ - Instance.InstanceType = (function() { + SslConfig.SslMode = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; + values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; + values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; + values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; return values; })(); /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1alpha.Instance.AvailabilityType + * CaSource enum. + * @name google.cloud.alloydb.v1alpha.SslConfig.CaSource * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value + * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value + * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value */ - Instance.AvailabilityType = (function() { + SslConfig.CaSource = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; + values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; return values; })(); - return Instance; + return SslConfig; })(); - v1alpha.ConnectionInfo = (function() { + v1alpha.AutomatedBackupPolicy = (function() { /** - * Properties of a ConnectionInfo. + * Properties of an AutomatedBackupPolicy. * @memberof google.cloud.alloydb.v1alpha - * @interface IConnectionInfo - * @property {string|null} [name] ConnectionInfo name - * @property {string|null} [ipAddress] ConnectionInfo ipAddress - * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain - * @property {string|null} [instanceUid] ConnectionInfo instanceUid + * @interface IAutomatedBackupPolicy + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention + * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled + * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig + * @property {string|null} [location] AutomatedBackupPolicy location + * @property {Object.|null} [labels] AutomatedBackupPolicy labels */ /** - * Constructs a new ConnectionInfo. + * Constructs a new AutomatedBackupPolicy. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ConnectionInfo. - * @implements IConnectionInfo + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy * @constructor - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set */ - function ConnectionInfo(properties) { - this.pemCertificateChain = []; + function AutomatedBackupPolicy(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24107,120 +22853,229 @@ } /** - * ConnectionInfo name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * AutomatedBackupPolicy weeklySchedule. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @instance */ - ConnectionInfo.prototype.name = ""; + AutomatedBackupPolicy.prototype.weeklySchedule = null; /** - * ConnectionInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * AutomatedBackupPolicy timeBasedRetention. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @instance */ - ConnectionInfo.prototype.ipAddress = ""; + AutomatedBackupPolicy.prototype.timeBasedRetention = null; /** - * ConnectionInfo pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * AutomatedBackupPolicy quantityBasedRetention. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @instance */ - ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + AutomatedBackupPolicy.prototype.quantityBasedRetention = null; /** - * ConnectionInfo instanceUid. - * @member {string} instanceUid - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * AutomatedBackupPolicy enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @instance */ - ConnectionInfo.prototype.instanceUid = ""; + AutomatedBackupPolicy.prototype.enabled = null; /** - * Creates a new ConnectionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo instance + * AutomatedBackupPolicy backupWindow. + * @member {google.protobuf.IDuration|null|undefined} backupWindow + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance */ - ConnectionInfo.create = function create(properties) { - return new ConnectionInfo(properties); - }; + AutomatedBackupPolicy.prototype.backupWindow = null; /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * AutomatedBackupPolicy encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance */ - ConnectionInfo.encode = function encode(message, writer) { + AutomatedBackupPolicy.prototype.encryptionConfig = null; + + /** + * AutomatedBackupPolicy location. + * @member {string} location + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.location = ""; + + /** + * AutomatedBackupPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedBackupPolicy schedule. + * @member {"weeklySchedule"|undefined} schedule + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy retention. + * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { + get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.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.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); - if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConnectionInfo message from the specified reader or buffer. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConnectionInfo.decode = function decode(reader, length) { + AutomatedBackupPolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 2: { + message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); break; } - case 2: { - message.ipAddress = reader.string(); + case 4: { + message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); + break; + } + case 5: { + message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); + break; + } + case 1: { + message.enabled = reader.bool(); break; } case 3: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); + message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } - case 4: { - message.instanceUid = reader.string(); + case 8: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = 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; } default: @@ -24232,548 +23087,1093 @@ }; /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConnectionInfo message. + * Verifies an AutomatedBackupPolicy message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConnectionInfo.verify = function verify(message) { + AutomatedBackupPolicy.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.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; + var properties = {}; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); + if (error) + return "timeBasedRetention." + error; + } + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + if (properties.retention === 1) + return "retention: multiple values"; + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); + if (error) + return "quantityBasedRetention." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.protobuf.Duration.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: string expected"; return null; }; /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ConnectionInfo) + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1alpha.ConnectionInfo.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(); + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); + } + if (object.timeBasedRetention != null) { + if (typeof object.timeBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.timeBasedRetention: object expected"); + message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); + } + if (object.quantityBasedRetention != null) { + if (typeof object.quantityBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.quantityBasedRetention: object expected"); + message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.backupWindow: object expected"); + message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.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.instanceUid != null) - message.instanceUid = String(object.instanceUid); return message; }; /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static - * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} message ConnectionInfo + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} message AutomatedBackupPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionInfo.toObject = function toObject(message, options) { + AutomatedBackupPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.name = ""; - object.ipAddress = ""; - object.instanceUid = ""; + object.backupWindow = null; + object.location = ""; + object.encryptionConfig = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - object.instanceUid = message.instanceUid; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); + if (options.oneofs) + object.schedule = "weeklySchedule"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + object.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); + if (options.oneofs) + object.retention = "timeBasedRetention"; + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + object.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); + if (options.oneofs) + object.retention = "quantityBasedRetention"; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); return object; }; /** - * Converts this ConnectionInfo to JSON. + * Converts this AutomatedBackupPolicy to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @instance * @returns {Object.} JSON object */ - ConnectionInfo.prototype.toJSON = function toJSON() { + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ConnectionInfo + * Gets the default type url for AutomatedBackupPolicy * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ConnectionInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy"; }; - return ConnectionInfo; - })(); - - v1alpha.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1alpha.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1alpha.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime - */ + AutomatedBackupPolicy.WeeklySchedule = (function() { - /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set - */ - function Backup(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]]; - } + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface IWeeklySchedule + * @property {Array.|null} [startTimes] WeeklySchedule startTimes + * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek + */ - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.name = ""; + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + this.startTimes = []; + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.displayName = ""; + /** + * WeeklySchedule startTimes. + * @member {Array.} startTimes + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.startTimes = $util.emptyArray; - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.uid = ""; + /** + * WeeklySchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.createTime = null; + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.deleteTime = null; + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimes != null && message.startTimes.length) + for (var i = 0; i < message.startTimes.length; ++i) + $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Backup state. - * @member {google.cloud.alloydb.v1alpha.Backup.State} state - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.state = 0; + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.startTimes && message.startTimes.length)) + message.startTimes = []; + message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Backup type. - * @member {google.cloud.alloydb.v1alpha.Backup.Type} type - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.type = 0; + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.description = ""; + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimes != null && message.hasOwnProperty("startTimes")) { + if (!Array.isArray(message.startTimes)) + return "startTimes: array expected"; + for (var i = 0; i < message.startTimes.length; ++i) { + var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); + if (error) + return "startTimes." + error; + } + } + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; - /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.clusterUid = ""; + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); + if (object.startTimes) { + if (!Array.isArray(object.startTimes)) + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); + message.startTimes = []; + for (var i = 0; i < object.startTimes.length; ++i) { + if (typeof object.startTimes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); + message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + } + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + return message; + }; - /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.clusterName = ""; + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTimes = []; + object.daysOfWeek = []; + } + if (message.startTimes && message.startTimes.length) { + object.startTimes = []; + for (var j = 0; j < message.startTimes.length; ++j) + object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + return object; + }; - /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.reconciling = false; + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.encryptionConfig = null; + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule"; + }; - /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; + return WeeklySchedule; + })(); - /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.etag = ""; + AutomatedBackupPolicy.TimeBasedRetention = (function() { - /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.annotations = $util.emptyObject; + /** + * Properties of a TimeBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface ITimeBasedRetention + * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod + */ - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Constructs a new TimeBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a TimeBasedRetention. + * @implements ITimeBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + */ + function TimeBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.expiryTime = null; + /** + * TimeBasedRetention retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @instance + */ + TimeBasedRetention.prototype.retentionPeriod = null; - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance + */ + TimeBasedRetention.create = function create(properties) { + return new TimeBasedRetention(properties); + }; - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + */ + TimeBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this TimeBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @instance + * @returns {Object.} JSON object + */ + TimeBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention"; + }; + + return TimeBasedRetention; + })(); + + AutomatedBackupPolicy.QuantityBasedRetention = (function() { + + /** + * Properties of a QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface IQuantityBasedRetention + * @property {number|null} [count] QuantityBasedRetention count + */ + + /** + * Constructs a new QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a QuantityBasedRetention. + * @implements IQuantityBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + */ + function QuantityBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedRetention count. + * @member {number} count + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + */ + QuantityBasedRetention.prototype.count = 0; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance + */ + QuantityBasedRetention.create = function create(properties) { + return new QuantityBasedRetention(properties); + }; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + return writer; + }; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + */ + QuantityBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention"; + }; + + return QuantityBasedRetention; + })(); + + return AutomatedBackupPolicy; + })(); + + v1alpha.ContinuousBackupConfig = (function() { + + /** + * Properties of a ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + */ + + /** + * Constructs a new ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set + */ + function ContinuousBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.enabled = null; + + /** + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + + /** + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig instance + */ + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); + }; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decode = function decode(reader, length) { + ContinuousBackupConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); 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.uid = reader.string(); + message.enabled = reader.bool(); 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 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - 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; + message.recoveryWindowDays = reader.int32(); break; } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); - break; - } - case 10: { - message.clusterName = reader.string(); - break; - } - case 11: { - message.reconciling = reader.bool(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 16: { - 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; - } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); break; } default: @@ -24785,449 +24185,153 @@ }; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decodeDelimited = function decodeDelimited(reader) { + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Backup message. + * Verifies a ContinuousBackupConfig message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Backup.verify = function verify(message) { + ContinuousBackupConfig.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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); if (error) return "encryptionConfig." + error; } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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"; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } return null; }; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup) + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) return object; - var message = new $root.google.cloud.alloydb.v1alpha.Backup(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.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.alloydb.v1alpha.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ON_DEMAND": - case 1: - message.type = 1; - break; - case "AUTOMATED": - case 2: - message.type = 2; - break; - case "CONTINUOUS": - case 3: - message.type = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; if (object.encryptionConfig != null) { if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionConfig: object expected"); + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encryptionConfig: object expected"); message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.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]]); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } return message; }; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @static - * @param {google.cloud.alloydb.v1alpha.Backup} message Backup + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} message ContinuousBackupConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Backup.toObject = function toObject(message, options) { + ContinuousBackupConfig.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.uid = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; - object.reconciling = false; object.encryptionConfig = null; - object.encryptionInfo = null; - object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; + object.recoveryWindowDays = 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - 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]]; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; return object; }; /** - * Converts this Backup to JSON. + * Converts this ContinuousBackupConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @instance * @returns {Object.} JSON object */ - Backup.prototype.toJSON = function toJSON() { + ContinuousBackupConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Backup + * Gets the default type url for ContinuousBackupConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Backup + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupConfig"; }; - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.alloydb.v1alpha.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value - */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - - return Backup; + return ContinuousBackupConfig; })(); - v1alpha.SupportedDatabaseFlag = (function() { + v1alpha.ContinuousBackupInfo = (function() { /** - * Properties of a SupportedDatabaseFlag. + * Properties of a ContinuousBackupInfo. * @memberof google.cloud.alloydb.v1alpha - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime */ /** - * Constructs a new SupportedDatabaseFlag. + * Constructs a new ContinuousBackupInfo. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo * @constructor - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; + function ContinuousBackupInfo(properties) { + this.schedule = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25235,198 +24339,128 @@ } /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @instance */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; + ContinuousBackupInfo.prototype.encryptionInfo = null; /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @instance */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; + ContinuousBackupInfo.prototype.enabledTime = null; /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @instance */ - SupportedDatabaseFlag.prototype.name = ""; + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @instance */ - SupportedDatabaseFlag.prototype.flagName = ""; + ContinuousBackupInfo.prototype.earliestRestorableTime = null; /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo instance */ - SupportedDatabaseFlag.prototype.valueType = 0; - - /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - - /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - - /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag instance - */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); }; /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SupportedDatabaseFlag.encode = function encode(message, writer) { + ContinuousBackupInfo.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.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); writer.ldelim(); } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SupportedDatabaseFlag.decode = function decode(reader, length) { + ContinuousBackupInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } case 1: { - message.name = reader.string(); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); break; } case 2: { - message.flagName = reader.string(); + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.valueType = reader.int32(); - break; - } - case 4: { - message.acceptsMultipleValues = reader.bool(); - break; - } - case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; + if (!(message.schedule && message.schedule.length)) + message.schedule = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); + message.schedule.push(reader.int32()); } else - message.supportedDbVersions.push(reader.int32()); + message.schedule.push(reader.int32()); break; } - case 6: { - message.requiresDbRestart = reader.bool(); + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -25438,1613 +24472,2462 @@ }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SupportedDatabaseFlag message. + * Verifies a ContinuousBackupInfo message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SupportedDatabaseFlag.verify = function verify(message) { + ContinuousBackupInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { default: - return "supportedDbVersions: enum value[] expected"; + return "schedule: enum value[] expected"; case 0: case 1: case 2: + case 3: + case 4: + case 5: + case 6: + case 7: break; } } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } return null; }; /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; break; } - case "DATABASE_VERSION_UNSPECIFIED": + case "DAY_OF_WEEK_UNSPECIFIED": case 0: - message.supportedDbVersions[i] = 0; + message.schedule[i] = 0; break; - case "POSTGRES_13": + case "MONDAY": case 1: - message.supportedDbVersions[i] = 1; + message.schedule[i] = 1; break; - case "POSTGRES_14": + case "TUESDAY": case 2: - message.supportedDbVersions[i] = 2; + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; break; } } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } return message; }; /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} message ContinuousBackupInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { + ContinuousBackupInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.supportedDbVersions = []; + object.schedule = []; if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); return object; }; /** - * Converts this SupportedDatabaseFlag to JSON. + * Converts this ContinuousBackupInfo to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @instance * @returns {Object.} JSON object */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + ContinuousBackupInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SupportedDatabaseFlag + * Gets the default type url for ContinuousBackupInfo * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupInfo"; }; - SupportedDatabaseFlag.StringRestrictions = (function() { + return ContinuousBackupInfo; + })(); - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ + v1alpha.BackupSource = (function() { - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; + /** + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set + */ + function BackupSource(properties) { + if (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 StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new BackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource instance + */ + BackupSource.create = function create(properties) { + return new BackupSource(properties); + }; - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + return writer; + }; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.backupUid = reader.string(); + break; + } + case 1: { + message.backupName = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a StringRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } - return null; - }; + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } - return message; - }; + /** + * Verifies a BackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BackupSource) return object; - }; + var message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; - /** - * Converts this StringRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @instance - * @returns {Object.} JSON object - */ - StringRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; + } + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; - /** - * Gets the default type url for StringRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions"; - }; + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return StringRestrictions; - })(); + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BackupSource"; + }; - SupportedDatabaseFlag.IntegerRestrictions = (function() { + return BackupSource; + })(); - /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue - */ + v1alpha.ContinuousBackupSource = (function() { - /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions - * @constructor - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - */ - function IntegerRestrictions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance - */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); - }; + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); - if (error) - return "maxValue." + error; - } - return null; - }; + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); - } - return message; - }; + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); + if (error) + return "pointInTime." + error; + } + return null; + }; - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minValue = null; - object.maxValue = null; - } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + */ + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource) return object; - }; - - /** - * Converts this IntegerRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - * @returns {Object.} JSON object - */ - IntegerRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + } + return message; + }; - /** - * Gets the default type url for IntegerRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions"; - }; + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} message ContinuousBackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.pointInTime = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + return object; + }; - return IntegerRestrictions; - })(); + /** + * Converts this ContinuousBackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ValueType enum. - * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value + * Gets the default type url for ContinuousBackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupSource"; + }; - return SupportedDatabaseFlag; + return ContinuousBackupSource; })(); - v1alpha.AlloyDBAdmin = (function() { + v1alpha.Cluster = (function() { /** - * Constructs a new AlloyDBAdmin service. + * Properties of a Cluster. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an AlloyDBAdmin - * @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 + * @interface ICluster + * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1alpha.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1alpha.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1alpha.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function Cluster(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]]; + } /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} [response] ListClustersResponse + * Cluster backupSource. + * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.backupSource = null; /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1alpha.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1alpha.ListClustersRequest, $root.google.cloud.alloydb.v1alpha.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); + Cluster.prototype.migrationSource = null; /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.name = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Cluster} [response] Cluster + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.displayName = ""; /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1alpha.GetClusterRequest, $root.google.cloud.alloydb.v1alpha.Cluster, request, callback); - }, "name", { value: "GetCluster" }); + Cluster.prototype.uid = ""; /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.createTime = null; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.updateTime = null; /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1alpha.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); + Cluster.prototype.deleteTime = null; /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.labels = $util.emptyObject; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Cluster state. + * @member {google.cloud.alloydb.v1alpha.Cluster.State} state + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.state = 0; /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster clusterType. + * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); + Cluster.prototype.clusterType = 0; /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.databaseVersion = 0; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.networkConfig = null; /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); + Cluster.prototype.network = ""; /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.etag = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef PromoteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.annotations = $util.emptyObject; /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); + Cluster.prototype.reconciling = false; /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster initialUser. + * @member {google.cloud.alloydb.v1alpha.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Cluster.prototype.initialUser = null; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance */ + Cluster.prototype.automatedBackupPolicy = null; /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} [response] ListInstancesResponse */ + Cluster.prototype.sslConfig = null; /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1alpha.ListInstancesRequest, $root.google.cloud.alloydb.v1alpha.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); + Cluster.prototype.encryptionConfig = null; /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Instance} [response] Instance */ + Cluster.prototype.encryptionInfo = null; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1alpha.GetInstanceRequest, $root.google.cloud.alloydb.v1alpha.Instance, request, callback); - }, "name", { value: "GetInstance" }); + Cluster.prototype.continuousBackupConfig = null; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + Cluster.prototype.continuousBackupInfo = null; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); + Cluster.prototype.secondaryConfig = null; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateSecondaryInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + Cluster.prototype.primaryConfig = null; - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { - return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryInstance" }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster instance */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); + Cluster.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1alpha.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1alpha.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + return writer; + }; /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + Cluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 24: { + message.clusterType = reader.int32(); + break; + } + case 9: { + message.databaseVersion = reader.int32(); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + 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; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.decode(reader, reader.uint32()); + break; + } + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } + 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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1alpha.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.fromObject(object.migrationSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.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.alloydb.v1alpha.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "EMPTY": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.fromObject(object.networkConfig); + } + if (object.network != null) + message.network = String(object.network); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.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]]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } + return message; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + Cluster.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.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; + object.etag = ""; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; + object.networkConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + 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]]; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.toObject(message.networkConfig, options); + return object; + }; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster * @instance - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster"; + }; - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); + Cluster.NetworkConfig = (function() { - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} [response] ListBackupsResponse - */ + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1alpha.ListBackupsRequest, $root.google.cloud.alloydb.v1alpha.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Backup} [response] Backup - */ + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1alpha.GetBackupRequest, $root.google.cloud.alloydb.v1alpha.Backup, request, callback); - }, "name", { value: "GetBackup" }); + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1alpha.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.NetworkConfig"; + }; - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); + return NetworkConfig; + })(); - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + Cluster.SecondaryConfig = (function() { - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse - */ + /** + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + */ - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); + /** + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set + */ + function SecondaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @instance + */ + SecondaryConfig.prototype.primaryClusterName = ""; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GenerateClientCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse - */ + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig instance + */ + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); + }; - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { - return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, request, callback); - }, "name", { value: "GenerateClientCertificate" }); + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + return writer; + }; - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetConnectionInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} [response] ConnectionInfo - */ + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryClusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { - return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1alpha.ConnectionInfo, request, callback); - }, "name", { value: "GetConnectionInfo" }); + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + /** + * Verifies a SecondaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecondaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; + return null; + }; + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + */ + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); + return message; + }; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} message SecondaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecondaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; + return object; + }; + + /** + * Converts this SecondaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @instance + * @returns {Object.} JSON object + */ + SecondaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecondaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig"; + }; + + return SecondaryConfig; + })(); + + Cluster.PrimaryConfig = (function() { + + /** + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + */ + + /** + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set + */ + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @instance + */ + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig instance + */ + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); + }; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + */ + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} message PrimaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; + } + return object; + }; + + /** + * Converts this PrimaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @instance + * @returns {Object.} JSON object + */ + PrimaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig"; + }; + + return PrimaryConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1alpha.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); - return AlloyDBAdmin; + return Cluster; })(); - v1alpha.ListClustersRequest = (function() { + v1alpha.Instance = (function() { /** - * Properties of a ListClustersRequest. + * Properties of an Instance. * @memberof google.cloud.alloydb.v1alpha - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1alpha.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1alpha.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy */ /** - * Constructs a new ListClustersRequest. + * Constructs a new Instance. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest + * @classdesc Represents an Instance. + * @implements IInstance * @constructor - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set */ - function ListClustersRequest(properties) { + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + this.annotations = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27052,405 +26935,432 @@ } /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersRequest.prototype.parent = ""; + Instance.prototype.name = ""; /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersRequest.prototype.pageSize = 0; + Instance.prototype.displayName = ""; /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersRequest.prototype.pageToken = ""; + Instance.prototype.uid = ""; /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersRequest.prototype.filter = ""; + Instance.prototype.createTime = null; /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersRequest.prototype.orderBy = ""; + Instance.prototype.updateTime = null; /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest instance + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; + Instance.prototype.deleteTime = null; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + Instance.prototype.labels = $util.emptyObject; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Instance state. + * @member {google.cloud.alloydb.v1alpha.Instance.State} state + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Instance.prototype.state = 0; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Instance instanceType. + * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Instance.prototype.instanceType = 0; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Instance machineConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Instance.prototype.machineConfig = null; /** - * Verifies a ListClustersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Instance availabilityType. + * @member {google.cloud.alloydb.v1alpha.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + Instance.prototype.availabilityType = 0; /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; + Instance.prototype.gceZone = ""; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + Instance.prototype.databaseFlags = $util.emptyObject; /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * Instance writableNode. + * @member {google.cloud.alloydb.v1alpha.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance - * @returns {Object.} JSON object */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Instance.prototype.writableNode = null; /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersRequest"; - }; + Instance.prototype.nodes = $util.emptyArray; - return ListClustersRequest; - })(); + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; - v1alpha.ListClustersResponse = (function() { + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; /** - * Properties of a ListClustersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable + * Instance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ + Instance.prototype.ipAddress = ""; /** - * Constructs a new ListClustersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Instance.prototype.reconciling = false; /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersResponse.prototype.clusters = $util.emptyArray; + Instance.prototype.etag = ""; /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersResponse.prototype.nextPageToken = ""; + Instance.prototype.annotations = $util.emptyObject; /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * Instance updatePolicy. + * @member {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null|undefined} updatePolicy + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; + Instance.prototype.updatePolicy = null; /** - * Creates a new ListClustersResponse instance using the specified properties. + * Creates a new Instance instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse instance + * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance instance */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); + Instance.create = function create(properties) { + return new Instance(properties); }; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encode = function encode(message, writer) { + Instance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + 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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) + $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + Instance.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes an Instance message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decode = function decode(reader, length) { + 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.alloydb.v1alpha.ListClustersResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32())); + message.name = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.displayName = reader.string(); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.instanceType = reader.int32(); + break; + } + case 10: { + message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.availabilityType = reader.int32(); + break; + } + case 12: { + message.gceZone = reader.string(); + break; + } + case 13: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { + 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; + } + case 22: { + message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.decode(reader, reader.uint32()); break; } default: @@ -27462,1110 +27372,1928 @@ }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes an Instance message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + Instance.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersResponse message. + * Verifies an Instance message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListClustersResponse.verify = function verify(message) { + Instance.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.clusters[i]); - if (error) - return "clusters." + error; - } + 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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.writableNode); + if (error) + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify(message.updatePolicy); + if (error) + return "updatePolicy." + error; } return null; }; /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Instance message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersResponse) + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.clusters[i]); + var message = new $root.google.cloud.alloydb.v1alpha.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.fromObject(object.machineConfig); + } + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.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]]); + } + if (object.updatePolicy != null) { + if (typeof object.updatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updatePolicy: object expected"); + message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.fromObject(object.updatePolicy); } return message; }; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * Creates a plain object from an Instance message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static - * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} message ListClustersResponse + * @param {google.cloud.alloydb.v1alpha.Instance} message Instance * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersResponse.toObject = function toObject(message, options) { + Instance.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; + if (options.arrays || options.defaults) + object.nodes = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.databaseFlags = {}; + object.annotations = {}; } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.clusters[j], options); + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; + object.reconciling = false; + object.etag = ""; + object.writableNode = null; + object.queryInsightsConfig = null; + object.updatePolicy = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + 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]]; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.nodes[j], options); } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) + object.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.toObject(message.updatePolicy, options); return object; }; /** - * Converts this ListClustersResponse to JSON. + * Converts this Instance to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @instance * @returns {Object.} JSON object */ - ListClustersResponse.prototype.toJSON = function toJSON() { + Instance.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for Instance * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @memberof google.cloud.alloydb.v1alpha.Instance * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance"; }; - return ListClustersResponse; - })(); - - v1alpha.GetClusterRequest = (function() { + Instance.MachineConfig = (function() { - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - */ + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + */ - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.name = ""; + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.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 MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + return writer; + }; - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.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; - }; + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + return null; + }; - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.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; - }; + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + return message; + }; - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cpuCount = 0; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + return object; + }; - /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetClusterRequest"; - }; + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return GetClusterRequest; - })(); + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.MachineConfig"; + }; - v1alpha.CreateSecondaryClusterRequest = (function() { + return MachineConfig; + })(); - /** - * Properties of a CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateSecondaryClusterRequest - * @property {string|null} [parent] CreateSecondaryClusterRequest parent - * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster - * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly - */ + Instance.Node = (function() { - /** - * Constructs a new CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set - */ - function CreateSecondaryClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Node. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state + */ - /** - * CreateSecondaryClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.parent = ""; + /** + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CreateSecondaryClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.clusterId = ""; + /** + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.zoneId = ""; - /** - * CreateSecondaryClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.cluster = null; + /** + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.id = ""; - /** - * CreateSecondaryClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.requestId = ""; + /** + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.ip = ""; - /** - * CreateSecondaryClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.state = ""; - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance - */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); - }; + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + return writer; + }; - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a CreateSecondaryClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.Node) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; + } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; + }; - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.Node"; + }; - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest"; - }; + return Node; + })(); - return CreateSecondaryClusterRequest; - })(); + Instance.QueryInsightsInstanceConfig = (function() { - v1alpha.CreateClusterRequest = (function() { + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ - /** - * Properties of a CreateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly - */ + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new CreateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set - */ - function CreateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.clusterId = ""; + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.requestId = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.validateOnly = false; + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest instance - */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); - }; + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; + return message; + }; - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateClusterRequest} message CreateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + return null; + }; - /** - * Converts this CreateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; - /** - * Gets the default type url for CreateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateClusterRequest"; - }; + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; - return CreateClusterRequest; - })(); + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1alpha.UpdateClusterRequest = (function() { + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig"; + }; - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing - */ + return QueryInsightsInstanceConfig; + })(); - /** - * Constructs a new UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set - */ - function UpdateClusterRequest(properties) { - if (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.ReadPoolConfig = (function() { - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; + /** + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + */ - /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.cluster = null; + /** + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set + */ + function ReadPoolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.requestId = ""; + /** + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @instance + */ + ReadPoolConfig.prototype.nodeCount = 0; - /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.validateOnly = false; + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig instance + */ + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); + }; - /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.allowMissing = false; + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + return writer; + }; - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest instance - */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + return null; + }; + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + */ + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + return object; + }; + + /** + * Converts this ReadPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ReadPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig"; + }; + + return ReadPoolConfig; + })(); + + Instance.UpdatePolicy = (function() { + + /** + * Properties of an UpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IUpdatePolicy + * @property {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode + */ + + /** + * Constructs a new UpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents an UpdatePolicy. + * @implements IUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set + */ + function UpdatePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePolicy mode. + * @member {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode} mode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @instance + */ + UpdatePolicy.prototype.mode = 0; + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy instance + */ + UpdatePolicy.create = function create(properties) { + return new UpdatePolicy(properties); + }; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + */ + UpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DEFAULT": + case 1: + message.mode = 1; + break; + case "FORCE_APPLY": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} message UpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this UpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + UpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.UpdatePolicy"; + }; + + /** + * Mode enum. + * @name google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} FORCE_APPLY=2 FORCE_APPLY value + */ + UpdatePolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "FORCE_APPLY"] = 2; + return values; + })(); + + return UpdatePolicy; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * InstanceType enum. + * @name google.cloud.alloydb.v1alpha.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); + + /** + * AvailabilityType enum. + * @name google.cloud.alloydb.v1alpha.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + return Instance; + })(); + + v1alpha.ConnectionInfo = (function() { + + /** + * Properties of a ConnectionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @interface IConnectionInfo + * @property {string|null} [name] ConnectionInfo name + * @property {string|null} [ipAddress] ConnectionInfo ipAddress + * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain + * @property {string|null} [instanceUid] ConnectionInfo instanceUid + */ + + /** + * Constructs a new ConnectionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ConnectionInfo. + * @implements IConnectionInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set + */ + function ConnectionInfo(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionInfo name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.name = ""; + + /** + * ConnectionInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.ipAddress = ""; + + /** + * ConnectionInfo pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + + /** + * ConnectionInfo instanceUid. + * @member {string} instanceUid + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.instanceUid = ""; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo instance + */ + ConnectionInfo.create = function create(properties) { + return new ConnectionInfo(properties); + }; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClusterRequest.encode = function encode(message, writer) { + ConnectionInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); + if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); return writer; }; /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * Decodes a ConnectionInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateClusterRequest.decode = function decode(reader, length) { + ConnectionInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + message.ipAddress = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); break; } case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); + message.instanceUid = reader.string(); break; } default: @@ -28577,169 +29305,180 @@ }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateClusterRequest message. + * Verifies a ConnectionInfo message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateClusterRequest.verify = function verify(message) { + ConnectionInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + if (!$util.isString(message.instanceUid)) + return "instanceUid: string expected"; return null; }; /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest) + ConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ConnectionInfo) return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + var message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1alpha.ConnectionInfo.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + if (object.instanceUid != null) + message.instanceUid = String(object.instanceUid); return message; }; /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static - * @param {google.cloud.alloydb.v1alpha.UpdateClusterRequest} message UpdateClusterRequest + * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} message ConnectionInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateClusterRequest.toObject = function toObject(message, options) { + ConnectionInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; if (options.defaults) { - object.updateMask = null; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; + object.name = ""; + object.ipAddress = ""; + object.instanceUid = ""; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + object.instanceUid = message.instanceUid; return object; }; /** - * Converts this UpdateClusterRequest to JSON. + * Converts this ConnectionInfo to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @instance * @returns {Object.} JSON object */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { + ConnectionInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateClusterRequest + * Gets the default type url for ConnectionInfo * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ConnectionInfo"; }; - return UpdateClusterRequest; + return ConnectionInfo; })(); - v1alpha.DeleteClusterRequest = (function() { + v1alpha.Backup = (function() { /** - * Properties of a DeleteClusterRequest. + * Properties of a Backup. * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1alpha.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1alpha.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime */ /** - * Constructs a new DeleteClusterRequest. + * Constructs a new Backup. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest + * @classdesc Represents a Backup. + * @implements IBackup * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set */ - function DeleteClusterRequest(properties) { + function Backup(properties) { + this.labels = {}; + this.annotations = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28747,110 +29486,252 @@ } /** - * DeleteClusterRequest name. + * Backup name. * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance */ - DeleteClusterRequest.prototype.name = ""; + Backup.prototype.name = ""; /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * Backup displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance */ - DeleteClusterRequest.prototype.requestId = ""; + Backup.prototype.displayName = ""; /** - * DeleteClusterRequest etag. + * Backup uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.uid = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.deleteTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup state. + * @member {google.cloud.alloydb.v1alpha.Backup.State} state + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup type. + * @member {google.cloud.alloydb.v1alpha.Backup.Type} type + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.type = 0; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.clusterUid = ""; + + /** + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.clusterName = ""; + + /** + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.reconciling = false; + + /** + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.encryptionConfig = null; + + /** + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup etag. * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance */ - DeleteClusterRequest.prototype.etag = ""; + Backup.prototype.etag = ""; /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance */ - DeleteClusterRequest.prototype.validateOnly = false; + Backup.prototype.annotations = $util.emptyObject; /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance */ - DeleteClusterRequest.prototype.force = false; + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.expiryTime = null; + + /** + * Creates a new Backup instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest instance + * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup instance */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); + Backup.create = function create(properties) { + return new Backup(properties); }; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteClusterRequest.encode = function encode(message, writer) { + Backup.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + Backup.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes a Backup message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteClusterRequest.decode = function decode(reader, length) { + Backup.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -28859,19 +29740,113 @@ break; } case 2: { - message.requestId = reader.string(); + message.displayName = reader.string(); break; } case 3: { - message.etag = reader.string(); + message.uid = reader.string(); break; } case 4: { - message.validateOnly = reader.bool(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 5: { - message.force = reader.bool(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); + break; + } + case 10: { + message.clusterName = reader.string(); + break; + } + case 11: { + message.reconciling = reader.bool(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 16: { + 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; + } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -28883,158 +29858,449 @@ }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a Backup message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + Backup.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteClusterRequest message. + * Verifies a Backup message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteClusterRequest.verify = function verify(message) { + Backup.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + return null; + }; + /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Backup message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest) + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup) return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.Backup(); if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.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.alloydb.v1alpha.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "AUTOMATED": + case 2: + message.type = 2; + break; + case "CONTINUOUS": + case 3: + message.type = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); + } if (object.etag != null) message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.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]]); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } return message; }; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a Backup message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static - * @param {google.cloud.alloydb.v1alpha.DeleteClusterRequest} message DeleteClusterRequest + * @param {google.cloud.alloydb.v1alpha.Backup} message Backup * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteClusterRequest.toObject = function toObject(message, options) { + Backup.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.requestId = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; + object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; object.etag = ""; - object.validateOnly = false; - object.force = false; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + 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]]; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); return object; }; /** - * Converts this DeleteClusterRequest to JSON. + * Converts this Backup to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @instance * @returns {Object.} JSON object */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { + Backup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteClusterRequest + * Gets the default type url for Backup * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.Backup * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup"; }; - return DeleteClusterRequest; + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.alloydb.v1alpha.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); + + return Backup; })(); - v1alpha.PromoteClusterRequest = (function() { + v1alpha.SupportedDatabaseFlag = (function() { /** - * Properties of a PromoteClusterRequest. + * Properties of a SupportedDatabaseFlag. * @memberof google.cloud.alloydb.v1alpha - * @interface IPromoteClusterRequest - * @property {string|null} [name] PromoteClusterRequest name - * @property {string|null} [requestId] PromoteClusterRequest requestId - * @property {string|null} [etag] PromoteClusterRequest etag - * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart */ /** - * Constructs a new PromoteClusterRequest. + * Constructs a new SupportedDatabaseFlag. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag * @constructor - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set */ - function PromoteClusterRequest(properties) { + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29042,117 +30308,198 @@ } /** - * PromoteClusterRequest name. + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.stringRestrictions = null; + + /** + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.integerRestrictions = null; + + /** + * SupportedDatabaseFlag name. * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @instance */ - PromoteClusterRequest.prototype.name = ""; + SupportedDatabaseFlag.prototype.name = ""; /** - * PromoteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @instance */ - PromoteClusterRequest.prototype.requestId = ""; + SupportedDatabaseFlag.prototype.flagName = ""; /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @instance */ - PromoteClusterRequest.prototype.etag = ""; + SupportedDatabaseFlag.prototype.valueType = 0; /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @instance */ - PromoteClusterRequest.prototype.validateOnly = false; + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; /** - * Creates a new PromoteClusterRequest instance using the specified properties. + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest instance + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag instance */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); }; /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PromoteClusterRequest.encode = function encode(message, writer) { + SupportedDatabaseFlag.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteClusterRequest.decode = function decode(reader, length) { + SupportedDatabaseFlag.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } case 1: { message.name = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.flagName = reader.string(); break; } case 3: { - message.etag = reader.string(); + message.valueType = reader.int32(); break; } case 4: { - message.validateOnly = reader.bool(); + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); break; } default: @@ -29164,327 +30511,874 @@ }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PromoteClusterRequest message. + * Verifies a SupportedDatabaseFlag message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PromoteClusterRequest.verify = function verify(message) { + SupportedDatabaseFlag.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); + if (error) + return "stringRestrictions." + error; + } + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; return null; }; /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest) + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) return object; - var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; + } + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); return message; }; /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1alpha.PromoteClusterRequest} message PromoteClusterRequest + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} message SupportedDatabaseFlag * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PromoteClusterRequest.toObject = function toObject(message, options) { + SupportedDatabaseFlag.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; if (options.defaults) { object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; + } return object; }; /** - * Converts this PromoteClusterRequest to JSON. + * Converts this SupportedDatabaseFlag to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @instance * @returns {Object.} JSON object */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PromoteClusterRequest + * Gets the default type url for SupportedDatabaseFlag * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag"; }; - return PromoteClusterRequest; - })(); - - v1alpha.RestoreClusterRequest = (function() { - - /** - * Properties of a RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly - */ + SupportedDatabaseFlag.StringRestrictions = (function() { - /** - * Constructs a new RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set - */ - function RestoreClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues + */ - /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.backupSource = null; + /** + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions + * @constructor + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + */ + function StringRestrictions(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * RestoreClusterRequest continuousBackupSource. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null|undefined} continuousBackupSource - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.continuousBackupSource = null; + /** + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @instance + */ + StringRestrictions.prototype.allowedValues = $util.emptyArray; - /** - * RestoreClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.parent = ""; + /** + * Creates a new StringRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance + */ + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); + }; - /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.clusterId = ""; + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + return writer; + }; - /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.cluster = null; + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * RestoreClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.requestId = ""; + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.validateOnly = false; + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Verifies a StringRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + return null; + }; - /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + */ + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + return object; + }; + + /** + * Converts this StringRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @instance + * @returns {Object.} JSON object + */ + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions"; + }; + + return StringRestrictions; + })(); + + SupportedDatabaseFlag.IntegerRestrictions = (function() { + + /** + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + */ + + /** + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions + * @constructor + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + */ + function IntegerRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.minValue = null; + + /** + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + */ + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); + }; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + return null; + }; + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); + + /** + * ValueType enum. + * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value + */ + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + return SupportedDatabaseFlag; + })(); + + v1alpha.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1alpha.User.UserType|null} [userType] User userType + */ + + /** + * Constructs a new User. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set + */ + function User(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.User * @instance */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + User.prototype.name = ""; /** - * Creates a new RestoreClusterRequest instance using the specified properties. + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.password = ""; + + /** + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.databaseRoles = $util.emptyArray; + + /** + * User userType. + * @member {google.cloud.alloydb.v1alpha.User.UserType} userType + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.userType = 0; + + /** + * Creates a new User instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest instance + * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.User} User instance */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); + User.create = function create(properties) { + return new User(properties); }; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreClusterRequest.encode = function encode(message, writer) { + User.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); return writer; }; /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + User.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1alpha.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreClusterRequest.decode = function decode(reader, length) { + User.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.User(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); - break; - } - case 8: { - message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.decode(reader, reader.uint32()); - break; - } case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.clusterId = reader.string(); + message.password = reader.string(); break; } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + case 4: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); break; } case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); + message.userType = reader.int32(); break; } default: @@ -29496,1450 +31390,1373 @@ }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1alpha.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + User.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestoreClusterRequest message. + * Verifies a User message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestoreClusterRequest.verify = function verify(message) { + User.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify(message.continuousBackupSource); - if (error) - return "continuousBackupSource." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; return null; }; /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1alpha.User} User */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest) + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.User) return object; - var message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); - } - if (object.continuousBackupSource != null) { - if (typeof object.continuousBackupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.continuousBackupSource: object expected"); - message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.fromObject(object.continuousBackupSource); + var message = new $root.google.cloud.alloydb.v1alpha.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1alpha.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a User message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static - * @param {google.cloud.alloydb.v1alpha.RestoreClusterRequest} message RestoreClusterRequest + * @param {google.cloud.alloydb.v1alpha.User} message User * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreClusterRequest.toObject = function toObject(message, options) { + User.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - object.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.toObject(message.continuousBackupSource, options); - if (options.oneofs) - object.source = "continuousBackupSource"; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] : message.userType; return object; }; /** - * Converts this RestoreClusterRequest to JSON. + * Converts this User to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @instance * @returns {Object.} JSON object */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { + User.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestoreClusterRequest + * Gets the default type url for User * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1alpha.User * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.User"; }; - return RestoreClusterRequest; + /** + * UserType enum. + * @name google.cloud.alloydb.v1alpha.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value + */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; })(); - v1alpha.ListInstancesRequest = (function() { + v1alpha.AlloyDBAdmin = (function() { /** - * Properties of a ListInstancesRequest. + * Constructs a new AlloyDBAdmin service. * @memberof google.cloud.alloydb.v1alpha - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @classdesc Represents an AlloyDBAdmin + * @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 AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} [response] ListClustersResponse */ - ListInstancesRequest.prototype.parent = ""; /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.prototype.pageSize = 0; + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1alpha.ListClustersRequest, $root.google.cloud.alloydb.v1alpha.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.prototype.pageToken = ""; /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Cluster} [response] Cluster */ - ListInstancesRequest.prototype.filter = ""; /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.prototype.orderBy = ""; + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1alpha.GetClusterRequest, $root.google.cloud.alloydb.v1alpha.Cluster, request, callback); + }, "name", { value: "GetCluster" }); /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest instance + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1alpha.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1alpha.ListInstancesResponse = (function() { /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesResponse.prototype.nextPageToken = ""; /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse instance + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} [response] ListInstancesResponse */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1alpha.ListInstancesRequest, $root.google.cloud.alloydb.v1alpha.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Instance} [response] Instance */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1alpha.GetInstanceRequest, $root.google.cloud.alloydb.v1alpha.Instance, request, callback); + }, "name", { value: "GetInstance" }); /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1alpha.GetInstanceRequest = (function() { /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1alpha.InstanceView|null} [view] GetInstanceRequest view + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - 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]]; - } + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetInstanceRequest.prototype.name = ""; /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1alpha.InstanceView} view - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - GetInstanceRequest.prototype.view = 0; /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest instance + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - 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.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - 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.alloydb.v1alpha.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - 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"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "INSTANCE_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "INSTANCE_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "INSTANCE_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] : message.view; - return object; - }; /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @instance - * @returns {Object.} JSON object + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - 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.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1alpha.CreateInstanceRequest = (function() { + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - 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.alloydb.v1alpha.CreateInstanceRequest + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CreateInstanceRequest.prototype.parent = ""; + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateInstanceRequest.prototype.instanceId = ""; /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CreateInstanceRequest.prototype.instance = null; /** - * CreateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CreateInstanceRequest.prototype.requestId = ""; + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1alpha.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateInstanceRequest.prototype.validateOnly = false; /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - 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.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} [response] ListBackupsResponse */ - 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.alloydb.v1alpha.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.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - 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.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1alpha.ListBackupsRequest, $root.google.cloud.alloydb.v1alpha.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Backup} [response] Backup */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - 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.alloydb.v1alpha.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1alpha.GetBackupRequest, $root.google.cloud.alloydb.v1alpha.Backup, request, callback); + }, "name", { value: "GetBackup" }); /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1alpha.CreateSecondaryInstanceRequest = (function() { /** - * Properties of a CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateSecondaryInstanceRequest - * @property {string|null} [parent] CreateSecondaryInstanceRequest parent - * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateSecondaryInstanceRequest instance - * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1alpha.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); /** - * Constructs a new CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function CreateSecondaryInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * CreateSecondaryInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CreateSecondaryInstanceRequest.prototype.parent = ""; /** - * CreateSecondaryInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CreateSecondaryInstanceRequest.prototype.instanceId = ""; + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); /** - * CreateSecondaryInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateSecondaryInstanceRequest.prototype.instance = null; /** - * CreateSecondaryInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CreateSecondaryInstanceRequest.prototype.requestId = ""; + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); /** - * CreateSecondaryInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse + */ + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GenerateClientCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse + */ + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { + return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, request, callback); + }, "name", { value: "GenerateClientCertificate" }); + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetConnectionInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} [response] ConnectionInfo + */ + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { + return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1alpha.ConnectionInfo, request, callback); + }, "name", { value: "GetConnectionInfo" }); + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} [response] ListUsersResponse + */ + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1alpha.ListUsersRequest, $root.google.cloud.alloydb.v1alpha.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1alpha.GetUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1alpha.CreateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1alpha.UpdateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1alpha.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBAdmin; + })(); + + v1alpha.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest instance */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); }; /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + ListClustersRequest.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.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * Decodes a ListClustersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length) { + ListClustersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -30948,19 +32765,19 @@ break; } case 2: { - message.instanceId = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } case 4: { - message.requestId = reader.string(); + message.filter = reader.string(); break; } case 5: { - message.validateOnly = reader.bool(); + message.orderBy = reader.string(); break; } default: @@ -30972,161 +32789,159 @@ }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecondaryInstanceRequest message. + * Verifies a ListClustersRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSecondaryInstanceRequest.verify = function verify(message) { + ListClustersRequest.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.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); 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.alloydb.v1alpha.CreateSecondaryInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {google.cloud.alloydb.v1alpha.ListClustersRequest} message ListClustersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + ListClustersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } 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.alloydb.v1alpha.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this CreateSecondaryInstanceRequest to JSON. + * Converts this ListClustersRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @instance * @returns {Object.} JSON object */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + ListClustersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecondaryInstanceRequest + * Gets the default type url for ListClustersRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersRequest"; }; - return CreateSecondaryInstanceRequest; + return ListClustersRequest; })(); - v1alpha.CreateInstanceRequests = (function() { + v1alpha.ListClustersResponse = (function() { /** - * Properties of a CreateInstanceRequests. + * Properties of a ListClustersResponse. * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable */ /** - * Constructs a new CreateInstanceRequests. + * Constructs a new ListClustersResponse. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31134,78 +32949,109 @@ } /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @instance */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + ListClustersResponse.prototype.clusters = $util.emptyArray; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests instance + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse instance */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); }; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encode = function encode(message, writer) { + ListClustersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a ListClustersResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decode = function decode(reader, length) { + ListClustersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.decode(reader, reader.uint32())); + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -31217,141 +33063,170 @@ }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequests message. + * Verifies a ListClustersResponse message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateInstanceRequests.verify = function verify(message) { + ListClustersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.clusters[i]); if (error) - return "createInstanceRequests." + error; + return "clusters." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests) + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersResponse) return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + var message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.clusters[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static - * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} message CreateInstanceRequests + * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} message ListClustersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequests.toObject = function toObject(message, options) { + ListClustersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } return object; }; /** - * Converts this CreateInstanceRequests to JSON. + * Converts this ListClustersResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @instance * @returns {Object.} JSON object */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { + ListClustersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for ListClustersResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequests"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersResponse"; }; - return CreateInstanceRequests; + return ListClustersResponse; })(); - v1alpha.BatchCreateInstancesRequest = (function() { + v1alpha.GetClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesRequest. + * Properties of a GetClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1alpha.ClusterView|null} [view] GetClusterRequest view */ /** - * Constructs a new BatchCreateInstancesRequest. + * Constructs a new GetClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesRequest(properties) { + function GetClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31359,103 +33234,89 @@ } /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.parent = ""; - - /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @instance */ - BatchCreateInstancesRequest.prototype.requests = null; + GetClusterRequest.prototype.name = ""; /** - * BatchCreateInstancesRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1alpha.ClusterView} view + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @instance */ - BatchCreateInstancesRequest.prototype.requestId = ""; + GetClusterRequest.prototype.view = 0; /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * Creates a new GetClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest instance */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { + GetClusterRequest.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.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes a GetClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decode = function decode(reader, length) { + GetClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); + message.view = reader.int32(); break; } default: @@ -31467,145 +33328,159 @@ }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies a GetClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesRequest.verify = function verify(message) { + GetClusterRequest.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.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.fromObject(object.requests); + var message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CLUSTER_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CLUSTER_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": + case 2: + message.view = 2; + break; } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {google.cloud.alloydb.v1alpha.GetClusterRequest} message GetClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { + GetClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.requests = null; - object.requestId = ""; + object.name = ""; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.toObject(message.requests, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] : message.view; return object; }; /** - * Converts this BatchCreateInstancesRequest to JSON. + * Converts this GetClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + GetClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for GetClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetClusterRequest"; }; - return BatchCreateInstancesRequest; + return GetClusterRequest; })(); - v1alpha.BatchCreateInstancesResponse = (function() { + v1alpha.CreateSecondaryClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesResponse. + * Properties of a CreateSecondaryClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly */ /** - * Constructs a new BatchCreateInstancesResponse. + * Constructs a new CreateSecondaryClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; + function CreateSecondaryClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31613,78 +33488,131 @@ } /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @instance */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + CreateSecondaryClusterRequest.prototype.parent = ""; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.clusterId = ""; + + /** + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.cluster = null; + + /** + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.requestId = ""; + + /** + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { + CreateSecondaryClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); return writer; }; /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decode = function decode(reader, length) { + CreateSecondaryClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); break; } default: @@ -31696,142 +33624,164 @@ }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies a CreateSecondaryClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesResponse.verify = function verify(message) { + CreateSecondaryClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); - } + var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this BatchCreateInstancesResponse to JSON. + * Converts this CreateSecondaryClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for CreateSecondaryClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest"; }; - return BatchCreateInstancesResponse; + return CreateSecondaryClusterRequest; })(); - v1alpha.BatchCreateInstancesMetadata = (function() { + v1alpha.CreateClusterRequest = (function() { /** - * Properties of a BatchCreateInstancesMetadata. + * Properties of a CreateClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly */ /** - * Constructs a new BatchCreateInstancesMetadata. + * Constructs a new CreateClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; + function CreateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31839,114 +33789,131 @@ } /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + CreateClusterRequest.prototype.parent = ""; /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + CreateClusterRequest.prototype.clusterId = ""; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest instance */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { + CreateClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a CreateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decode = function decode(reader, length) { + CreateClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); + message.parent = reader.string(); break; } case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); break; } default: @@ -31958,165 +33925,164 @@ }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a CreateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesMetadata.verify = function verify(message) { + CreateClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } + var message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {google.cloud.alloydb.v1alpha.CreateClusterRequest} message CreateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + CreateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this BatchCreateInstancesMetadata to JSON. + * Converts this CreateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + CreateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for CreateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateClusterRequest"; }; - return BatchCreateInstancesMetadata; + return CreateClusterRequest; })(); - v1alpha.BatchCreateInstanceStatus = (function() { + v1alpha.UpdateClusterRequest = (function() { /** - * Properties of a BatchCreateInstanceStatus. + * Properties of an UpdateClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing */ /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new UpdateClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set */ - function BatchCreateInstanceStatus(properties) { + function UpdateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32124,117 +34090,131 @@ } /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.state = 0; + UpdateClusterRequest.prototype.updateMask = null; /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; + UpdateClusterRequest.prototype.cluster = null; /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance */ - BatchCreateInstanceStatus.prototype.error = null; + UpdateClusterRequest.prototype.requestId = ""; /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @instance */ - BatchCreateInstanceStatus.prototype.type = 0; + UpdateClusterRequest.prototype.validateOnly = false; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest instance */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); }; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { + UpdateClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - 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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes an UpdateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decode = function decode(reader, length) { + UpdateClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.errorMsg = reader.string(); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); break; } case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + message.validateOnly = reader.bool(); break; } - case 3: { - message.type = reader.int32(); + case 5: { + message.allowMissing = reader.bool(); break; } default: @@ -32246,253 +34226,169 @@ }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies an UpdateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstanceStatus.verify = function verify(message) { + UpdateClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "error." + error; + return "updateMask." + error; } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); - 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 "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; - } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); + var message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {google.cloud.alloydb.v1alpha.UpdateClusterRequest} message UpdateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { + UpdateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this BatchCreateInstanceStatus to JSON. + * Converts this UpdateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + UpdateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for UpdateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateClusterRequest"; }; - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; + return UpdateClusterRequest; })(); - v1alpha.UpdateInstanceRequest = (function() { + v1alpha.DeleteClusterRequest = (function() { /** - * Properties of an UpdateInstanceRequest. + * Properties of a DeleteClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force */ /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new DeleteClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set */ - function UpdateInstanceRequest(properties) { + function DeleteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32500,123 +34396,123 @@ } /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance */ - UpdateInstanceRequest.prototype.updateMask = null; + DeleteClusterRequest.prototype.name = ""; /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance */ - UpdateInstanceRequest.prototype.instance = null; + DeleteClusterRequest.prototype.requestId = ""; /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance */ - UpdateInstanceRequest.prototype.requestId = ""; + DeleteClusterRequest.prototype.etag = ""; /** - * UpdateInstanceRequest validateOnly. + * DeleteClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance */ - UpdateInstanceRequest.prototype.validateOnly = false; + DeleteClusterRequest.prototype.validateOnly = false; /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance */ - UpdateInstanceRequest.prototype.allowMissing = false; + DeleteClusterRequest.prototype.force = false; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new DeleteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest instance + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest instance */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); }; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encode = function encode(message, writer) { + DeleteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); return writer; }; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decode = function decode(reader, length) { + DeleteClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - message.requestId = reader.string(); + message.etag = reader.string(); break; } case 4: { @@ -32624,7 +34520,7 @@ break; } case 5: { - message.allowMissing = reader.bool(); + message.force = reader.bool(); break; } default: @@ -32636,168 +34532,158 @@ }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a DeleteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateInstanceRequest.verify = function verify(message) { + DeleteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } + var message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {google.cloud.alloydb.v1alpha.DeleteClusterRequest} message DeleteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + DeleteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.instance = null; + object.name = ""; object.requestId = ""; + object.etag = ""; object.validateOnly = false; - object.allowMissing = false; + object.force = false; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this DeleteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { + DeleteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for DeleteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteClusterRequest"; }; - return UpdateInstanceRequest; + return DeleteClusterRequest; })(); - v1alpha.DeleteInstanceRequest = (function() { + v1alpha.PromoteClusterRequest = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a PromoteClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new PromoteClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function PromoteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32805,59 +34691,59 @@ } /** - * DeleteInstanceRequest name. + * PromoteClusterRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @instance */ - DeleteInstanceRequest.prototype.name = ""; + PromoteClusterRequest.prototype.name = ""; /** - * DeleteInstanceRequest requestId. + * PromoteClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @instance */ - DeleteInstanceRequest.prototype.requestId = ""; + PromoteClusterRequest.prototype.requestId = ""; /** - * DeleteInstanceRequest etag. + * PromoteClusterRequest etag. * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @instance */ - DeleteInstanceRequest.prototype.etag = ""; + PromoteClusterRequest.prototype.etag = ""; /** - * DeleteInstanceRequest validateOnly. + * PromoteClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @instance */ - DeleteInstanceRequest.prototype.validateOnly = false; + PromoteClusterRequest.prototype.validateOnly = false; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new PromoteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + PromoteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -32872,33 +34758,33 @@ }; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a PromoteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest * @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) { + PromoteClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -32927,30 +34813,30 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest * @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) { + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a PromoteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @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) { + PromoteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -32969,17 +34855,17 @@ }; /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); if (object.name != null) message.name = String(object.name); if (object.requestId != null) @@ -32992,15 +34878,15 @@ }; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.alloydb.v1alpha.PromoteClusterRequest} message PromoteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + PromoteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -33022,54 +34908,58 @@ }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this PromoteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + PromoteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for PromoteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterRequest"; }; - return DeleteInstanceRequest; + return PromoteClusterRequest; })(); - v1alpha.FailoverInstanceRequest = (function() { + v1alpha.RestoreClusterRequest = (function() { /** - * Properties of a FailoverInstanceRequest. + * Properties of a RestoreClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly */ /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new RestoreClusterRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set */ - function FailoverInstanceRequest(properties) { + function RestoreClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33077,102 +34967,172 @@ } /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @instance */ - FailoverInstanceRequest.prototype.name = ""; + RestoreClusterRequest.prototype.backupSource = null; /** - * FailoverInstanceRequest requestId. + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.continuousBackupSource = null; + + /** + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.parent = ""; + + /** + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.clusterId = ""; + + /** + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @instance */ - FailoverInstanceRequest.prototype.requestId = ""; + RestoreClusterRequest.prototype.requestId = ""; /** - * FailoverInstanceRequest validateOnly. + * RestoreClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @instance */ - FailoverInstanceRequest.prototype.validateOnly = false; + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest instance + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest instance */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); }; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encode = function encode(message, writer) { + RestoreClusterRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes a RestoreClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decode = function decode(reader, length) { + RestoreClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.clusterId = reader.string(); break; } case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { message.validateOnly = reader.bool(); break; } @@ -33185,35 +35145,62 @@ }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FailoverInstanceRequest message. + * Verifies a RestoreClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FailoverInstanceRequest.verify = function verify(message) { + RestoreClusterRequest.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"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; @@ -33224,19 +35211,36 @@ }; /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); + } + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.fromObject(object.continuousBackupSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) @@ -33245,81 +35249,99 @@ }; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {google.cloud.alloydb.v1alpha.RestoreClusterRequest} message RestoreClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverInstanceRequest.toObject = function toObject(message, options) { + RestoreClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; + object.clusterId = ""; + object.cluster = null; object.requestId = ""; object.validateOnly = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; + } return object; }; /** - * Converts this FailoverInstanceRequest to JSON. + * Converts this RestoreClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @instance * @returns {Object.} JSON object */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { + RestoreClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for RestoreClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.FailoverInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreClusterRequest"; }; - return FailoverInstanceRequest; + return RestoreClusterRequest; })(); - v1alpha.RestartInstanceRequest = (function() { + v1alpha.ListInstancesRequest = (function() { /** - * Properties of a RestartInstanceRequest. + * Properties of a ListInstancesRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy */ /** - * Constructs a new RestartInstanceRequest. + * Constructs a new ListInstancesRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set */ - function RestartInstanceRequest(properties) { + function ListInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33327,319 +35349,67 @@ } /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance */ - RestartInstanceRequest.prototype.name = ""; + ListInstancesRequest.prototype.parent = ""; /** - * RestartInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance */ - RestartInstanceRequest.prototype.requestId = ""; + ListInstancesRequest.prototype.pageSize = 0; /** - * RestartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance */ - RestartInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest instance - */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); - }; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestartInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestartInstanceRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.RestartInstanceRequest} message RestartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestartInstanceRequest"; - }; - - return RestartInstanceRequest; - })(); - - v1alpha.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; + ListInstancesRequest.prototype.pageToken = ""; /** - * ListBackupsRequest filter. + * ListInstancesRequest filter. * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance */ - ListBackupsRequest.prototype.filter = ""; + ListInstancesRequest.prototype.filter = ""; /** - * ListBackupsRequest orderBy. + * ListInstancesRequest orderBy. * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance */ - ListBackupsRequest.prototype.orderBy = ""; + ListInstancesRequest.prototype.orderBy = ""; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest instance */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encode = function encode(message, writer) { + ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -33656,33 +35426,33 @@ }; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decode = function decode(reader, length) { + ListInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -33715,30 +35485,30 @@ }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsRequest.verify = function verify(message) { + ListInstancesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -33760,17 +35530,17 @@ }; /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsRequest) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) @@ -33785,15 +35555,15 @@ }; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.ListBackupsRequest} message ListBackupsRequest + * @param {google.cloud.alloydb.v1alpha.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsRequest.toObject = function toObject(message, options) { + ListInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -33818,55 +35588,55 @@ }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - ListBackupsRequest.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesRequest"; }; - return ListBackupsRequest; + return ListInstancesRequest; })(); - v1alpha.ListBackupsResponse = (function() { + v1alpha.ListInstancesResponse = (function() { /** - * Properties of a ListBackupsResponse. + * Properties of a ListInstancesResponse. * @memberof google.cloud.alloydb.v1alpha - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable */ /** - * Constructs a new ListBackupsResponse. + * Constructs a new ListInstancesResponse. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set */ - function ListBackupsResponse(properties) { - this.backups = []; + function ListInstancesResponse(properties) { + this.instances = []; this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -33875,56 +35645,56 @@ } /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @instance */ - ListBackupsResponse.prototype.backups = $util.emptyArray; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * ListBackupsResponse nextPageToken. + * ListInstancesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @instance */ - ListBackupsResponse.prototype.nextPageToken = ""; + ListInstancesResponse.prototype.nextPageToken = ""; /** - * ListBackupsResponse unreachable. + * ListInstancesResponse unreachable. * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @instance */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; + ListInstancesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new ListInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse instance */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); }; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encode = function encode(message, writer) { + ListInstancesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.unreachable != null && message.unreachable.length) @@ -33934,40 +35704,40 @@ }; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decode = function decode(reader, length) { + ListInstancesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32())); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); break; } case 2: { @@ -33989,39 +35759,39 @@ }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsResponse message. + * Verifies a ListInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsResponse.verify = function verify(message) { + ListInstancesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backups[i]); + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); if (error) - return "backups." + error; + return "instances." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -34038,32 +35808,32 @@ }; /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsResponse) + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backups[i]); + var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.unreachable) { if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.unreachable: array expected"); + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.unreachable: array expected"); message.unreachable = []; for (var i = 0; i < object.unreachable.length; ++i) message.unreachable[i] = String(object.unreachable[i]); @@ -34072,28 +35842,28 @@ }; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} message ListBackupsResponse + * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} message ListInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsResponse.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.backups = []; + object.instances = []; object.unreachable = []; } if (options.defaults) object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backups[j], options); + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -34106,52 +35876,53 @@ }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this ListInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @instance * @returns {Object.} JSON object */ - ListBackupsResponse.prototype.toJSON = function toJSON() { + ListInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for ListInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesResponse"; }; - return ListBackupsResponse; + return ListInstancesResponse; })(); - v1alpha.GetBackupRequest = (function() { + v1alpha.GetInstanceRequest = (function() { /** - * Properties of a GetBackupRequest. + * Properties of a GetInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1alpha.InstanceView|null} [view] GetInstanceRequest view */ /** - * Constructs a new GetBackupRequest. + * Constructs a new GetInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set */ - function GetBackupRequest(properties) { + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34159,70 +35930,80 @@ } /** - * GetBackupRequest name. + * GetInstanceRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @instance */ - GetBackupRequest.prototype.name = ""; + GetInstanceRequest.prototype.name = ""; /** - * Creates a new GetBackupRequest instance using the specified properties. + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1alpha.InstanceView} view + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.view = 0; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest instance + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest instance */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); }; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encode = function encode(message, 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); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decode = function decode(reader, length) { + 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.alloydb.v1alpha.GetBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -34230,6 +36011,10 @@ message.name = reader.string(); break; } + case 2: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -34239,126 +36024,159 @@ }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBackupRequest message. + * Verifies a GetInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBackupRequest.verify = function verify(message) { + 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"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetBackupRequest) + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); if (object.name != null) message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; + } return message; }; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.GetBackupRequest} message GetBackupRequest + * @param {google.cloud.alloydb.v1alpha.GetInstanceRequest} message GetInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupRequest.toObject = function toObject(message, options) { + GetInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] : message.view; return object; }; /** - * Converts this GetBackupRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @instance * @returns {Object.} JSON object */ - GetBackupRequest.prototype.toJSON = function toJSON() { + GetInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for GetInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetInstanceRequest"; }; - return GetBackupRequest; + return GetInstanceRequest; })(); - v1alpha.CreateBackupRequest = (function() { + v1alpha.CreateInstanceRequest = (function() { /** - * Properties of a CreateBackupRequest. + * Properties of a CreateInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly */ /** - * Constructs a new CreateBackupRequest. + * Constructs a new CreateInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set */ - function CreateBackupRequest(properties) { + function CreateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34366,75 +36184,75 @@ } /** - * CreateBackupRequest parent. + * CreateInstanceRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance */ - CreateBackupRequest.prototype.parent = ""; + CreateInstanceRequest.prototype.parent = ""; /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance */ - CreateBackupRequest.prototype.backupId = ""; + CreateInstanceRequest.prototype.instanceId = ""; /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance */ - CreateBackupRequest.prototype.backup = null; + CreateInstanceRequest.prototype.instance = null; /** - * CreateBackupRequest requestId. + * CreateInstanceRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance */ - CreateBackupRequest.prototype.requestId = ""; + CreateInstanceRequest.prototype.requestId = ""; /** - * CreateBackupRequest validateOnly. + * CreateInstanceRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance */ - CreateBackupRequest.prototype.validateOnly = false; + CreateInstanceRequest.prototype.validateOnly = false; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest instance */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encode = function encode(message, 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.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) @@ -34443,33 +36261,33 @@ }; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decode = function decode(reader, length) { + 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.alloydb.v1alpha.CreateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -34478,11 +36296,11 @@ break; } case 2: { - message.backupId = reader.string(); + message.instanceId = reader.string(); break; } case 3: { - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); break; } case 4: { @@ -34502,42 +36320,42 @@ }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBackupRequest message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBackupRequest.verify = function verify(message) { + 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.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); + 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.alloydb.v1alpha.Instance.verify(message.instance); if (error) - return "backup." + error; + return "instance." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) @@ -34549,25 +36367,25 @@ }; /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateBackupRequest) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); } if (object.requestId != null) message.requestId = String(object.requestId); @@ -34577,31 +36395,31 @@ }; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.CreateBackupRequest} message CreateBackupRequest + * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.backupId = ""; - object.backup = null; + object.instanceId = ""; + object.instance = null; object.requestId = ""; object.validateOnly = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) @@ -34610,56 +36428,56 @@ }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateBackupRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for CreateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequest"; }; - return CreateBackupRequest; + return CreateInstanceRequest; })(); - v1alpha.UpdateBackupRequest = (function() { + v1alpha.CreateSecondaryInstanceRequest = (function() { /** - * Properties of an UpdateBackupRequest. + * Properties of a CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly */ /** - * Constructs a new UpdateBackupRequest. + * Constructs a new CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set */ - function UpdateBackupRequest(properties) { + function CreateSecondaryInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34667,131 +36485,131 @@ } /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance */ - UpdateBackupRequest.prototype.updateMask = null; + CreateSecondaryInstanceRequest.prototype.parent = ""; /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance */ - UpdateBackupRequest.prototype.backup = null; + CreateSecondaryInstanceRequest.prototype.instanceId = ""; /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance */ - UpdateBackupRequest.prototype.requestId = ""; + CreateSecondaryInstanceRequest.prototype.instance = null; /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance */ - UpdateBackupRequest.prototype.validateOnly = false; + CreateSecondaryInstanceRequest.prototype.requestId = ""; /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance */ - UpdateBackupRequest.prototype.allowMissing = false; + CreateSecondaryInstanceRequest.prototype.validateOnly = false; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); }; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encode = function encode(message, writer) { + CreateSecondaryInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decode = function decode(reader, length) { + CreateSecondaryInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; } case 3: { - message.requestId = reader.string(); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); break; } case 4: { - message.validateOnly = reader.bool(); + message.requestId = reader.string(); break; } case 5: { - message.allowMissing = reader.bool(); + message.validateOnly = reader.bool(); break; } default: @@ -34803,41 +36621,42 @@ }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateBackupRequest message. + * Verifies a CreateSecondaryInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateBackupRequest.verify = function verify(message) { + CreateSecondaryInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); + 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.alloydb.v1alpha.Instance.verify(message.instance); if (error) - return "backup." + error; + return "instance." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) @@ -34845,126 +36664,118 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest) + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); + var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + 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.alloydb.v1alpha.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.UpdateBackupRequest} message UpdateBackupRequest + * @param {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupRequest.toObject = function toObject(message, options) { + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.backup = null; + object.parent = ""; + object.instanceId = ""; + object.instance = null; object.requestId = ""; object.validateOnly = false; - object.allowMissing = false; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + 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.alloydb.v1alpha.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @instance * @returns {Object.} JSON object */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for CreateSecondaryInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest"; }; - return UpdateBackupRequest; + return CreateSecondaryInstanceRequest; })(); - v1alpha.DeleteBackupRequest = (function() { + v1alpha.CreateInstanceRequests = (function() { /** - * Properties of a DeleteBackupRequest. + * Properties of a CreateInstanceRequests. * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests */ /** - * Constructs a new DeleteBackupRequest. + * Constructs a new CreateInstanceRequests. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set */ - function DeleteBackupRequest(properties) { + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34972,117 +36783,78 @@ } /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.requestId = ""; - - /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.validateOnly = false; - - /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @instance */ - DeleteBackupRequest.prototype.etag = ""; + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests instance */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); }; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encode = function encode(message, writer) { + CreateInstanceRequests.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decode = function decode(reader, length) { + CreateInstanceRequests.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = reader.string(); + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.decode(reader, reader.uint32())); break; } default: @@ -35094,149 +36866,141 @@ }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteBackupRequest message. + * Verifies a CreateInstanceRequests message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteBackupRequest.verify = function verify(message) { + CreateInstanceRequests.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (error) + return "createInstanceRequests." + error; + } + } return null; }; /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest) + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests) return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); + var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + } + } return message; }; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1alpha.DeleteBackupRequest} message DeleteBackupRequest + * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} message CreateInstanceRequests * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBackupRequest.toObject = function toObject(message, options) { + CreateInstanceRequests.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; return object; }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this CreateInstanceRequests to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @instance * @returns {Object.} JSON object */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequests.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for CreateInstanceRequests * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequests"; }; - return DeleteBackupRequest; + return CreateInstanceRequests; })(); - v1alpha.ListSupportedDatabaseFlagsRequest = (function() { + v1alpha.BatchCreateInstancesRequest = (function() { /** - * Properties of a ListSupportedDatabaseFlagsRequest. + * Properties of a BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId */ /** - * Constructs a new ListSupportedDatabaseFlagsRequest. + * Constructs a new BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsRequest(properties) { + function BatchCreateInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35244,90 +37008,90 @@ } /** - * ListSupportedDatabaseFlagsRequest parent. + * BatchCreateInstancesRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + BatchCreateInstancesRequest.prototype.parent = ""; /** - * ListSupportedDatabaseFlagsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + BatchCreateInstancesRequest.prototype.requests = null; /** - * ListSupportedDatabaseFlagsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * BatchCreateInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + BatchCreateInstancesRequest.prototype.requestId = ""; /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + BatchCreateInstancesRequest.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.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { + BatchCreateInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -35336,11 +37100,11 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.requestId = reader.string(); break; } default: @@ -35352,141 +37116,145 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsRequest message. + * Verifies a BatchCreateInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + BatchCreateInstancesRequest.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.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); 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.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.fromObject(object.requests); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} message BatchCreateInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + BatchCreateInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.requests = null; + object.requestId = ""; } 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.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.toObject(message.requests, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest + * Gets the default type url for BatchCreateInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest"; }; - return ListSupportedDatabaseFlagsRequest; + return BatchCreateInstancesRequest; })(); - v1alpha.ListSupportedDatabaseFlagsResponse = (function() { + v1alpha.BatchCreateInstancesResponse = (function() { /** - * Properties of a ListSupportedDatabaseFlagsResponse. + * Properties of a BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1alpha - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances */ /** - * Constructs a new ListSupportedDatabaseFlagsResponse. + * Constructs a new BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; + function BatchCreateInstancesResponse(properties) { + this.instances = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35494,92 +37262,78 @@ } /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; - - /** - * ListSupportedDatabaseFlagsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @instance */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + BatchCreateInstancesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { + BatchCreateInstancesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); break; } default: @@ -35591,151 +37345,142 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsResponse message. + * Verifies a BatchCreateInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + BatchCreateInstancesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); if (error) - return "supportedDatabaseFlags." + error; + return "instances." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} message BatchCreateInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + BatchCreateInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * Converts this BatchCreateInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse + * Gets the default type url for BatchCreateInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse"; }; - return ListSupportedDatabaseFlagsResponse; + return BatchCreateInstancesResponse; })(); - v1alpha.GenerateClientCertificateRequest = (function() { + v1alpha.BatchCreateInstancesMetadata = (function() { /** - * Properties of a GenerateClientCertificateRequest. + * Properties of a BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1alpha - * @interface IGenerateClientCertificateRequest - * @property {string|null} [parent] GenerateClientCertificateRequest parent - * @property {string|null} [requestId] GenerateClientCertificateRequest requestId - * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr - * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses */ /** - * Constructs a new GenerateClientCertificateRequest. + * Constructs a new BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GenerateClientCertificateRequest. - * @implements IGenerateClientCertificateRequest + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata * @constructor - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set */ - function GenerateClientCertificateRequest(properties) { + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35743,117 +37488,114 @@ } /** - * GenerateClientCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.parent = ""; - - /** - * GenerateClientCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.requestId = ""; - - /** - * GenerateClientCertificateRequest pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @instance */ - GenerateClientCertificateRequest.prototype.pemCsr = ""; + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; /** - * GenerateClientCertificateRequest certDuration. - * @member {google.protobuf.IDuration|null|undefined} certDuration - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @instance */ - GenerateClientCertificateRequest.prototype.certDuration = null; + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance */ - GenerateClientCertificateRequest.create = function create(properties) { - return new GenerateClientCertificateRequest(properties); + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); }; /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateRequest.encode = function encode(message, writer) { + BatchCreateInstancesMetadata.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); - if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) - $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateRequest.decode = function decode(reader, length) { + BatchCreateInstancesMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); break; } case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.pemCsr = reader.string(); - break; - } - case 4: { - message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; break; } default: @@ -35865,154 +37607,165 @@ }; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateClientCertificateRequest message. + * Verifies a BatchCreateInstancesMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GenerateClientCertificateRequest.verify = function verify(message) { + BatchCreateInstancesMetadata.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) { - var error = $root.google.protobuf.Duration.verify(message.certDuration); - if (error) - return "certDuration." + error; + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; + } + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); + if (error) + return "instanceStatuses." + error; + } } return null; }; /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata */ - GenerateClientCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) return object; - var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.certDuration != null) { - if (typeof object.certDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.certDuration: object expected"); - message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); + } + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } } return message; }; /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateClientCertificateRequest.toObject = function toObject(message, options) { + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - object.pemCsr = ""; - object.certDuration = null; + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; + } + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) - object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); return object; }; /** - * Converts this GenerateClientCertificateRequest to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @instance * @returns {Object.} JSON object */ - GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateClientCertificateRequest + * Gets the default type url for BatchCreateInstancesMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata"; }; - return GenerateClientCertificateRequest; + return BatchCreateInstancesMetadata; })(); - v1alpha.GenerateClientCertificateResponse = (function() { + v1alpha.BatchCreateInstanceStatus = (function() { /** - * Properties of a GenerateClientCertificateResponse. + * Properties of a BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1alpha - * @interface IGenerateClientCertificateResponse - * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate - * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type */ /** - * Constructs a new GenerateClientCertificateResponse. + * Constructs a new BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GenerateClientCertificateResponse. - * @implements IGenerateClientCertificateResponse + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus * @constructor - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set */ - function GenerateClientCertificateResponse(properties) { - this.pemCertificateChain = []; + function BatchCreateInstanceStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36020,92 +37773,117 @@ } /** - * GenerateClientCertificateResponse pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @instance */ - GenerateClientCertificateResponse.prototype.pemCertificate = ""; + BatchCreateInstanceStatus.prototype.state = 0; /** - * GenerateClientCertificateResponse pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @instance */ - GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; + BatchCreateInstanceStatus.prototype.errorMsg = ""; /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.error = null; + + /** + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.type = 0; + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance */ - GenerateClientCertificateResponse.create = function create(properties) { - return new GenerateClientCertificateResponse(properties); + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); }; /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateResponse.encode = function encode(message, writer) { + BatchCreateInstanceStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + 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(); return writer; }; /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateResponse.decode = function decode(reader, length) { + BatchCreateInstanceStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.pemCertificate = reader.string(); + message.state = reader.int32(); break; } case 2: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); break; } default: @@ -36117,144 +37895,253 @@ }; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateClientCertificateResponse message. + * Verifies a BatchCreateInstanceStatus message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GenerateClientCertificateResponse.verify = function verify(message) { + BatchCreateInstanceStatus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus */ - GenerateClientCertificateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) return object; - var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); + 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 "PENDING_CREATE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; + break; } return message; }; /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} message BatchCreateInstanceStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateClientCertificateResponse.toObject = function toObject(message, options) { + BatchCreateInstanceStatus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) - object.pemCertificate = ""; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); return object; }; /** - * Converts this GenerateClientCertificateResponse to JSON. + * Converts this BatchCreateInstanceStatus to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @instance * @returns {Object.} JSON object */ - GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateClientCertificateResponse + * Gets the default type url for BatchCreateInstanceStatus * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus"; }; - return GenerateClientCertificateResponse; + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; })(); - v1alpha.GetConnectionInfoRequest = (function() { + v1alpha.UpdateInstanceRequest = (function() { /** - * Properties of a GetConnectionInfoRequest. + * Properties of an UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IGetConnectionInfoRequest - * @property {string|null} [parent] GetConnectionInfoRequest parent - * @property {string|null} [requestId] GetConnectionInfoRequest requestId + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing */ /** - * Constructs a new GetConnectionInfoRequest. + * Constructs a new UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetConnectionInfoRequest. - * @implements IGetConnectionInfoRequest + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set */ - function GetConnectionInfoRequest(properties) { + function UpdateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36262,91 +38149,133 @@ } /** - * GetConnectionInfoRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @instance */ - GetConnectionInfoRequest.prototype.parent = ""; + UpdateInstanceRequest.prototype.updateMask = null; /** - * GetConnectionInfoRequest requestId. + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @instance */ - GetConnectionInfoRequest.prototype.requestId = ""; + UpdateInstanceRequest.prototype.requestId = ""; /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.validateOnly = false; + + /** + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest instance + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest instance */ - GetConnectionInfoRequest.create = function create(properties) { - return new GetConnectionInfoRequest(properties); + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); }; /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionInfoRequest.encode = function encode(message, writer) { + UpdateInstanceRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionInfoRequest.decode = function decode(reader, length) { + UpdateInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { message.requestId = reader.string(); break; } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -36356,138 +38285,168 @@ }; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetConnectionInfoRequest message. + * Verifies an UpdateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetConnectionInfoRequest.verify = function verify(message) { + UpdateInstanceRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); + if (error) + return "instance." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest */ - GetConnectionInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); + } if (object.requestId != null) message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} message UpdateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConnectionInfoRequest.toObject = function toObject(message, options) { + UpdateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; + object.updateMask = null; + object.instance = null; object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this GetConnectionInfoRequest to JSON. + * Converts this UpdateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @instance * @returns {Object.} JSON object */ - GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + UpdateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetConnectionInfoRequest + * Gets the default type url for UpdateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetConnectionInfoRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateInstanceRequest"; }; - return GetConnectionInfoRequest; + return UpdateInstanceRequest; })(); - v1alpha.OperationMetadata = (function() { + v1alpha.DeleteInstanceRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly */ /** - * Constructs a new OperationMetadata. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36495,187 +38454,117 @@ } /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @instance */ - OperationMetadata.prototype.statusMessage = ""; + DeleteInstanceRequest.prototype.name = ""; /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @instance */ - OperationMetadata.prototype.requestedCancellation = false; + DeleteInstanceRequest.prototype.requestId = ""; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + DeleteInstanceRequest.prototype.etag = ""; /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @instance */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteInstanceRequest.prototype.validateOnly = false; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata instance + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest * @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) { + 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.alloydb.v1alpha.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - message.target = reader.string(); + message.etag = reader.string(); break; } case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -36687,245 +38576,149 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest * @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) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @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) { + DeleteInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.OperationMetadata) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1alpha.OperationMetadata} message OperationMetadata + * @param {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + DeleteInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for DeleteInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteInstanceRequest"; }; - return OperationMetadata; - })(); - - return v1alpha; - })(); - - alloydb.v1beta = (function() { - - /** - * Namespace v1beta. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1beta = {}; - - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1beta.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - */ - v1beta.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - return values; - })(); - - /** - * InstanceView enum. - * @name google.cloud.alloydb.v1beta.InstanceView - * @enum {number} - * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value - * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value - * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value - */ - v1beta.InstanceView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; - values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; - return values; + return DeleteInstanceRequest; })(); - v1beta.UserPassword = (function() { + v1alpha.FailoverInstanceRequest = (function() { /** - * Properties of a UserPassword. - * @memberof google.cloud.alloydb.v1beta - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password + * Properties of a FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly */ /** - * Constructs a new UserPassword. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a UserPassword. - * @implements IUserPassword + * Constructs a new FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set */ - function UserPassword(properties) { + function FailoverInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36933,89 +38726,103 @@ } /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1beta.UserPassword + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @instance */ - UserPassword.prototype.user = ""; + FailoverInstanceRequest.prototype.name = ""; /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1beta.UserPassword + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @instance */ - UserPassword.prototype.password = ""; + FailoverInstanceRequest.prototype.requestId = ""; /** - * Creates a new UserPassword instance using the specified properties. + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword instance + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest instance */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); }; /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPassword.encode = function encode(message, writer) { + FailoverInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserPassword message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserPassword.decode = function decode(reader, length) { + FailoverInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UserPassword(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.user = reader.string(); + message.name = reader.string(); break; } case 2: { - message.password = reader.string(); + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -37027,133 +38834,142 @@ }; /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserPassword message. + * Verifies a FailoverInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserPassword.verify = function verify(message) { + FailoverInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UserPassword) + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.UserPassword(); - if (object.user != null) - message.user = String(object.user); - if (object.password != null) - message.password = String(object.password); + var message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.UserPassword} message UserPassword + * @param {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} message FailoverInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserPassword.toObject = function toObject(message, options) { + FailoverInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.user = ""; - object.password = ""; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this UserPassword to JSON. + * Converts this FailoverInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @instance * @returns {Object.} JSON object */ - UserPassword.prototype.toJSON = function toJSON() { + FailoverInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserPassword + * Gets the default type url for FailoverInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UserPassword + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UserPassword"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.FailoverInstanceRequest"; }; - return UserPassword; + return FailoverInstanceRequest; })(); - v1beta.MigrationSource = (function() { + v1alpha.InjectFaultRequest = (function() { /** - * Properties of a MigrationSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IMigrationSource - * @property {string|null} [hostPort] MigrationSource hostPort - * @property {string|null} [referenceId] MigrationSource referenceId - * @property {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + * Properties of an InjectFaultRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly */ /** - * Constructs a new MigrationSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource + * Constructs a new InjectFaultRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set */ - function MigrationSource(properties) { + function InjectFaultRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37161,103 +38977,117 @@ } /** - * MigrationSource hostPort. - * @member {string} hostPort - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @instance */ - MigrationSource.prototype.hostPort = ""; + InjectFaultRequest.prototype.faultType = 0; /** - * MigrationSource referenceId. - * @member {string} referenceId - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @instance */ - MigrationSource.prototype.referenceId = ""; + InjectFaultRequest.prototype.name = ""; /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * InjectFaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @instance */ - MigrationSource.prototype.sourceType = 0; + InjectFaultRequest.prototype.requestId = ""; /** - * Creates a new MigrationSource instance using the specified properties. + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.validateOnly = false; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource instance + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest instance */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); }; /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationSource.encode = function encode(message, writer) { + InjectFaultRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrationSource message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationSource.decode = function decode(reader, length) { + InjectFaultRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hostPort = reader.string(); + message.faultType = reader.int32(); break; } case 2: { - message.referenceId = reader.string(); + message.name = reader.string(); break; } case 3: { - message.sourceType = reader.int32(); + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); break; } default: @@ -37269,172 +39099,182 @@ }; /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrationSource message. + * Verifies an InjectFaultRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrationSource.verify = function verify(message) { + InjectFaultRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - if (!$util.isString(message.hostPort)) - return "hostPort: string expected"; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { default: - return "sourceType: enum value expected"; + return "faultType: enum value expected"; case 0: case 1: break; } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MigrationSource) + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.InjectFaultRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); - if (object.hostPort != null) - message.hostPort = String(object.hostPort); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - switch (object.sourceType) { + var message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); + switch (object.faultType) { default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; + if (typeof object.faultType === "number") { + message.faultType = object.faultType; break; } break; - case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": + case "FAULT_TYPE_UNSPECIFIED": case 0: - message.sourceType = 0; + message.faultType = 0; break; - case "DMS": + case "STOP_VM": case 1: - message.sourceType = 1; + message.faultType = 1; break; } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.MigrationSource} message MigrationSource + * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest} message InjectFaultRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrationSource.toObject = function toObject(message, options) { + InjectFaultRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.hostPort = ""; - object.referenceId = ""; - object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - object.hostPort = message.hostPort; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this MigrationSource to JSON. + * Converts this InjectFaultRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @instance * @returns {Object.} JSON object */ - MigrationSource.prototype.toJSON = function toJSON() { + InjectFaultRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrationSource + * Gets the default type url for InjectFaultRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MigrationSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.InjectFaultRequest"; }; /** - * MigrationSourceType enum. - * @name google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + * FaultType enum. + * @name google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType * @enum {number} - * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value - * @property {number} DMS=1 DMS value + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value */ - MigrationSource.MigrationSourceType = (function() { + InjectFaultRequest.FaultType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DMS"] = 1; + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; return values; })(); - return MigrationSource; + return InjectFaultRequest; })(); - v1beta.EncryptionConfig = (function() { + v1alpha.RestartInstanceRequest = (function() { /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly */ /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function RestartInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37442,75 +39282,103 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + RestartInstanceRequest.prototype.name = ""; /** - * Creates a new EncryptionConfig instance using the specified properties. + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.requestId = ""; + + /** + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig instance + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); }; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encode = function encode(message, writer) { + RestartInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decode = function decode(reader, length) { + RestartInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.kmsKeyName = reader.string(); + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -37522,124 +39390,143 @@ }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionConfig message. + * Verifies a RestartInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionConfig.verify = function verify(message) { + RestartInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionConfig) + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + var message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.EncryptionConfig} message EncryptionConfig + * @param {google.cloud.alloydb.v1alpha.RestartInstanceRequest} message RestartInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + RestartInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this EncryptionConfig to JSON. + * Converts this RestartInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @instance * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { + RestartInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for RestartInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestartInstanceRequest"; }; - return EncryptionConfig; + return RestartInstanceRequest; })(); - v1beta.EncryptionInfo = (function() { + v1alpha.ListBackupsRequest = (function() { /** - * Properties of an EncryptionInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1beta.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + * Properties of a ListBackupsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy */ /** - * Constructs a new EncryptionInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; + function ListBackupsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37647,92 +39534,131 @@ } /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1beta.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @instance */ - EncryptionInfo.prototype.encryptionType = 0; + ListBackupsRequest.prototype.parent = ""; /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @instance */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + ListBackupsRequest.prototype.pageSize = 0; /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo instance + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; + ListBackupsRequest.prototype.pageToken = ""; /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer. + * Decodes a ListBackupsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionInfo.decode = function decode(reader, length) { + ListBackupsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.encryptionType = reader.int32(); + message.parent = reader.string(); break; } case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -37744,184 +39670,159 @@ }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionInfo message. + * Verifies a ListBackupsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionInfo.verify = function verify(message) { + ListBackupsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionInfo) + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.alloydb.v1beta.EncryptionInfo.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); - } + var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.EncryptionInfo} message EncryptionInfo + * @param {google.cloud.alloydb.v1alpha.ListBackupsRequest} message ListBackupsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionInfo.toObject = function toObject(message, options) { + ListBackupsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyVersions = []; - if (options.defaults) - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this EncryptionInfo to JSON. + * Converts this ListBackupsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @instance * @returns {Object.} JSON object */ - EncryptionInfo.prototype.toJSON = function toJSON() { + ListBackupsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionInfo + * Gets the default type url for ListBackupsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsRequest"; }; - /** - * Type enum. - * @name google.cloud.alloydb.v1beta.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; + return ListBackupsRequest; })(); - v1beta.SslConfig = (function() { + v1alpha.ListBackupsResponse = (function() { /** - * Properties of a SslConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface ISslConfig - * @property {google.cloud.alloydb.v1beta.SslConfig.SslMode|null} [sslMode] SslConfig sslMode - * @property {google.cloud.alloydb.v1beta.SslConfig.CaSource|null} [caSource] SslConfig caSource + * Properties of a ListBackupsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable */ /** - * Constructs a new SslConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SslConfig. - * @implements ISslConfig + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse * @constructor - * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set */ - function SslConfig(properties) { + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37929,89 +39830,109 @@ } /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1beta.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1beta.SslConfig + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @instance */ - SslConfig.prototype.sslMode = 0; + ListBackupsResponse.prototype.backups = $util.emptyArray; /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1beta.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1beta.SslConfig + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @instance */ - SslConfig.prototype.caSource = 0; + ListBackupsResponse.prototype.nextPageToken = ""; /** - * Creates a new SslConfig instance using the specified properties. + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig instance + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse instance */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); }; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encode = function encode(message, writer) { + ListBackupsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); - if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes a ListBackupsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decode = function decode(reader, length) { + ListBackupsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SslConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.sslMode = reader.int32(); + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32())); break; } case 2: { - message.caSource = reader.int32(); + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -38023,219 +39944,169 @@ }; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SslConfig message. + * Verifies a ListBackupsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SslConfig.verify = function verify(message) { + ListBackupsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - switch (message.sslMode) { - default: - return "sslMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.caSource != null && message.hasOwnProperty("caSource")) - switch (message.caSource) { - default: - return "caSource: enum value expected"; - case 0: - case 1: - break; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SslConfig) + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.SslConfig(); - switch (object.sslMode) { - default: - if (typeof object.sslMode === "number") { - message.sslMode = object.sslMode; - break; + var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backups[i]); } - break; - case "SSL_MODE_UNSPECIFIED": - case 0: - message.sslMode = 0; - break; - case "SSL_MODE_ALLOW": - case 1: - message.sslMode = 1; - break; - case "SSL_MODE_REQUIRE": - case 2: - message.sslMode = 2; - break; - case "SSL_MODE_VERIFY_CA": - case 3: - message.sslMode = 3; - break; } - switch (object.caSource) { - default: - if (typeof object.caSource === "number") { - message.caSource = object.caSource; - break; - } - break; - case "CA_SOURCE_UNSPECIFIED": - case 0: - message.caSource = 0; - break; - case "CA_SOURCE_MANAGED": - case 1: - message.caSource = 1; - break; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } return message; }; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.SslConfig} message SslConfig + * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} message ListBackupsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslConfig.toObject = function toObject(message, options) { + ListBackupsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; - object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] : message.sslMode; - if (message.caSource != null && message.hasOwnProperty("caSource")) - object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] : message.caSource; return object; }; /** - * Converts this SslConfig to JSON. + * Converts this ListBackupsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @instance * @returns {Object.} JSON object */ - SslConfig.prototype.toJSON = function toJSON() { + ListBackupsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SslConfig + * Gets the default type url for ListBackupsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SslConfig + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SslConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsResponse"; }; - /** - * SslMode enum. - * @name google.cloud.alloydb.v1beta.SslConfig.SslMode - * @enum {number} - * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value - * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value - * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value - * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value - */ - SslConfig.SslMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; - values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; - values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; - return values; - })(); - - /** - * CaSource enum. - * @name google.cloud.alloydb.v1beta.SslConfig.CaSource - * @enum {number} - * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value - * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value - */ - SslConfig.CaSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; - return values; - })(); - - return SslConfig; + return ListBackupsResponse; })(); - v1beta.AutomatedBackupPolicy = (function() { + v1alpha.GetBackupRequest = (function() { /** - * Properties of an AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1beta - * @interface IAutomatedBackupPolicy - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention - * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled - * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig - * @property {string|null} [location] AutomatedBackupPolicy location - * @property {Object.|null} [labels] AutomatedBackupPolicy labels + * Properties of a GetBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name */ /** - * Constructs a new AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy + * Constructs a new GetBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; + function GetBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38243,229 +40114,75 @@ } /** - * AutomatedBackupPolicy weeklySchedule. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.weeklySchedule = null; - - /** - * AutomatedBackupPolicy timeBasedRetention. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.timeBasedRetention = null; - - /** - * AutomatedBackupPolicy quantityBasedRetention. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.quantityBasedRetention = null; - - /** - * AutomatedBackupPolicy enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.enabled = null; - - /** - * AutomatedBackupPolicy backupWindow. - * @member {google.protobuf.IDuration|null|undefined} backupWindow - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.backupWindow = null; - - /** - * AutomatedBackupPolicy encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.encryptionConfig = null; - - /** - * AutomatedBackupPolicy location. - * @member {string} location - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.location = ""; - - /** - * AutomatedBackupPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutomatedBackupPolicy schedule. - * @member {"weeklySchedule"|undefined} schedule - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetBackupRequest.prototype.name = ""; /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. + * Creates a new GetBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy instance + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest instance */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); }; /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomatedBackupPolicy.encode = function encode(message, writer) { + GetBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - 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.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * Decodes a GetBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomatedBackupPolicy.decode = function decode(reader, length) { + GetBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); - break; - } - case 4: { - message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); - break; - } - case 5: { - message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); - break; - } case 1: { - message.enabled = reader.bool(); - break; - } - case 3: { - message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.location = 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; + message.name = reader.string(); break; } default: @@ -38477,975 +40194,427 @@ }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomatedBackupPolicy message. + * Verifies a GetBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AutomatedBackupPolicy.verify = function verify(message) { + GetBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - properties.schedule = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); - if (error) - return "weeklySchedule." + error; - } - } - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); - if (error) - return "timeBasedRetention." + error; - } - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - if (properties.retention === 1) - return "retention: multiple values"; - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); - if (error) - return "quantityBasedRetention." + error; - } - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.protobuf.Duration.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: 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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(); - if (object.weeklySchedule != null) { - if (typeof object.weeklySchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.weeklySchedule: object expected"); - message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); - } - if (object.timeBasedRetention != null) { - if (typeof object.timeBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.timeBasedRetention: object expected"); - message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); - } - if (object.quantityBasedRetention != null) { - if (typeof object.quantityBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.quantityBasedRetention: object expected"); - message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); - } - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.backupWindow: object expected"); - message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.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]]); - } + var message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {google.cloud.alloydb.v1alpha.GetBackupRequest} message GetBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { + GetBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.backupWindow = null; - object.location = ""; - object.encryptionConfig = null; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - object.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); - if (options.oneofs) - object.schedule = "weeklySchedule"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - object.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); - if (options.oneofs) - object.retention = "timeBasedRetention"; - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - object.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); - if (options.oneofs) - object.retention = "quantityBasedRetention"; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - 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.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this AutomatedBackupPolicy to JSON. + * Converts this GetBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @instance * @returns {Object.} JSON object */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + GetBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomatedBackupPolicy + * Gets the default type url for GetBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetBackupRequest"; }; - AutomatedBackupPolicy.WeeklySchedule = (function() { - - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ - - /** - * Constructs a new WeeklySchedule. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a WeeklySchedule. - * @implements IWeeklySchedule - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - */ - function WeeklySchedule(properties) { - this.startTimes = []; - this.daysOfWeek = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return GetBackupRequest; + })(); - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; + v1alpha.CreateBackupRequest = (function() { - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + */ - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance - */ - WeeklySchedule.create = function create(properties) { - return new WeeklySchedule(properties); - }; + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimes != null && message.startTimes.length) - for (var i = 0; i < message.startTimes.length; ++i) - $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.startTimes && message.startTimes.length)) - message.startTimes = []; - message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.requestId = ""; - /** - * Verifies a WeeklySchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeeklySchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimes != null && message.hasOwnProperty("startTimes")) { - if (!Array.isArray(message.startTimes)) - return "startTimes: array expected"; - for (var i = 0; i < message.startTimes.length; ++i) { - var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); - if (error) - return "startTimes." + error; - } - } - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; + /** + * CreateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.validateOnly = false; - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); - if (object.startTimes) { - if (!Array.isArray(object.startTimes)) - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); - message.startTimes = []; - for (var i = 0; i < object.startTimes.length; ++i) { - if (typeof object.startTimes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); - message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); - } - } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - return message; - }; + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeeklySchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startTimes = []; - object.daysOfWeek = []; - } - if (message.startTimes && message.startTimes.length) { - object.startTimes = []; - for (var j = 0; j < message.startTimes.length; ++j) - object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); - } - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - return object; - }; + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.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.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; - /** - * Converts this WeeklySchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - * @returns {Object.} JSON object - */ - WeeklySchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Gets the default type url for WeeklySchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule"; - }; - - return WeeklySchedule; - })(); - - AutomatedBackupPolicy.TimeBasedRetention = (function() { + } + return message; + }; - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new TimeBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a TimeBasedRetention. - * @implements ITimeBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - */ - function TimeBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.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.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); + if (error) + return "backup." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance - */ - TimeBasedRetention.create = function create(properties) { - return new TimeBasedRetention(properties); - }; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) - $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); - if (error) - return "retentionPeriod." + error; - } - return null; - }; - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - */ - TimeBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); - if (object.retentionPeriod != null) { - if (typeof object.retentionPeriod !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); - message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); - } - return message; - }; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionPeriod = null; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) - object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); - return object; - }; - - /** - * Converts this TimeBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @instance - * @returns {Object.} JSON object - */ - TimeBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention"; - }; - - return TimeBasedRetention; - })(); - - AutomatedBackupPolicy.QuantityBasedRetention = (function() { - - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ - - /** - * Constructs a new QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a QuantityBasedRetention. - * @implements IQuantityBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - */ - function QuantityBasedRetention(properties) { - if (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 plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance - */ - QuantityBasedRetention.create = function create(properties) { - return new QuantityBasedRetention(properties); - }; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - */ - QuantityBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention"; - }; + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return QuantityBasedRetention; - })(); + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateBackupRequest"; + }; - return AutomatedBackupPolicy; + return CreateBackupRequest; })(); - v1beta.ContinuousBackupConfig = (function() { + v1alpha.UpdateBackupRequest = (function() { /** - * Properties of a ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupConfig - * @property {boolean|null} [enabled] ContinuousBackupConfig enabled - * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing */ /** - * Constructs a new ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set */ - function ContinuousBackupConfig(properties) { + function UpdateBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39453,117 +40622,131 @@ } /** - * ContinuousBackupConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @instance */ - ContinuousBackupConfig.prototype.enabled = null; + UpdateBackupRequest.prototype.updateMask = null; /** - * ContinuousBackupConfig recoveryWindowDays. - * @member {number} recoveryWindowDays - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @instance */ - ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + UpdateBackupRequest.prototype.backup = null; /** - * ContinuousBackupConfig encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @instance */ - ContinuousBackupConfig.prototype.encryptionConfig = null; + UpdateBackupRequest.prototype.requestId = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * UpdateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.validateOnly = false; /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @instance */ - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + UpdateBackupRequest.prototype.allowMissing = false; /** - * Creates a new ContinuousBackupConfig instance using the specified properties. + * Creates a new UpdateBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig instance + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest instance */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); }; /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupConfig.encode = function encode(message, writer) { + UpdateBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * Decodes an UpdateBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupConfig.decode = function decode(reader, length) { + UpdateBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } - case 4: { - message.recoveryWindowDays = reader.int32(); + case 2: { + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); break; } case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); break; } default: @@ -39575,152 +40758,168 @@ }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupConfig message. + * Verifies an UpdateBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupConfig.verify = function verify(message) { + UpdateBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - if (!$util.isInteger(message.recoveryWindowDays)) - return "recoveryWindowDays: integer expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); if (error) - return "encryptionConfig." + error; + return "backup." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig) + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.recoveryWindowDays != null) - message.recoveryWindowDays = object.recoveryWindowDays | 0; - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + var message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {google.cloud.alloydb.v1alpha.UpdateBackupRequest} message UpdateBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupConfig.toObject = function toObject(message, options) { + UpdateBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.encryptionConfig = null; - object.recoveryWindowDays = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; + object.updateMask = null; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - object.recoveryWindowDays = message.recoveryWindowDays; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this ContinuousBackupConfig to JSON. + * Converts this UpdateBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @instance * @returns {Object.} JSON object */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { + UpdateBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupConfig + * Gets the default type url for UpdateBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateBackupRequest"; }; - return ContinuousBackupConfig; + return UpdateBackupRequest; })(); - v1beta.ContinuousBackupInfo = (function() { + v1alpha.DeleteBackupRequest = (function() { /** - * Properties of a ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupInfo - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo - * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime - * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag */ /** - * Constructs a new ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set */ - function ContinuousBackupInfo(properties) { - this.schedule = []; + function DeleteBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39728,114 +40927,117 @@ } /** - * ContinuousBackupInfo encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @instance */ - ContinuousBackupInfo.prototype.encryptionInfo = null; + DeleteBackupRequest.prototype.name = ""; /** - * ContinuousBackupInfo enabledTime. - * @member {google.protobuf.ITimestamp|null|undefined} enabledTime - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @instance */ - ContinuousBackupInfo.prototype.enabledTime = null; + DeleteBackupRequest.prototype.requestId = ""; /** - * ContinuousBackupInfo schedule. - * @member {Array.} schedule - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * DeleteBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @instance */ - ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + DeleteBackupRequest.prototype.validateOnly = false; /** - * Creates a new ContinuousBackupInfo instance using the specified properties. + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo instance + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest instance */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); }; /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupInfo.encode = function encode(message, writer) { + DeleteBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) - $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schedule != null && message.schedule.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.schedule.length; ++i) - writer.int32(message.schedule[i]); - writer.ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); return writer; }; /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * Decodes a DeleteBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupInfo.decode = function decode(reader, length) { + DeleteBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - if (!(message.schedule && message.schedule.length)) - message.schedule = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.schedule.push(reader.int32()); - } else - message.schedule.push(reader.int32()); + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); break; } default: @@ -39847,212 +41049,149 @@ }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupInfo message. + * Verifies a DeleteBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupInfo.verify = function verify(message) { + DeleteBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); - if (error) - return "enabledTime." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - if (!Array.isArray(message.schedule)) - return "schedule: array expected"; - for (var i = 0; i < message.schedule.length; ++i) - switch (message.schedule[i]) { - default: - return "schedule: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo) + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.enabledTime != null) { - if (typeof object.enabledTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.enabledTime: object expected"); - message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); - } - if (object.schedule) { - if (!Array.isArray(object.schedule)) - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.schedule: array expected"); - message.schedule = []; - for (var i = 0; i < object.schedule.length; ++i) - switch (object.schedule[i]) { - default: - if (typeof object.schedule[i] === "number") { - message.schedule[i] = object.schedule[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.schedule[i] = 0; - break; - case "MONDAY": - case 1: - message.schedule[i] = 1; - break; - case "TUESDAY": - case 2: - message.schedule[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.schedule[i] = 3; - break; - case "THURSDAY": - case 4: - message.schedule[i] = 4; - break; - case "FRIDAY": - case 5: - message.schedule[i] = 5; - break; - case "SATURDAY": - case 6: - message.schedule[i] = 6; - break; - case "SUNDAY": - case 7: - message.schedule[i] = 7; - break; - } - } + var message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {google.cloud.alloydb.v1alpha.DeleteBackupRequest} message DeleteBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupInfo.toObject = function toObject(message, options) { + DeleteBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.schedule = []; if (options.defaults) { - object.encryptionInfo = null; - object.enabledTime = null; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) - object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); - if (message.schedule && message.schedule.length) { - object.schedule = []; - for (var j = 0; j < message.schedule.length; ++j) - object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this ContinuousBackupInfo to JSON. + * Converts this DeleteBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @instance * @returns {Object.} JSON object */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { + DeleteBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupInfo + * Gets the default type url for DeleteBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteBackupRequest"; }; - return ContinuousBackupInfo; + return DeleteBackupRequest; })(); - v1beta.BackupSource = (function() { + v1alpha.ListSupportedDatabaseFlagsRequest = (function() { /** - * Properties of a BackupSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName + * Properties of a ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken */ /** - * Constructs a new BackupSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BackupSource. - * @implements IBackupSource + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set */ - function BackupSource(properties) { + function ListSupportedDatabaseFlagsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40060,89 +41199,103 @@ } /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1beta.BackupSource + * ListSupportedDatabaseFlagsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @instance */ - BackupSource.prototype.backupUid = ""; + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1beta.BackupSource + * ListSupportedDatabaseFlagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @instance */ - BackupSource.prototype.backupName = ""; + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; /** - * Creates a new BackupSource instance using the specified properties. + * ListSupportedDatabaseFlagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); }; /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BackupSource message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BackupSource.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BackupSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } case 2: { - message.backupUid = reader.string(); + message.pageSize = reader.int32(); break; } - case 1: { - message.backupName = reader.string(); + case 3: { + message.pageToken = reader.string(); break; } default: @@ -40154,132 +41307,141 @@ }; /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BackupSource message. + * Verifies a ListSupportedDatabaseFlagsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BackupSource.verify = function verify(message) { + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BackupSource) + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); + var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.BackupSource} message BackupSource + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupSource.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this BackupSource to JSON. + * Converts this ListSupportedDatabaseFlagsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @instance * @returns {Object.} JSON object */ - BackupSource.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BackupSource + * Gets the default type url for ListSupportedDatabaseFlagsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest"; }; - return BackupSource; + return ListSupportedDatabaseFlagsRequest; })(); - v1beta.ContinuousBackupSource = (function() { + v1alpha.ListSupportedDatabaseFlagsResponse = (function() { /** - * Properties of a ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + * Properties of a ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken */ /** - * Constructs a new ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set */ - function ContinuousBackupSource(properties) { + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40287,89 +41449,92 @@ } /** - * ContinuousBackupSource cluster. - * @member {string} cluster - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @instance */ - ContinuousBackupSource.prototype.cluster = ""; + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; /** - * ContinuousBackupSource pointInTime. - * @member {google.protobuf.ITimestamp|null|undefined} pointInTime - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * ListSupportedDatabaseFlagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @instance */ - ContinuousBackupSource.prototype.pointInTime = null; + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; /** - * Creates a new ContinuousBackupSource instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); }; /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupSource.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); - if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[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 ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupSource.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cluster = reader.string(); + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.decode(reader, reader.uint32())); break; } case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -40381,162 +41546,152 @@ }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupSource message. + * Verifies a ListSupportedDatabaseFlagsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContinuousBackupSource.verify = function verify(message) { + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) - if (!$util.isString(message.cluster)) - return "cluster: string expected"; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); - if (error) - return "pointInTime." + error; + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (error) + return "supportedDatabaseFlags." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupSource) + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); - if (object.cluster != null) - message.cluster = String(object.cluster); - if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupSource.pointInTime: object expected"); - message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} message ContinuousBackupSource + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupSource.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.cluster = ""; - object.pointInTime = null; + if (options.arrays || options.defaults) + object.supportedDatabaseFlags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); } - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = message.cluster; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ContinuousBackupSource to JSON. + * Converts this ListSupportedDatabaseFlagsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @instance * @returns {Object.} JSON object */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupSource + * Gets the default type url for ListSupportedDatabaseFlagsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse"; }; - return ContinuousBackupSource; + return ListSupportedDatabaseFlagsResponse; })(); - v1beta.Cluster = (function() { + v1alpha.GenerateClientCertificateRequest = (function() { /** - * Properties of a Cluster. - * @memberof google.cloud.alloydb.v1beta - * @interface ICluster - * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1beta.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1beta.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1beta.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig - * @property {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo - * @property {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * Properties of a GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGenerateClientCertificateRequest + * @property {string|null} [parent] GenerateClientCertificateRequest parent + * @property {string|null} [requestId] GenerateClientCertificateRequest requestId + * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr + * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey */ /** - * Constructs a new Cluster. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a Cluster. - * @implements ICluster + * Constructs a new GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GenerateClientCertificateRequest. + * @implements IGenerateClientCertificateRequest * @constructor - * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; + function GenerateClientCertificateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40544,465 +41699,406 @@ } /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance */ - Cluster.prototype.backupSource = null; + GenerateClientCertificateRequest.prototype.parent = ""; /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1beta.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance */ - Cluster.prototype.migrationSource = null; + GenerateClientCertificateRequest.prototype.requestId = ""; /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateRequest pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance */ - Cluster.prototype.name = ""; + GenerateClientCertificateRequest.prototype.pemCsr = ""; /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateRequest certDuration. + * @member {google.protobuf.IDuration|null|undefined} certDuration + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance */ - Cluster.prototype.displayName = ""; + GenerateClientCertificateRequest.prototype.certDuration = null; /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateRequest publicKey. + * @member {string} publicKey + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance */ - Cluster.prototype.uid = ""; + GenerateClientCertificateRequest.prototype.publicKey = ""; /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance */ - Cluster.prototype.createTime = null; + GenerateClientCertificateRequest.create = function create(properties) { + return new GenerateClientCertificateRequest(properties); + }; /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.updateTime = null; + GenerateClientCertificateRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); + if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) + $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); + return writer; + }; /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Cluster.prototype.deleteTime = null; - - /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.labels = $util.emptyObject; - - /** - * Cluster state. - * @member {google.cloud.alloydb.v1beta.Cluster.State} state - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.state = 0; - - /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.clusterType = 0; - - /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.databaseVersion = 0; + GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.network = ""; + GenerateClientCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.pemCsr = reader.string(); + break; + } + case 4: { + message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.publicKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.prototype.etag = ""; + GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Verifies a GenerateClientCertificateRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.prototype.annotations = $util.emptyObject; + GenerateClientCertificateRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) { + var error = $root.google.protobuf.Duration.verify(message.certDuration); + if (error) + return "certDuration." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; + return null; + }; /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest */ - Cluster.prototype.reconciling = false; + GenerateClientCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.certDuration != null) { + if (typeof object.certDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.certDuration: object expected"); + message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + } + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + return message; + }; /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1beta.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Cluster.prototype.initialUser = null; + GenerateClientCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + object.pemCsr = ""; + object.certDuration = null; + object.publicKey = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) + object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + return object; + }; /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1beta.Cluster + * Converts this GenerateClientCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest * @instance + * @returns {Object.} JSON object */ - Cluster.prototype.automatedBackupPolicy = null; + GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Gets the default type url for GenerateClientCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Cluster.prototype.sslConfig = null; + GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest"; + }; - /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.encryptionConfig = null; + return GenerateClientCertificateRequest; + })(); - /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.encryptionInfo = null; + v1alpha.GenerateClientCertificateResponse = (function() { /** - * Cluster continuousBackupConfig. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null|undefined} continuousBackupConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Properties of a GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGenerateClientCertificateResponse + * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate + * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @property {string|null} [caCert] GenerateClientCertificateResponse caCert */ - Cluster.prototype.continuousBackupConfig = null; /** - * Cluster continuousBackupInfo. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null|undefined} continuousBackupInfo - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance + * Constructs a new GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GenerateClientCertificateResponse. + * @implements IGenerateClientCertificateResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set */ - Cluster.prototype.continuousBackupInfo = null; + function GenerateClientCertificateResponse(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateResponse pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @instance */ - Cluster.prototype.secondaryConfig = null; + GenerateClientCertificateResponse.prototype.pemCertificate = ""; /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateResponse pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @instance */ - Cluster.prototype.primaryConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.Cluster + * GenerateClientCertificateResponse caCert. + * @member {string} caCert + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @instance */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + GenerateClientCertificateResponse.prototype.caCert = ""; /** - * Creates a new Cluster instance using the specified properties. + * Creates a new GenerateClientCertificateResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster instance + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance */ - Cluster.create = function create(properties) { - return new Cluster(properties); + GenerateClientCertificateResponse.create = function create(properties) { + return new GenerateClientCertificateResponse(properties); }; /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encode = function encode(message, writer) { + GenerateClientCertificateResponse.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1beta.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1beta.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); - if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); return writer; }; /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { + GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Cluster message from the specified reader or buffer. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decode = function decode(reader, length) { + GenerateClientCertificateResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.decode(reader, reader.uint32()); - break; - } case 1: { - message.name = reader.string(); + message.pemCertificate = reader.string(); break; } case 2: { - message.displayName = reader.string(); + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); break; } case 3: { - message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - 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; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 27: { - message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.decode(reader, reader.uint32()); - break; - } - case 28: { - message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + message.caCert = reader.string(); break; } default: @@ -41014,531 +42110,9620 @@ }; /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decodeDelimited = function decodeDelimited(reader) { + GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Cluster message. + * Verifies a GenerateClientCertificateResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Cluster.verify = function verify(message) { + GenerateClientCertificateResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] 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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.caCert != null && message.hasOwnProperty("caCert")) + if (!$util.isString(message.caCert)) + return "caCert: string expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + */ + GenerateClientCertificateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (object.caCert != null) + message.caCert = String(object.caCert); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.pemCertificate = ""; + object.caCert = ""; } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; } - 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.caCert != null && message.hasOwnProperty("caCert")) + object.caCert = message.caCert; + return object; + }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse"; + }; + + return GenerateClientCertificateResponse; + })(); + + v1alpha.GetConnectionInfoRequest = (function() { + + /** + * Properties of a GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetConnectionInfoRequest + * @property {string|null} [parent] GetConnectionInfoRequest parent + * @property {string|null} [requestId] GetConnectionInfoRequest requestId + */ + + /** + * Constructs a new GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetConnectionInfoRequest. + * @implements IGetConnectionInfoRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set + */ + function GetConnectionInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionInfoRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.parent = ""; + + /** + * GetConnectionInfoRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.requestId = ""; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest instance + */ + GetConnectionInfoRequest.create = function create(properties) { + return new GetConnectionInfoRequest(properties); + }; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: + reader.skipType(tag & 7); break; } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1beta.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify(message.continuousBackupConfig); - if (error) - return "continuousBackupConfig." + error; - } - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify(message.continuousBackupInfo); - if (error) - return "continuousBackupInfo." + error; } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; + return message; + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionInfoRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionInfoRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + */ + GetConnectionInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify(message.primaryConfig); - if (error) - return "primaryConfig." + error; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - return null; + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetConnectionInfoRequest"; }; - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster - */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.fromObject(object.migrationSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.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.alloydb.v1beta.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; + return GetConnectionInfoRequest; + })(); + + v1alpha.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.alloydb.v1alpha.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 batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchCreateInstancesMetadata = null; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.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"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.OperationMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1alpha.ListUsersRequest = (function() { + + /** + * Properties of a ListUsersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy + */ + + /** + * Constructs a new ListUsersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set + */ + function ListUsersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.parent = ""; + + /** + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageSize = 0; + + /** + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest instance + */ + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); + }; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + */ + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListUsersRequest} message ListUsersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListUsersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersRequest"; + }; + + return ListUsersRequest; + })(); + + v1alpha.ListUsersResponse = (function() { + + /** + * Properties of a ListUsersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable + */ + + /** + * Constructs a new ListUsersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set + */ + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.users = $util.emptyArray; + + /** + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.nextPageToken = ""; + + /** + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse instance + */ + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1alpha.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + */ + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1alpha.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1alpha.GetUserRequest = (function() { + + /** + * Properties of a GetUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name + */ + + /** + * Constructs a new GetUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set + */ + function GetUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @instance + */ + GetUserRequest.prototype.name = ""; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest instance + */ + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.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 GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); + 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 GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.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 GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.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 GetUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1alpha.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.parent = ""; + + /** + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.userId = ""; + + /** + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; + + /** + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest instance + */ + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); + }; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.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.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserRequest.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.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + */ + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateUserRequest} message CreateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateUserRequest"; + }; + + return CreateUserRequest; + })(); + + v1alpha.UpdateUserRequest = (function() { + + /** + * Properties of an UpdateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing + */ + + /** + * Constructs a new UpdateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; + + /** + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.requestId = ""; + + /** + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateUserRequest"; + }; + + return UpdateUserRequest; + })(); + + v1alpha.DeleteUserRequest = (function() { + + /** + * Properties of a DeleteUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly + */ + + /** + * Constructs a new DeleteUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; + + /** + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.requestId = ""; + + /** + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteUserRequest"; + }; + + return DeleteUserRequest; + })(); + + return v1alpha; + })(); + + alloydb.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1beta = {}; + + /** + * InstanceView enum. + * @name google.cloud.alloydb.v1beta.InstanceView + * @enum {number} + * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value + * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value + * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value + */ + v1beta.InstanceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; + values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1beta.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1beta.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1beta.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + */ + v1beta.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + return values; + })(); + + v1beta.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.alloydb.v1beta + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set + */ + function UserPassword(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + */ + UserPassword.prototype.user = ""; + + /** + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + */ + UserPassword.prototype.password = ""; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UserPassword) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UserPassword"; + }; + + return UserPassword; + })(); + + v1beta.MigrationSource = (function() { + + /** + * Properties of a MigrationSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IMigrationSource + * @property {string|null} [hostPort] MigrationSource hostPort + * @property {string|null} [referenceId] MigrationSource referenceId + * @property {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + */ + + /** + * Constructs a new MigrationSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set + */ + function MigrationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.hostPort = ""; + + /** + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.referenceId = ""; + + /** + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.sourceType = 0; + + /** + * Creates a new MigrationSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource instance + */ + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); + }; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hostPort = reader.string(); + break; + } + case 2: { + message.referenceId = reader.string(); + break; + } + case 3: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (!$util.isString(message.hostPort)) + return "hostPort: string expected"; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + */ + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MigrationSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); + if (object.hostPort != null) + message.hostPort = String(object.hostPort); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DMS": + case 1: + message.sourceType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.MigrationSource} message MigrationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + object.hostPort = message.hostPort; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this MigrationSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + * @returns {Object.} JSON object + */ + MigrationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MigrationSource"; + }; + + /** + * MigrationSourceType enum. + * @name google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + * @enum {number} + * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DMS=1 DMS value + */ + MigrationSource.MigrationSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DMS"] = 1; + return values; + })(); + + return MigrationSource; + })(); + + v1beta.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1beta.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IEncryptionInfo + * @property {google.cloud.alloydb.v1beta.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.cloud.alloydb.v1beta.EncryptionInfo.Type} encryptionType + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.alloydb.v1beta.EncryptionInfo.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyVersions = []; + if (options.defaults) + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.cloud.alloydb.v1beta.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v1beta.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface ISslConfig + * @property {google.cloud.alloydb.v1beta.SslConfig.SslMode|null} [sslMode] SslConfig sslMode + * @property {google.cloud.alloydb.v1beta.SslConfig.CaSource|null} [caSource] SslConfig caSource + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig sslMode. + * @member {google.cloud.alloydb.v1beta.SslConfig.SslMode} sslMode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + */ + SslConfig.prototype.sslMode = 0; + + /** + * SslConfig caSource. + * @member {google.cloud.alloydb.v1beta.SslConfig.CaSource} caSource + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + */ + SslConfig.prototype.caSource = 0; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); + if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sslMode = reader.int32(); + break; + } + case 2: { + message.caSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + switch (message.sslMode) { + default: + return "sslMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.caSource != null && message.hasOwnProperty("caSource")) + switch (message.caSource) { + default: + return "caSource: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SslConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SslConfig(); + switch (object.sslMode) { + default: + if (typeof object.sslMode === "number") { + message.sslMode = object.sslMode; + break; + } + break; + case "SSL_MODE_UNSPECIFIED": + case 0: + message.sslMode = 0; + break; + case "SSL_MODE_ALLOW": + case 1: + message.sslMode = 1; + break; + case "SSL_MODE_REQUIRE": + case 2: + message.sslMode = 2; + break; + case "SSL_MODE_VERIFY_CA": + case 3: + message.sslMode = 3; + break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; + } + switch (object.caSource) { + default: + if (typeof object.caSource === "number") { + message.caSource = object.caSource; + break; + } + break; + case "CA_SOURCE_UNSPECIFIED": + case 0: + message.caSource = 0; + break; + case "CA_SOURCE_MANAGED": + case 1: + message.caSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; + object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + } + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] : message.sslMode; + if (message.caSource != null && message.hasOwnProperty("caSource")) + object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] : message.caSource; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SslConfig"; + }; + + /** + * SslMode enum. + * @name google.cloud.alloydb.v1beta.SslConfig.SslMode + * @enum {number} + * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value + * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value + * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value + * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value + */ + SslConfig.SslMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; + values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; + values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; + return values; + })(); + + /** + * CaSource enum. + * @name google.cloud.alloydb.v1beta.SslConfig.CaSource + * @enum {number} + * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value + * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value + */ + SslConfig.CaSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; + return values; + })(); + + return SslConfig; + })(); + + v1beta.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1beta + * @interface IAutomatedBackupPolicy + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention + * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled + * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig + * @property {string|null} [location] AutomatedBackupPolicy location + * @property {Object.|null} [labels] AutomatedBackupPolicy labels + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy weeklySchedule. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.weeklySchedule = null; + + /** + * AutomatedBackupPolicy timeBasedRetention. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.timeBasedRetention = null; + + /** + * AutomatedBackupPolicy quantityBasedRetention. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.quantityBasedRetention = null; + + /** + * AutomatedBackupPolicy enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.enabled = null; + + /** + * AutomatedBackupPolicy backupWindow. + * @member {google.protobuf.IDuration|null|undefined} backupWindow + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.backupWindow = null; + + /** + * AutomatedBackupPolicy encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.encryptionConfig = null; + + /** + * AutomatedBackupPolicy location. + * @member {string} location + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.location = ""; + + /** + * AutomatedBackupPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedBackupPolicy schedule. + * @member {"weeklySchedule"|undefined} schedule + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy retention. + * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { + get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + 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.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); + break; + } + case 5: { + message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); + break; + } + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); + if (error) + return "timeBasedRetention." + error; + } + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + if (properties.retention === 1) + return "retention: multiple values"; + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); + if (error) + return "quantityBasedRetention." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.protobuf.Duration.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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"; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(); + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); + } + if (object.timeBasedRetention != null) { + if (typeof object.timeBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.timeBasedRetention: object expected"); + message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); + } + if (object.quantityBasedRetention != null) { + if (typeof object.quantityBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.quantityBasedRetention: object expected"); + message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.backupWindow: object expected"); + message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.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]]); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.backupWindow = null; + object.location = ""; + object.encryptionConfig = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); + if (options.oneofs) + object.schedule = "weeklySchedule"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + object.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); + if (options.oneofs) + object.retention = "timeBasedRetention"; + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + object.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); + if (options.oneofs) + object.retention = "quantityBasedRetention"; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy"; + }; + + AutomatedBackupPolicy.WeeklySchedule = (function() { + + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface IWeeklySchedule + * @property {Array.|null} [startTimes] WeeklySchedule startTimes + * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek + */ + + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + this.startTimes = []; + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklySchedule startTimes. + * @member {Array.} startTimes + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.startTimes = $util.emptyArray; + + /** + * WeeklySchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimes != null && message.startTimes.length) + for (var i = 0; i < message.startTimes.length; ++i) + $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.startTimes && message.startTimes.length)) + message.startTimes = []; + message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimes != null && message.hasOwnProperty("startTimes")) { + if (!Array.isArray(message.startTimes)) + return "startTimes: array expected"; + for (var i = 0; i < message.startTimes.length; ++i) { + var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); + if (error) + return "startTimes." + error; + } + } + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); + if (object.startTimes) { + if (!Array.isArray(object.startTimes)) + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); + message.startTimes = []; + for (var i = 0; i < object.startTimes.length; ++i) { + if (typeof object.startTimes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); + message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + } + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTimes = []; + object.daysOfWeek = []; + } + if (message.startTimes && message.startTimes.length) { + object.startTimes = []; + for (var j = 0; j < message.startTimes.length; ++j) + object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule"; + }; + + return WeeklySchedule; + })(); + + AutomatedBackupPolicy.TimeBasedRetention = (function() { + + /** + * Properties of a TimeBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface ITimeBasedRetention + * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod + */ + + /** + * Constructs a new TimeBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a TimeBasedRetention. + * @implements ITimeBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + */ + function TimeBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeBasedRetention retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @instance + */ + TimeBasedRetention.prototype.retentionPeriod = null; + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance + */ + TimeBasedRetention.create = function create(properties) { + return new TimeBasedRetention(properties); + }; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + */ + TimeBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this TimeBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @instance + * @returns {Object.} JSON object + */ + TimeBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention"; + }; + + return TimeBasedRetention; + })(); + + AutomatedBackupPolicy.QuantityBasedRetention = (function() { + + /** + * Properties of a QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface IQuantityBasedRetention + * @property {number|null} [count] QuantityBasedRetention count + */ + + /** + * Constructs a new QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a QuantityBasedRetention. + * @implements IQuantityBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + */ + function QuantityBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedRetention count. + * @member {number} count + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + */ + QuantityBasedRetention.prototype.count = 0; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance + */ + QuantityBasedRetention.create = function create(properties) { + return new QuantityBasedRetention(properties); + }; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + return writer; + }; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + */ + QuantityBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention"; + }; + + return QuantityBasedRetention; + })(); + + return AutomatedBackupPolicy; + })(); + + v1beta.ContinuousBackupConfig = (function() { + + /** + * Properties of a ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + */ + + /** + * Constructs a new ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set + */ + function ContinuousBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.enabled = null; + + /** + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + + /** + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig instance + */ + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); + }; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 4: { + message.recoveryWindowDays = reader.int32(); + break; + } + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + */ + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionConfig = null; + object.recoveryWindowDays = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; + return object; + }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupConfig"; + }; + + return ContinuousBackupConfig; + })(); + + v1beta.ContinuousBackupInfo = (function() { + + /** + * Properties of a ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime + */ + + /** + * Constructs a new ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set + */ + function ContinuousBackupInfo(properties) { + this.schedule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.encryptionInfo = null; + + /** + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.enabledTime = null; + + /** + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + + /** + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.earliestRestorableTime = null; + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo instance + */ + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); + }; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); + writer.ldelim(); + } + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schedule && message.schedule.length)) + message.schedule = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.schedule.push(reader.int32()); + } else + message.schedule.push(reader.int32()); + break; + } + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { + default: + return "schedule: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + */ + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); + } + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { + default: + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.schedule[i] = 0; + break; + case "MONDAY": + case 1: + message.schedule[i] = 1; + break; + case "TUESDAY": + case 2: + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; + break; + } + } + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedule = []; + if (options.defaults) { + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupInfo"; + }; + + return ContinuousBackupInfo; + })(); + + v1beta.BackupSource = (function() { + + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ + + /** + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set + */ + function BackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; + + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; + + /** + * Creates a new BackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource instance + */ + BackupSource.create = function create(properties) { + return new BackupSource(properties); + }; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + return writer; + }; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.backupUid = reader.string(); + break; + } + case 1: { + message.backupName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; + } + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; + + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BackupSource"; + }; + + return BackupSource; + })(); + + v1beta.ContinuousBackupSource = (function() { + + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ + + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; + + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); + if (error) + return "pointInTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + */ + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} message ContinuousBackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.pointInTime = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupSource"; + }; + + return ContinuousBackupSource; + })(); + + v1beta.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.alloydb.v1beta + * @interface ICluster + * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1beta.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1beta.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1beta.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set + */ + function Cluster(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]]; + } + + /** + * Cluster backupSource. + * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.backupSource = null; + + /** + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1beta.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.migrationSource = null; + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.displayName = ""; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.deleteTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster state. + * @member {google.cloud.alloydb.v1beta.Cluster.State} state + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster clusterType. + * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.clusterType = 0; + + /** + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.databaseVersion = 0; + + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + + /** + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.network = ""; + + /** + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.etag = ""; + + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; + + /** + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.reconciling = false; + + /** + * Cluster initialUser. + * @member {google.cloud.alloydb.v1beta.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.initialUser = null; + + /** + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.automatedBackupPolicy = null; + + /** + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.sslConfig = null; + + /** + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + /** + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.encryptionInfo = null; + + /** + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.continuousBackupConfig = null; + + /** + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.continuousBackupInfo = null; + + /** + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.secondaryConfig = null; + + /** + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.primaryConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + 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 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1beta.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1beta.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 24: { + message.clusterType = reader.int32(); + break; + } + case 9: { + message.databaseVersion = reader.int32(); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + 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; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.decode(reader, reader.uint32()); + break; + } + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } + 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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1beta.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.fromObject(object.migrationSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.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.alloydb.v1beta.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "EMPTY": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.fromObject(object.networkConfig); + } + if (object.network != null) + message.network = String(object.network); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.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]]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.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.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; + object.etag = ""; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; + object.networkConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + 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]]; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.toObject(message.networkConfig, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster"; + }; + + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + Cluster.SecondaryConfig = (function() { + + /** + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + */ + + /** + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set + */ + function SecondaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @instance + */ + SecondaryConfig.prototype.primaryClusterName = ""; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig instance + */ + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); + }; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + return writer; + }; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryClusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecondaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecondaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; + return null; + }; + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + */ + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); + return message; + }; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} message SecondaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecondaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; + return object; + }; + + /** + * Converts this SecondaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @instance + * @returns {Object.} JSON object + */ + SecondaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecondaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.SecondaryConfig"; + }; + + return SecondaryConfig; + })(); + + Cluster.PrimaryConfig = (function() { + + /** + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + */ + + /** + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set + */ + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @instance + */ + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig instance + */ + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); + }; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + */ + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} message PrimaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; + } + return object; + }; + + /** + * Converts this PrimaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @instance + * @returns {Object.} JSON object + */ + PrimaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PrimaryConfig"; + }; + + return PrimaryConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1beta.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value + */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); + + return Cluster; + })(); + + v1beta.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.alloydb.v1beta + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1beta.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1beta.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1beta.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + 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]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance state. + * @member {google.cloud.alloydb.v1beta.Instance.State} state + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance instanceType. + * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance machineConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.machineConfig = null; + + /** + * Instance availabilityType. + * @member {google.cloud.alloydb.v1beta.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.availabilityType = 0; + + /** + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.gceZone = ""; + + /** + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.databaseFlags = $util.emptyObject; + + /** + * Instance writableNode. + * @member {google.cloud.alloydb.v1beta.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.writableNode = null; + + /** + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.nodes = $util.emptyArray; + + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; + + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; + + /** + * Instance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.ipAddress = ""; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance updatePolicy. + * @member {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null|undefined} updatePolicy + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.updatePolicy = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + 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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) + $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.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.alloydb.v1beta.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.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.alloydb.v1beta.Instance(), 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.uid = 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.instanceType = reader.int32(); + break; + } + case 10: { + message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.availabilityType = reader.int32(); + break; + } + case 12: { + message.gceZone = reader.string(); + break; + } + case 13: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { + 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; + } + case 22: { + message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.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.alloydb.v1beta.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.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.alloydb.v1beta.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.writableNode); + if (error) + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify(message.updatePolicy); + if (error) + return "updatePolicy." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.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.alloydb.v1beta.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.fromObject(object.machineConfig); + } + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.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]]); + } + if (object.updatePolicy != null) { + if (typeof object.updatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.updatePolicy: object expected"); + message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.fromObject(object.updatePolicy); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.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.arrays || options.defaults) + object.nodes = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.databaseFlags = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; + object.reconciling = false; + object.etag = ""; + object.writableNode = null; + object.queryInsightsConfig = null; + object.updatePolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + 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]]; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.nodes[j], options); + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) + object.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.toObject(message.updatePolicy, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.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.alloydb.v1beta.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.alloydb.v1beta.Instance"; + }; + + Instance.MachineConfig = (function() { + + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + */ + + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + return writer; + }; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + return null; + }; + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.MachineConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + return message; + }; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cpuCount = 0; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + return object; + }; + + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.MachineConfig"; + }; + + return MachineConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.zoneId = ""; + + /** + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.id = ""; + + /** + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.ip = ""; + + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.state = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.Node) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; + } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.Node"; + }; + + return Node; + })(); + + Instance.QueryInsightsInstanceConfig = (function() { + + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; + + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.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]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.continuousBackupConfig != null) { - if (typeof object.continuousBackupConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupConfig: object expected"); - message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); - } - if (object.continuousBackupInfo != null) { - if (typeof object.continuousBackupInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupInfo: object expected"); - message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.fromObject(object.primaryConfig); - } - return message; - }; + return null; + }; - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {google.cloud.alloydb.v1beta.Cluster} message Cluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cluster.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.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.continuousBackupConfig = null; - object.continuousBackupInfo = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - 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]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) - object.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) - object.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); - return object; - }; + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; - /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - * @returns {Object.} JSON object - */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; - /** - * Gets the default type url for Cluster - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster"; - }; + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Cluster.SecondaryConfig = (function() { + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig"; + }; + + return QueryInsightsInstanceConfig; + })(); + + Instance.ReadPoolConfig = (function() { /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount */ /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set */ - function SecondaryConfig(properties) { + function ReadPoolConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41546,75 +51731,75 @@ } /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @instance */ - SecondaryConfig.prototype.primaryClusterName = ""; + ReadPoolConfig.prototype.nodeCount = 0; /** - * Creates a new SecondaryConfig instance using the specified properties. + * Creates a new ReadPoolConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig instance + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig instance */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); }; /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecondaryConfig.encode = function encode(message, writer) { + ReadPoolConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); return writer; }; /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecondaryConfig message from the specified reader or buffer. + * Decodes a ReadPoolConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecondaryConfig.decode = function decode(reader, length) { + ReadPoolConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.primaryClusterName = reader.string(); + message.nodeCount = reader.int32(); break; } default: @@ -41626,123 +51811,122 @@ }; /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecondaryConfig message. + * Verifies a ReadPoolConfig message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecondaryConfig.verify = function verify(message) { + ReadPoolConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; return null; }; /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); + var message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; return message; }; /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static - * @param {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} message SecondaryConfig + * @param {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} message ReadPoolConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecondaryConfig.toObject = function toObject(message, options) { + ReadPoolConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; return object; }; /** - * Converts this SecondaryConfig to JSON. + * Converts this ReadPoolConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @instance * @returns {Object.} JSON object */ - SecondaryConfig.prototype.toJSON = function toJSON() { + ReadPoolConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SecondaryConfig + * Gets the default type url for ReadPoolConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.SecondaryConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ReadPoolConfig"; }; - return SecondaryConfig; + return ReadPoolConfig; })(); - Cluster.PrimaryConfig = (function() { + Instance.UpdatePolicy = (function() { /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + * Properties of an UpdatePolicy. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IUpdatePolicy + * @property {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode */ /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig + * Constructs a new UpdatePolicy. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents an UpdatePolicy. + * @implements IUpdatePolicy * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; + function UpdatePolicy(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41750,78 +51934,75 @@ } /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * UpdatePolicy mode. + * @member {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode} mode + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @instance */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + UpdatePolicy.prototype.mode = 0; /** - * Creates a new PrimaryConfig instance using the specified properties. + * Creates a new UpdatePolicy instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig instance + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy instance */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); + UpdatePolicy.create = function create(properties) { + return new UpdatePolicy(properties); }; /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrimaryConfig.encode = function encode(message, writer) { + UpdatePolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); return writer; }; /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrimaryConfig message from the specified reader or buffer. + * Decodes an UpdatePolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrimaryConfig.decode = function decode(reader, length) { + UpdatePolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); + message.mode = reader.int32(); break; } default: @@ -41833,206 +52014,536 @@ }; /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrimaryConfig message. + * Verifies an UpdatePolicy message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrimaryConfig.verify = function verify(message) { + UpdatePolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + UpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + var message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DEFAULT": + case 1: + message.mode = 1; + break; + case "FORCE_APPLY": + case 2: + message.mode = 2; + break; } return message; }; /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static - * @param {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} message PrimaryConfig + * @param {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} message UpdatePolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrimaryConfig.toObject = function toObject(message, options) { + UpdatePolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] : message.mode; return object; }; /** - * Converts this PrimaryConfig to JSON. + * Converts this UpdatePolicy to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @instance * @returns {Object.} JSON object */ - PrimaryConfig.prototype.toJSON = function toJSON() { + UpdatePolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrimaryConfig + * Gets the default type url for UpdatePolicy * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PrimaryConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.UpdatePolicy"; }; - return PrimaryConfig; + /** + * Mode enum. + * @name google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} FORCE_APPLY=2 FORCE_APPLY value + */ + UpdatePolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "FORCE_APPLY"] = 2; + return values; + })(); + + return UpdatePolicy; })(); /** * State enum. - * @name google.cloud.alloydb.v1beta.Cluster.State + * @name google.cloud.alloydb.v1beta.Instance.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} READY=1 READY value * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value * @property {number} PROMOTING=9 PROMOTING value */ - Cluster.State = (function() { + Instance.State = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "READY"] = 1; values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; values[valuesById[9] = "PROMOTING"] = 9; return values; })(); /** - * ClusterType enum. - * @name google.cloud.alloydb.v1beta.Cluster.ClusterType + * InstanceType enum. + * @name google.cloud.alloydb.v1beta.Instance.InstanceType * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); + + /** + * AvailabilityType enum. + * @name google.cloud.alloydb.v1beta.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + return Instance; + })(); + + v1beta.ConnectionInfo = (function() { + + /** + * Properties of a ConnectionInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IConnectionInfo + * @property {string|null} [name] ConnectionInfo name + * @property {string|null} [ipAddress] ConnectionInfo ipAddress + * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain + * @property {string|null} [instanceUid] ConnectionInfo instanceUid + */ + + /** + * Constructs a new ConnectionInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ConnectionInfo. + * @implements IConnectionInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set + */ + function ConnectionInfo(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionInfo name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.name = ""; + + /** + * ConnectionInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.ipAddress = ""; + + /** + * ConnectionInfo pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + + /** + * ConnectionInfo instanceUid. + * @member {string} instanceUid + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.instanceUid = ""; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo instance + */ + ConnectionInfo.create = function create(properties) { + return new ConnectionInfo(properties); + }; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.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.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); + if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); + return writer; + }; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ipAddress = reader.string(); + break; + } + case 3: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 4: { + message.instanceUid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionInfo.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.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + if (!$util.isString(message.instanceUid)) + return "instanceUid: string expected"; + return null; + }; + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + */ + ConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ConnectionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1beta.ConnectionInfo.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.instanceUid != null) + message.instanceUid = String(object.instanceUid); + return message; + }; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.ConnectionInfo} message ConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.name = ""; + object.ipAddress = ""; + object.instanceUid = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + object.instanceUid = message.instanceUid; + return object; + }; + + /** + * Converts this ConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + ConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); + ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ConnectionInfo"; + }; - return Cluster; + return ConnectionInfo; })(); - v1beta.Instance = (function() { + v1beta.Backup = (function() { /** - * Properties of an Instance. + * Properties of a Backup. * @memberof google.cloud.alloydb.v1beta - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1beta.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1beta.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1beta.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1beta.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1beta.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime */ /** - * Constructs a new Instance. + * Constructs a new Backup. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an Instance. - * @implements IInstance + * @classdesc Represents a Backup. + * @implements IBackup * @constructor - * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set */ - function Instance(properties) { + function Backup(properties) { this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; this.annotations = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -42041,195 +52552,179 @@ } /** - * Instance name. + * Backup name. * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.name = ""; + Backup.prototype.name = ""; /** - * Instance displayName. + * Backup displayName. * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.displayName = ""; + Backup.prototype.displayName = ""; /** - * Instance uid. + * Backup uid. * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.uid = ""; + Backup.prototype.uid = ""; /** - * Instance createTime. + * Backup createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.createTime = null; + Backup.prototype.createTime = null; /** - * Instance updateTime. + * Backup updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.updateTime = null; + Backup.prototype.updateTime = null; /** - * Instance deleteTime. + * Backup deleteTime. * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.deleteTime = null; + Backup.prototype.deleteTime = null; /** - * Instance labels. + * Backup labels. * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance state. - * @member {google.cloud.alloydb.v1beta.Instance.State} state - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.instanceType = 0; + Backup.prototype.labels = $util.emptyObject; /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup state. + * @member {google.cloud.alloydb.v1beta.Backup.State} state + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.machineConfig = null; + Backup.prototype.state = 0; /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1beta.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup type. + * @member {google.cloud.alloydb.v1beta.Backup.Type} type + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.availabilityType = 0; + Backup.prototype.type = 0; /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.gceZone = ""; + Backup.prototype.description = ""; /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.databaseFlags = $util.emptyObject; + Backup.prototype.clusterUid = ""; /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1beta.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.writableNode = null; + Backup.prototype.clusterName = ""; /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.nodes = $util.emptyArray; + Backup.prototype.reconciling = false; /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.queryInsightsConfig = null; + Backup.prototype.encryptionConfig = null; /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.readPoolConfig = null; + Backup.prototype.encryptionInfo = null; /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.ipAddress = ""; + Backup.prototype.etag = ""; /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.reconciling = false; + Backup.prototype.annotations = $util.emptyObject; /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.etag = ""; + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Instance + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1beta.Backup * @instance */ - Instance.prototype.annotations = $util.emptyObject; + Backup.prototype.expiryTime = null; /** - * Creates a new Instance instance using the specified properties. + * Creates a new Backup instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static - * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance} Instance instance + * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Backup} Backup instance */ - Instance.create = function create(properties) { - return new Instance(properties); + Backup.create = function create(properties) { + return new Backup(properties); }; /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static - * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encode = function encode(message, writer) { + Backup.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -42242,73 +52737,67 @@ $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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static - * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { + Backup.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a Backup message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance} Instance + * @returns {google.cloud.alloydb.v1beta.Backup} Backup * @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) { + Backup.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -42332,11 +52821,11 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 6: { + case 15: { message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 7: { + case 6: { if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; @@ -42359,80 +52848,43 @@ message.labels[key] = value; break; } - case 8: { + case 7: { message.state = reader.int32(); break; } + case 8: { + message.type = reader.int32(); + break; + } case 9: { - message.instanceType = reader.int32(); + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); break; } case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.decode(reader, reader.uint32()); + message.clusterName = reader.string(); break; } case 11: { - message.availabilityType = reader.int32(); + message.reconciling = reader.bool(); break; } case 12: { - message.gceZone = reader.string(); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); break; } case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - 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.databaseFlags[key] = value; - break; - } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32()); - break; - } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); break; } case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.ipAddress = reader.string(); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { message.etag = reader.string(); break; } - case 18: { + case 16: { if (message.annotations === $util.emptyObject) message.annotations = {}; var end2 = reader.uint32() + reader.pos; @@ -42455,6 +52907,14 @@ message.annotations[key] = value; break; } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -42464,30 +52924,30 @@ }; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a Backup message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance} Instance + * @returns {google.cloud.alloydb.v1beta.Backup} Backup * @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) { + Backup.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Instance message. + * Verifies a Backup message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @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) { + Backup.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -42531,77 +52991,40 @@ case 2: case 3: case 4: - case 5: - case 6: - case 8: - case 9: break; } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "instanceType: enum value expected"; + return "type: enum value expected"; case 0: case 1: case 2: case 3: break; } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { - default: - return "availabilityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); if (error) - return "queryInsightsConfig." + error; + return "encryptionConfig." + error; } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); if (error) - return "readPoolConfig." + error; + return "encryptionInfo." + error; } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; if (message.etag != null && message.hasOwnProperty("etag")) if (!$util.isString(message.etag)) return "etag: string expected"; @@ -42613,21 +53036,29 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } return null; }; /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * Creates a Backup message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance} Instance + * @returns {google.cloud.alloydb.v1beta.Backup} Backup */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance) + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Backup) return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance(); + var message = new $root.google.cloud.alloydb.v1beta.Backup(); if (object.name != null) message.name = String(object.name); if (object.displayName != null) @@ -42636,22 +53067,22 @@ message.uid = String(object.uid); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.createTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.Backup.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.alloydb.v1beta.Instance.updateTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.Backup.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.deleteTime != null) { if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.deleteTime: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.Backup.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.labels: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.Backup.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]]); @@ -42671,11 +53102,11 @@ case 1: message.state = 1; break; - case "STOPPED": + case "CREATING": case 2: message.state = 2; break; - case "CREATING": + case "FAILED": case 3: message.state = 3; break; @@ -42683,140 +53114,90 @@ case 4: message.state = 4; break; - case "MAINTENANCE": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; } - switch (object.instanceType) { + switch (object.type) { default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; + if (typeof object.type === "number") { + message.type = object.type; break; } break; - case "INSTANCE_TYPE_UNSPECIFIED": + case "TYPE_UNSPECIFIED": case 0: - message.instanceType = 0; + message.type = 0; break; - case "PRIMARY": + case "ON_DEMAND": case 1: - message.instanceType = 1; + message.type = 1; break; - case "READ_POOL": + case "AUTOMATED": case 2: - message.instanceType = 2; + message.type = 2; break; - case "SECONDARY": + case "CONTINUOUS": case 3: - message.instanceType = 3; - break; - } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { - default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; - break; - } - break; - case "AVAILABILITY_TYPE_UNSPECIFIED": - case 0: - message.availabilityType = 0; - break; - case "ZONAL": - case 1: - message.availabilityType = 1; - break; - case "REGIONAL": - case 2: - message.availabilityType = 2; + message.type = 3; break; } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); if (object.reconciling != null) message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } if (object.etag != null) message.etag = String(object.etag); if (object.annotations) { if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.annotations: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.Backup.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]]); } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } return message; }; /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. + * Creates a plain object from a Backup message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static - * @param {google.cloud.alloydb.v1beta.Instance} message Instance + * @param {google.cloud.alloydb.v1beta.Backup} message Backup * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Instance.toObject = function toObject(message, options) { + Backup.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; if (options.objects || options.defaults) { object.labels = {}; - object.databaseFlags = {}; object.annotations = {}; } if (options.defaults) { @@ -42825,18 +53206,22 @@ object.uid = ""; object.createTime = null; object.updateTime = null; - object.deleteTime = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -42848,8 +53233,6 @@ 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -42857,568 +53240,608 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; if (message.reconciling != null && message.hasOwnProperty("reconciling")) object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); if (message.etag != null && message.hasOwnProperty("etag")) object.etag = message.etag; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); 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]]; } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.nodes[j], options); - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); return object; }; /** - * Converts this Instance to JSON. + * Converts this Backup to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @instance * @returns {Object.} JSON object */ - Instance.prototype.toJSON = function toJSON() { + Backup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Instance + * Gets the default type url for Backup * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance + * @memberof google.cloud.alloydb.v1beta.Backup * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup"; }; - Instance.MachineConfig = (function() { - - /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount - */ - - /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set - */ - function MachineConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.cpuCount = 0; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig instance - */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); - }; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - return writer; - }; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * State enum. + * @name google.cloud.alloydb.v1beta.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Type enum. + * @name google.cloud.alloydb.v1beta.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); - /** - * Verifies a MachineConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MachineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - return null; - }; + return Backup; + })(); - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.MachineConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - return message; - }; + v1beta.SupportedDatabaseFlag = (function() { - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.MachineConfig} message MachineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MachineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cpuCount = 0; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - return object; - }; + /** + * Properties of a SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1beta + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + */ - /** - * Converts this MachineConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @instance - * @returns {Object.} JSON object - */ - MachineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag + * @constructor + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set + */ + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Gets the default type url for MachineConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.MachineConfig"; - }; + /** + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.stringRestrictions = null; - return MachineConfig; - })(); + /** + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.integerRestrictions = null; - Instance.Node = (function() { + /** + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.name = ""; - /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state - */ + /** + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.flagName = ""; - /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.valueType = 0; - /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; + /** + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.id = ""; + /** + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.ip = ""; + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.state = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); - return writer; - }; + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag instance + */ + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); + }; - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.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.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flagName = reader.string(); + break; + } + case 3: { + message.valueType = reader.int32(); + break; + } + case 4: { + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - return null; - }; + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.Node) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); - return message; - }; + /** + * Verifies a SupportedDatabaseFlag message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedDatabaseFlag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); + if (error) + return "stringRestrictions." + error; + } + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + return null; + }; - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + */ + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } + if (object.name != null) + message.name = String(object.name); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - return object; - }; + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; + } + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + return message; + }; - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedDatabaseFlag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; + if (options.defaults) { + object.name = ""; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; + } + return object; + }; - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.Node"; - }; + /** + * Converts this SupportedDatabaseFlag to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + * @returns {Object.} JSON object + */ + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Node; - })(); + /** + * Gets the default type url for SupportedDatabaseFlag + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag"; + }; - Instance.QueryInsightsInstanceConfig = (function() { + SupportedDatabaseFlag.StringRestrictions = (function() { /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues */ /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set */ - function QueryInsightsInstanceConfig(properties) { + function StringRestrictions(properties) { + this.allowedValues = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43426,153 +53849,78 @@ } /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @instance */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); + StringRestrictions.prototype.allowedValues = $util.emptyArray; /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * Creates a new StringRestrictions instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); }; /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { + StringRestrictions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); return writer; }; /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * Decodes a StringRestrictions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryInsightsInstanceConfig.decode = function decode(reader, length) { + StringRestrictions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); break; } default: @@ -43584,159 +53932,135 @@ }; /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryInsightsInstanceConfig message. + * Verifies a StringRestrictions message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryInsightsInstanceConfig.verify = function verify(message) { + StringRestrictions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; } return null; }; /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } return message; }; /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + StringRestrictions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; } return object; }; /** - * Converts this QueryInsightsInstanceConfig to JSON. + * Converts this StringRestrictions to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @instance * @returns {Object.} JSON object */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + StringRestrictions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryInsightsInstanceConfig + * Gets the default type url for StringRestrictions * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions"; }; - return QueryInsightsInstanceConfig; + return StringRestrictions; })(); - Instance.ReadPoolConfig = (function() { + SupportedDatabaseFlag.IntegerRestrictions = (function() { /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue */ /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set */ - function ReadPoolConfig(properties) { + function IntegerRestrictions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43744,75 +54068,89 @@ } /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @instance */ - ReadPoolConfig.prototype.nodeCount = 0; + IntegerRestrictions.prototype.minValue = null; /** - * Creates a new ReadPoolConfig instance using the specified properties. + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig instance + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); }; /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadPoolConfig.encode = function encode(message, writer) { + IntegerRestrictions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. + * Decodes an IntegerRestrictions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadPoolConfig.decode = function decode(reader, length) { + IntegerRestrictions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.nodeCount = reader.int32(); + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; } default: @@ -43824,1518 +54162,1688 @@ }; /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadPoolConfig message. + * Verifies an IntegerRestrictions message. * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadPoolConfig.verify = function verify(message) { + IntegerRestrictions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } return null; }; - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); + + /** + * ValueType enum. + * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value + */ + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + return SupportedDatabaseFlag; + })(); + + v1beta.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.alloydb.v1beta + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1beta.User.UserType|null} [userType] User userType + */ + + /** + * Constructs a new User. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set + */ + function User(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.name = ""; + + /** + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.password = ""; + + /** + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.databaseRoles = $util.emptyArray; + + /** + * User userType. + * @member {google.cloud.alloydb.v1beta.User.UserType} userType + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.userType = 0; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.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.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 4: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); + break; + } + case 5: { + message.userType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.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.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.User) + return object; + var message = new $root.google.cloud.alloydb.v1beta.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1beta.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) { + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; + } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] : message.userType; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.User"; + }; + + /** + * UserType enum. + * @name google.cloud.alloydb.v1beta.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value + */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; + })(); + + v1beta.AlloyDBAdmin = (function() { + + /** + * Constructs a new AlloyDBAdmin service. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an AlloyDBAdmin + * @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 AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1beta.ListClustersRequest, $root.google.cloud.alloydb.v1beta.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1beta.GetClusterRequest, $root.google.cloud.alloydb.v1beta.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1beta.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1beta.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1beta.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ReadPoolConfig"; - }; + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - return ReadPoolConfig; - })(); + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1beta.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); /** - * State enum. - * @name google.cloud.alloydb.v1beta.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); /** - * InstanceType enum. - * @name google.cloud.alloydb.v1beta.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; - return values; - })(); /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1beta.Instance.AvailabilityType - * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Instance.AvailabilityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - return values; - })(); + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1beta.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); - return Instance; - })(); + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - v1beta.ConnectionInfo = (function() { + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ /** - * Properties of a ConnectionInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IConnectionInfo - * @property {string|null} [name] ConnectionInfo name - * @property {string|null} [ipAddress] ConnectionInfo ipAddress - * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain - * @property {string|null} [instanceUid] ConnectionInfo instanceUid + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); /** - * Constructs a new ConnectionInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ConnectionInfo. - * @implements IConnectionInfo - * @constructor - * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function ConnectionInfo(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ConnectionInfo name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 */ - ConnectionInfo.prototype.name = ""; + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1beta.ListInstancesRequest, $root.google.cloud.alloydb.v1beta.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); /** - * ConnectionInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ConnectionInfo.prototype.ipAddress = ""; /** - * ConnectionInfo pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 */ - ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1beta.GetInstanceRequest, $root.google.cloud.alloydb.v1beta.Instance, request, callback); + }, "name", { value: "GetInstance" }); /** - * ConnectionInfo instanceUid. - * @member {string} instanceUid - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ConnectionInfo.prototype.instanceUid = ""; /** - * Creates a new ConnectionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ConnectionInfo.create = function create(properties) { - return new ConnectionInfo(properties); - }; /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ConnectionInfo.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.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); - if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1beta.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ConnectionInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.ipAddress = reader.string(); - break; - } - case 3: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 4: { - message.instanceUid = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); /** - * Verifies a ConnectionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ConnectionInfo.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.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: string expected"; - return null; - }; /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ConnectionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1beta.ConnectionInfo.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.instanceUid != null) - message.instanceUid = String(object.instanceUid); - return message; - }; /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.ConnectionInfo} message ConnectionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ConnectionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) { - object.name = ""; - object.ipAddress = ""; - object.instanceUid = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - object.instanceUid = message.instanceUid; - return object; - }; + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); /** - * Converts this ConnectionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ConnectionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ConnectionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ConnectionInfo"; - }; - - return ConnectionInfo; - })(); - v1beta.Backup = (function() { + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1beta - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1beta.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1beta.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function Backup(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]]; - } /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.name = ""; + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.displayName = ""; /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - Backup.prototype.uid = ""; /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.createTime = null; + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1beta.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.updateTime = null; /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - Backup.prototype.deleteTime = null; /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.labels = $util.emptyObject; + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1beta.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); /** - * Backup state. - * @member {google.cloud.alloydb.v1beta.Backup.State} state - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.state = 0; /** - * Backup type. - * @member {google.cloud.alloydb.v1beta.Backup.Type} type - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} [response] ListBackupsResponse */ - Backup.prototype.type = 0; /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 */ - Backup.prototype.description = ""; + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1beta.ListBackupsRequest, $root.google.cloud.alloydb.v1beta.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.clusterUid = ""; /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1beta.Backup + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 */ - Backup.prototype.clusterName = ""; + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1beta.GetBackupRequest, $root.google.cloud.alloydb.v1beta.Backup, request, callback); + }, "name", { value: "GetBackup" }); /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.reconciling = false; /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.Backup + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.encryptionConfig = null; + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1beta.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.encryptionInfo = null; /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Backup + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.etag = ""; + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1beta.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.annotations = $util.emptyObject; /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1beta.Backup + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1beta.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.expiryTime = null; /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Backup} Backup instance + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse */ - Backup.create = function create(properties) { - return new Backup(properties); - }; /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 */ - Backup.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - 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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GenerateClientCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse */ - Backup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup(), 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.uid = 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 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - 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 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); - break; - } - case 10: { - message.clusterName = reader.string(); - break; - } - case 11: { - message.reconciling = reader.bool(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 16: { - 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; - } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * @returns {undefined} + * @variation 1 */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { + return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, request, callback); + }, "name", { value: "GenerateClientCertificate" }); /** - * Verifies a Backup message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: 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.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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"; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - return null; - }; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Backup} Backup + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetConnectionInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ConnectionInfo} [response] ConnectionInfo */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Backup) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Backup(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.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.alloydb.v1beta.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ON_DEMAND": - case 1: - message.type = 1; - break; - case "AUTOMATED": - case 2: - message.type = 2; - break; - case "CONTINUOUS": - case 3: - message.type = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.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]]); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - return message; - }; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.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.uid = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; - object.reconciling = false; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - 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]]; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - return object; - }; + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { + return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1beta.ConnectionInfo, request, callback); + }, "name", { value: "GetConnectionInfo" }); /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Backup + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListUsersResponse} [response] ListUsersResponse */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup"; - }; /** - * State enum. - * @name google.cloud.alloydb.v1beta.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1beta.ListUsersRequest, $root.google.cloud.alloydb.v1beta.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); /** - * Type enum. - * @name google.cloud.alloydb.v1beta.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - return Backup; - })(); + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User + */ - v1beta.SupportedDatabaseFlag = (function() { + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1beta.GetUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "GetUser" }); /** - * Properties of a SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1beta - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag - * @constructor - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1beta.CreateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1beta.UpdateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "UpdateUser" }); /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - SupportedDatabaseFlag.prototype.name = ""; /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - SupportedDatabaseFlag.prototype.flagName = ""; + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1beta.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - SupportedDatabaseFlag.prototype.valueType = 0; + + return AlloyDBAdmin; + })(); + + v1beta.ListClustersRequest = (function() { /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @instance */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + ListClustersRequest.prototype.parent = ""; /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @instance */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + ListClustersRequest.prototype.pageSize = 0; /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @instance */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; + ListClustersRequest.prototype.pageToken = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @instance */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListClustersRequest.prototype.orderBy = ""; /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. + * Creates a new ListClustersRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag instance + * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest instance */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); }; /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SupportedDatabaseFlag.encode = function encode(message, writer) { + ListClustersRequest.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.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); - writer.ldelim(); - } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * Decodes a ListClustersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SupportedDatabaseFlag.decode = function decode(reader, length) { + ListClustersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.flagName = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.valueType = reader.int32(); + message.pageToken = reader.string(); break; } case 4: { - message.acceptsMultipleValues = reader.bool(); + message.filter = reader.string(); break; } case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); - } else - message.supportedDbVersions.push(reader.int32()); - break; - } - case 6: { - message.requiresDbRestart = reader.bool(); + message.orderBy = reader.string(); break; } default: @@ -45347,1613 +55855,1901 @@ }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SupportedDatabaseFlag message. + * Verifies a ListClustersRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SupportedDatabaseFlag.verify = function verify(message) { + ListClustersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { - default: - return "supportedDbVersions: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag - */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); - } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; - } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { - default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; - break; - } - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.supportedDbVersions[i] = 0; - break; - case "POSTGRES_13": - case 1: - message.supportedDbVersions[i] = 1; - break; - case "POSTGRES_14": - case 2: - message.supportedDbVersions[i] = 2; - break; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {google.cloud.alloydb.v1beta.ListClustersRequest} message ListClustersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { + ListClustersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedDbVersions = []; if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this SupportedDatabaseFlag to JSON. + * Converts this ListClustersRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @instance * @returns {Object.} JSON object */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + ListClustersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SupportedDatabaseFlag + * Gets the default type url for ListClustersRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersRequest"; }; - SupportedDatabaseFlag.StringRestrictions = (function() { - - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ - - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } - return null; - }; - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } - return message; - }; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } - return object; - }; - - /** - * Converts this StringRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @instance - * @returns {Object.} JSON object - */ - StringRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions"; - }; + return ListClustersRequest; + })(); - return StringRestrictions; - })(); + v1beta.ListClustersResponse = (function() { - SupportedDatabaseFlag.IntegerRestrictions = (function() { + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ - /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue - */ + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions - * @constructor - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - */ - function IntegerRestrictions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance - */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); - }; + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an IntegerRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.clusters[i]); if (error) - return "maxValue." + error; - } - return null; - }; - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + return "clusters." + error; } - return message; - }; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minValue = null; - object.maxValue = null; - } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersResponse) return object; - }; - - /** - * Converts this IntegerRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - * @returns {Object.} JSON object - */ - IntegerRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.clusters[i]); } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions"; - }; + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; - return IntegerRestrictions; - })(); + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; /** - * ValueType enum. - * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + * @returns {Object.} JSON object */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SupportedDatabaseFlag; + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersResponse"; + }; + + return ListClustersResponse; })(); - v1beta.AlloyDBAdmin = (function() { + v1beta.GetClusterRequest = (function() { /** - * Constructs a new AlloyDBAdmin service. + * Properties of a GetClusterRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an AlloyDBAdmin - * @extends $protobuf.rpc.Service + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1beta.ClusterView|null} [view] GetClusterRequest view + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest * @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 + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1beta.ClusterView} view + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.view = 0; + + /** + * Creates a new GetClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest * @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 {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest instance */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListClustersResponse} [response] ListClustersResponse + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1beta.ListClustersRequest, $root.google.cloud.alloydb.v1beta.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Cluster} [response] Cluster + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1beta.GetClusterRequest, $root.google.cloud.alloydb.v1beta.Cluster, request, callback); - }, "name", { value: "GetCluster" }); + GetClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CLUSTER_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CLUSTER_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": + case 2: + message.view = 2; + break; + } + return message; + }; /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.ClusterView[message.view] : message.view; + return object; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + * @returns {Object.} JSON object */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1beta.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1beta.CreateSecondaryClusterRequest = (function() { /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly */ /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set */ + function CreateSecondaryClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1beta.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); + CreateSecondaryClusterRequest.prototype.parent = ""; /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSecondaryClusterRequest.prototype.clusterId = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance */ + CreateSecondaryClusterRequest.prototype.cluster = null; /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1beta.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); + CreateSecondaryClusterRequest.prototype.requestId = ""; /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSecondaryClusterRequest.prototype.validateOnly = false; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef PromoteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance */ + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); + }; /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1beta.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); + CreateSecondaryClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateSecondaryClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1beta.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a CreateSecondaryClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + CreateSecondaryClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest */ + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * Converts this CreateSecondaryClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} [response] ListInstancesResponse + * Gets the default type url for CreateSecondaryClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest"; + }; + + return CreateSecondaryClusterRequest; + })(); + + v1beta.CreateClusterRequest = (function() { /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 + * Properties of a CreateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1beta.ListInstancesRequest, $root.google.cloud.alloydb.v1beta.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Instance} [response] Instance + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance */ + CreateClusterRequest.prototype.parent = ""; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1beta.GetInstanceRequest, $root.google.cloud.alloydb.v1beta.Instance, request, callback); - }, "name", { value: "GetInstance" }); + CreateClusterRequest.prototype.clusterId = ""; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateClusterRequest.prototype.cluster = null; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance */ + CreateClusterRequest.prototype.requestId = ""; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1beta.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); + CreateClusterRequest.prototype.validateOnly = false; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest instance */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateSecondaryInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { - return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryInstance" }); + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); + CreateClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1beta.UpdateClusterRequest = (function() { /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing */ /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); + UpdateClusterRequest.prototype.updateMask = null; /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateClusterRequest.prototype.cluster = null; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance */ + UpdateClusterRequest.prototype.requestId = ""; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); + UpdateClusterRequest.prototype.validateOnly = false; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateClusterRequest.prototype.allowMissing = false; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest instance */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1beta.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} [response] ListBackupsResponse + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1beta.ListBackupsRequest, $root.google.cloud.alloydb.v1beta.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Backup} [response] Backup + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1beta.GetBackupRequest, $root.google.cloud.alloydb.v1beta.Backup, request, callback); - }, "name", { value: "GetBackup" }); + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateClusterRequest"; + }; - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1beta.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); + return UpdateClusterRequest; + })(); + + v1beta.DeleteClusterRequest = (function() { /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force */ /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1beta.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); + DeleteClusterRequest.prototype.name = ""; /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteClusterRequest.prototype.requestId = ""; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance */ + DeleteClusterRequest.prototype.etag = ""; /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * DeleteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1beta.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); + DeleteClusterRequest.prototype.validateOnly = false; /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteClusterRequest.prototype.force = false; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest instance */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); + DeleteClusterRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GenerateClientCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DeleteClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - * @returns {undefined} - * @variation 1 + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { - return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, request, callback); - }, "name", { value: "GenerateClientCertificate" }); + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + DeleteClusterRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetConnectionInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ConnectionInfo} [response] ConnectionInfo + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest * @instance - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { - return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1beta.ConnectionInfo, request, callback); - }, "name", { value: "GetConnectionInfo" }); + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteClusterRequest"; + }; - return AlloyDBAdmin; + return DeleteClusterRequest; })(); - v1beta.ListClustersRequest = (function() { + v1beta.PromoteClusterRequest = (function() { /** - * Properties of a ListClustersRequest. + * Properties of a PromoteClusterRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly */ /** - * Constructs a new ListClustersRequest. + * Constructs a new PromoteClusterRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set */ - function ListClustersRequest(properties) { + function PromoteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46961,131 +57757,117 @@ } /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.parent = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @instance */ - ListClustersRequest.prototype.pageSize = 0; + PromoteClusterRequest.prototype.name = ""; /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @instance */ - ListClustersRequest.prototype.pageToken = ""; + PromoteClusterRequest.prototype.requestId = ""; /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @instance */ - ListClustersRequest.prototype.filter = ""; + PromoteClusterRequest.prototype.etag = ""; /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * PromoteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @instance */ - ListClustersRequest.prototype.orderBy = ""; + PromoteClusterRequest.prototype.validateOnly = false; /** - * Creates a new ListClustersRequest instance using the specified properties. + * Creates a new PromoteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest instance + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest instance */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); }; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersRequest.encode = function encode(message, writer) { + PromoteClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a PromoteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersRequest.decode = function decode(reader, length) { + PromoteClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.requestId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.etag = reader.string(); break; } case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -47097,159 +57879,153 @@ }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersRequest message. + * Verifies a PromoteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListClustersRequest.verify = function verify(message) { + PromoteClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersRequest) + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.ListClustersRequest} message ListClustersRequest + * @param {google.cloud.alloydb.v1beta.PromoteClusterRequest} message PromoteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersRequest.toObject = function toObject(message, options) { + PromoteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this ListClustersRequest to JSON. + * Converts this PromoteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @instance * @returns {Object.} JSON object */ - ListClustersRequest.prototype.toJSON = function toJSON() { + PromoteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersRequest + * Gets the default type url for PromoteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterRequest"; }; - return ListClustersRequest; + return PromoteClusterRequest; })(); - v1beta.ListClustersResponse = (function() { + v1beta.RestoreClusterRequest = (function() { /** - * Properties of a ListClustersResponse. + * Properties of a RestoreClusterRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1beta.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly */ /** - * Constructs a new ListClustersResponse. + * Constructs a new RestoreClusterRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; + function RestoreClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47257,109 +58033,173 @@ } /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @instance */ - ListClustersResponse.prototype.clusters = $util.emptyArray; + RestoreClusterRequest.prototype.backupSource = null; /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @instance */ - ListClustersResponse.prototype.nextPageToken = ""; + RestoreClusterRequest.prototype.continuousBackupSource = null; /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @instance */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; + RestoreClusterRequest.prototype.parent = ""; /** - * Creates a new ListClustersResponse instance using the specified properties. + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.clusterId = ""; + + /** + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.requestId = ""; + + /** + * RestoreClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse instance + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest instance */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); }; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encode = function encode(message, writer) { + RestoreClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes a RestoreClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decode = function decode(reader, length) { + RestoreClusterRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.clusterId = reader.string(); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); break; } default: @@ -47371,169 +58211,203 @@ }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersResponse message. + * Verifies a RestoreClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListClustersResponse.verify = function verify(message) { + RestoreClusterRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.clusters[i]); + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); if (error) - return "clusters." + error; + return "backupSource." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersResponse) + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.clusters[i]); - } + var message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.fromObject(object.continuousBackupSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1beta.ListClustersResponse} message ListClustersResponse + * @param {google.cloud.alloydb.v1beta.RestoreClusterRequest} message RestoreClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersResponse.toObject = function toObject(message, options) { + RestoreClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.clusters[j], options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; } return object; }; /** - * Converts this ListClustersResponse to JSON. + * Converts this RestoreClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @instance * @returns {Object.} JSON object */ - ListClustersResponse.prototype.toJSON = function toJSON() { + RestoreClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for RestoreClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreClusterRequest"; }; - return ListClustersResponse; + return RestoreClusterRequest; })(); - v1beta.GetClusterRequest = (function() { + v1beta.ListInstancesRequest = (function() { /** - * Properties of a GetClusterRequest. + * Properties of a ListInstancesRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy */ /** - * Constructs a new GetClusterRequest. + * Constructs a new ListInstancesRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set */ - function GetClusterRequest(properties) { + function ListInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47541,75 +58415,131 @@ } /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @instance */ - GetClusterRequest.prototype.name = ""; + ListInstancesRequest.prototype.parent = ""; /** - * Creates a new GetClusterRequest instance using the specified properties. + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest instance + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest instance */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetClusterRequest.encode = function encode(message, writer) { + ListInstancesRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetClusterRequest.decode = function decode(reader, length) { + ListInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -47621,126 +58551,159 @@ }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetClusterRequest message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetClusterRequest.verify = function verify(message) { + ListInstancesRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetClusterRequest) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.GetClusterRequest} message GetClusterRequest + * @param {google.cloud.alloydb.v1beta.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetClusterRequest.toObject = function toObject(message, options) { + ListInstancesRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this GetClusterRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - GetClusterRequest.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetClusterRequest + * Gets the default type url for ListInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesRequest"; }; - return GetClusterRequest; + return ListInstancesRequest; })(); - v1beta.CreateSecondaryClusterRequest = (function() { + v1beta.ListInstancesResponse = (function() { /** - * Properties of a CreateSecondaryClusterRequest. + * Properties of a ListInstancesResponse. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateSecondaryClusterRequest - * @property {string|null} [parent] CreateSecondaryClusterRequest parent - * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster - * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable */ /** - * Constructs a new CreateSecondaryClusterRequest. + * Constructs a new ListInstancesResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set */ - function CreateSecondaryClusterRequest(properties) { + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47748,131 +58711,109 @@ } /** - * CreateSecondaryClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.parent = ""; - - /** - * CreateSecondaryClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.clusterId = ""; - - /** - * CreateSecondaryClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @instance */ - CreateSecondaryClusterRequest.prototype.cluster = null; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * CreateSecondaryClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @instance */ - CreateSecondaryClusterRequest.prototype.requestId = ""; + ListInstancesResponse.prototype.nextPageToken = ""; /** - * CreateSecondaryClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @instance */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; + ListInstancesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * Creates a new ListInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse instance */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); }; /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryClusterRequest.encode = function encode(message, writer) { + ListInstancesResponse.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryClusterRequest.decode = function decode(reader, length) { + ListInstancesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); break; } case 2: { - message.clusterId = reader.string(); + message.nextPageToken = reader.string(); break; } case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -47884,164 +58825,170 @@ }; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecondaryClusterRequest message. + * Verifies a ListInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSecondaryClusterRequest.verify = function verify(message) { + ListInstancesResponse.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.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; return null; }; /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + var message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} message ListInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateSecondaryClusterRequest to JSON. + * Converts this ListInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @instance * @returns {Object.} JSON object */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + ListInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecondaryClusterRequest + * Gets the default type url for ListInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesResponse"; }; - return CreateSecondaryClusterRequest; + return ListInstancesResponse; })(); - v1beta.CreateClusterRequest = (function() { + v1beta.GetInstanceRequest = (function() { /** - * Properties of a CreateClusterRequest. + * Properties of a GetInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1beta.InstanceView|null} [view] GetInstanceRequest view */ /** - * Constructs a new CreateClusterRequest. + * Constructs a new GetInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set */ - function CreateClusterRequest(properties) { + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48049,131 +58996,89 @@ } /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; - - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.clusterId = ""; - - /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; - - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @instance */ - CreateClusterRequest.prototype.requestId = ""; + GetInstanceRequest.prototype.name = ""; /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1beta.InstanceView} view + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @instance */ - CreateClusterRequest.prototype.validateOnly = false; + GetInstanceRequest.prototype.view = 0; /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new GetInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest instance + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest instance */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); }; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClusterRequest.encode = function encode(message, writer) { + GetInstanceRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClusterRequest.decode = function decode(reader, length) { + 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.alloydb.v1beta.CreateClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); + message.view = reader.int32(); break; } default: @@ -48185,164 +59090,159 @@ }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClusterRequest message. + * Verifies a GetInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateClusterRequest.verify = function verify(message) { + GetInstanceRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateClusterRequest) + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + var message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.CreateClusterRequest} message CreateClusterRequest + * @param {google.cloud.alloydb.v1beta.GetInstanceRequest} message GetInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClusterRequest.toObject = function toObject(message, options) { + GetInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; + object.name = ""; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.InstanceView[message.view] : message.view; return object; }; /** - * Converts this CreateClusterRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateClusterRequest.prototype.toJSON = function toJSON() { + GetInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateClusterRequest + * Gets the default type url for GetInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetInstanceRequest"; }; - return CreateClusterRequest; + return GetInstanceRequest; })(); - v1beta.UpdateClusterRequest = (function() { + v1beta.CreateInstanceRequest = (function() { /** - * Properties of an UpdateClusterRequest. + * Properties of a CreateInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly */ /** - * Constructs a new UpdateClusterRequest. + * Constructs a new CreateInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set */ - function UpdateClusterRequest(properties) { + function CreateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48350,131 +59250,131 @@ } /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance */ - UpdateClusterRequest.prototype.updateMask = null; + CreateInstanceRequest.prototype.parent = ""; /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance */ - UpdateClusterRequest.prototype.cluster = null; + CreateInstanceRequest.prototype.instanceId = ""; /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance */ - UpdateClusterRequest.prototype.requestId = ""; + CreateInstanceRequest.prototype.instance = null; /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance */ - UpdateClusterRequest.prototype.validateOnly = false; + CreateInstanceRequest.prototype.requestId = ""; /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance */ - UpdateClusterRequest.prototype.allowMissing = false; + CreateInstanceRequest.prototype.validateOnly = false; /** - * Creates a new UpdateClusterRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest instance */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClusterRequest.encode = function encode(message, writer) { + CreateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateClusterRequest.decode = function decode(reader, length) { + 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.alloydb.v1beta.UpdateClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; } case 3: { - message.requestId = reader.string(); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); break; } case 4: { - message.validateOnly = reader.bool(); + message.requestId = reader.string(); break; } case 5: { - message.allowMissing = reader.bool(); + message.validateOnly = reader.bool(); break; } default: @@ -48486,41 +59386,42 @@ }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateClusterRequest message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateClusterRequest.verify = function verify(message) { + CreateInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + 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.alloydb.v1beta.Instance.verify(message.instance); if (error) - return "cluster." + error; + return "instance." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) @@ -48528,127 +59429,121 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateClusterRequest) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + var message = new $root.google.cloud.alloydb.v1beta.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.alloydb.v1beta.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.UpdateClusterRequest} message UpdateClusterRequest + * @param {google.cloud.alloydb.v1beta.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateClusterRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.cluster = null; + object.parent = ""; + object.instanceId = ""; + object.instance = null; object.requestId = ""; object.validateOnly = false; - object.allowMissing = false; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + 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.alloydb.v1beta.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateClusterRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateClusterRequest + * Gets the default type url for CreateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequest"; }; - return UpdateClusterRequest; + return CreateInstanceRequest; })(); - v1beta.DeleteClusterRequest = (function() { + v1beta.CreateSecondaryInstanceRequest = (function() { /** - * Properties of a DeleteClusterRequest. + * Properties of a CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly */ /** - * Constructs a new DeleteClusterRequest. + * Constructs a new CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set */ - function DeleteClusterRequest(properties) { + function CreateSecondaryInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48656,131 +59551,131 @@ } /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance */ - DeleteClusterRequest.prototype.name = ""; + CreateSecondaryInstanceRequest.prototype.parent = ""; /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance */ - DeleteClusterRequest.prototype.requestId = ""; + CreateSecondaryInstanceRequest.prototype.instanceId = ""; /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance */ - DeleteClusterRequest.prototype.etag = ""; + CreateSecondaryInstanceRequest.prototype.instance = null; /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance */ - DeleteClusterRequest.prototype.validateOnly = false; + CreateSecondaryInstanceRequest.prototype.requestId = ""; /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance */ - DeleteClusterRequest.prototype.force = false; + CreateSecondaryInstanceRequest.prototype.validateOnly = false; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); }; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteClusterRequest.encode = function encode(message, writer) { + CreateSecondaryInstanceRequest.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.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.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteClusterRequest.decode = function decode(reader, length) { + CreateSecondaryInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.instanceId = reader.string(); break; } case 3: { - message.etag = reader.string(); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); break; } case 4: { - message.validateOnly = reader.bool(); + message.requestId = reader.string(); break; } case 5: { - message.force = reader.bool(); + message.validateOnly = reader.bool(); break; } default: @@ -48792,158 +59687,161 @@ }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteClusterRequest message. + * Verifies a CreateSecondaryInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteClusterRequest.verify = function verify(message) { + CreateSecondaryInstanceRequest.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.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.alloydb.v1beta.Instance.verify(message.instance); + if (error) + return "instance." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteClusterRequest) + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); + 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.alloydb.v1beta.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); + } if (object.requestId != null) message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.DeleteClusterRequest} message DeleteClusterRequest + * @param {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteClusterRequest.toObject = function toObject(message, options) { + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; + object.instanceId = ""; + object.instance = null; object.requestId = ""; - object.etag = ""; object.validateOnly = false; - object.force = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + 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.alloydb.v1beta.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this DeleteClusterRequest to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @instance * @returns {Object.} JSON object */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteClusterRequest + * Gets the default type url for CreateSecondaryInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest"; }; - return DeleteClusterRequest; + return CreateSecondaryInstanceRequest; })(); - v1beta.PromoteClusterRequest = (function() { + v1beta.CreateInstanceRequests = (function() { /** - * Properties of a PromoteClusterRequest. + * Properties of a CreateInstanceRequests. * @memberof google.cloud.alloydb.v1beta - * @interface IPromoteClusterRequest - * @property {string|null} [name] PromoteClusterRequest name - * @property {string|null} [requestId] PromoteClusterRequest requestId - * @property {string|null} [etag] PromoteClusterRequest etag - * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests */ /** - * Constructs a new PromoteClusterRequest. + * Constructs a new CreateInstanceRequests. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests * @constructor - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set */ - function PromoteClusterRequest(properties) { + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48951,117 +59849,78 @@ } /** - * PromoteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.name = ""; - - /** - * PromoteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.requestId = ""; - - /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.etag = ""; - - /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @instance */ - PromoteClusterRequest.prototype.validateOnly = false; + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; /** - * Creates a new PromoteClusterRequest instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests instance */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); }; /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PromoteClusterRequest.encode = function encode(message, writer) { + CreateInstanceRequests.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteClusterRequest.decode = function decode(reader, length) { + CreateInstanceRequests.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1beta.CreateInstanceRequest.decode(reader, reader.uint32())); break; } default: @@ -49073,153 +59932,141 @@ }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PromoteClusterRequest message. + * Verifies a CreateInstanceRequests message. * @function verify - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + */ + CreateInstanceRequests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (error) + return "createInstanceRequests." + error; + } + } return null; }; /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterRequest) + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequests) return object; - var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + } + } return message; }; /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1beta.PromoteClusterRequest} message PromoteClusterRequest + * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} message CreateInstanceRequests * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PromoteClusterRequest.toObject = function toObject(message, options) { + CreateInstanceRequests.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; return object; }; /** - * Converts this PromoteClusterRequest to JSON. + * Converts this CreateInstanceRequests to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @instance * @returns {Object.} JSON object */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequests.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PromoteClusterRequest + * Gets the default type url for CreateInstanceRequests * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequests"; }; - return PromoteClusterRequest; + return CreateInstanceRequests; })(); - v1beta.RestoreClusterRequest = (function() { + v1beta.BatchCreateInstancesRequest = (function() { /** - * Properties of a RestoreClusterRequest. + * Properties of a BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {google.cloud.alloydb.v1beta.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId */ /** - * Constructs a new RestoreClusterRequest. + * Constructs a new BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set */ - function RestoreClusterRequest(properties) { + function BatchCreateInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49227,175 +60074,105 @@ } /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.backupSource = null; - - /** - * RestoreClusterRequest continuousBackupSource. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupSource|null|undefined} continuousBackupSource - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.continuousBackupSource = null; - - /** - * RestoreClusterRequest parent. + * BatchCreateInstancesRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.parent = ""; - - /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @instance */ - RestoreClusterRequest.prototype.clusterId = ""; + BatchCreateInstancesRequest.prototype.parent = ""; /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @instance */ - RestoreClusterRequest.prototype.cluster = null; + BatchCreateInstancesRequest.prototype.requests = null; /** - * RestoreClusterRequest requestId. + * BatchCreateInstancesRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.requestId = ""; - - /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @instance */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + BatchCreateInstancesRequest.prototype.requestId = ""; /** - * Creates a new RestoreClusterRequest instance using the specified properties. + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); }; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreClusterRequest.encode = function encode(message, writer) { + BatchCreateInstancesRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreClusterRequest.decode = function decode(reader, length) { + BatchCreateInstancesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); - break; - } - case 8: { - message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.decode(reader, reader.uint32()); - break; - } case 1: { message.parent = reader.string(); break; } case 2: { - message.clusterId = reader.string(); + message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.decode(reader, reader.uint32()); break; } case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { message.requestId = reader.string(); break; } - case 6: { - message.validateOnly = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -49405,203 +60182,145 @@ }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestoreClusterRequest message. + * Verifies a BatchCreateInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestoreClusterRequest.verify = function verify(message) { + BatchCreateInstancesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.verify(message.continuousBackupSource); - if (error) - return "continuousBackupSource." + error; - } - } if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.verify(message.requests); if (error) - return "cluster." + error; + return "requests." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; return null; }; /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreClusterRequest) + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); - } - if (object.continuousBackupSource != null) { - if (typeof object.continuousBackupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.continuousBackupSource: object expected"); - message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.fromObject(object.continuousBackupSource); - } + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.fromObject(object.requests); } if (object.requestId != null) message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1beta.RestoreClusterRequest} message RestoreClusterRequest + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} message BatchCreateInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreClusterRequest.toObject = function toObject(message, options) { + BatchCreateInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.clusterId = ""; - object.cluster = null; + object.requests = null; object.requestId = ""; - object.validateOnly = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.toObject(message.requests, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - object.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.toObject(message.continuousBackupSource, options); - if (options.oneofs) - object.source = "continuousBackupSource"; - } return object; }; /** - * Converts this RestoreClusterRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @instance * @returns {Object.} JSON object */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestoreClusterRequest + * Gets the default type url for BatchCreateInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesRequest"; }; - return RestoreClusterRequest; + return BatchCreateInstancesRequest; })(); - v1beta.ListInstancesRequest = (function() { + v1beta.BatchCreateInstancesResponse = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1beta - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances */ /** - * Constructs a new ListInstancesRequest. + * Constructs a new BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function BatchCreateInstancesResponse(properties) { + this.instances = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49609,131 +60328,78 @@ } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @instance */ - ListInstancesRequest.prototype.orderBy = ""; + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encode = function encode(message, writer) { + BatchCreateInstancesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); break; } default: @@ -49745,159 +60411,142 @@ }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesRequest message. + * Verifies a BatchCreateInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListInstancesRequest.verify = function verify(message) { + BatchCreateInstancesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } return null; }; /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesRequest) + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); + } + } return message; }; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1beta.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} message BatchCreateInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + BatchCreateInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; return object; }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this BatchCreateInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for BatchCreateInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesResponse"; }; - return ListInstancesRequest; + return BatchCreateInstancesResponse; })(); - v1beta.ListInstancesResponse = (function() { + v1beta.BatchCreateInstancesMetadata = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1beta - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses */ /** - * Constructs a new ListInstancesResponse. + * Constructs a new BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata * @constructor - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49905,109 +60554,114 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + BatchCreateInstancesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decode = function decode(reader, length) { + BatchCreateInstancesMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); break; } case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; break; } default: @@ -50019,170 +60673,165 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a BatchCreateInstancesMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListInstancesResponse.verify = function verify(message) { + BatchCreateInstancesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; + } + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); if (error) - return "instances." + error; + return "instanceStatuses." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } return null; }; /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesResponse) + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); - } + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } } return message; }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); } return object; }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for BatchCreateInstancesMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata"; }; - return ListInstancesResponse; + return BatchCreateInstancesMetadata; })(); - v1beta.GetInstanceRequest = (function() { + v1beta.BatchCreateInstanceStatus = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of a BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1beta - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1beta.InstanceView|null} [view] GetInstanceRequest view + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type */ /** - * Constructs a new GetInstanceRequest. + * Constructs a new BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus * @constructor - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function BatchCreateInstanceStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50190,89 +60839,117 @@ } /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @instance */ - GetInstanceRequest.prototype.name = ""; + BatchCreateInstanceStatus.prototype.state = 0; /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1beta.InstanceView} view - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @instance */ - GetInstanceRequest.prototype.view = 0; + BatchCreateInstanceStatus.prototype.errorMsg = ""; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.error = null; + + /** + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.type = 0; + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encode = function encode(message, writer) { + BatchCreateInstanceStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + 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(); return writer; }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @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) { + BatchCreateInstanceStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.state = reader.int32(); break; } case 2: { - message.view = reader.int32(); + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); break; } default: @@ -50284,159 +60961,253 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus * @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) { + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies a BatchCreateInstanceStatus message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @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) { + BatchCreateInstanceStatus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { default: - return "view: enum value expected"; + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; case 0: case 1: case 2: + case 3: break; } return null; }; /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetInstanceRequest) + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) return object; - var message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); + switch (object.state) { default: - if (typeof object.view === "number") { - message.view = object.view; + if (typeof object.state === "number") { + message.state = object.state; break; } break; - case "INSTANCE_VIEW_UNSPECIFIED": + case "STATE_UNSPECIFIED": case 0: - message.view = 0; + message.state = 0; break; - case "INSTANCE_VIEW_BASIC": + case "PENDING_CREATE": case 1: - message.view = 1; + message.state = 1; break; - case "INSTANCE_VIEW_FULL": + case "READY": case 2: - message.view = 2; + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; break; } return message; }; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1beta.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} message BatchCreateInstanceStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + BatchCreateInstanceStatus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.InstanceView[message.view] : message.view; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); return object; }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this BatchCreateInstanceStatus to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for BatchCreateInstanceStatus * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstanceStatus"; }; - return GetInstanceRequest; + /** + * State enum. + * @name google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; })(); - v1beta.CreateInstanceRequest = (function() { + v1beta.UpdateInstanceRequest = (function() { /** - * Properties of a CreateInstanceRequest. + * Properties of an UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing */ /** - * Constructs a new CreateInstanceRequest. + * Constructs a new UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set */ - function CreateInstanceRequest(properties) { + function UpdateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50444,131 +61215,131 @@ } /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance */ - CreateInstanceRequest.prototype.parent = ""; + UpdateInstanceRequest.prototype.updateMask = null; /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance */ - CreateInstanceRequest.prototype.instanceId = ""; + UpdateInstanceRequest.prototype.instance = null; /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance */ - CreateInstanceRequest.prototype.instance = null; + UpdateInstanceRequest.prototype.requestId = ""; /** - * CreateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance */ - CreateInstanceRequest.prototype.requestId = ""; + UpdateInstanceRequest.prototype.validateOnly = false; /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance */ - CreateInstanceRequest.prototype.validateOnly = false; + UpdateInstanceRequest.prototype.allowMissing = false; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new UpdateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest instance */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encode = function encode(message, writer) { + UpdateInstanceRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest * @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) { + UpdateInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.instanceId = reader.string(); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); break; } case 3: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 4: { - message.requestId = reader.string(); + message.validateOnly = reader.bool(); break; } case 5: { - message.validateOnly = reader.bool(); + message.allowMissing = reader.bool(); break; } default: @@ -50580,38 +61351,37 @@ }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest * @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) { + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequest message. + * Verifies an UpdateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @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) { + UpdateInstanceRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } if (message.instance != null && message.hasOwnProperty("instance")) { var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); if (error) @@ -50623,121 +61393,126 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequest) + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); + var message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } if (object.instance != null) { if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequest.instance: object expected"); + throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.instance: object expected"); message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.CreateInstanceRequest} message CreateInstanceRequest + * @param {google.cloud.alloydb.v1beta.UpdateInstanceRequest} message UpdateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + UpdateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.instanceId = ""; + object.updateMask = null; object.instance = null; object.requestId = ""; object.validateOnly = false; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.instance != null && message.hasOwnProperty("instance")) object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this UpdateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { + UpdateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for UpdateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateInstanceRequest"; }; - return CreateInstanceRequest; + return UpdateInstanceRequest; })(); - v1beta.CreateSecondaryInstanceRequest = (function() { + v1beta.DeleteInstanceRequest = (function() { /** - * Properties of a CreateSecondaryInstanceRequest. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateSecondaryInstanceRequest - * @property {string|null} [parent] CreateSecondaryInstanceRequest parent - * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateSecondaryInstanceRequest instance - * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly */ /** - * Constructs a new CreateSecondaryInstanceRequest. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set */ - function CreateSecondaryInstanceRequest(properties) { + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50745,130 +61520,116 @@ } /** - * CreateSecondaryInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.parent = ""; - - /** - * CreateSecondaryInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @instance */ - CreateSecondaryInstanceRequest.prototype.instanceId = ""; + DeleteInstanceRequest.prototype.name = ""; /** - * CreateSecondaryInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @instance */ - CreateSecondaryInstanceRequest.prototype.instance = null; + DeleteInstanceRequest.prototype.requestId = ""; /** - * CreateSecondaryInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @instance */ - CreateSecondaryInstanceRequest.prototype.requestId = ""; + DeleteInstanceRequest.prototype.etag = ""; /** - * CreateSecondaryInstanceRequest validateOnly. + * DeleteInstanceRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @instance */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; + DeleteInstanceRequest.prototype.validateOnly = false; /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest instance */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + DeleteInstanceRequest.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.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length) { + 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.alloydb.v1beta.CreateSecondaryInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.instanceId = reader.string(); + message.requestId = reader.string(); break; } case 3: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); + message.etag = reader.string(); break; } case 4: { - message.requestId = reader.string(); - break; - } - case 5: { message.validateOnly = reader.bool(); break; } @@ -50881,46 +61642,41 @@ }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecondaryInstanceRequest message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSecondaryInstanceRequest.verify = function verify(message) { + DeleteInstanceRequest.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.alloydb.v1beta.Instance.verify(message.instance); - if (error) - return "instance." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; @@ -50928,114 +61684,107 @@ }; /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); - 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.alloydb.v1beta.CreateSecondaryInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); - } + var message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {google.cloud.alloydb.v1beta.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + DeleteInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; + object.name = ""; object.requestId = ""; + object.etag = ""; object.validateOnly = false; } - 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.alloydb.v1beta.Instance.toObject(message.instance, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateSecondaryInstanceRequest to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecondaryInstanceRequest + * Gets the default type url for DeleteInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteInstanceRequest"; }; - return CreateSecondaryInstanceRequest; + return DeleteInstanceRequest; })(); - v1beta.CreateInstanceRequests = (function() { + v1beta.FailoverInstanceRequest = (function() { /** - * Properties of a CreateInstanceRequests. + * Properties of a FailoverInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly */ /** - * Constructs a new CreateInstanceRequests. + * Constructs a new FailoverInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; + function FailoverInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51043,78 +61792,103 @@ } /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @instance */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + FailoverInstanceRequest.prototype.name = ""; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.requestId = ""; + + /** + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests instance + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest instance */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); }; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encode = function encode(message, writer) { + FailoverInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decode = function decode(reader, length) { + FailoverInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1beta.CreateInstanceRequest.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -51126,141 +61900,142 @@ }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequests message. + * Verifies a FailoverInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateInstanceRequests.verify = function verify(message) { + FailoverInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.verify(message.createInstanceRequests[i]); - if (error) - return "createInstanceRequests." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequests) + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); - } - } + var message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} message CreateInstanceRequests + * @param {google.cloud.alloydb.v1beta.FailoverInstanceRequest} message FailoverInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequests.toObject = function toObject(message, options) { + FailoverInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateInstanceRequests to JSON. + * Converts this FailoverInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { + FailoverInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for FailoverInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequests"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.FailoverInstanceRequest"; }; - return CreateInstanceRequests; + return FailoverInstanceRequest; })(); - v1beta.BatchCreateInstancesRequest = (function() { + v1beta.InjectFaultRequest = (function() { /** - * Properties of a BatchCreateInstancesRequest. + * Properties of an InjectFaultRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly */ /** - * Constructs a new BatchCreateInstancesRequest. + * Constructs a new InjectFaultRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set */ - function BatchCreateInstancesRequest(properties) { + function InjectFaultRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51268,105 +62043,119 @@ } /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @instance */ - BatchCreateInstancesRequest.prototype.parent = ""; + InjectFaultRequest.prototype.faultType = 0; /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @instance */ - BatchCreateInstancesRequest.prototype.requests = null; + InjectFaultRequest.prototype.name = ""; /** - * BatchCreateInstancesRequest requestId. + * InjectFaultRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @instance */ - BatchCreateInstancesRequest.prototype.requestId = ""; + InjectFaultRequest.prototype.requestId = ""; /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.validateOnly = false; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest instance */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { + InjectFaultRequest.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.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decode = function decode(reader, length) { + InjectFaultRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.faultType = reader.int32(); break; } case 2: { - message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 3: { message.requestId = reader.string(); break; } + case 4: { + message.validateOnly = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -51376,224 +62165,286 @@ }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies an InjectFaultRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesRequest.verify = function verify(message) { + InjectFaultRequest.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.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.verify(message.requests); - if (error) - return "requests." + error; - } + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { + default: + return "faultType: enum value expected"; + case 0: + case 1: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.InjectFaultRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.fromObject(object.requests); + var message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); + switch (object.faultType) { + default: + if (typeof object.faultType === "number") { + message.faultType = object.faultType; + break; + } + break; + case "FAULT_TYPE_UNSPECIFIED": + case 0: + message.faultType = 0; + break; + case "STOP_VM": + case 1: + message.faultType = 1; + break; } + if (object.name != null) + message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {google.cloud.alloydb.v1beta.InjectFaultRequest} message InjectFaultRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { + InjectFaultRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.requests = null; + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; object.requestId = ""; + object.validateOnly = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.toObject(message.requests, options); + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this BatchCreateInstancesRequest to JSON. + * Converts this InjectFaultRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + InjectFaultRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for InjectFaultRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.InjectFaultRequest"; }; - return BatchCreateInstancesRequest; + /** + * FaultType enum. + * @name google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType + * @enum {number} + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value + */ + InjectFaultRequest.FaultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; + return values; + })(); + + return InjectFaultRequest; })(); - v1beta.BatchCreateInstancesResponse = (function() { + v1beta.RestartInstanceRequest = (function() { /** - * Properties of a BatchCreateInstancesResponse. + * Properties of a RestartInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly */ /** - * Constructs a new BatchCreateInstancesResponse. + * Constructs a new RestartInstanceRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + RestartInstanceRequest.prototype.requestId = ""; /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @instance */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + RestartInstanceRequest.prototype.validateOnly = false; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * Creates a new RestartInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest instance */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { + RestartInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decode = function decode(reader, length) { + RestartInstanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); break; } default: @@ -51605,142 +62456,143 @@ }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies a RestartInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesResponse.verify = function verify(message) { + RestartInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.RestartInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); - } - } + var message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {google.cloud.alloydb.v1beta.RestartInstanceRequest} message RestartInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { + RestartInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this BatchCreateInstancesResponse to JSON. + * Converts this RestartInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + RestartInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for RestartInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestartInstanceRequest"; }; - return BatchCreateInstancesResponse; + return RestartInstanceRequest; })(); - v1beta.BatchCreateInstancesMetadata = (function() { + v1beta.ListBackupsRequest = (function() { /** - * Properties of a BatchCreateInstancesMetadata. + * Properties of a ListBackupsRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy */ /** - * Constructs a new BatchCreateInstancesMetadata. + * Constructs a new ListBackupsRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; + function ListBackupsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51748,114 +62600,131 @@ } /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + ListBackupsRequest.prototype.parent = ""; /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + ListBackupsRequest.prototype.pageSize = 0; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest instance */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { + ListBackupsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a ListBackupsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decode = function decode(reader, length) { + ListBackupsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); + message.parent = reader.string(); break; } case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -51867,165 +62736,159 @@ }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a ListBackupsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstancesMetadata.verify = function verify(message) { + ListBackupsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } - } + var message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {google.cloud.alloydb.v1beta.ListBackupsRequest} message ListBackupsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + ListBackupsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this BatchCreateInstancesMetadata to JSON. + * Converts this ListBackupsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + ListBackupsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for ListBackupsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsRequest"; }; - return BatchCreateInstancesMetadata; + return ListBackupsRequest; })(); - v1beta.BatchCreateInstanceStatus = (function() { + v1beta.ListBackupsResponse = (function() { /** - * Properties of a BatchCreateInstanceStatus. + * Properties of a ListBackupsResponse. * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable */ /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new ListBackupsResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set */ - function BatchCreateInstanceStatus(properties) { + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52033,117 +62896,109 @@ } /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.state = 0; - - /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @instance */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; + ListBackupsResponse.prototype.backups = $util.emptyArray; /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @instance */ - BatchCreateInstanceStatus.prototype.error = null; + ListBackupsResponse.prototype.nextPageToken = ""; /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @instance */ - BatchCreateInstanceStatus.prototype.type = 0; + ListBackupsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * Creates a new ListBackupsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse instance */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); }; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { + ListBackupsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - 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.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes a ListBackupsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decode = function decode(reader, length) { + ListBackupsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32())); break; } case 2: { - message.errorMsg = reader.string(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.type = reader.int32(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -52155,253 +63010,169 @@ }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies a ListBackupsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateInstanceStatus.verify = function verify(message) { + ListBackupsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; + var message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backups[i]); } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; - } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } return message; }; /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} message ListBackupsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { + ListBackupsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); return object; }; /** - * Converts this BatchCreateInstanceStatus to JSON. + * Converts this ListBackupsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @instance * @returns {Object.} JSON object */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + ListBackupsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for ListBackupsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstanceStatus"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsResponse"; }; - /** - * State enum. - * @name google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; + return ListBackupsResponse; })(); - v1beta.UpdateInstanceRequest = (function() { + v1beta.GetBackupRequest = (function() { /** - * Properties of an UpdateInstanceRequest. + * Properties of a GetBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name */ /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new GetBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set */ - function UpdateInstanceRequest(properties) { + function GetBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52409,131 +63180,75 @@ } /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.updateMask = null; - - /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.requestId = ""; - - /** - * UpdateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.validateOnly = false; - - /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @instance */ - UpdateInstanceRequest.prototype.allowMissing = false; + GetBackupRequest.prototype.name = ""; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new GetBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest instance */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); }; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encode = function encode(message, writer) { + GetBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a GetBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decode = function decode(reader, length) { + GetBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); + message.name = reader.string(); break; } default: @@ -52545,168 +63260,126 @@ }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a GetBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateInstanceRequest.verify = function verify(message) { + GetBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {google.cloud.alloydb.v1beta.GetBackupRequest} message GetBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + GetBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this GetBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { + GetBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for GetBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetBackupRequest"; }; - return UpdateInstanceRequest; + return GetBackupRequest; })(); - v1beta.DeleteInstanceRequest = (function() { + v1beta.CreateBackupRequest = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a CreateBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new CreateBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function CreateBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52714,116 +63387,130 @@ } /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @instance */ - DeleteInstanceRequest.prototype.name = ""; + CreateBackupRequest.prototype.parent = ""; /** - * DeleteInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @instance */ - DeleteInstanceRequest.prototype.requestId = ""; + CreateBackupRequest.prototype.backupId = ""; /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @instance */ - DeleteInstanceRequest.prototype.etag = ""; + CreateBackupRequest.prototype.backup = null; /** - * DeleteInstanceRequest validateOnly. + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.requestId = ""; + + /** + * CreateBackupRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @instance */ - DeleteInstanceRequest.prototype.validateOnly = false; + CreateBackupRequest.prototype.validateOnly = false; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new CreateBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + CreateBackupRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a CreateBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest * @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) { + CreateBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.backupId = reader.string(); break; } case 3: { - message.etag = reader.string(); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); break; } case 4: { + message.requestId = reader.string(); + break; + } + case 5: { message.validateOnly = reader.bool(); break; } @@ -52836,41 +63523,46 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest * @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) { + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a CreateBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @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) { + CreateBackupRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); + if (error) + return "backup." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; @@ -52878,107 +63570,117 @@ }; /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest) + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); + } if (object.requestId != null) message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.alloydb.v1beta.CreateBackupRequest} message CreateBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + CreateBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; + object.backupId = ""; + object.backup = null; object.requestId = ""; - object.etag = ""; object.validateOnly = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; return object; }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this CreateBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + CreateBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for CreateBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateBackupRequest"; }; - return DeleteInstanceRequest; + return CreateBackupRequest; })(); - v1beta.FailoverInstanceRequest = (function() { + v1beta.UpdateBackupRequest = (function() { /** - * Properties of a FailoverInstanceRequest. + * Properties of an UpdateBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing */ /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new UpdateBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set */ - function FailoverInstanceRequest(properties) { + function UpdateBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52986,105 +63688,133 @@ } /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @instance */ - FailoverInstanceRequest.prototype.name = ""; + UpdateBackupRequest.prototype.updateMask = null; /** - * FailoverInstanceRequest requestId. + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @instance */ - FailoverInstanceRequest.prototype.requestId = ""; + UpdateBackupRequest.prototype.requestId = ""; /** - * FailoverInstanceRequest validateOnly. + * UpdateBackupRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @instance */ - FailoverInstanceRequest.prototype.validateOnly = false; + UpdateBackupRequest.prototype.validateOnly = false; /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest instance */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); }; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encode = function encode(message, writer) { + UpdateBackupRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes an UpdateBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decode = function decode(reader, length) { + UpdateBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.requestId = reader.string(); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); break; } case 3: { + message.requestId = reader.string(); + break; + } + case 4: { message.validateOnly = reader.bool(); break; } + case 5: { + message.allowMissing = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -53094,141 +63824,168 @@ }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FailoverInstanceRequest message. + * Verifies an UpdateBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FailoverInstanceRequest.verify = function verify(message) { + UpdateBackupRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); + if (error) + return "backup." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest) + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); + } if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {google.cloud.alloydb.v1beta.UpdateBackupRequest} message UpdateBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverInstanceRequest.toObject = function toObject(message, options) { + UpdateBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.updateMask = null; + object.backup = null; object.requestId = ""; object.validateOnly = false; + object.allowMissing = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this FailoverInstanceRequest to JSON. + * Converts this UpdateBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @instance * @returns {Object.} JSON object */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { + UpdateBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for UpdateBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.FailoverInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateBackupRequest"; }; - return FailoverInstanceRequest; + return UpdateBackupRequest; })(); - v1beta.RestartInstanceRequest = (function() { + v1beta.DeleteBackupRequest = (function() { /** - * Properties of a RestartInstanceRequest. + * Properties of a DeleteBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag */ /** - * Constructs a new RestartInstanceRequest. + * Constructs a new DeleteBackupRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set */ - function RestartInstanceRequest(properties) { + function DeleteBackupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53236,51 +63993,59 @@ } /** - * RestartInstanceRequest name. + * DeleteBackupRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @instance */ - RestartInstanceRequest.prototype.name = ""; + DeleteBackupRequest.prototype.name = ""; /** - * RestartInstanceRequest requestId. + * DeleteBackupRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @instance */ - RestartInstanceRequest.prototype.requestId = ""; + DeleteBackupRequest.prototype.requestId = ""; /** - * RestartInstanceRequest validateOnly. + * DeleteBackupRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @instance */ - RestartInstanceRequest.prototype.validateOnly = false; + DeleteBackupRequest.prototype.validateOnly = false; /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest instance + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest instance */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); }; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartInstanceRequest.encode = function encode(message, writer) { + DeleteBackupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -53289,37 +64054,39 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); return writer; }; /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * Decodes a DeleteBackupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartInstanceRequest.decode = function decode(reader, length) { + DeleteBackupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -53335,6 +64102,10 @@ message.validateOnly = reader.bool(); break; } + case 4: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -53344,30 +64115,30 @@ }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestartInstanceRequest message. + * Verifies a DeleteBackupRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestartInstanceRequest.verify = function verify(message) { + DeleteBackupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -53379,40 +64150,45 @@ if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.RestartInstanceRequest) + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteBackupRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); if (object.name != null) message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); if (object.validateOnly != null) message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static - * @param {google.cloud.alloydb.v1beta.RestartInstanceRequest} message RestartInstanceRequest + * @param {google.cloud.alloydb.v1beta.DeleteBackupRequest} message DeleteBackupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestartInstanceRequest.toObject = function toObject(message, options) { + DeleteBackupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -53420,6 +64196,7 @@ object.name = ""; object.requestId = ""; object.validateOnly = false; + object.etag = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -53427,60 +64204,60 @@ object.requestId = message.requestId; if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this RestartInstanceRequest to JSON. + * Converts this DeleteBackupRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @instance * @returns {Object.} JSON object */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { + DeleteBackupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestartInstanceRequest + * Gets the default type url for DeleteBackupRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestartInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteBackupRequest"; }; - return RestartInstanceRequest; + return DeleteBackupRequest; })(); - v1beta.ListBackupsRequest = (function() { + v1beta.ListSupportedDatabaseFlagsRequest = (function() { /** - * Properties of a ListBackupsRequest. + * Properties of a ListSupportedDatabaseFlagsRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken */ /** - * Constructs a new ListBackupsRequest. + * Constructs a new ListSupportedDatabaseFlagsRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set */ - function ListBackupsRequest(properties) { + function ListSupportedDatabaseFlagsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53488,67 +64265,51 @@ } /** - * ListBackupsRequest parent. + * ListSupportedDatabaseFlagsRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @instance */ - ListBackupsRequest.prototype.parent = ""; + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; /** - * ListBackupsRequest pageSize. + * ListSupportedDatabaseFlagsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @instance */ - ListBackupsRequest.prototype.pageSize = 0; + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; /** - * ListBackupsRequest pageToken. + * ListSupportedDatabaseFlagsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @instance */ - ListBackupsRequest.prototype.orderBy = ""; + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); }; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -53557,41 +64318,37 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -53607,14 +64364,6 @@ message.pageToken = reader.string(); break; } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -53624,30 +64373,30 @@ }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListSupportedDatabaseFlagsRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsRequest.verify = function verify(message) { + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -53659,50 +64408,40 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; return null; }; /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsRequest) + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); + var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static - * @param {google.cloud.alloydb.v1beta.ListBackupsRequest} message ListBackupsRequest + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsRequest.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -53710,8 +64449,6 @@ object.parent = ""; object.pageSize = 0; object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -53719,64 +64456,58 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; return object; }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListSupportedDatabaseFlagsRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @instance * @returns {Object.} JSON object */ - ListBackupsRequest.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListSupportedDatabaseFlagsRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest"; }; - return ListBackupsRequest; + return ListSupportedDatabaseFlagsRequest; })(); - v1beta.ListBackupsResponse = (function() { + v1beta.ListSupportedDatabaseFlagsResponse = (function() { /** - * Properties of a ListBackupsResponse. + * Properties of a ListSupportedDatabaseFlagsResponse. * @memberof google.cloud.alloydb.v1beta - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken */ /** - * Constructs a new ListBackupsResponse. + * Constructs a new ListSupportedDatabaseFlagsResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse * @constructor - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53784,111 +64515,94 @@ } /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @instance */ - ListBackupsResponse.prototype.backups = $util.emptyArray; + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; /** - * ListBackupsResponse nextPageToken. + * ListSupportedDatabaseFlagsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @instance */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); }; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encode = function encode(message, writer) { + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decode = function decode(reader, length) { + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32())); + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.decode(reader, reader.uint32())); break; } case 2: { message.nextPageToken = reader.string(); break; } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } default: reader.skipType(tag & 7); break; @@ -53898,169 +64612,152 @@ }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsResponse message. + * Verifies a ListSupportedDatabaseFlagsResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsResponse.verify = function verify(message) { + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backups[i]); + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); if (error) - return "backups." + error; + return "supportedDatabaseFlags." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } return null; }; /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsResponse) + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backups[i]); + var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } return message; }; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static - * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} message ListBackupsResponse + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsResponse.toObject = function toObject(message, options) { + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } + if (options.arrays || options.defaults) + object.supportedDatabaseFlags = []; if (options.defaults) object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backups[j], options); + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } return object; }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this ListSupportedDatabaseFlagsResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @instance * @returns {Object.} JSON object */ - ListBackupsResponse.prototype.toJSON = function toJSON() { + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for ListSupportedDatabaseFlagsResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse"; }; - return ListBackupsResponse; + return ListSupportedDatabaseFlagsResponse; })(); - v1beta.GetBackupRequest = (function() { + v1beta.GenerateClientCertificateRequest = (function() { /** - * Properties of a GetBackupRequest. + * Properties of a GenerateClientCertificateRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name + * @interface IGenerateClientCertificateRequest + * @property {string|null} [parent] GenerateClientCertificateRequest parent + * @property {string|null} [requestId] GenerateClientCertificateRequest requestId + * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr + * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey */ /** - * Constructs a new GetBackupRequest. + * Constructs a new GenerateClientCertificateRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest + * @classdesc Represents a GenerateClientCertificateRequest. + * @implements IGenerateClientCertificateRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set */ - function GetBackupRequest(properties) { + function GenerateClientCertificateRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54068,75 +64765,131 @@ } /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * GenerateClientCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @instance */ - GetBackupRequest.prototype.name = ""; + GenerateClientCertificateRequest.prototype.parent = ""; /** - * Creates a new GetBackupRequest instance using the specified properties. + * GenerateClientCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.requestId = ""; + + /** + * GenerateClientCertificateRequest pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.pemCsr = ""; + + /** + * GenerateClientCertificateRequest certDuration. + * @member {google.protobuf.IDuration|null|undefined} certDuration + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.certDuration = null; + + /** + * GenerateClientCertificateRequest publicKey. + * @member {string} publicKey + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.publicKey = ""; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); + GenerateClientCertificateRequest.create = function create(properties) { + return new GenerateClientCertificateRequest(properties); }; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encode = function encode(message, writer) { + GenerateClientCertificateRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); + if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) + $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); return writer; }; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decode = function decode(reader, length) { + GenerateClientCertificateRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.pemCsr = reader.string(); + break; + } + case 4: { + message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.publicKey = reader.string(); break; } default: @@ -54148,126 +64901,163 @@ }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBackupRequest message. + * Verifies a GenerateClientCertificateRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBackupRequest.verify = function verify(message) { + GenerateClientCertificateRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) { + var error = $root.google.protobuf.Duration.verify(message.certDuration); + if (error) + return "certDuration." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; return null; }; /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetBackupRequest) + GenerateClientCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.certDuration != null) { + if (typeof object.certDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.certDuration: object expected"); + message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + } + if (object.publicKey != null) + message.publicKey = String(object.publicKey); return message; }; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static - * @param {google.cloud.alloydb.v1beta.GetBackupRequest} message GetBackupRequest + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} message GenerateClientCertificateRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupRequest.toObject = function toObject(message, options) { + GenerateClientCertificateRequest.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; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + object.pemCsr = ""; + object.certDuration = null; + object.publicKey = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) + object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; return object; }; /** - * Converts this GetBackupRequest to JSON. + * Converts this GenerateClientCertificateRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @instance * @returns {Object.} JSON object */ - GetBackupRequest.prototype.toJSON = function toJSON() { + GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for GenerateClientCertificateRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateRequest"; }; - return GetBackupRequest; + return GenerateClientCertificateRequest; })(); - v1beta.CreateBackupRequest = (function() { + v1beta.GenerateClientCertificateResponse = (function() { /** - * Properties of a CreateBackupRequest. + * Properties of a GenerateClientCertificateResponse. * @memberof google.cloud.alloydb.v1beta - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + * @interface IGenerateClientCertificateResponse + * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate + * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @property {string|null} [caCert] GenerateClientCertificateResponse caCert */ /** - * Constructs a new CreateBackupRequest. + * Constructs a new GenerateClientCertificateResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest + * @classdesc Represents a GenerateClientCertificateResponse. + * @implements IGenerateClientCertificateResponse * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set */ - function CreateBackupRequest(properties) { + function GenerateClientCertificateResponse(properties) { + this.pemCertificateChain = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54275,131 +65065,106 @@ } /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * GenerateClientCertificateResponse pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @instance */ - CreateBackupRequest.prototype.backup = null; + GenerateClientCertificateResponse.prototype.pemCertificate = ""; /** - * CreateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * GenerateClientCertificateResponse pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @instance */ - CreateBackupRequest.prototype.requestId = ""; + GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; /** - * CreateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * GenerateClientCertificateResponse caCert. + * @member {string} caCert + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @instance */ - CreateBackupRequest.prototype.validateOnly = false; + GenerateClientCertificateResponse.prototype.caCert = ""; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new GenerateClientCertificateResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); + GenerateClientCertificateResponse.create = function create(properties) { + return new GenerateClientCertificateResponse(properties); }; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encode = function encode(message, writer) { + GenerateClientCertificateResponse.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.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); return writer; }; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decode = function decode(reader, length) { + GenerateClientCertificateResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.pemCertificate = reader.string(); break; } case 2: { - message.backupId = reader.string(); + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); break; } case 3: { - message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); + message.caCert = reader.string(); break; } default: @@ -54411,298 +65176,245 @@ }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBackupRequest message. + * Verifies a GenerateClientCertificateResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBackupRequest.verify = function verify(message) { + GenerateClientCertificateResponse.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.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); - if (error) - return "backup." + error; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.caCert != null && message.hasOwnProperty("caCert")) + if (!$util.isString(message.caCert)) + return "caCert: string expected"; return null; }; /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateBackupRequest) + GenerateClientCertificateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); + var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + if (object.caCert != null) + message.caCert = String(object.caCert); return message; }; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static - * @param {google.cloud.alloydb.v1beta.CreateBackupRequest} message CreateBackupRequest + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} message GenerateClientCertificateResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupRequest.toObject = function toObject(message, options) { + GenerateClientCertificateResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; + object.pemCertificate = ""; + object.caCert = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + object.caCert = message.caCert; return object; }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this GenerateClientCertificateResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @instance * @returns {Object.} JSON object */ - CreateBackupRequest.prototype.toJSON = function toJSON() { + GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for GenerateClientCertificateResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateResponse"; }; - return CreateBackupRequest; + return GenerateClientCertificateResponse; })(); - v1beta.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing - */ + v1beta.GetConnectionInfoRequest = (function() { /** - * Constructs a new UpdateBackupRequest. + * Properties of a GetConnectionInfoRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance + * @interface IGetConnectionInfoRequest + * @property {string|null} [parent] GetConnectionInfoRequest parent + * @property {string|null} [requestId] GetConnectionInfoRequest requestId */ - UpdateBackupRequest.prototype.backup = null; /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance + * Constructs a new GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetConnectionInfoRequest. + * @implements IGetConnectionInfoRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set */ - UpdateBackupRequest.prototype.requestId = ""; + function GetConnectionInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * GetConnectionInfoRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @instance */ - UpdateBackupRequest.prototype.validateOnly = false; + GetConnectionInfoRequest.prototype.parent = ""; /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * GetConnectionInfoRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @instance */ - UpdateBackupRequest.prototype.allowMissing = false; + GetConnectionInfoRequest.prototype.requestId = ""; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new GetConnectionInfoRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest instance + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest instance */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); + GetConnectionInfoRequest.create = function create(properties) { + return new GetConnectionInfoRequest(properties); }; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encode = function encode(message, writer) { + GetConnectionInfoRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decode = function decode(reader, length) { + GetConnectionInfoRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { message.requestId = reader.string(); break; } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -54712,168 +65424,138 @@ }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateBackupRequest message. + * Verifies a GetConnectionInfoRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateBackupRequest.verify = function verify(message) { + GetConnectionInfoRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); - if (error) - return "backup." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateBackupRequest) + GetConnectionInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); - } + var message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); + if (object.parent != null) + message.parent = String(object.parent); if (object.requestId != null) message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static - * @param {google.cloud.alloydb.v1beta.UpdateBackupRequest} message UpdateBackupRequest + * @param {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} message GetConnectionInfoRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupRequest.toObject = function toObject(message, options) { + GetConnectionInfoRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.backup = null; + object.parent = ""; object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this GetConnectionInfoRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @instance * @returns {Object.} JSON object */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { + GetConnectionInfoRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for GetConnectionInfoRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetConnectionInfoRequest"; }; - return UpdateBackupRequest; + return GetConnectionInfoRequest; })(); - v1beta.DeleteBackupRequest = (function() { + v1beta.OperationMetadata = (function() { /** - * Properties of a DeleteBackupRequest. + * Properties of an OperationMetadata. * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion */ /** - * Constructs a new DeleteBackupRequest. + * Constructs a new OperationMetadata. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set */ - function DeleteBackupRequest(properties) { + function OperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54881,117 +65563,187 @@ } /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * OperationMetadata batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @instance */ - DeleteBackupRequest.prototype.name = ""; + OperationMetadata.prototype.batchCreateInstancesMetadata = null; /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @instance */ - DeleteBackupRequest.prototype.requestId = ""; + OperationMetadata.prototype.createTime = null; /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @instance */ - DeleteBackupRequest.prototype.validateOnly = false; + OperationMetadata.prototype.endTime = null; /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @instance */ - DeleteBackupRequest.prototype.etag = ""; + OperationMetadata.prototype.target = ""; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest instance + * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata instance */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); }; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encode = function encode(message, writer) { + OperationMetadata.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes an OperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decode = function decode(reader, length) { + 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.alloydb.v1beta.DeleteBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); + break; + } case 1: { - message.name = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.requestId = reader.string(); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.validateOnly = reader.bool(); + message.target = reader.string(); break; } case 4: { - message.etag = reader.string(); + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); break; } default: @@ -55003,149 +65755,204 @@ }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteBackupRequest message. + * Verifies an OperationMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteBackupRequest.verify = function verify(message) { + OperationMetadata.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; return null; }; /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteBackupRequest) + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.OperationMetadata) return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); + var message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.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.alloydb.v1beta.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); return message; }; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static - * @param {google.cloud.alloydb.v1beta.DeleteBackupRequest} message DeleteBackupRequest + * @param {google.cloud.alloydb.v1beta.OperationMetadata} message OperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBackupRequest.toObject = function toObject(message, options) { + OperationMetadata.toObject = function toObject(message, options) { if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; return object; }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this OperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @instance * @returns {Object.} JSON object */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { + OperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for OperationMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @memberof google.cloud.alloydb.v1beta.OperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteBackupRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.OperationMetadata"; }; - return DeleteBackupRequest; + return OperationMetadata; })(); - v1beta.ListSupportedDatabaseFlagsRequest = (function() { + v1beta.ListUsersRequest = (function() { /** - * Properties of a ListSupportedDatabaseFlagsRequest. + * Properties of a ListUsersRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy */ /** - * Constructs a new ListSupportedDatabaseFlagsRequest. + * Constructs a new ListUsersRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsRequest(properties) { + function ListUsersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55153,51 +65960,67 @@ } /** - * ListSupportedDatabaseFlagsRequest parent. + * ListUsersRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + ListUsersRequest.prototype.parent = ""; /** - * ListSupportedDatabaseFlagsRequest pageSize. + * ListUsersRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + ListUsersRequest.prototype.pageSize = 0; /** - * ListSupportedDatabaseFlagsRequest pageToken. + * ListUsersRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @instance */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + ListUsersRequest.prototype.pageToken = ""; /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest instance */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + ListUsersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -55206,37 +66029,41 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * Decodes a ListUsersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length) { + ListUsersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -55252,6 +66079,14 @@ message.pageToken = reader.string(); break; } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -55261,30 +66096,30 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsRequest message. + * Verifies a ListUsersRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + ListUsersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -55296,40 +66131,50 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); + var message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {google.cloud.alloydb.v1beta.ListUsersRequest} message ListUsersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + ListUsersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -55337,6 +66182,8 @@ object.parent = ""; object.pageSize = 0; object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -55344,58 +66191,64 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * Converts this ListUsersRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + ListUsersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest + * Gets the default type url for ListUsersRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersRequest"; }; - return ListSupportedDatabaseFlagsRequest; + return ListUsersRequest; })(); - v1beta.ListSupportedDatabaseFlagsResponse = (function() { + v1beta.ListUsersResponse = (function() { /** - * Properties of a ListSupportedDatabaseFlagsResponse. + * Properties of a ListUsersResponse. * @memberof google.cloud.alloydb.v1beta - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable */ /** - * Constructs a new ListSupportedDatabaseFlagsResponse. + * Constructs a new ListUsersResponse. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse * @constructor - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55403,94 +66256,111 @@ } /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @instance */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; + ListUsersResponse.prototype.users = $util.emptyArray; /** - * ListSupportedDatabaseFlagsResponse nextPageToken. + * ListUsersResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @instance */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + ListUsersResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsersResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse instance */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + ListUsersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1beta.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * Decodes a ListUsersResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length) { + ListUsersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.decode(reader, reader.uint32())); + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32())); break; } case 2: { message.nextPageToken = reader.string(); break; } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -55500,151 +66370,169 @@ }; /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSupportedDatabaseFlagsResponse message. + * Verifies a ListUsersResponse message. * @function verify - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + ListUsersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.users[i]); if (error) - return "supportedDatabaseFlags." + error; + return "users." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersResponse) return object; - var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + var message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1beta.User.fromObject(object.users[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {google.cloud.alloydb.v1beta.ListUsersResponse} message ListUsersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + ListUsersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } if (options.defaults) object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1beta.User.toObject(message.users[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * Converts this ListUsersResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @instance * @returns {Object.} JSON object */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + ListUsersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse + * Gets the default type url for ListUsersResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersResponse"; }; - return ListSupportedDatabaseFlagsResponse; + return ListUsersResponse; })(); - v1beta.GenerateClientCertificateRequest = (function() { + v1beta.GetUserRequest = (function() { /** - * Properties of a GenerateClientCertificateRequest. + * Properties of a GetUserRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IGenerateClientCertificateRequest - * @property {string|null} [parent] GenerateClientCertificateRequest parent - * @property {string|null} [requestId] GenerateClientCertificateRequest requestId - * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr - * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name */ /** - * Constructs a new GenerateClientCertificateRequest. + * Constructs a new GetUserRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GenerateClientCertificateRequest. - * @implements IGenerateClientCertificateRequest + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set */ - function GenerateClientCertificateRequest(properties) { + function GetUserRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55652,117 +66540,75 @@ } /** - * GenerateClientCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.parent = ""; - - /** - * GenerateClientCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.requestId = ""; - - /** - * GenerateClientCertificateRequest pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.pemCsr = ""; - - /** - * GenerateClientCertificateRequest certDuration. - * @member {google.protobuf.IDuration|null|undefined} certDuration - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @instance */ - GenerateClientCertificateRequest.prototype.certDuration = null; + GetUserRequest.prototype.name = ""; /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * Creates a new GetUserRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance + * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest instance */ - GenerateClientCertificateRequest.create = function create(properties) { - return new GenerateClientCertificateRequest(properties); + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); }; /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateRequest.encode = function encode(message, writer) { + GetUserRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); - if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) - $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * Decodes a GetUserRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateRequest.decode = function decode(reader, length) { + GetUserRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.pemCsr = reader.string(); - break; - } - case 4: { - message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -55774,154 +66620,126 @@ }; /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateClientCertificateRequest message. + * Verifies a GetUserRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GenerateClientCertificateRequest.verify = function verify(message) { + GetUserRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) { - var error = $root.google.protobuf.Duration.verify(message.certDuration); - if (error) - return "certDuration." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest */ - GenerateClientCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetUserRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.certDuration != null) { - if (typeof object.certDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.certDuration: object expected"); - message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); - } + var message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {google.cloud.alloydb.v1beta.GetUserRequest} message GetUserRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateClientCertificateRequest.toObject = function toObject(message, options) { + GetUserRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - object.pemCsr = ""; - object.certDuration = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) - object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GenerateClientCertificateRequest to JSON. + * Converts this GetUserRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @instance * @returns {Object.} JSON object */ - GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + GetUserRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateClientCertificateRequest + * Gets the default type url for GetUserRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @memberof google.cloud.alloydb.v1beta.GetUserRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetUserRequest"; }; - return GenerateClientCertificateRequest; + return GetUserRequest; })(); - v1beta.GenerateClientCertificateResponse = (function() { + v1beta.CreateUserRequest = (function() { /** - * Properties of a GenerateClientCertificateResponse. + * Properties of a CreateUserRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IGenerateClientCertificateResponse - * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate - * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1beta.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly */ /** - * Constructs a new GenerateClientCertificateResponse. + * Constructs a new CreateUserRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GenerateClientCertificateResponse. - * @implements IGenerateClientCertificateResponse + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set */ - function GenerateClientCertificateResponse(properties) { - this.pemCertificateChain = []; + function CreateUserRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55929,92 +66747,131 @@ } /** - * GenerateClientCertificateResponse pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @instance */ - GenerateClientCertificateResponse.prototype.pemCertificate = ""; + CreateUserRequest.prototype.parent = ""; /** - * GenerateClientCertificateResponse pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @instance */ - GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; + CreateUserRequest.prototype.userId = ""; /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; + + /** + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest instance */ - GenerateClientCertificateResponse.create = function create(properties) { - return new GenerateClientCertificateResponse(properties); + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); }; /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateResponse.encode = function encode(message, writer) { + CreateUserRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); return writer; }; /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * Decodes a CreateUserRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateResponse.decode = function decode(reader, length) { + CreateUserRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.pemCertificate = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); break; } - case 2: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); + case 5: { + message.validateOnly = reader.bool(); break; } default: @@ -56026,144 +66883,164 @@ }; /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateClientCertificateResponse message. + * Verifies a CreateUserRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GenerateClientCertificateResponse.verify = function verify(message) { + CreateUserRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); + if (error) + return "user." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest */ - GenerateClientCertificateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateUserRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + var message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {google.cloud.alloydb.v1beta.CreateUserRequest} message CreateUserRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateClientCertificateResponse.toObject = function toObject(message, options) { + CreateUserRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) - object.pemCertificate = ""; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this GenerateClientCertificateResponse to JSON. + * Converts this CreateUserRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @instance * @returns {Object.} JSON object */ - GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + CreateUserRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateClientCertificateResponse + * Gets the default type url for CreateUserRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateUserRequest"; }; - return GenerateClientCertificateResponse; + return CreateUserRequest; })(); - v1beta.GetConnectionInfoRequest = (function() { + v1beta.UpdateUserRequest = (function() { /** - * Properties of a GetConnectionInfoRequest. + * Properties of an UpdateUserRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IGetConnectionInfoRequest - * @property {string|null} [parent] GetConnectionInfoRequest parent - * @property {string|null} [requestId] GetConnectionInfoRequest requestId + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1beta.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing */ /** - * Constructs a new GetConnectionInfoRequest. + * Constructs a new UpdateUserRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetConnectionInfoRequest. - * @implements IGetConnectionInfoRequest + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set */ - function GetConnectionInfoRequest(properties) { + function UpdateUserRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56171,91 +67048,133 @@ } /** - * GetConnectionInfoRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @instance */ - GetConnectionInfoRequest.prototype.parent = ""; + UpdateUserRequest.prototype.updateMask = null; /** - * GetConnectionInfoRequest requestId. + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @instance */ - GetConnectionInfoRequest.prototype.requestId = ""; + UpdateUserRequest.prototype.requestId = ""; /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest instance + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest instance */ - GetConnectionInfoRequest.create = function create(properties) { - return new GetConnectionInfoRequest(properties); + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); }; /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionInfoRequest.encode = function encode(message, writer) { + UpdateUserRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * Decodes an UpdateUserRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionInfoRequest.decode = function decode(reader, length) { + UpdateUserRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { + message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); + break; + } + case 3: { message.requestId = reader.string(); break; } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -56265,138 +67184,167 @@ }; /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetConnectionInfoRequest message. + * Verifies an UpdateUserRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetConnectionInfoRequest.verify = function verify(message) { + UpdateUserRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); + if (error) + return "user." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest */ - GetConnectionInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateUserRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); + } if (object.requestId != null) message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static - * @param {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {google.cloud.alloydb.v1beta.UpdateUserRequest} message UpdateUserRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConnectionInfoRequest.toObject = function toObject(message, options) { + UpdateUserRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; + object.updateMask = null; + object.user = null; object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this GetConnectionInfoRequest to JSON. + * Converts this UpdateUserRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @instance * @returns {Object.} JSON object */ - GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + UpdateUserRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetConnectionInfoRequest + * Gets the default type url for UpdateUserRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetConnectionInfoRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateUserRequest"; }; - return GetConnectionInfoRequest; + return UpdateUserRequest; })(); - v1beta.OperationMetadata = (function() { + v1beta.DeleteUserRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a DeleteUserRequest. * @memberof google.cloud.alloydb.v1beta - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly */ /** - * Constructs a new OperationMetadata. + * Constructs a new DeleteUserRequest. * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest * @constructor - * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function DeleteUserRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56404,187 +67352,103 @@ } /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @instance */ - OperationMetadata.prototype.requestedCancellation = false; + DeleteUserRequest.prototype.name = ""; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + DeleteUserRequest.prototype.requestId = ""; /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @instance */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteUserRequest.prototype.validateOnly = false; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new DeleteUserRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata instance + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + DeleteUserRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a DeleteUserRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest * @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) { + DeleteUserRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -56596,180 +67460,119 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest * @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) { + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a DeleteUserRequest message. * @function verify - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @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) { + DeleteUserRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.OperationMetadata) + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteUserRequest) return object; - var message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.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.alloydb.v1beta.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static - * @param {google.cloud.alloydb.v1beta.OperationMetadata} message OperationMetadata + * @param {google.cloud.alloydb.v1beta.DeleteUserRequest} message DeleteUserRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + DeleteUserRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this DeleteUserRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + DeleteUserRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for DeleteUserRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteUserRequest"; }; - return OperationMetadata; + return DeleteUserRequest; })(); return v1beta; diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index 9f0c8da39625..5f9c0125668b 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -19,6 +19,20 @@ "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" }, "nested": { + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, "DatabaseVersion": { "valuesOptions": { "POSTGRES_13": { @@ -31,13 +45,6 @@ "POSTGRES_14": 2 } }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, "UserPassword": { "fields": { "user": { @@ -139,11 +146,24 @@ }, "nested": { "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, "values": { "SSL_MODE_UNSPECIFIED": 0, "SSL_MODE_ALLOW": 1, "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3 + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 } }, "CaSource": { @@ -247,6 +267,65 @@ } } }, + "ContinuousBackupConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "recoveryWindowDays": { + "type": "int32", + "id": 4 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 3 + } + } + }, + "ContinuousBackupInfo": { + "fields": { + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enabledTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schedule": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "BackupSource": { "fields": { "backupUid": { @@ -266,6 +345,24 @@ } } }, + "ContinuousBackupSource": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pointInTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "Cluster": { "options": { "(google.api.resource).type": "alloydb.googleapis.com/Cluster", @@ -397,7 +494,10 @@ }, "sslConfig": { "type": "SslConfig", - "id": 18 + "id": 18, + "options": { + "deprecated": true + } }, "encryptionConfig": { "type": "EncryptionConfig", @@ -413,6 +513,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "continuousBackupConfig": { + "type": "ContinuousBackupConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "continuousBackupInfo": { + "type": "ContinuousBackupInfo", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "secondaryConfig": { "type": "SecondaryConfig", "id": 22 @@ -938,6 +1052,53 @@ } } }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, "AlloyDBAdmin": { "options": { "(google.api.default_host)": "alloydb.googleapis.com", @@ -1062,6 +1223,34 @@ } ] }, + "PromoteCluster": { + "requestType": "PromoteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, "RestoreCluster": { "requestType": "RestoreClusterRequest", "responseType": "google.longrunning.Operation", @@ -1086,6 +1275,34 @@ } ] }, + "CreateSecondaryCluster": { + "requestType": "CreateSecondaryClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, "ListInstances": { "requestType": "ListInstancesRequest", "responseType": "ListInstancesResponse", @@ -1150,6 +1367,34 @@ } ] }, + "CreateSecondaryInstance": { + "requestType": "CreateSecondaryInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "(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/*/clusters/*}/instances:createsecondary", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, "BatchCreateInstances": { "requestType": "BatchCreateInstancesRequest", "responseType": "google.longrunning.Operation", @@ -1256,6 +1501,34 @@ } ] }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, "RestartInstance": { "requestType": "RestartInstanceRequest", "responseType": "google.longrunning.Operation", @@ -1419,10 +1692,104 @@ "(google.api.method_signature)": "parent" } ] - } - } - }, - "ListClustersRequest": { + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" + } + }, + { + "(google.api.method_signature)": "parent,user,user_id" + } + ] + }, + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" + } + }, + { + "(google.api.method_signature)": "user,update_mask" + } + ] + }, + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListClustersRequest": { "fields": { "parent": { "type": "string", @@ -1486,6 +1853,53 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1608,11 +2022,45 @@ } } }, + "PromoteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "RestoreClusterRequest": { "oneofs": { "source": { "oneof": [ - "backupSource" + "backupSource", + "continuousBackupSource" ] } }, @@ -1621,6 +2069,10 @@ "type": "BackupSource", "id": 4 }, + "continuousBackupSource": { + "type": "ContinuousBackupSource", + "id": 8 + }, "parent": { "type": "string", "id": 1, @@ -1770,6 +2222,46 @@ } } }, + "CreateSecondaryInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "CreateInstanceRequests": { "fields": { "createInstanceRequests": { @@ -1962,6 +2454,47 @@ } } }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, "RestartInstanceRequest": { "fields": { "name": { @@ -2228,32 +2761,207 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "verb": { - "type": "string", + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "statusMessage": { - "type": "string", + "allowMissing": { + "type": "bool", "id": 5, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" } }, - "apiVersion": { + "requestId": { "type": "string", - "id": 7, + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -2273,6 +2981,20 @@ "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" }, "nested": { + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, "DatabaseVersion": { "valuesOptions": { "POSTGRES_13": { @@ -2285,13 +3007,6 @@ "POSTGRES_14": 2 } }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, "UserPassword": { "fields": { "user": { @@ -2393,11 +3108,24 @@ }, "nested": { "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, "values": { "SSL_MODE_UNSPECIFIED": 0, "SSL_MODE_ALLOW": 1, "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3 + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 } }, "CaSource": { @@ -2550,6 +3278,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -2684,6 +3419,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "network": { "type": "string", "id": 10, @@ -2721,7 +3463,10 @@ }, "sslConfig": { "type": "SslConfig", - "id": 18 + "id": 18, + "options": { + "deprecated": true + } }, "encryptionConfig": { "type": "EncryptionConfig", @@ -2764,6 +3509,25 @@ } }, "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "SecondaryConfig": { "fields": { "primaryClusterName": { @@ -2934,6 +3698,10 @@ "keyType": "string", "type": "string", "id": 18 + }, + "updatePolicy": { + "type": "UpdatePolicy", + "id": 22 } }, "nested": { @@ -3019,6 +3787,23 @@ } } }, + "UpdatePolicy": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DEFAULT": 1, + "FORCE_APPLY": 2 + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -3071,6 +3856,7 @@ "type": "string", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OUTPUT_ONLY" } }, @@ -3310,6 +4096,53 @@ } } }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, "AlloyDBAdmin": { "options": { "(google.api.default_host)": "alloydb.googleapis.com", @@ -3712,6 +4545,34 @@ } ] }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, "RestartInstance": { "requestType": "RestartInstanceRequest", "responseType": "google.longrunning.Operation", @@ -3817,100 +4678,194 @@ "parsedOptions": [ { "(google.api.http)": { - "patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", - "body": "backup" + "patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/backups/*}", + "(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": "/v1alpha/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSupportedDatabaseFlags": { + "requestType": "ListSupportedDatabaseFlagsRequest", + "responseType": "ListSupportedDatabaseFlagsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GenerateClientCertificate": { + "requestType": "GenerateClientCertificateRequest", + "responseType": "GenerateClientCertificateResponse", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionInfo": { + "requestType": "GetConnectionInfoRequest", + "responseType": "ConnectionInfo", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" } }, { - "(google.api.method_signature)": "backup,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } + "(google.api.method_signature)": "parent" } ] }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/backups/*}" + "get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" } }, { "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } } ] }, - "ListSupportedDatabaseFlags": { - "requestType": "ListSupportedDatabaseFlagsRequest", - "responseType": "ListSupportedDatabaseFlagsResponse", + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags", - "(google.api.method_signature)": "parent" + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "parent,user,user_id" } ] }, - "GenerateClientCertificate": { - "requestType": "GenerateClientCertificateRequest", - "responseType": "GenerateClientCertificateResponse", + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" + "(google.api.http).patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "body": "*" + "patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "user,update_mask" } ] }, - "GetConnectionInfo": { - "requestType": "GetConnectionInfoRequest", - "responseType": "ConnectionInfo", + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", - "(google.api.method_signature)": "parent" + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "name" } ] } @@ -3980,6 +4935,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4574,6 +5536,47 @@ } } }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, "RestartInstanceRequest": { "fields": { "name": { @@ -4824,6 +5827,7 @@ "type": "string", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL" } }, @@ -4833,6 +5837,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "publicKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4852,6 +5863,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "caCert": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4897,46 +5915,221 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "endTime": { - "type": "google.protobuf.Timestamp", + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } }, - "target": { + "requestId": { "type": "string", "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "verb": { - "type": "string", + "validateOnly": { + "type": "bool", "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, - "statusMessage": { - "type": "string", + "allowMissing": { + "type": "bool", "id": 5, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" } }, - "apiVersion": { + "requestId": { "type": "string", - "id": 7, + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -4956,6 +6149,20 @@ "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" }, "nested": { + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, "DatabaseVersion": { "valuesOptions": { "POSTGRES_13": { @@ -4968,13 +6175,6 @@ "POSTGRES_14": 2 } }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, "UserPassword": { "fields": { "user": { @@ -5076,11 +6276,24 @@ }, "nested": { "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, "values": { "SSL_MODE_UNSPECIFIED": 0, "SSL_MODE_ALLOW": 1, "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3 + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 } }, "CaSource": { @@ -5233,6 +6446,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -5367,6 +6587,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "network": { "type": "string", "id": 10, @@ -5404,7 +6631,10 @@ }, "sslConfig": { "type": "SslConfig", - "id": 18 + "id": 18, + "options": { + "deprecated": true + } }, "encryptionConfig": { "type": "EncryptionConfig", @@ -5447,6 +6677,25 @@ } }, "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "SecondaryConfig": { "fields": { "primaryClusterName": { @@ -5617,6 +6866,10 @@ "keyType": "string", "type": "string", "id": 18 + }, + "updatePolicy": { + "type": "UpdatePolicy", + "id": 22 } }, "nested": { @@ -5702,6 +6955,23 @@ } } }, + "UpdatePolicy": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DEFAULT": 1, + "FORCE_APPLY": 2 + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -5754,6 +7024,7 @@ "type": "string", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OUTPUT_ONLY" } }, @@ -5993,6 +7264,53 @@ } } }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, "AlloyDBAdmin": { "options": { "(google.api.default_host)": "alloydb.googleapis.com", @@ -6395,6 +7713,34 @@ } ] }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, "RestartInstance": { "requestType": "RestartInstanceRequest", "responseType": "google.longrunning.Operation", @@ -6515,85 +7861,179 @@ } ] }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/backups/*}", + "(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": "/v1beta/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSupportedDatabaseFlags": { + "requestType": "ListSupportedDatabaseFlagsRequest", + "responseType": "ListSupportedDatabaseFlagsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GenerateClientCertificate": { + "requestType": "GenerateClientCertificateRequest", + "responseType": "GenerateClientCertificateResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionInfo": { + "requestType": "GetConnectionInfoRequest", + "responseType": "ConnectionInfo", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/backups/*}" + "get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" } }, { "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } } ] }, - "ListSupportedDatabaseFlags": { - "requestType": "ListSupportedDatabaseFlagsRequest", - "responseType": "ListSupportedDatabaseFlagsResponse", + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags", - "(google.api.method_signature)": "parent" + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "parent,user,user_id" } ] }, - "GenerateClientCertificate": { - "requestType": "GenerateClientCertificateRequest", - "responseType": "GenerateClientCertificateResponse", + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" + "(google.api.http).patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "body": "*" + "patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "user,update_mask" } ] }, - "GetConnectionInfo": { - "requestType": "GetConnectionInfoRequest", - "responseType": "ConnectionInfo", + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", - "(google.api.method_signature)": "parent" + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + "delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "name" } ] } @@ -6663,6 +8103,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -7257,6 +8704,47 @@ } } }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, "RestartInstanceRequest": { "fields": { "name": { @@ -7507,6 +8995,7 @@ "type": "string", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL" } }, @@ -7516,6 +9005,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "publicKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -7535,6 +9031,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "caCert": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -7623,6 +9126,181 @@ } } } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } } } } diff --git a/packages/google-cloud-alloydb/samples/README.md b/packages/google-cloud-alloydb/samples/README.md index 0d4e2a371de2..8b54391235cb 100644 --- a/packages/google-cloud-alloydb/samples/README.md +++ b/packages/google-cloud-alloydb/samples/README.md @@ -16,73 +16,93 @@ * [Alloy_d_b_admin.create_backup](#alloy_d_b_admin.create_backup) * [Alloy_d_b_admin.create_cluster](#alloy_d_b_admin.create_cluster) * [Alloy_d_b_admin.create_instance](#alloy_d_b_admin.create_instance) + * [Alloy_d_b_admin.create_secondary_cluster](#alloy_d_b_admin.create_secondary_cluster) + * [Alloy_d_b_admin.create_secondary_instance](#alloy_d_b_admin.create_secondary_instance) + * [Alloy_d_b_admin.create_user](#alloy_d_b_admin.create_user) * [Alloy_d_b_admin.delete_backup](#alloy_d_b_admin.delete_backup) * [Alloy_d_b_admin.delete_cluster](#alloy_d_b_admin.delete_cluster) * [Alloy_d_b_admin.delete_instance](#alloy_d_b_admin.delete_instance) + * [Alloy_d_b_admin.delete_user](#alloy_d_b_admin.delete_user) * [Alloy_d_b_admin.failover_instance](#alloy_d_b_admin.failover_instance) * [Alloy_d_b_admin.get_backup](#alloy_d_b_admin.get_backup) * [Alloy_d_b_admin.get_cluster](#alloy_d_b_admin.get_cluster) * [Alloy_d_b_admin.get_instance](#alloy_d_b_admin.get_instance) + * [Alloy_d_b_admin.get_user](#alloy_d_b_admin.get_user) + * [Alloy_d_b_admin.inject_fault](#alloy_d_b_admin.inject_fault) * [Alloy_d_b_admin.list_backups](#alloy_d_b_admin.list_backups) * [Alloy_d_b_admin.list_clusters](#alloy_d_b_admin.list_clusters) * [Alloy_d_b_admin.list_instances](#alloy_d_b_admin.list_instances) * [Alloy_d_b_admin.list_supported_database_flags](#alloy_d_b_admin.list_supported_database_flags) + * [Alloy_d_b_admin.list_users](#alloy_d_b_admin.list_users) + * [Alloy_d_b_admin.promote_cluster](#alloy_d_b_admin.promote_cluster) * [Alloy_d_b_admin.restart_instance](#alloy_d_b_admin.restart_instance) * [Alloy_d_b_admin.restore_cluster](#alloy_d_b_admin.restore_cluster) * [Alloy_d_b_admin.update_backup](#alloy_d_b_admin.update_backup) * [Alloy_d_b_admin.update_cluster](#alloy_d_b_admin.update_cluster) * [Alloy_d_b_admin.update_instance](#alloy_d_b_admin.update_instance) + * [Alloy_d_b_admin.update_user](#alloy_d_b_admin.update_user) * [Alloy_d_b_admin.batch_create_instances](#alloy_d_b_admin.batch_create_instances) * [Alloy_d_b_admin.create_backup](#alloy_d_b_admin.create_backup) * [Alloy_d_b_admin.create_cluster](#alloy_d_b_admin.create_cluster) * [Alloy_d_b_admin.create_instance](#alloy_d_b_admin.create_instance) * [Alloy_d_b_admin.create_secondary_cluster](#alloy_d_b_admin.create_secondary_cluster) * [Alloy_d_b_admin.create_secondary_instance](#alloy_d_b_admin.create_secondary_instance) + * [Alloy_d_b_admin.create_user](#alloy_d_b_admin.create_user) * [Alloy_d_b_admin.delete_backup](#alloy_d_b_admin.delete_backup) * [Alloy_d_b_admin.delete_cluster](#alloy_d_b_admin.delete_cluster) * [Alloy_d_b_admin.delete_instance](#alloy_d_b_admin.delete_instance) + * [Alloy_d_b_admin.delete_user](#alloy_d_b_admin.delete_user) * [Alloy_d_b_admin.failover_instance](#alloy_d_b_admin.failover_instance) * [Alloy_d_b_admin.generate_client_certificate](#alloy_d_b_admin.generate_client_certificate) * [Alloy_d_b_admin.get_backup](#alloy_d_b_admin.get_backup) * [Alloy_d_b_admin.get_cluster](#alloy_d_b_admin.get_cluster) * [Alloy_d_b_admin.get_connection_info](#alloy_d_b_admin.get_connection_info) * [Alloy_d_b_admin.get_instance](#alloy_d_b_admin.get_instance) + * [Alloy_d_b_admin.get_user](#alloy_d_b_admin.get_user) + * [Alloy_d_b_admin.inject_fault](#alloy_d_b_admin.inject_fault) * [Alloy_d_b_admin.list_backups](#alloy_d_b_admin.list_backups) * [Alloy_d_b_admin.list_clusters](#alloy_d_b_admin.list_clusters) * [Alloy_d_b_admin.list_instances](#alloy_d_b_admin.list_instances) * [Alloy_d_b_admin.list_supported_database_flags](#alloy_d_b_admin.list_supported_database_flags) + * [Alloy_d_b_admin.list_users](#alloy_d_b_admin.list_users) * [Alloy_d_b_admin.promote_cluster](#alloy_d_b_admin.promote_cluster) * [Alloy_d_b_admin.restart_instance](#alloy_d_b_admin.restart_instance) * [Alloy_d_b_admin.restore_cluster](#alloy_d_b_admin.restore_cluster) * [Alloy_d_b_admin.update_backup](#alloy_d_b_admin.update_backup) * [Alloy_d_b_admin.update_cluster](#alloy_d_b_admin.update_cluster) * [Alloy_d_b_admin.update_instance](#alloy_d_b_admin.update_instance) + * [Alloy_d_b_admin.update_user](#alloy_d_b_admin.update_user) * [Alloy_d_b_admin.batch_create_instances](#alloy_d_b_admin.batch_create_instances) * [Alloy_d_b_admin.create_backup](#alloy_d_b_admin.create_backup) * [Alloy_d_b_admin.create_cluster](#alloy_d_b_admin.create_cluster) * [Alloy_d_b_admin.create_instance](#alloy_d_b_admin.create_instance) * [Alloy_d_b_admin.create_secondary_cluster](#alloy_d_b_admin.create_secondary_cluster) * [Alloy_d_b_admin.create_secondary_instance](#alloy_d_b_admin.create_secondary_instance) + * [Alloy_d_b_admin.create_user](#alloy_d_b_admin.create_user) * [Alloy_d_b_admin.delete_backup](#alloy_d_b_admin.delete_backup) * [Alloy_d_b_admin.delete_cluster](#alloy_d_b_admin.delete_cluster) * [Alloy_d_b_admin.delete_instance](#alloy_d_b_admin.delete_instance) + * [Alloy_d_b_admin.delete_user](#alloy_d_b_admin.delete_user) * [Alloy_d_b_admin.failover_instance](#alloy_d_b_admin.failover_instance) * [Alloy_d_b_admin.generate_client_certificate](#alloy_d_b_admin.generate_client_certificate) * [Alloy_d_b_admin.get_backup](#alloy_d_b_admin.get_backup) * [Alloy_d_b_admin.get_cluster](#alloy_d_b_admin.get_cluster) * [Alloy_d_b_admin.get_connection_info](#alloy_d_b_admin.get_connection_info) * [Alloy_d_b_admin.get_instance](#alloy_d_b_admin.get_instance) + * [Alloy_d_b_admin.get_user](#alloy_d_b_admin.get_user) + * [Alloy_d_b_admin.inject_fault](#alloy_d_b_admin.inject_fault) * [Alloy_d_b_admin.list_backups](#alloy_d_b_admin.list_backups) * [Alloy_d_b_admin.list_clusters](#alloy_d_b_admin.list_clusters) * [Alloy_d_b_admin.list_instances](#alloy_d_b_admin.list_instances) * [Alloy_d_b_admin.list_supported_database_flags](#alloy_d_b_admin.list_supported_database_flags) + * [Alloy_d_b_admin.list_users](#alloy_d_b_admin.list_users) * [Alloy_d_b_admin.promote_cluster](#alloy_d_b_admin.promote_cluster) * [Alloy_d_b_admin.restart_instance](#alloy_d_b_admin.restart_instance) * [Alloy_d_b_admin.restore_cluster](#alloy_d_b_admin.restore_cluster) * [Alloy_d_b_admin.update_backup](#alloy_d_b_admin.update_backup) * [Alloy_d_b_admin.update_cluster](#alloy_d_b_admin.update_cluster) * [Alloy_d_b_admin.update_instance](#alloy_d_b_admin.update_instance) - * [Quickstart](#quickstart) + * [Alloy_d_b_admin.update_user](#alloy_d_b_admin.update_user) * [Quickstart](#quickstart) ## Before you begin @@ -168,6 +188,57 @@ __Usage:__ +### Alloy_d_b_admin.create_secondary_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js` + + +----- + + + + +### Alloy_d_b_admin.create_secondary_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_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-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js` + + +----- + + + + +### Alloy_d_b_admin.create_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js` + + +----- + + + + ### Alloy_d_b_admin.delete_backup View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js). @@ -219,6 +290,23 @@ __Usage:__ +### Alloy_d_b_admin.delete_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js` + + +----- + + + + ### Alloy_d_b_admin.failover_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js). @@ -287,6 +375,40 @@ __Usage:__ +### Alloy_d_b_admin.get_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js` + + +----- + + + + +### Alloy_d_b_admin.inject_fault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js` + + +----- + + + + ### Alloy_d_b_admin.list_backups View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js). @@ -355,6 +477,40 @@ __Usage:__ +### Alloy_d_b_admin.list_users + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js` + + +----- + + + + +### Alloy_d_b_admin.promote_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js` + + +----- + + + + ### Alloy_d_b_admin.restart_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js). @@ -440,6 +596,23 @@ __Usage:__ +### Alloy_d_b_admin.update_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js` + + +----- + + + + ### Alloy_d_b_admin.batch_create_instances View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js). @@ -542,6 +715,23 @@ __Usage:__ +### Alloy_d_b_admin.create_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js` + + +----- + + + + ### Alloy_d_b_admin.delete_backup View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js). @@ -593,6 +783,23 @@ __Usage:__ +### Alloy_d_b_admin.delete_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js` + + +----- + + + + ### Alloy_d_b_admin.failover_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js). @@ -695,6 +902,40 @@ __Usage:__ +### Alloy_d_b_admin.get_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js` + + +----- + + + + +### Alloy_d_b_admin.inject_fault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js` + + +----- + + + + ### Alloy_d_b_admin.list_backups View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js). @@ -763,6 +1004,23 @@ __Usage:__ +### Alloy_d_b_admin.list_users + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js` + + +----- + + + + ### Alloy_d_b_admin.promote_cluster View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js). @@ -865,6 +1123,23 @@ __Usage:__ +### Alloy_d_b_admin.update_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js` + + +----- + + + + ### Alloy_d_b_admin.batch_create_instances View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js). @@ -967,6 +1242,23 @@ __Usage:__ +### Alloy_d_b_admin.create_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js` + + +----- + + + + ### Alloy_d_b_admin.delete_backup View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js). @@ -1018,6 +1310,23 @@ __Usage:__ +### Alloy_d_b_admin.delete_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js` + + +----- + + + + ### Alloy_d_b_admin.failover_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js). @@ -1120,6 +1429,40 @@ __Usage:__ +### Alloy_d_b_admin.get_user + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js` + + +----- + + + + +### Alloy_d_b_admin.inject_fault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js` + + +----- + + + + ### Alloy_d_b_admin.list_backups View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js). @@ -1188,6 +1531,23 @@ __Usage:__ +### Alloy_d_b_admin.list_users + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js). + +[![Open in Cloud 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-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js` + + +----- + + + + ### Alloy_d_b_admin.promote_cluster View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js). @@ -1290,16 +1650,16 @@ __Usage:__ -### Quickstart +### Alloy_d_b_admin.update_user -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js). -[![Open in Cloud 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-alloydb/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js,samples/README.md) __Usage:__ -`node packages/google-cloud-alloydb/samples/quickstart.js` +`node packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js` ----- @@ -1309,14 +1669,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/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-alloydb/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/quickstart.js,samples/README.md) __Usage:__ -`node packages/google-cloud-alloydb/samples/test/quickstart.js` +`node packages/google-cloud-alloydb/samples/quickstart.js` diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js index e39ba08337ad..17f17f37ce06 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js @@ -29,7 +29,7 @@ function main(parent, clusterId, cluster) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent resource. For the required format, see the + * Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. */ // const parent = 'abc123' diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 000000000000..aec58b13bbc4 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// 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, clusterId, cluster) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_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 location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object (the secondary cluster). + */ + // const clusterId = 'abc123' + /** + * Required. Configuration of the requesting object (the secondary cluster). + */ + // const cluster = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 000000000000..320f99a83f1b --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// 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 alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_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 parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js new file mode 100644 index 000000000000..06f111116274 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// 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, userId, user) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_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. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js new file mode 100644 index 000000000000..10d860ddf9de --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// 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 alloydb_v1_generated_AlloyDBAdmin_DeleteUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js index cd7148d57a63..b32884e92de4 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js @@ -33,6 +33,11 @@ function main(name) { * comment on the Cluster.name field. */ // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js new file mode 100644 index 000000000000..ebd091815127 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.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 alloydb_v1_generated_AlloyDBAdmin_GetUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js new file mode 100644 index 000000000000..5f97744ae378 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// 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(faultType, name) { + // [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_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 type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js new file mode 100644 index 000000000000..e35664eedd22 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// 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 alloydb_v1_generated_AlloyDBAdmin_ListUsers_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 value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 000000000000..374b2efc5c94 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,88 @@ +// 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 alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_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 resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callPromoteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.promoteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js index c0cd4675f3c2..f5c3d9b0c04d 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js @@ -32,6 +32,11 @@ function main(parent, clusterId, cluster) { * Backup source. */ // const backupSource = {} + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + */ + // const continuousBackupSource = {} /** * Required. The name of the parent resource. For the required format, see the * comment on the Cluster.name field. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js new file mode 100644 index 000000000000..44e3c468fd03 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// 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(user) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json index d5cd01ea4752..b5eaef115607 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -90,6 +90,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1.ClusterView" } ], "resultType": ".google.cloud.alloydb.v1.Cluster", @@ -275,6 +279,58 @@ } } }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async", + "title": "AlloyDBAdmin promoteCluster Sample", + "origin": "API_DEFINITION", + "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.promote_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async", "title": "AlloyDBAdmin restoreCluster Sample", @@ -286,7 +342,7 @@ "segments": [ { "start": 25, - "end": 89, + "end": 94, "type": "FULL" } ], @@ -299,6 +355,10 @@ "name": "backup_source", "type": ".google.cloud.alloydb.v1.BackupSource" }, + { + "name": "continuous_backup_source", + "type": ".google.cloud.alloydb.v1.ContinuousBackupSource" + }, { "name": "parent", "type": "TYPE_STRING" @@ -335,6 +395,62 @@ } } }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async", + "title": "AlloyDBAdmin createSecondaryCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListInstances_async", "title": "AlloyDBAdmin listInstances Sample", @@ -491,6 +607,62 @@ } } }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async", + "title": "AlloyDBAdmin createSecondaryInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SECONDARY Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async", "title": "AlloyDBAdmin batchCreateInstances Sample", @@ -695,6 +867,58 @@ } } }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async", "title": "AlloyDBAdmin restartInstance Sample", @@ -1050,6 +1274,262 @@ } } } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js index cf7b820d471a..60bfe7a2d319 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js @@ -29,7 +29,7 @@ function main(parent, clusterId, cluster) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent resource. For the required format, see the + * Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. */ // const parent = 'abc123' diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js index bb47f77d9d64..bbf1a8bb324f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js @@ -29,8 +29,8 @@ function main(parent, clusterId, cluster) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent resource (the primary cluster). For the - * required format, see the comment on the Cluster.name field. + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js new file mode 100644 index 000000000000..c17313229cbf --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// 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, userId, user) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_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. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js new file mode 100644 index 000000000000..ccae6f071fd8 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// 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 alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js index 5282130bb476..a6e93141ab58 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js @@ -59,6 +59,10 @@ function main(parent) { * default duration. */ // const certDuration = {} + /** + * Optional. The public key from the client. + */ + // const publicKey = 'abc123' // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js index 8bc210176ecc..105fe1770196 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js @@ -33,6 +33,11 @@ function main(name) { * comment on the Cluster.name field. */ // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js new file mode 100644 index 000000000000..c9bc60e0f225 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.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 alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js new file mode 100644 index 000000000000..77f3909226d6 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// 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(faultType, name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_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 type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js new file mode 100644 index 000000000000..8ad052f5026f --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// 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 alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_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 value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js new file mode 100644 index 000000000000..102a1f5a7ded --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// 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(user) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json index defac3638722..0d8ddea316d0 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -90,6 +90,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1alpha.ClusterView" } ], "resultType": ".google.cloud.alloydb.v1alpha.Cluster", @@ -863,6 +867,58 @@ } } }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async", "title": "AlloyDBAdmin restartInstance Sample", @@ -1230,7 +1286,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 84, "type": "FULL" } ], @@ -1254,6 +1310,10 @@ { "name": "cert_duration", "type": ".google.protobuf.Duration" + }, + { + "name": "public_key", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse", @@ -1314,6 +1374,262 @@ } } } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1alpha.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1alpha.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js index 1bfdaa013423..007b2035e5ad 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js @@ -29,7 +29,7 @@ function main(parent, clusterId, cluster) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent resource. For the required format, see the + * Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. */ // const parent = 'abc123' diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js index 987b96503862..3648ea69ddab 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js @@ -29,8 +29,8 @@ function main(parent, clusterId, cluster) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent resource (the primary cluster). For the - * required format, see the comment on the Cluster.name field. + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js new file mode 100644 index 000000000000..35b545f5787c --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// 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, userId, user) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_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. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js new file mode 100644 index 000000000000..1c136516dbc5 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// 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 alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js index 80a34ec35f80..dc803703ca16 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js @@ -59,6 +59,10 @@ function main(parent) { * default duration. */ // const certDuration = {} + /** + * Optional. The public key from the client. + */ + // const publicKey = 'abc123' // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js index f2887d12b748..f59851b0aa05 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js @@ -33,6 +33,11 @@ function main(name) { * comment on the Cluster.name field. */ // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js new file mode 100644 index 000000000000..e929520ef15e --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.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 alloydb_v1beta_generated_AlloyDBAdmin_GetUser_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 resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js new file mode 100644 index 000000000000..70ec80b1e149 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// 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(faultType, name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_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 type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js new file mode 100644 index 000000000000..6b6fd77d14b2 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// 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 alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_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 value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js new file mode 100644 index 000000000000..5b9f0aea08e0 --- /dev/null +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// 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(user) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json index d6f8f0b62163..035e45d80cfd 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -90,6 +90,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1beta.ClusterView" } ], "resultType": ".google.cloud.alloydb.v1beta.Cluster", @@ -863,6 +867,58 @@ } } }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, { "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async", "title": "AlloyDBAdmin restartInstance Sample", @@ -1230,7 +1286,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 84, "type": "FULL" } ], @@ -1254,6 +1310,10 @@ { "name": "cert_duration", "type": ".google.protobuf.Duration" + }, + { + "name": "public_key", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse", @@ -1314,6 +1374,262 @@ } } } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1beta.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1beta.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts index 1bc36a316af4..591dce74f78d 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts @@ -211,6 +211,9 @@ export class AlloyDBAdminClient { supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/flags/{flag}' ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), }; // Some of the methods on this service return "paged" results, @@ -237,6 +240,11 @@ export class AlloyDBAdminClient { 'nextPageToken', 'supportedDatabaseFlags' ), + listUsers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'users' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -298,18 +306,36 @@ export class AlloyDBAdminClient { const deleteClusterMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.OperationMetadata' ) as gax.protobuf.Type; + const promoteClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster' + ) as gax.protobuf.Type; + const promoteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata' + ) as gax.protobuf.Type; const restoreClusterResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.Cluster' ) as gax.protobuf.Type; const restoreClusterMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.OperationMetadata' ) as gax.protobuf.Type; + const createSecondaryClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster' + ) as gax.protobuf.Type; + const createSecondaryClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata' + ) as gax.protobuf.Type; const createInstanceResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.Instance' ) as gax.protobuf.Type; const createInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.OperationMetadata' ) as gax.protobuf.Type; + const createSecondaryInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance' + ) as gax.protobuf.Type; + const createSecondaryInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata' + ) as gax.protobuf.Type; const batchCreateInstancesResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.BatchCreateInstancesResponse' ) as gax.protobuf.Type; @@ -334,6 +360,12 @@ export class AlloyDBAdminClient { const failoverInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.OperationMetadata' ) as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance' + ) as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata' + ) as gax.protobuf.Type; const restartInstanceResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1.Instance' ) as gax.protobuf.Type; @@ -375,16 +407,39 @@ export class AlloyDBAdminClient { deleteClusterResponse.decode.bind(deleteClusterResponse), deleteClusterMetadata.decode.bind(deleteClusterMetadata) ), + promoteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteClusterResponse.decode.bind(promoteClusterResponse), + promoteClusterMetadata.decode.bind(promoteClusterMetadata) + ), restoreCluster: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restoreClusterResponse.decode.bind(restoreClusterResponse), restoreClusterMetadata.decode.bind(restoreClusterMetadata) ), + createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryClusterResponse.decode.bind( + createSecondaryClusterResponse + ), + createSecondaryClusterMetadata.decode.bind( + createSecondaryClusterMetadata + ) + ), createInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), createInstanceMetadata.decode.bind(createInstanceMetadata) ), + createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryInstanceResponse.decode.bind( + createSecondaryInstanceResponse + ), + createSecondaryInstanceMetadata.decode.bind( + createSecondaryInstanceMetadata + ) + ), batchCreateInstances: new this._gaxModule.LongrunningDescriptor( this.operationsClient, batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), @@ -405,6 +460,11 @@ export class AlloyDBAdminClient { failoverInstanceResponse.decode.bind(failoverInstanceResponse), failoverInstanceMetadata.decode.bind(failoverInstanceMetadata) ), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata) + ), restartInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restartInstanceResponse.decode.bind(restartInstanceResponse), @@ -482,14 +542,18 @@ export class AlloyDBAdminClient { 'createCluster', 'updateCluster', 'deleteCluster', + 'promoteCluster', 'restoreCluster', + 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', + 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', + 'injectFault', 'restartInstance', 'listBackups', 'getBackup', @@ -497,6 +561,11 @@ export class AlloyDBAdminClient { 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', + 'listUsers', + 'getUser', + 'createUser', + 'updateUser', + 'deleteUser', ]; for (const methodName of alloyDBAdminStubMethods) { const callPromise = this.alloyDBAdminStub.then( @@ -591,6 +660,9 @@ export class AlloyDBAdminClient { * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -836,18 +908,100 @@ export class AlloyDBAdminClient { this.initialize(); return this.innerApiCalls.getBackup(request, options, callback); } - /** - * Creates a new Cluster in a given project and location. + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1.IGetUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | undefined, + {} | undefined + ] + >; + getUser( + request: protos.google.cloud.alloydb.v1.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request: protos.google.cloud.alloydb.v1.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request?: protos.google.cloud.alloydb.v1.IGetUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | 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.getUser(request, options, callback); + } + /** + * Creates a new User in a given project, location, and cluster. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId + * Required. Value for parent. + * @param {string} request.userId * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * @param {google.cloud.alloydb.v1.User} request.user * Required. The resource being created * @param {string} [request.requestId] * Optional. An optional request ID to identify requests. Specify a unique @@ -864,84 +1018,63 @@ export class AlloyDBAdminClient { * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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. + * The first element of the array is an object representing {@link google.cloud.alloydb.v1.User | User}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateUser_async */ - createCluster( - request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + createUser( + request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | undefined, {} | undefined ] >; - createCluster( - request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + createUser( + request: protos.google.cloud.alloydb.v1.ICreateUserRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined > ): void; - createCluster( - request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + createUser( + request: protos.google.cloud.alloydb.v1.ICreateUserRequest, callback: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined > ): void; - createCluster( - request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + createUser( + request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | undefined, {} | undefined ] > | void { @@ -961,55 +1094,20 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); - } - /** - * Check the status of the long running operation returned by `createCluster()`. - * @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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async - */ - async checkCreateClusterProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.alloydb.v1.Cluster, - protos.google.cloud.alloydb.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.createCluster, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.alloydb.v1.Cluster, - protos.google.cloud.alloydb.v1.OperationMetadata - >; + return this.innerApiCalls.createUser(request, options, callback); } /** - * Updates the parameters of a single Cluster. + * Updates the parameters of a single User. * * @param {Object} request * The request object that will be sent. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. Field mask is used to specify the fields to be overwritten in the - * Cluster resource by the update. + * User resource by the update. * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. If the * user does not provide a mask then all fields will be overwritten. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * @param {google.cloud.alloydb.v1.User} request.user * Required. The resource being updated * @param {string} [request.requestId] * Optional. An optional request ID to identify requests. Specify a unique @@ -1026,87 +1124,65 @@ export class AlloyDBAdminClient { * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. * @param {boolean} [request.allowMissing] - * Optional. If set to true, update succeeds even if cluster is not found. In - * that case, a new cluster is created and `update_mask` is ignored. + * Optional. Allow missing fields in the update mask. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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. + * The first element of the array is an object representing {@link google.cloud.alloydb.v1.User | User}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async */ - updateCluster( - request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + updateUser( + request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | undefined, {} | undefined ] >; - updateCluster( - request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + updateUser( + request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | null | undefined, {} | null | undefined > ): void; - updateCluster( - request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + updateUser( + request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, callback: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | null | undefined, {} | null | undefined > ): void; - updateCluster( - request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + updateUser( + request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | null | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | null | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | undefined, {} | undefined ] > | void { @@ -1123,39 +1199,757 @@ export class AlloyDBAdminClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'cluster.name': request.cluster!.name ?? '', + 'user.name': request.user!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); + return this.innerApiCalls.updateUser(request, options, callback); } /** - * Check the status of the long running operation returned by `updateCluster()`. - * @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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async - */ - async checkUpdateClusterProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.alloydb.v1.Cluster, - protos.google.cloud.alloydb.v1.OperationMetadata - > - > { - const request = + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | undefined, + {} | undefined + ] + >; + deleteUser( + request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | 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.deleteUser(request, options, callback); + } + + /** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCluster( + request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.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.createCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCluster()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async + */ + async checkCreateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.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.createCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * request. + * @param {boolean} [request.allowMissing] + * Optional. If set to true, update succeeds even if cluster is not found. In + * that case, a new cluster is created and `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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCluster( + request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.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({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCluster()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async + */ + async checkUpdateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.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.updateCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.OperationMetadata + >; + } + /** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.etag] + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @param {boolean} [request.force] + * Optional. Whether to cascade delete child instances for given cluster. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCluster( + request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.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.deleteCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCluster()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + */ + async checkDeleteClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.alloydb.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.deleteCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1.OperationMetadata + >; + } + /** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.etag] + * Optional. The current etag of the Cluster. + * If an etag is provided and does not match the current etag of the Cluster, + * deletion will be blocked and an ABORTED error will be returned. + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async + */ + promoteCluster( + request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + promoteCluster( + request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + promoteCluster( + request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + promoteCluster( + request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.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.promoteCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `promoteCluster()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async + */ + async checkPromoteClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.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.updateCluster, + this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1164,18 +1958,29 @@ export class AlloyDBAdminClient { >; } /** - * Deletes a single Cluster. + * Creates a new Cluster in a given project and location, with a volume + * restored from the provided source, either a backup ID or a point-in-time + * and a source cluster. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the + * @param {google.cloud.alloydb.v1.BackupSource} request.backupSource + * Backup source. + * @param {google.cloud.alloydb.v1.ContinuousBackupSource} request.continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being created * @param {string} [request.requestId] * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * guarantee that for at least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1185,15 +1990,10 @@ export class AlloyDBAdminClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). - * @param {string} [request.etag] - * Optional. The current etag of the Cluster. - * If an etag is provided and does not match the current etag of the Cluster, - * deletion will be blocked and an ABORTED error will be returned. * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @param {boolean} [request.force] - * Optional. Whether to cascade delete child instances for given cluster. + * any other type of validation), but do not actually execute the import + * request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1203,52 +2003,52 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async */ - deleteCluster( - request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + restoreCluster( + request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteCluster( - request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + restoreCluster( + request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteCluster( - request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + restoreCluster( + request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteCluster( - request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + restoreCluster( + request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1256,7 +2056,7 @@ export class AlloyDBAdminClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1265,7 +2065,7 @@ export class AlloyDBAdminClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1285,13 +2085,179 @@ export class AlloyDBAdminClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); + return this.innerApiCalls.restoreCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restoreCluster()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async + */ + async checkRestoreClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.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.restoreCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.OperationMetadata + >; + } + /** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object (the secondary cluster). + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the create + * request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.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.createSecondaryCluster( + request, + options, + callback + ); } /** - * Check the status of the long running operation returned by `deleteCluster()`. + * Check the status of the long running operation returned by `createSecondaryCluster()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1299,14 +2265,14 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async */ - async checkDeleteClusterProgress( + async checkCreateSecondaryClusterProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata > > { @@ -1317,29 +2283,25 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteCluster, + this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1.Cluster, protos.google.cloud.alloydb.v1.OperationMetadata >; } /** - * Creates a new Cluster in a given project and location, with a volume - * restored from the provided source, either a backup ID or a point-in-time - * and a source cluster. + * Creates a new Instance in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {google.cloud.alloydb.v1.BackupSource} request.backupSource - * Backup source. * @param {string} request.parent * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId + * comment on the Instance.name field. + * @param {string} request.instanceId * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * @param {google.cloud.alloydb.v1.Instance} request.instance * Required. The resource being created * @param {string} [request.requestId] * Optional. An optional request ID to identify requests. Specify a unique @@ -1357,7 +2319,7 @@ export class AlloyDBAdminClient { * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import + * any other type of validation), but do not actually execute the create * request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1368,52 +2330,52 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async */ - restoreCluster( - request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + createInstance( + request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - restoreCluster( - request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + createInstance( + request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - restoreCluster( - request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + createInstance( + request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, callback: Callback< LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - restoreCluster( - request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + createInstance( + request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1421,7 +2383,7 @@ export class AlloyDBAdminClient { >, callback?: Callback< LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1430,7 +2392,7 @@ export class AlloyDBAdminClient { ): Promise< [ LROperation< - protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1453,10 +2415,10 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.restoreCluster(request, options, callback); + return this.innerApiCalls.createInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `restoreCluster()`. + * 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. @@ -1464,14 +2426,14 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async */ - async checkRestoreClusterProgress( + async checkCreateInstanceProgress( name: string ): Promise< LROperation< - protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata > > { @@ -1482,16 +2444,16 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.restoreCluster, + this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata >; } /** - * Creates a new Instance in a given project and location. + * Creates a new SECONDARY Instance in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -1529,11 +2491,11 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async */ - createInstance( - request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, options?: CallOptions ): Promise< [ @@ -1545,8 +2507,8 @@ export class AlloyDBAdminClient { {} | undefined ] >; - createInstance( - request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, options: CallOptions, callback: Callback< LROperation< @@ -1557,8 +2519,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - createInstance( - request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, callback: Callback< LROperation< protos.google.cloud.alloydb.v1.IInstance, @@ -1568,8 +2530,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - createInstance( - request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1614,10 +2576,14 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); + return this.innerApiCalls.createSecondaryInstance( + request, + options, + callback + ); } /** - * Check the status of the long running operation returned by `createInstance()`. + * Check the status of the long running operation returned by `createSecondaryInstance()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1625,10 +2591,10 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async */ - async checkCreateInstanceProgress( + async checkCreateSecondaryInstanceProgress( name: string ): Promise< LROperation< @@ -1643,7 +2609,7 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.createInstance, + this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1971,16 +2937,178 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.updateInstance, + this.descriptors.longrunning.updateInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.alloydb.v1.Instance, + protos.google.cloud.alloydb.v1.OperationMetadata + >; + } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.etag] + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.alloydb.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.cloud.alloydb.v1.Instance, + protos.google.protobuf.Empty, protos.google.cloud.alloydb.v1.OperationMetadata >; } /** - * Deletes a single Instance. + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. * * @param {Object} request * The request object that will be sent. @@ -2001,13 +3129,9 @@ export class AlloyDBAdminClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). - * @param {string} [request.etag] - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * any other type of validation), but do not actually execute the failover. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2017,52 +3141,52 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteInstance( - request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2070,7 +3194,7 @@ export class AlloyDBAdminClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2079,7 +3203,7 @@ export class AlloyDBAdminClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2102,10 +3226,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + return this.innerApiCalls.failoverInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteInstance()`. + * Check the status of the long running operation returned by `failoverInstance()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2113,14 +3237,14 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async */ - async checkDeleteInstanceProgress( + async checkFailoverInstanceProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata > > { @@ -2131,21 +3255,22 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteInstance, + this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1.Instance, protos.google.cloud.alloydb.v1.OperationMetadata >; } /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. + * Injects fault in an instance. * Imperative only. * * @param {Object} request * The request object that will be sent. + * @param {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Instance.name field. @@ -2165,7 +3290,8 @@ export class AlloyDBAdminClient { * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * any other type of validation), but do not actually execute the fault + * injection. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2175,11 +3301,11 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, options?: CallOptions ): Promise< [ @@ -2191,8 +3317,8 @@ export class AlloyDBAdminClient { {} | undefined ] >; - failoverInstance( - request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, options: CallOptions, callback: Callback< LROperation< @@ -2203,8 +3329,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, callback: Callback< LROperation< protos.google.cloud.alloydb.v1.IInstance, @@ -2214,8 +3340,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2260,10 +3386,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + return this.innerApiCalls.injectFault(request, options, callback); } /** - * Check the status of the long running operation returned by `failoverInstance()`. + * Check the status of the long running operation returned by `injectFault()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2271,10 +3397,10 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async */ - async checkFailoverInstanceProgress( + async checkInjectFaultProgress( name: string ): Promise< LROperation< @@ -2289,7 +3415,7 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.failoverInstance, + this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -3769,6 +4895,202 @@ export class AlloyDBAdminClient { callSettings ) as AsyncIterable; } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.alloydb.v1.User | User}. + * 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest | null, + protos.google.cloud.alloydb.v1.IListUsersResponse + ] + >; + listUsers( + request: protos.google.cloud.alloydb.v1.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1.IUser + > + ): void; + listUsers( + request: protos.google.cloud.alloydb.v1.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1.IUser + > + ): void; + listUsers( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1.IUser + >, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1.IUser + > + ): Promise< + [ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest | null, + protos.google.cloud.alloydb.v1.IListUsersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listUsers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.alloydb.v1.User | User} 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.alloydb.v1.User | User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] 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. @@ -4449,6 +5771,68 @@ export class AlloyDBAdminClient { ).flag; } + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project: string, location: string, cluster: string, user: string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json index 2e9ce8ba519f..36f5fba71c06 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json @@ -57,11 +57,21 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "RestoreCluster": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListInstances": { "timeout_millis": 60000, "retry_codes_name": "unavailable", @@ -77,6 +87,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "BatchCreateInstances": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -97,6 +112,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "RestartInstance": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -131,6 +151,31 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-alloydb/src/v1/gapic_metadata.json b/packages/google-cloud-alloydb/src/v1/gapic_metadata.json index f137a5494888..6adc76c380df 100644 --- a/packages/google-cloud-alloydb/src/v1/gapic_metadata.json +++ b/packages/google-cloud-alloydb/src/v1/gapic_metadata.json @@ -25,6 +25,26 @@ "getBackup" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -40,16 +60,31 @@ "deleteCluster" ] }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, "RestoreCluster": { "methods": [ "restoreCluster" ] }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, "CreateInstance": { "methods": [ "createInstance" ] }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, "BatchCreateInstances": { "methods": [ "batchCreateInstances" @@ -70,6 +105,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -117,6 +157,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } }, @@ -138,6 +185,26 @@ "getBackup" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -153,16 +220,31 @@ "deleteCluster" ] }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, "RestoreCluster": { "methods": [ "restoreCluster" ] }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, "CreateInstance": { "methods": [ "createInstance" ] }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, "BatchCreateInstances": { "methods": [ "batchCreateInstances" @@ -183,6 +265,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -230,6 +317,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } } diff --git a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts index a21bc212566f..86aa80cac1c5 100644 --- a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts @@ -214,6 +214,9 @@ export class AlloyDBAdminClient { supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/flags/{flag}' ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), }; // Some of the methods on this service return "paged" results, @@ -240,6 +243,11 @@ export class AlloyDBAdminClient { 'nextPageToken', 'supportedDatabaseFlags' ), + listUsers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'users' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -355,6 +363,12 @@ export class AlloyDBAdminClient { const failoverInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1alpha.OperationMetadata' ) as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance' + ) as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata' + ) as gax.protobuf.Type; const restartInstanceResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1alpha.Instance' ) as gax.protobuf.Type; @@ -449,6 +463,11 @@ export class AlloyDBAdminClient { failoverInstanceResponse.decode.bind(failoverInstanceResponse), failoverInstanceMetadata.decode.bind(failoverInstanceMetadata) ), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata) + ), restartInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restartInstanceResponse.decode.bind(restartInstanceResponse), @@ -537,6 +556,7 @@ export class AlloyDBAdminClient { 'updateInstance', 'deleteInstance', 'failoverInstance', + 'injectFault', 'restartInstance', 'listBackups', 'getBackup', @@ -546,6 +566,11 @@ export class AlloyDBAdminClient { 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', + 'listUsers', + 'getUser', + 'createUser', + 'updateUser', + 'deleteUser', ]; for (const methodName of alloyDBAdminStubMethods) { const callPromise = this.alloyDBAdminStub.then( @@ -640,6 +665,9 @@ export class AlloyDBAdminClient { * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1alpha.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -931,6 +959,8 @@ export class AlloyDBAdminClient { * 24 hours. The endpoint may or may not honor the hint. If the hint is left * unspecified or is not honored, then the endpoint will pick an appropriate * default duration. + * @param {string} [request.publicKey] + * Optional. The public key from the client. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1131,6 +1161,411 @@ export class AlloyDBAdminClient { this.initialize(); return this.innerApiCalls.getConnectionInfo(request, options, callback); } + /** + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1alpha.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | undefined, + {} | undefined + ] + >; + getUser( + request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.IGetUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | 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.getUser(request, options, callback); + } + /** + * Creates a new User in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.userId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.User} request.user + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1alpha.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async + */ + createUser( + request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | undefined, + {} | undefined + ] + >; + createUser( + request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + createUser( + request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + createUser( + request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.ICreateUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | 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.createUser(request, options, callback); + } + /** + * Updates the parameters of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.alloydb.v1alpha.User} request.user + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * Optional. Allow missing fields in the update mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1alpha.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async + */ + updateUser( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | undefined, + {} | undefined + ] + >; + updateUser( + request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + updateUser( + request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + updateUser( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | 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({ + 'user.name': request.user!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateUser(request, options, callback); + } + /** + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | undefined, + {} | undefined + ] + >; + deleteUser( + request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | 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.deleteUser(request, options, callback); + } /** * Creates a new Cluster in a given project and location. @@ -1138,7 +1573,7 @@ export class AlloyDBAdminClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the + * Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param {string} request.clusterId * Required. ID of the requesting object. @@ -1958,8 +2393,8 @@ export class AlloyDBAdminClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent resource (the primary cluster). For the - * required format, see the comment on the Cluster.name field. + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. * @param {string} request.clusterId * Required. ID of the requesting object (the secondary cluster). * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster @@ -2767,12 +3202,174 @@ export class AlloyDBAdminClient { this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.alloydb.v1alpha.Instance, + protos.google.cloud.alloydb.v1alpha.Instance, + protos.google.cloud.alloydb.v1alpha.OperationMetadata + >; + } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.etag] + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1alpha.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.alloydb.v1alpha.OperationMetadata >; } /** - * Deletes a single Instance. + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. * * @param {Object} request * The request object that will be sent. @@ -2793,13 +3390,9 @@ export class AlloyDBAdminClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). - * @param {string} [request.etag] - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * any other type of validation), but do not actually execute the failover. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2809,52 +3402,52 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteInstance( - request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2862,7 +3455,7 @@ export class AlloyDBAdminClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2871,7 +3464,7 @@ export class AlloyDBAdminClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2894,10 +3487,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + return this.innerApiCalls.failoverInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteInstance()`. + * Check the status of the long running operation returned by `failoverInstance()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2905,14 +3498,14 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async */ - async checkDeleteInstanceProgress( + async checkFailoverInstanceProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1alpha.Instance, protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { @@ -2923,21 +3516,22 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteInstance, + this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1alpha.Instance, protos.google.cloud.alloydb.v1alpha.OperationMetadata >; } /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. + * Injects fault in an instance. * Imperative only. * * @param {Object} request * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Instance.name field. @@ -2957,7 +3551,8 @@ export class AlloyDBAdminClient { * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * any other type of validation), but do not actually execute the fault + * injection. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2967,11 +3562,11 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, options?: CallOptions ): Promise< [ @@ -2983,8 +3578,8 @@ export class AlloyDBAdminClient { {} | undefined ] >; - failoverInstance( - request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, options: CallOptions, callback: Callback< LROperation< @@ -2995,8 +3590,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, callback: Callback< LROperation< protos.google.cloud.alloydb.v1alpha.IInstance, @@ -3006,8 +3601,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, optionsOrCallback?: | CallOptions | Callback< @@ -3052,10 +3647,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + return this.innerApiCalls.injectFault(request, options, callback); } /** - * Check the status of the long running operation returned by `failoverInstance()`. + * Check the status of the long running operation returned by `injectFault()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -3063,10 +3658,10 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async */ - async checkFailoverInstanceProgress( + async checkInjectFaultProgress( name: string ): Promise< LROperation< @@ -3081,7 +3676,7 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.failoverInstance, + this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -4579,6 +5174,204 @@ export class AlloyDBAdminClient { callSettings ) as AsyncIterable; } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.alloydb.v1alpha.User | User}. + * 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest | null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse + ] + >; + listUsers( + request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1alpha.IUser + > + ): void; + listUsers( + request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1alpha.IUser + > + ): void; + listUsers( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + | protos.google.cloud.alloydb.v1alpha.IListUsersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.IUser + >, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1alpha.IUser + > + ): Promise< + [ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest | null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listUsers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.alloydb.v1alpha.User | User} 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.alloydb.v1alpha.User | User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] 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. @@ -5334,6 +6127,68 @@ export class AlloyDBAdminClient { ).flag; } + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project: string, location: string, cluster: string, user: string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json index c9e1211004bb..3ba95e2d1923 100644 --- a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json +++ b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json @@ -112,6 +112,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "RestartInstance": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -156,6 +161,31 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-alloydb/src/v1alpha/gapic_metadata.json b/packages/google-cloud-alloydb/src/v1alpha/gapic_metadata.json index 9440fb72b729..dc65d97c1e59 100644 --- a/packages/google-cloud-alloydb/src/v1alpha/gapic_metadata.json +++ b/packages/google-cloud-alloydb/src/v1alpha/gapic_metadata.json @@ -35,6 +35,26 @@ "getConnectionInfo" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -95,6 +115,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -142,6 +167,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } }, @@ -173,6 +205,26 @@ "getConnectionInfo" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -233,6 +285,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -280,6 +337,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } } diff --git a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts index 6b6291b1589e..415bdaed8137 100644 --- a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts @@ -214,6 +214,9 @@ export class AlloyDBAdminClient { supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/flags/{flag}' ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), }; // Some of the methods on this service return "paged" results, @@ -240,6 +243,11 @@ export class AlloyDBAdminClient { 'nextPageToken', 'supportedDatabaseFlags' ), + listUsers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'users' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -354,6 +362,12 @@ export class AlloyDBAdminClient { const failoverInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.alloydb.v1beta.OperationMetadata' ) as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance' + ) as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata' + ) as gax.protobuf.Type; const restartInstanceResponse = protoFilesRoot.lookup( '.google.cloud.alloydb.v1beta.Instance' ) as gax.protobuf.Type; @@ -448,6 +462,11 @@ export class AlloyDBAdminClient { failoverInstanceResponse.decode.bind(failoverInstanceResponse), failoverInstanceMetadata.decode.bind(failoverInstanceMetadata) ), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata) + ), restartInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restartInstanceResponse.decode.bind(restartInstanceResponse), @@ -536,6 +555,7 @@ export class AlloyDBAdminClient { 'updateInstance', 'deleteInstance', 'failoverInstance', + 'injectFault', 'restartInstance', 'listBackups', 'getBackup', @@ -545,6 +565,11 @@ export class AlloyDBAdminClient { 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', + 'listUsers', + 'getUser', + 'createUser', + 'updateUser', + 'deleteUser', ]; for (const methodName of alloyDBAdminStubMethods) { const callPromise = this.alloyDBAdminStub.then( @@ -639,6 +664,9 @@ export class AlloyDBAdminClient { * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1beta.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -924,6 +952,8 @@ export class AlloyDBAdminClient { * 24 hours. The endpoint may or may not honor the hint. If the hint is left * unspecified or is not honored, then the endpoint will pick an appropriate * default duration. + * @param {string} [request.publicKey] + * Optional. The public key from the client. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1124,6 +1154,409 @@ export class AlloyDBAdminClient { this.initialize(); return this.innerApiCalls.getConnectionInfo(request, options, callback); } + /** + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1beta.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | undefined, + {} | undefined + ] + >; + getUser( + request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): void; + getUser( + request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | 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.getUser(request, options, callback); + } + /** + * Creates a new User in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.userId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.User} request.user + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1beta.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async + */ + createUser( + request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | undefined, + {} | undefined + ] + >; + createUser( + request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + createUser( + request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + createUser( + request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + | protos.google.cloud.alloydb.v1beta.ICreateUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | 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.createUser(request, options, callback); + } + /** + * Updates the parameters of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * User resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.alloydb.v1beta.User} request.user + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * Optional. Allow missing fields in the update mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.alloydb.v1beta.User | User}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async + */ + updateUser( + request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | undefined, + {} | undefined + ] + >; + updateUser( + request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + updateUser( + request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): void; + updateUser( + request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + | protos.google.cloud.alloydb.v1beta.IUpdateUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | 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({ + 'user.name': request.user!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateUser(request, options, callback); + } + /** + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.protobuf.Empty | Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | undefined, + {} | undefined + ] + >; + deleteUser( + request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.alloydb.v1beta.IDeleteUserRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | 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.deleteUser(request, options, callback); + } /** * Creates a new Cluster in a given project and location. @@ -1131,7 +1564,7 @@ export class AlloyDBAdminClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the + * Required. The location of the new cluster. For the required format, see the * comment on the Cluster.name field. * @param {string} request.clusterId * Required. ID of the requesting object. @@ -1951,8 +2384,8 @@ export class AlloyDBAdminClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent resource (the primary cluster). For the - * required format, see the comment on the Cluster.name field. + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. * @param {string} request.clusterId * Required. ID of the requesting object (the secondary cluster). * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster @@ -2760,12 +3193,174 @@ export class AlloyDBAdminClient { this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.alloydb.v1beta.Instance, + protos.google.cloud.alloydb.v1beta.Instance, + protos.google.cloud.alloydb.v1beta.OperationMetadata + >; + } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.etag] + * Optional. The current etag of the Instance. + * If an etag is provided and does not match the current etag of the Instance, + * deletion will be blocked and an ABORTED error will be returned. + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1beta.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.alloydb.v1beta.OperationMetadata >; } /** - * Deletes a single Instance. + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. * * @param {Object} request * The request object that will be sent. @@ -2786,13 +3381,9 @@ export class AlloyDBAdminClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). - * @param {string} [request.etag] - * Optional. The current etag of the Instance. - * If an etag is provided and does not match the current etag of the Instance, - * deletion will be blocked and an ABORTED error will be returned. * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * any other type of validation), but do not actually execute the failover. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2802,52 +3393,52 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteInstance( - request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + failoverInstance( + request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + failoverInstance( + request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2855,7 +3446,7 @@ export class AlloyDBAdminClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2864,7 +3455,7 @@ export class AlloyDBAdminClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2887,10 +3478,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + return this.innerApiCalls.failoverInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteInstance()`. + * Check the status of the long running operation returned by `failoverInstance()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2898,14 +3489,14 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async */ - async checkDeleteInstanceProgress( + async checkFailoverInstanceProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1beta.Instance, protos.google.cloud.alloydb.v1beta.OperationMetadata > > { @@ -2916,21 +3507,22 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteInstance, + this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.alloydb.v1beta.Instance, protos.google.cloud.alloydb.v1beta.OperationMetadata >; } /** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. + * Injects fault in an instance. * Imperative only. * * @param {Object} request * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. * @param {string} request.name * Required. The name of the resource. For the required format, see the * comment on the Instance.name field. @@ -2950,7 +3542,8 @@ export class AlloyDBAdminClient { * not supported (00000000-0000-0000-0000-000000000000). * @param {boolean} [request.validateOnly] * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * any other type of validation), but do not actually execute the fault + * injection. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2960,11 +3553,11 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, options?: CallOptions ): Promise< [ @@ -2976,8 +3569,8 @@ export class AlloyDBAdminClient { {} | undefined ] >; - failoverInstance( - request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, options: CallOptions, callback: Callback< LROperation< @@ -2988,8 +3581,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + injectFault( + request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, callback: Callback< LROperation< protos.google.cloud.alloydb.v1beta.IInstance, @@ -2999,8 +3592,8 @@ export class AlloyDBAdminClient { {} | null | undefined > ): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + injectFault( + request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, optionsOrCallback?: | CallOptions | Callback< @@ -3045,10 +3638,10 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + return this.innerApiCalls.injectFault(request, options, callback); } /** - * Check the status of the long running operation returned by `failoverInstance()`. + * Check the status of the long running operation returned by `injectFault()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -3056,10 +3649,10 @@ export class AlloyDBAdminClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async + * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async */ - async checkFailoverInstanceProgress( + async checkInjectFaultProgress( name: string ): Promise< LROperation< @@ -3074,7 +3667,7 @@ export class AlloyDBAdminClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.failoverInstance, + this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -4572,6 +5165,204 @@ export class AlloyDBAdminClient { callSettings ) as AsyncIterable; } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.alloydb.v1beta.User | User}. + * 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest | null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse + ] + >; + listUsers( + request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1beta.IUser + > + ): void; + listUsers( + request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1beta.IUser + > + ): void; + listUsers( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + | protos.google.cloud.alloydb.v1beta.IListUsersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.IUser + >, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1beta.IUser + > + ): Promise< + [ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest | null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listUsers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.alloydb.v1beta.User | User} 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 `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.alloydb.v1beta.User | User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + 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['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] 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. @@ -5327,6 +6118,68 @@ export class AlloyDBAdminClient { ).flag; } + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project: string, location: string, cluster: string, user: string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json index e1c1a1616fa4..37e28ec4af01 100644 --- a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json +++ b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json @@ -112,6 +112,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "RestartInstance": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -156,6 +161,31 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-alloydb/src/v1beta/gapic_metadata.json b/packages/google-cloud-alloydb/src/v1beta/gapic_metadata.json index fbb5789c7174..dd8aad6acafb 100644 --- a/packages/google-cloud-alloydb/src/v1beta/gapic_metadata.json +++ b/packages/google-cloud-alloydb/src/v1beta/gapic_metadata.json @@ -35,6 +35,26 @@ "getConnectionInfo" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -95,6 +115,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -142,6 +167,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } }, @@ -173,6 +205,26 @@ "getConnectionInfo" ] }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, "CreateCluster": { "methods": [ "createCluster" @@ -233,6 +285,11 @@ "failoverInstance" ] }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, "RestartInstance": { "methods": [ "restartInstance" @@ -280,6 +337,13 @@ "listSupportedDatabaseFlagsStream", "listSupportedDatabaseFlagsAsync" ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] } } } diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts index eb435559eded..507cb93358c0 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts @@ -650,69 +650,64 @@ describe('v1.AlloyDBAdminClient', () => { }); }); - describe('createCluster', () => { - it('invokes createCluster without error', async () => { + describe('getUser', () => { + it('invokes getUser without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() + new protos.google.cloud.alloydb.v1.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster without error using callback', async () => { + it('invokes getUser without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() + new protos.google.cloud.alloydb.v1.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createCluster( + client.getUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1.IUser | null ) => { if (err) { reject(err); @@ -722,193 +717,256 @@ describe('v1.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with call error', async () => { + it('invokes getUser with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() + new protos.google.cloud.alloydb.v1.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateClusterRequest', + '.google.cloud.alloydb.v1.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() ); - await assert.rejects(client.createCluster(request), expectedError); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with LRO error', async () => { + it('invokes createUser without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() + new protos.google.cloud.alloydb.v1.CreateUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateClusterRequest', + '.google.cloud.alloydb.v1.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() ); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); + client.innerApiCalls.createUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1.IUser | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress without error', async () => { + it('invokes createUser with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() ); - 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.checkCreateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateUserRequest', + ['parent'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress with error', async () => { + it('invokes createUser with closed client', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() ); - await assert.rejects( - client.checkCreateClusterProgress(''), - expectedError + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateUserRequest', + ['parent'] ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createUser(request), expectedError); }); }); - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { + describe('updateUser', () => { + it('invokes updateUser without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster without error using callback', async () => { + it('invokes updateUser without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateCluster( + client.updateUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1.IUser | null ) => { if (err) { reject(err); @@ -918,191 +976,262 @@ describe('v1.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with call error', async () => { + it('invokes updateUser with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( + client.innerApiCalls.updateUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateCluster(request), expectedError); + await assert.rejects(client.updateUser(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with LRO error', async () => { + it('invokes updateUser with closed client', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() ); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress without error', async () => { + it('invokes deleteUser without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() ); - 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.checkUpdateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteUserRequest', + ['name'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + 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.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress with error', async () => { + it('invokes deleteUser with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.deleteUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.checkUpdateClusterProgress(''), - expectedError - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { + it('invokes deleteUser with closed client', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1.DeleteUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteClusterRequest', + '.google.cloud.alloydb.v1.DeleteUserRequest', ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster without error using callback', async () => { + it('invokes createCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteCluster( + client.createCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -1115,86 +1244,86 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with call error', async () => { + it('invokes createCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteCluster(request), expectedError); + await assert.rejects(client.createCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with LRO error', async () => { + it('invokes createCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteClusterProgress without error', async () => { + it('invokes checkCreateClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1208,7 +1337,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress( + const decodedOperation = await client.checkCreateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1216,7 +1345,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteClusterProgress with error', async () => { + it('invokes checkCreateClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1229,69 +1358,71 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteClusterProgress(''), + client.checkCreateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.UpdateClusterRequest', + ['cluster', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.updateCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster without error using callback', async () => { + it('invokes updateCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.UpdateClusterRequest', + ['cluster', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restoreCluster( + client.updateCluster( request, ( err?: Error | null, @@ -1315,80 +1446,82 @@ describe('v1.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with call error', async () => { + it('invokes updateCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.UpdateClusterRequest', + ['cluster', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restoreCluster(request), expectedError); + await assert.rejects(client.updateCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with LRO error', async () => { + it('invokes updateCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1.UpdateClusterRequest', + ['cluster', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.updateCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestoreClusterProgress without error', async () => { + it('invokes checkUpdateClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1402,7 +1535,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress( + const decodedOperation = await client.checkUpdateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1410,7 +1543,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestoreClusterProgress with error', async () => { + it('invokes checkUpdateClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1423,74 +1556,74 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestoreClusterProgress(''), + client.checkUpdateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createInstance', () => { - it('invokes createInstance without error', async () => { + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateInstanceRequest', - ['parent'] + '.google.cloud.alloydb.v1.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); + const [operation] = await client.deleteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance without error using callback', async () => { + it('invokes deleteCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateInstanceRequest', - ['parent'] + '.google.cloud.alloydb.v1.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createInstance( + client.deleteCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -1503,86 +1636,86 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with call error', async () => { + it('invokes deleteCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateInstanceRequest', - ['parent'] + '.google.cloud.alloydb.v1.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createInstance(request), expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with LRO error', async () => { + it('invokes deleteCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateInstanceRequest', - ['parent'] + '.google.cloud.alloydb.v1.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createInstance(request); + const [operation] = await client.deleteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateInstanceProgress without error', async () => { + it('invokes checkDeleteClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1596,7 +1729,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress( + const decodedOperation = await client.checkDeleteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1604,7 +1737,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateInstanceProgress with error', async () => { + it('invokes checkDeleteClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1617,74 +1750,74 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateInstanceProgress(''), + client.checkDeleteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', - ['parent'] + '.google.cloud.alloydb.v1.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.promoteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances without error using callback', async () => { + it('invokes promoteCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', - ['parent'] + '.google.cloud.alloydb.v1.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( + client.promoteCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -1697,86 +1830,86 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with call error', async () => { + it('invokes promoteCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', - ['parent'] + '.google.cloud.alloydb.v1.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.batchCreateInstances(request), expectedError); + await assert.rejects(client.promoteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with LRO error', async () => { + it('invokes promoteCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', - ['parent'] + '.google.cloud.alloydb.v1.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.promoteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkBatchCreateInstancesProgress without error', async () => { + it('invokes checkPromoteClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1790,7 +1923,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress( + const decodedOperation = await client.checkPromoteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1798,7 +1931,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkBatchCreateInstancesProgress with error', async () => { + it('invokes checkPromoteClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1811,76 +1944,74 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkBatchCreateInstancesProgress(''), + client.checkPromoteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1.RestoreClusterRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); + const [operation] = await client.restoreCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance without error using callback', async () => { + it('invokes restoreCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1.RestoreClusterRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateInstance( + client.restoreCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -1893,88 +2024,86 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with call error', async () => { + it('invokes restoreCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1.RestoreClusterRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateInstance(request), expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with LRO error', async () => { + it('invokes restoreCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1.RestoreClusterRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateInstance(request); + const [operation] = await client.restoreCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateInstanceProgress without error', async () => { + it('invokes checkRestoreClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1988,7 +2117,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress( + const decodedOperation = await client.checkRestoreClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1996,7 +2125,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateInstanceProgress with error', async () => { + it('invokes checkRestoreClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2009,74 +2138,74 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkUpdateInstanceProgress(''), + client.checkRestoreClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.createSecondaryCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance without error using callback', async () => { + it('invokes createSecondaryCluster without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteInstance( + client.createSecondaryCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -2089,86 +2218,89 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.ICluster, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with call error', async () => { + it('invokes createSecondaryCluster with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteInstance(request), expectedError); + await assert.rejects( + client.createSecondaryCluster(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with LRO error', async () => { + it('invokes createSecondaryCluster with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.createSecondaryCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryClusterProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2182,7 +2314,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress( + const decodedOperation = await client.checkCreateSecondaryClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2190,7 +2322,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryClusterProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2203,69 +2335,69 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteInstanceProgress(''), + client.checkCreateSecondaryClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { + describe('createInstance', () => { + it('invokes createInstance without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance without error using callback', async () => { + it('invokes createInstance without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.failoverInstance( + client.createInstance( request, ( err?: Error | null, @@ -2289,80 +2421,80 @@ describe('v1.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with call error', async () => { + it('invokes createInstance with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.failoverInstance(request), expectedError); + await assert.rejects(client.createInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with LRO error', async () => { + it('invokes createInstance with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.createInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkFailoverInstanceProgress without error', async () => { + it('invokes checkCreateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2376,7 +2508,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress( + const decodedOperation = await client.checkCreateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2384,7 +2516,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkFailoverInstanceProgress with error', async () => { + it('invokes checkCreateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2397,69 +2529,69 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkFailoverInstanceProgress(''), + client.checkCreateInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestartInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); + const [operation] = await client.createSecondaryInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance without error using callback', async () => { + it('invokes createSecondaryInstance without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestartInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restartInstance( + client.createSecondaryInstance( request, ( err?: Error | null, @@ -2483,80 +2615,83 @@ describe('v1.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with call error', async () => { + it('invokes createSecondaryInstance with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestartInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restartInstance(request), expectedError); + await assert.rejects( + client.createSecondaryInstance(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with LRO error', async () => { + it('invokes createSecondaryInstance with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.RestartInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restartInstance(request); + const [operation] = await client.createSecondaryInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestartInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2570,15 +2705,16 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress( - expectedResponse.name - ); + const decodedOperation = + await client.checkCreateSecondaryInstanceProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestartInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2591,25 +2727,25 @@ describe('v1.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestartInstanceProgress(''), + client.checkCreateSecondaryInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createBackup', () => { - it('invokes createBackup without error', async () => { + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateBackupRequest', + '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent'] ); request.parent = defaultValue1; @@ -2617,31 +2753,32 @@ describe('v1.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); + client.innerApiCalls.batchCreateInstances = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateInstances(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup without error using callback', async () => { + it('invokes batchCreateInstances without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateBackupRequest', + '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent'] ); request.parent = defaultValue1; @@ -2649,15 +2786,15 @@ describe('v1.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createBackup( + client.batchCreateInstances( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -2670,86 +2807,86 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with call error', async () => { + it('invokes batchCreateInstances with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateBackupRequest', + '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createBackup(request), expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with LRO error', async () => { + it('invokes batchCreateInstances with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.CreateBackupRequest', + '.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createBackup(request); + const [operation] = await client.batchCreateInstances(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateBackupProgress without error', async () => { + it('invokes checkBatchCreateInstancesProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2763,7 +2900,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress( + const decodedOperation = await client.checkBatchCreateInstancesProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2771,7 +2908,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateBackupProgress with error', async () => { + it('invokes checkBatchCreateInstancesProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2783,73 +2920,77 @@ describe('v1.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + await assert.rejects( + client.checkBatchCreateInstancesProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() ); - request.backup ??= {}; + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1.UpdateInstanceRequest', + ['instance', 'name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup without error using callback', async () => { + it('invokes updateInstance without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() ); - request.backup ??= {}; + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1.UpdateInstanceRequest', + ['instance', 'name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateBackup( + client.updateInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata > | null ) => { @@ -2862,88 +3003,88 @@ describe('v1.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IInstance, protos.google.cloud.alloydb.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with call error', async () => { + it('invokes updateInstance with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() ); - request.backup ??= {}; + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1.UpdateInstanceRequest', + ['instance', 'name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateBackup(request), expectedError); + await assert.rejects(client.updateInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with LRO error', async () => { + it('invokes updateInstance with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() ); - request.backup ??= {}; + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1.UpdateInstanceRequest', + ['instance', 'name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateBackup(request); + const [operation] = await client.updateInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateBackupProgress without error', async () => { + it('invokes checkUpdateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2957,7 +3098,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress( + const decodedOperation = await client.checkUpdateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2965,7 +3106,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateBackupProgress with error', async () => { + it('invokes checkUpdateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2977,23 +3118,26 @@ describe('v1.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + await assert.rejects( + client.checkUpdateInstanceProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteBackupRequest', + '.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3001,31 +3145,32 @@ describe('v1.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup without error using callback', async () => { + it('invokes deleteInstance without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteBackupRequest', + '.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3033,10 +3178,10 @@ describe('v1.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteBackup( + client.deleteInstance( request, ( err?: Error | null, @@ -3060,80 +3205,80 @@ describe('v1.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with call error', async () => { + it('invokes deleteInstance with call error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteBackupRequest', + '.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteBackup(request), expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with LRO error', async () => { + it('invokes deleteInstance with LRO error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.DeleteBackupRequest', + '.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteBackup(request); + const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteBackupProgress without error', async () => { + it('invokes checkDeleteInstanceProgress without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3147,7 +3292,7 @@ describe('v1.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress( + const decodedOperation = await client.checkDeleteInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3155,7 +3300,7 @@ describe('v1.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteBackupProgress with error', async () => { + it('invokes checkDeleteInstanceProgress with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3167,73 +3312,1531 @@ describe('v1.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + await assert.rejects( + client.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.FailoverInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.FailoverInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.failoverInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.FailoverInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.failoverInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.FailoverInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.failoverInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.failoverInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkFailoverInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkFailoverInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkFailoverInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkFailoverInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('injectFault', () => { + it('invokes injectFault without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.InjectFaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.InjectFaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.injectFault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.InjectFaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.injectFault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.InjectFaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.injectFault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.injectFault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInjectFaultProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkInjectFaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInjectFaultProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkInjectFaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.RestartInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.RestartInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.RestartInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restartInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.RestartInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkRestartInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkRestartInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); }); }); - describe('listClusters', () => { - it('invokes listClusters without error', async () => { + describe('listInstances', () => { + it('invokes listInstances without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters without error using callback', async () => { + it('invokes listInstances without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), ]; - client.innerApiCalls.listClusters = + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listClusters( + client.listInstances( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1.ICluster[] | null + result?: protos.google.cloud.alloydb.v1.IInstance[] | null ) => { if (err) { reject(err); @@ -3246,74 +4849,74 @@ describe('v1.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters with error', async () => { + it('invokes listInstances with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall( + client.innerApiCalls.listInstances = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listClusters(request), expectedError); + await assert.rejects(client.listInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClustersStream without error', async () => { + it('invokes listInstancesStream without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), ]; - client.descriptors.page.listClusters.createStream = + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1.Cluster) => { + (response: protos.google.cloud.alloydb.v1.Instance) => { responses.push(response); } ); @@ -3327,12 +4930,12 @@ describe('v1.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3340,32 +4943,30 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('invokes listClustersStream with error', async () => { + it('invokes listInstancesStream with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listClustersStream(request); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1.Cluster) => { + (response: protos.google.cloud.alloydb.v1.Instance) => { responses.push(response); } ); @@ -3378,12 +4979,12 @@ describe('v1.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3391,42 +4992,42 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters without error', async () => { + it('uses async iteration with listInstances without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), ]; - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; - const iterable = client.listClustersAsync(request); + const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3434,39 +5035,39 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters with error', async () => { + it('uses async iteration with listInstances with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() + new protos.google.cloud.alloydb.v1.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListClustersRequest', + '.google.cloud.alloydb.v1.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); + const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; + const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3475,68 +5076,68 @@ describe('v1.AlloyDBAdminClient', () => { }); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { + describe('listBackups', () => { + it('invokes listBackups without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances without error using callback', async () => { + it('invokes listBackups without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), ]; - client.innerApiCalls.listInstances = + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listInstances( + client.listBackups( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1.IInstance[] | null + result?: protos.google.cloud.alloydb.v1.IBackup[] | null ) => { if (err) { reject(err); @@ -3549,77 +5150,74 @@ describe('v1.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances with error', async () => { + it('invokes listBackups with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall( + client.innerApiCalls.listBackups = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listInstances(request), expectedError); + await assert.rejects(client.listBackups(request), expectedError); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstancesStream without error', async () => { + it('invokes listBackupsStream without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), ]; - client.descriptors.page.listInstances.createStream = + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Instance[] = []; - stream.on( - 'data', - (response: protos.google.cloud.alloydb.v1.Instance) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.alloydb.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -3630,12 +5228,12 @@ describe('v1.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3643,33 +5241,32 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('invokes listInstancesStream with error', async () => { + it('invokes listBackupsStream with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Instance[] = []; - stream.on( - 'data', - (response: protos.google.cloud.alloydb.v1.Instance) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.alloydb.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -3679,12 +5276,12 @@ describe('v1.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3692,42 +5289,42 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances without error', async () => { + it('uses async iteration with listBackups without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), ]; - client.descriptors.page.listInstances.asyncIterate = + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); + const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3735,39 +5332,41 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances with error', async () => { + it('uses async iteration with listBackups with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() + new protos.google.cloud.alloydb.v1.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListInstancesRequest', + '.google.cloud.alloydb.v1.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; + const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3776,68 +5375,83 @@ describe('v1.AlloyDBAdminClient', () => { }); }); - describe('listBackups', () => { - it('invokes listBackups without error', async () => { + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); + client.innerApiCalls.listSupportedDatabaseFlags = + stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups without error using callback', async () => { + it('invokes listSupportedDatabaseFlags without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listBackups( + client.listSupportedDatabaseFlags( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1.IBackup[] | null + result?: + | protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] + | null ) => { if (err) { reject(err); @@ -3850,74 +5464,87 @@ describe('v1.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups with error', async () => { + it('invokes listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall( + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listBackups(request), expectedError); + await assert.rejects( + client.listSupportedDatabaseFlags(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackupsStream without error', async () => { + it('invokes listSupportedDatabaseFlagsStream without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.createStream = + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { - responses.push(response); - }); + const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -3928,12 +5555,18 @@ describe('v1.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3941,32 +5574,34 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('invokes listBackupsStream with error', async () => { + it('invokes listSupportedDatabaseFlagsStream with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listBackupsStream(request); + client.descriptors.page.listSupportedDatabaseFlags.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { - responses.push(response); - }); + const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -3976,12 +5611,18 @@ describe('v1.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3989,42 +5630,53 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups without error', async () => { + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.asyncIterate = + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; - const iterable = client.listBackupsAsync(request); + const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = + []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4032,41 +5684,44 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups with error', async () => { + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListBackupsRequest', + '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listBackupsAsync(request); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; + const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4075,83 +5730,68 @@ describe('v1.AlloyDBAdminClient', () => { }); }); - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { + describe('listUsers', () => { + it('invokes listUsers without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = - stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags without error using callback', async () => { + it('invokes listUsers without error using callback', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( + client.listUsers( request, ( err?: Error | null, - result?: - | protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] - | null + result?: protos.google.cloud.alloydb.v1.IUser[] | null ) => { if (err) { reject(err); @@ -4164,87 +5804,71 @@ describe('v1.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags with error', async () => { + it('invokes listUsers with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.listSupportedDatabaseFlags(request), - expectedError - ); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlagsStream without error', async () => { + it('invokes listUsersStream without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.alloydb.v1.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -4255,18 +5879,12 @@ describe('v1.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4274,34 +5892,32 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('invokes listSupportedDatabaseFlagsStream with error', async () => { + it('invokes listUsersStream with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { - responses.push(response); - } - ); + const responses: protos.google.cloud.alloydb.v1.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { + responses.push(response); + }); stream.on('end', () => { resolve(responses); }); @@ -4311,18 +5927,12 @@ describe('v1.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4330,53 +5940,41 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + it('uses async iteration with listUsers without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = - []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); + const responses: protos.google.cloud.alloydb.v1.IUser[] = []; + const iterable = client.listUsersAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4384,44 +5982,40 @@ describe('v1.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + it('uses async iteration with listUsers with error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listUsersAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1.IUser[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5626,5 +7220,81 @@ describe('v1.AlloyDBAdminClient', () => { ); }); }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + user: 'userValue', + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'userValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts index 3fd063d67b22..d57f217290c4 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts @@ -919,69 +919,64 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); }); - describe('createCluster', () => { - it('invokes createCluster without error', async () => { + describe('getUser', () => { + it('invokes getUser without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1alpha.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster without error using callback', async () => { + it('invokes getUser without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1alpha.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createCluster( + client.getUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1alpha.IUser | null ) => { if (err) { reject(err); @@ -991,193 +986,256 @@ describe('v1alpha.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with call error', async () => { + it('invokes getUser with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + '.google.cloud.alloydb.v1alpha.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() ); - await assert.rejects(client.createCluster(request), expectedError); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with LRO error', async () => { + it('invokes createUser without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + '.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() ); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); + client.innerApiCalls.createUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1alpha.IUser | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress without error', async () => { + it('invokes createUser with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() ); - 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.checkCreateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateUserRequest', + ['parent'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress with error', async () => { + it('invokes createUser with closed client', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() ); - await assert.rejects( - client.checkCreateClusterProgress(''), - expectedError + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateUserRequest', + ['parent'] ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createUser(request), expectedError); }); }); - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { + describe('updateUser', () => { + it('invokes updateUser without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1alpha.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1alpha.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster without error using callback', async () => { + it('invokes updateUser without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1alpha.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1alpha.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateCluster( + client.updateUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1alpha.IUser | null ) => { if (err) { reject(err); @@ -1187,191 +1245,262 @@ describe('v1alpha.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with call error', async () => { + it('invokes updateUser with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1alpha.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( + client.innerApiCalls.updateUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateCluster(request), expectedError); + await assert.rejects(client.updateUser(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with LRO error', async () => { + it('invokes updateUser with closed client', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1alpha.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() ); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress without error', async () => { + it('invokes deleteUser without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() ); - 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.checkUpdateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteUserRequest', + ['name'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + 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.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress with error', async () => { + it('invokes deleteUser with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.deleteUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.checkUpdateClusterProgress(''), - expectedError - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { + it('invokes deleteUser with closed client', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', + '.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster without error using callback', async () => { + it('invokes createCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteCluster( + client.createCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -1384,86 +1513,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with call error', async () => { + it('invokes createCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteCluster(request), expectedError); + await assert.rejects(client.createCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with LRO error', async () => { + it('invokes createCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteClusterProgress without error', async () => { + it('invokes checkCreateClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1477,7 +1606,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress( + const decodedOperation = await client.checkCreateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1485,7 +1614,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteClusterProgress with error', async () => { + it('invokes checkCreateClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1498,69 +1627,71 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteClusterProgress(''), + client.checkCreateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('promoteCluster', () => { - it('invokes promoteCluster without error', async () => { + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteCluster = + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteCluster(request); + const [operation] = await client.updateCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster without error using callback', async () => { + it('invokes updateCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteCluster = + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.promoteCluster( + client.updateCluster( request, ( err?: Error | null, @@ -1584,80 +1715,82 @@ describe('v1alpha.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster with call error', async () => { + it('invokes updateCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.promoteCluster(request), expectedError); + await assert.rejects(client.updateCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster with LRO error', async () => { + it('invokes updateCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.promoteCluster(request); + const [operation] = await client.updateCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkPromoteClusterProgress without error', async () => { + it('invokes checkUpdateClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1671,7 +1804,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteClusterProgress( + const decodedOperation = await client.checkUpdateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1679,7 +1812,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkPromoteClusterProgress with error', async () => { + it('invokes checkUpdateClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1692,74 +1825,74 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkPromoteClusterProgress(''), + client.checkUpdateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.deleteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster without error using callback', async () => { + it('invokes deleteCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restoreCluster( + client.deleteCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -1772,86 +1905,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with call error', async () => { + it('invokes deleteCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restoreCluster(request), expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with LRO error', async () => { + it('invokes deleteCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.deleteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestoreClusterProgress without error', async () => { + it('invokes checkDeleteClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1865,7 +1998,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress( + const decodedOperation = await client.checkDeleteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1873,7 +2006,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestoreClusterProgress with error', async () => { + it('invokes checkDeleteClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1886,69 +2019,69 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestoreClusterProgress(''), + client.checkDeleteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createSecondaryCluster', () => { - it('invokes createSecondaryCluster without error', async () => { + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryCluster = + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryCluster(request); + const [operation] = await client.promoteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster without error using callback', async () => { + it('invokes promoteCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryCluster = + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSecondaryCluster( + client.promoteCluster( request, ( err?: Error | null, @@ -1972,83 +2105,80 @@ describe('v1alpha.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster with call error', async () => { + it('invokes promoteCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects( - client.createSecondaryCluster(request), - expectedError - ); + await assert.rejects(client.promoteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster with LRO error', async () => { + it('invokes promoteCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createSecondaryCluster(request); + const [operation] = await client.promoteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateSecondaryClusterProgress without error', async () => { + it('invokes checkPromoteClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2062,7 +2192,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryClusterProgress( + const decodedOperation = await client.checkPromoteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2070,7 +2200,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateSecondaryClusterProgress with error', async () => { + it('invokes checkPromoteClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2083,25 +2213,25 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateSecondaryClusterProgress(''), + client.checkPromoteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createInstance', () => { - it('invokes createInstance without error', async () => { + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', + '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2109,32 +2239,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); + const [operation] = await client.restoreCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance without error using callback', async () => { + it('invokes restoreCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', + '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2142,15 +2272,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createInstance( + client.restoreCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -2163,86 +2293,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with call error', async () => { + it('invokes restoreCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', + '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createInstance(request), expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with LRO error', async () => { + it('invokes restoreCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', + '.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createInstance(request); + const [operation] = await client.restoreCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateInstanceProgress without error', async () => { + it('invokes checkRestoreClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2256,7 +2386,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress( + const decodedOperation = await client.checkRestoreClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2264,7 +2394,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateInstanceProgress with error', async () => { + it('invokes checkRestoreClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2277,25 +2407,25 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateInstanceProgress(''), + client.checkRestoreClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createSecondaryInstance', () => { - it('invokes createSecondaryInstance without error', async () => { + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2303,32 +2433,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryInstance(request); + const [operation] = await client.createSecondaryCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance without error using callback', async () => { + it('invokes createSecondaryCluster without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2336,15 +2466,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSecondaryInstance( + client.createSecondaryCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -2357,89 +2487,89 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.ICluster, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance with call error', async () => { + it('invokes createSecondaryCluster with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, expectedError ); await assert.rejects( - client.createSecondaryInstance(request), + client.createSecondaryCluster(request), expectedError ); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance with LRO error', async () => { + it('invokes createSecondaryCluster with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createSecondaryInstance(request); + const [operation] = await client.createSecondaryCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateSecondaryInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryClusterProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2453,16 +2583,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateSecondaryInstanceProgress( - expectedResponse.name - ); + const decodedOperation = await client.checkCreateSecondaryClusterProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateSecondaryInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryClusterProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2475,25 +2604,25 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateSecondaryInstanceProgress(''), + client.checkCreateSecondaryClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { + describe('createInstance', () => { + it('invokes createInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; @@ -2501,32 +2630,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances without error using callback', async () => { + it('invokes createInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; @@ -2534,15 +2663,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( + client.createInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -2555,86 +2684,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with call error', async () => { + it('invokes createInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.batchCreateInstances(request), expectedError); + await assert.rejects(client.createInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with LRO error', async () => { + it('invokes createInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.createInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkBatchCreateInstancesProgress without error', async () => { + it('invokes checkCreateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2648,7 +2777,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress( + const decodedOperation = await client.checkCreateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2656,7 +2785,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkBatchCreateInstancesProgress with error', async () => { + it('invokes checkCreateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2669,71 +2798,69 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkBatchCreateInstancesProgress(''), + client.checkCreateInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); + const [operation] = await client.createSecondaryInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance without error using callback', async () => { + it('invokes createSecondaryInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateInstance( + client.createSecondaryInstance( request, ( err?: Error | null, @@ -2757,82 +2884,83 @@ describe('v1alpha.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with call error', async () => { + it('invokes createSecondaryInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateInstance(request), expectedError); + await assert.rejects( + client.createSecondaryInstance(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with LRO error', async () => { + it('invokes createSecondaryInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateInstance(request); + const [operation] = await client.createSecondaryInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2846,15 +2974,16 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress( - expectedResponse.name - ); + const decodedOperation = + await client.checkCreateSecondaryInstanceProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2867,74 +2996,74 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkUpdateInstanceProgress(''), + client.checkCreateSecondaryInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.batchCreateInstances(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance without error using callback', async () => { + it('invokes batchCreateInstances without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteInstance( + client.batchCreateInstances( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -2947,86 +3076,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with call error', async () => { + it('invokes batchCreateInstances with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteInstance(request), expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with LRO error', async () => { + it('invokes batchCreateInstances with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.batchCreateInstances(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteInstanceProgress without error', async () => { + it('invokes checkBatchCreateInstancesProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3040,7 +3169,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress( + const decodedOperation = await client.checkBatchCreateInstancesProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3048,7 +3177,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteInstanceProgress with error', async () => { + it('invokes checkBatchCreateInstancesProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3061,69 +3190,71 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteInstanceProgress(''), + client.checkBatchCreateInstancesProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance without error using callback', async () => { + it('invokes updateInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.failoverInstance( + client.updateInstance( request, ( err?: Error | null, @@ -3147,80 +3278,82 @@ describe('v1alpha.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with call error', async () => { + it('invokes updateInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.failoverInstance(request), expectedError); + await assert.rejects(client.updateInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with LRO error', async () => { + it('invokes updateInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.updateInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkFailoverInstanceProgress without error', async () => { + it('invokes checkUpdateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3234,7 +3367,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress( + const decodedOperation = await client.checkUpdateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3242,7 +3375,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkFailoverInstanceProgress with error', async () => { + it('invokes checkUpdateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3255,25 +3388,25 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkFailoverInstanceProgress(''), + client.checkUpdateInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', + '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3281,32 +3414,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); + const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance without error using callback', async () => { + it('invokes deleteInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', + '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3314,15 +3447,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restartInstance( + client.deleteInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -3335,86 +3468,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with call error', async () => { + it('invokes deleteInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', + '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restartInstance(request), expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with LRO error', async () => { + it('invokes deleteInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', + '.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restartInstance(request); + const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestartInstanceProgress without error', async () => { + it('invokes checkDeleteInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3428,7 +3561,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress( + const decodedOperation = await client.checkDeleteInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3436,7 +3569,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestartInstanceProgress with error', async () => { + it('invokes checkDeleteInstanceProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3449,73 +3582,74 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestartInstanceProgress(''), + client.checkDeleteInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createBackup', () => { - it('invokes createBackup without error', async () => { + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); + client.innerApiCalls.failoverInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup without error using callback', async () => { + it('invokes failoverInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = + client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createBackup( + client.failoverInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -3528,86 +3662,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with call error', async () => { + it('invokes failoverInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createBackup(request), expectedError); + await assert.rejects(client.failoverInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with LRO error', async () => { + it('invokes failoverInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createBackup(request); + const [operation] = await client.failoverInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateBackupProgress without error', async () => { + it('invokes checkFailoverInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3621,7 +3755,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress( + const decodedOperation = await client.checkFailoverInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3629,7 +3763,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateBackupProgress with error', async () => { + it('invokes checkFailoverInstanceProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3641,73 +3775,74 @@ describe('v1alpha.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + await assert.rejects( + client.checkFailoverInstanceProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { + describe('injectFault', () => { + it('invokes injectFault without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1alpha.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup without error using callback', async () => { + it('invokes injectFault without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1alpha.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = + client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateBackup( + client.injectFault( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -3720,88 +3855,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with call error', async () => { + it('invokes injectFault with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1alpha.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.injectFault = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateBackup(request), expectedError); + await assert.rejects(client.injectFault(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with LRO error', async () => { + it('invokes injectFault with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1alpha.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.injectFault = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateBackup(request); + const [operation] = await client.injectFault(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateBackupProgress without error', async () => { + it('invokes checkInjectFaultProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3815,7 +3948,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress( + const decodedOperation = await client.checkInjectFaultProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3823,7 +3956,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateBackupProgress with error', async () => { + it('invokes checkInjectFaultProgress with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3835,23 +3968,23 @@ describe('v1alpha.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + await assert.rejects(client.checkInjectFaultProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3859,31 +3992,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); + client.innerApiCalls.restartInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup without error using callback', async () => { + it('invokes restartInstance without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3891,15 +4025,15 @@ describe('v1alpha.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteBackup( + client.restartInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata > | null ) => { @@ -3912,86 +4046,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IInstance, protos.google.cloud.alloydb.v1alpha.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with call error', async () => { + it('invokes restartInstance with call error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteBackup(request), expectedError); + await assert.rejects(client.restartInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with LRO error', async () => { + it('invokes restartInstance with LRO error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + '.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteBackup(request); + const [operation] = await client.restartInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteBackupProgress without error', async () => { + it('invokes checkRestartInstanceProgress without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4005,7 +4139,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress( + const decodedOperation = await client.checkRestartInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -4013,97 +4147,1001 @@ describe('v1alpha.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteBackupProgress with error', async () => { + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkRestartInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1alpha.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1alpha.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listClusters', () => { - it('invokes listClusters without error', async () => { + describe('listInstances', () => { + it('invokes listInstances without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters without error using callback', async () => { + it('invokes listInstances without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), ]; - client.innerApiCalls.listClusters = + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listClusters( + client.listInstances( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1alpha.ICluster[] | null + result?: protos.google.cloud.alloydb.v1alpha.IInstance[] | null ) => { if (err) { reject(err); @@ -4116,80 +5154,80 @@ describe('v1alpha.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters with error', async () => { + it('invokes listInstances with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall( + client.innerApiCalls.listInstances = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listClusters(request), expectedError); + await assert.rejects(client.listInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClustersStream without error', async () => { + it('invokes listInstancesStream without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), ]; - client.descriptors.page.listClusters.createStream = + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + (response: protos.google.cloud.alloydb.v1alpha.Instance) => { responses.push(response); } ); @@ -4203,12 +5241,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4216,32 +5254,30 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('invokes listClustersStream with error', async () => { + it('invokes listInstancesStream with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listClustersStream(request); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + (response: protos.google.cloud.alloydb.v1alpha.Instance) => { responses.push(response); } ); @@ -4254,12 +5290,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4267,48 +5303,48 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters without error', async () => { + it('uses async iteration with listInstances without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() + new protos.google.cloud.alloydb.v1alpha.Instance() ), ]; - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; - const iterable = client.listClustersAsync(request); + const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; + const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4316,39 +5352,39 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters with error', async () => { + it('uses async iteration with listInstances with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListClustersRequest', + '.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); + const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4357,80 +5393,68 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { + describe('listBackups', () => { + it('invokes listBackups without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances without error using callback', async () => { + it('invokes listBackups without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), ]; - client.innerApiCalls.listInstances = + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listInstances( + client.listBackups( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1alpha.IInstance[] | null + result?: protos.google.cloud.alloydb.v1alpha.IBackup[] | null ) => { if (err) { reject(err); @@ -4443,80 +5467,74 @@ describe('v1alpha.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances with error', async () => { + it('invokes listBackups with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall( + client.innerApiCalls.listBackups = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listInstances(request), expectedError); + await assert.rejects(client.listBackups(request), expectedError); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstancesStream without error', async () => { + it('invokes listBackupsStream without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), ]; - client.descriptors.page.listInstances.createStream = + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Instance) => { + (response: protos.google.cloud.alloydb.v1alpha.Backup) => { responses.push(response); } ); @@ -4530,12 +5548,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4543,30 +5561,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('invokes listInstancesStream with error', async () => { + it('invokes listBackupsStream with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Instance) => { + (response: protos.google.cloud.alloydb.v1alpha.Backup) => { responses.push(response); } ); @@ -4579,12 +5599,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4592,48 +5612,42 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances without error', async () => { + it('uses async iteration with listBackups without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), ]; - client.descriptors.page.listInstances.asyncIterate = + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; - const iterable = client.listInstancesAsync(request); + const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; + const iterable = client.listBackupsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4641,39 +5655,41 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances with error', async () => { + it('uses async iteration with listBackups with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListInstancesRequest', + '.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4682,68 +5698,83 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); }); - describe('listBackups', () => { - it('invokes listBackups without error', async () => { + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); + client.innerApiCalls.listSupportedDatabaseFlags = + stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups without error using callback', async () => { + it('invokes listSupportedDatabaseFlags without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listBackups( + client.listSupportedDatabaseFlags( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1alpha.IBackup[] | null + result?: + | protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] + | null ) => { if (err) { reject(err); @@ -4756,74 +5787,86 @@ describe('v1alpha.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups with error', async () => { + it('invokes listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall( + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listBackups(request), expectedError); + await assert.rejects( + client.listSupportedDatabaseFlags(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackupsStream without error', async () => { + it('invokes listSupportedDatabaseFlagsStream without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.createStream = + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = + []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Backup) => { + ( + response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + ) => { responses.push(response); } ); @@ -4837,12 +5880,18 @@ describe('v1alpha.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4850,32 +5899,33 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('invokes listBackupsStream with error', async () => { + it('invokes listSupportedDatabaseFlagsStream with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listBackupsStream(request); + client.descriptors.page.listSupportedDatabaseFlags.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = + []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1alpha.Backup) => { + ( + response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + ) => { responses.push(response); } ); @@ -4888,12 +5938,18 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4901,42 +5957,53 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups without error', async () => { + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.asyncIterate = + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; - const iterable = client.listBackupsAsync(request); + const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = + []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4944,41 +6011,44 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups with error', async () => { + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListBackupsRequest', + '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listBackupsAsync(request); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; + const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4987,83 +6057,68 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); }); - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { + describe('listUsers', () => { + it('invokes listUsers without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = - stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags without error using callback', async () => { + it('invokes listUsers without error using callback', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( + client.listUsers( request, ( err?: Error | null, - result?: - | protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] - | null + result?: protos.google.cloud.alloydb.v1alpha.IUser[] | null ) => { if (err) { reject(err); @@ -5076,86 +6131,71 @@ describe('v1alpha.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags with error', async () => { + it('invokes listUsers with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.listSupportedDatabaseFlags(request), - expectedError - ); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlagsStream without error', async () => { + it('invokes listUsersStream without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; stream.on( 'data', - ( - response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - ) => { + (response: protos.google.cloud.alloydb.v1alpha.User) => { responses.push(response); } ); @@ -5169,18 +6209,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5188,33 +6222,32 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('invokes listSupportedDatabaseFlagsStream with error', async () => { + it('invokes listUsersStream with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; stream.on( 'data', - ( - response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - ) => { + (response: protos.google.cloud.alloydb.v1alpha.User) => { responses.push(response); } ); @@ -5227,18 +6260,12 @@ describe('v1alpha.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5246,53 +6273,41 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + it('uses async iteration with listUsers without error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = - []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); + const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; + const iterable = client.listUsersAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5300,44 +6315,40 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + it('uses async iteration with listUsers with error', async () => { const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listUsersAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6618,5 +7629,81 @@ describe('v1alpha.AlloyDBAdminClient', () => { ); }); }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + user: 'userValue', + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'userValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts index f0debccd3a5e..f7e19f4f5332 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts @@ -919,69 +919,64 @@ describe('v1beta.AlloyDBAdminClient', () => { }); }); - describe('createCluster', () => { - it('invokes createCluster without error', async () => { + describe('getUser', () => { + it('invokes getUser without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + new protos.google.cloud.alloydb.v1beta.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1beta.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster without error using callback', async () => { + it('invokes getUser without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + new protos.google.cloud.alloydb.v1beta.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.GetUserRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1beta.User() ); - client.innerApiCalls.createCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createCluster( + client.getUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1beta.IUser | null ) => { if (err) { reject(err); @@ -991,193 +986,256 @@ describe('v1beta.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.getUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with call error', async () => { + it('invokes getUser with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + new protos.google.cloud.alloydb.v1beta.GetUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateClusterRequest', + '.google.cloud.alloydb.v1beta.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.GetUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() ); - await assert.rejects(client.createCluster(request), expectedError); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createCluster with LRO error', async () => { + it('invokes createUser without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateClusterRequest', + '.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() ); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); + client.innerApiCalls.createUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1beta.IUser | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createCluster as SinonStub + client.innerApiCalls.createUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress without error', async () => { + it('invokes createUser with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() ); - 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.checkCreateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateUserRequest', + ['parent'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClusterProgress with error', async () => { + it('invokes createUser with closed client', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() ); - await assert.rejects( - client.checkCreateClusterProgress(''), - expectedError + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateUserRequest', + ['parent'] ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createUser(request), expectedError); }); }); - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { + describe('updateUser', () => { + it('invokes updateUser without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1beta.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1beta.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster without error using callback', async () => { + it('invokes updateUser without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1beta.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.alloydb.v1beta.User() ); - client.innerApiCalls.updateCluster = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateUser = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateCluster( + client.updateUser( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IOperationMetadata - > | null + result?: protos.google.cloud.alloydb.v1beta.IUser | null ) => { if (err) { reject(err); @@ -1187,191 +1245,262 @@ describe('v1beta.AlloyDBAdminClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with call error', async () => { + it('invokes updateUser with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1beta.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( + client.innerApiCalls.updateUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateCluster(request), expectedError); + await assert.rejects(client.updateUser(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.updateUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateCluster with LRO error', async () => { + it('invokes updateUser with closed client', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() ); - request.cluster ??= {}; + request.user ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateClusterRequest', - ['cluster', 'name'] + '.google.cloud.alloydb.v1beta.UpdateUserRequest', + ['user', 'name'] ); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall( - undefined, - undefined, - expectedError + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() ); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateCluster as SinonStub + client.innerApiCalls.deleteUser as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress without error', async () => { + it('invokes deleteUser without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() ); - 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.checkUpdateClusterProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteUserRequest', + ['name'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + 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.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClusterProgress with error', async () => { + it('invokes deleteUser with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteUserRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.deleteUser = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.checkUpdateClusterProgress(''), - expectedError - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUser as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { + it('invokes deleteUser with closed client', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteClusterRequest', + '.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster without error using callback', async () => { + it('invokes createCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteCluster = + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteCluster( + client.createCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -1384,86 +1513,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with call error', async () => { + it('invokes createCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteCluster(request), expectedError); + await assert.rejects(client.createCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteCluster with LRO error', async () => { + it('invokes createCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.CreateClusterRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall( + client.innerApiCalls.createCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteCluster(request); + const [operation] = await client.createCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteCluster as SinonStub + client.innerApiCalls.createCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteClusterProgress without error', async () => { + it('invokes checkCreateClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1477,7 +1606,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress( + const decodedOperation = await client.checkCreateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1485,7 +1614,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteClusterProgress with error', async () => { + it('invokes checkCreateClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1498,69 +1627,71 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteClusterProgress(''), + client.checkCreateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('promoteCluster', () => { - it('invokes promoteCluster without error', async () => { + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteCluster = + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteCluster(request); + const [operation] = await client.updateCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster without error using callback', async () => { + it('invokes updateCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteCluster = + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.promoteCluster( + client.updateCluster( request, ( err?: Error | null, @@ -1584,80 +1715,82 @@ describe('v1beta.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster with call error', async () => { + it('invokes updateCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.promoteCluster(request), expectedError); + await assert.rejects(client.updateCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteCluster with LRO error', async () => { + it('invokes updateCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() ); + request.cluster ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.PromoteClusterRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateClusterRequest', + ['cluster', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall( + client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.promoteCluster(request); + const [operation] = await client.updateCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteCluster as SinonStub + client.innerApiCalls.updateCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkPromoteClusterProgress without error', async () => { + it('invokes checkUpdateClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1671,7 +1804,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteClusterProgress( + const decodedOperation = await client.checkUpdateClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1679,7 +1812,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkPromoteClusterProgress with error', async () => { + it('invokes checkUpdateClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1692,74 +1825,74 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkPromoteClusterProgress(''), + client.checkUpdateClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.deleteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster without error using callback', async () => { + it('invokes deleteCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restoreCluster = + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restoreCluster( + client.deleteCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -1772,86 +1905,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with call error', async () => { + it('invokes deleteCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restoreCluster(request), expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restoreCluster with LRO error', async () => { + it('invokes deleteCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestoreClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.DeleteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall( + client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restoreCluster(request); + const [operation] = await client.deleteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restoreCluster as SinonStub + client.innerApiCalls.deleteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestoreClusterProgress without error', async () => { + it('invokes checkDeleteClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1865,7 +1998,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress( + const decodedOperation = await client.checkDeleteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1873,7 +2006,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestoreClusterProgress with error', async () => { + it('invokes checkDeleteClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1886,69 +2019,69 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestoreClusterProgress(''), + client.checkDeleteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createSecondaryCluster', () => { - it('invokes createSecondaryCluster without error', async () => { + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryCluster = + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryCluster(request); + const [operation] = await client.promoteCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster without error using callback', async () => { + it('invokes promoteCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryCluster = + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSecondaryCluster( + client.promoteCluster( request, ( err?: Error | null, @@ -1972,83 +2105,80 @@ describe('v1beta.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster with call error', async () => { + it('invokes promoteCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects( - client.createSecondaryCluster(request), - expectedError - ); + await assert.rejects(client.promoteCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryCluster with LRO error', async () => { + it('invokes promoteCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.PromoteClusterRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( + client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createSecondaryCluster(request); + const [operation] = await client.promoteCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryCluster as SinonStub + client.innerApiCalls.promoteCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateSecondaryClusterProgress without error', async () => { + it('invokes checkPromoteClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2062,7 +2192,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryClusterProgress( + const decodedOperation = await client.checkPromoteClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2070,7 +2200,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateSecondaryClusterProgress with error', async () => { + it('invokes checkPromoteClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2083,25 +2213,25 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateSecondaryClusterProgress(''), + client.checkPromoteClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createInstance', () => { - it('invokes createInstance without error', async () => { + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateInstanceRequest', + '.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2109,32 +2239,32 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); + const [operation] = await client.restoreCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance without error using callback', async () => { + it('invokes restoreCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateInstanceRequest', + '.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2142,15 +2272,15 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createInstance( + client.restoreCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -2163,86 +2293,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with call error', async () => { + it('invokes restoreCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateInstanceRequest', + '.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createInstance(request), expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createInstance with LRO error', async () => { + it('invokes restoreCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateInstanceRequest', + '.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall( + client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createInstance(request); + const [operation] = await client.restoreCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createInstance as SinonStub + client.innerApiCalls.restoreCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateInstanceProgress without error', async () => { + it('invokes checkRestoreClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2256,7 +2386,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress( + const decodedOperation = await client.checkRestoreClusterProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2264,7 +2394,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateInstanceProgress with error', async () => { + it('invokes checkRestoreClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2277,25 +2407,25 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateInstanceProgress(''), + client.checkRestoreClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createSecondaryInstance', () => { - it('invokes createSecondaryInstance without error', async () => { + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2303,32 +2433,32 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryInstance(request); + const [operation] = await client.createSecondaryCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance without error using callback', async () => { + it('invokes createSecondaryCluster without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -2336,15 +2466,15 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSecondaryInstance = + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSecondaryInstance( + client.createSecondaryCluster( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -2357,89 +2487,89 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance with call error', async () => { + it('invokes createSecondaryCluster with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, expectedError ); await assert.rejects( - client.createSecondaryInstance(request), + client.createSecondaryCluster(request), expectedError ); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSecondaryInstance with LRO error', async () => { + it('invokes createSecondaryCluster with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + '.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createSecondaryInstance(request); + const [operation] = await client.createSecondaryCluster(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSecondaryInstance as SinonStub + client.innerApiCalls.createSecondaryCluster as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateSecondaryInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryClusterProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2453,16 +2583,15 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateSecondaryInstanceProgress( - expectedResponse.name - ); + const decodedOperation = await client.checkCreateSecondaryClusterProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateSecondaryInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryClusterProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2475,25 +2604,25 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkCreateSecondaryInstanceProgress(''), + client.checkCreateSecondaryClusterProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { + describe('createInstance', () => { + it('invokes createInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; @@ -2501,32 +2630,32 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances without error using callback', async () => { + it('invokes createInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; @@ -2534,15 +2663,15 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateInstances = + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( + client.createInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -2555,86 +2684,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with call error', async () => { + it('invokes createInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.batchCreateInstances(request), expectedError); + await assert.rejects(client.createInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes batchCreateInstances with LRO error', async () => { + it('invokes createInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + '.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall( + client.innerApiCalls.createInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.batchCreateInstances(request); + const [operation] = await client.createInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.batchCreateInstances as SinonStub + client.innerApiCalls.createInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkBatchCreateInstancesProgress without error', async () => { + it('invokes checkCreateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2648,7 +2777,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress( + const decodedOperation = await client.checkCreateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2656,7 +2785,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkBatchCreateInstancesProgress with error', async () => { + it('invokes checkCreateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2669,71 +2798,69 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkBatchCreateInstancesProgress(''), + client.checkCreateInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); + const [operation] = await client.createSecondaryInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance without error using callback', async () => { + it('invokes createSecondaryInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateInstance( + client.createSecondaryInstance( request, ( err?: Error | null, @@ -2757,82 +2884,83 @@ describe('v1beta.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with call error', async () => { + it('invokes createSecondaryInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateInstance(request), expectedError); + await assert.rejects( + client.createSecondaryInstance(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateInstance with LRO error', async () => { + it('invokes createSecondaryInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() ); - request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', - ['instance', 'name'] + '.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', + ['parent'] ); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall( + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateInstance(request); + const [operation] = await client.createSecondaryInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateInstance as SinonStub + client.innerApiCalls.createSecondaryInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateInstanceProgress without error', async () => { + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2846,15 +2974,16 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress( - expectedResponse.name - ); + const decodedOperation = + await client.checkCreateSecondaryInstanceProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateInstanceProgress with error', async () => { + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2867,74 +2996,74 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkUpdateInstanceProgress(''), + client.checkCreateSecondaryInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.batchCreateInstances(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance without error using callback', async () => { + it('invokes batchCreateInstances without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteInstance( + client.batchCreateInstances( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -2947,86 +3076,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with call error', async () => { + it('invokes batchCreateInstances with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteInstance(request), expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with LRO error', async () => { + it('invokes batchCreateInstances with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.batchCreateInstances(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.batchCreateInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteInstanceProgress without error', async () => { + it('invokes checkBatchCreateInstancesProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3040,7 +3169,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress( + const decodedOperation = await client.checkBatchCreateInstancesProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3048,7 +3177,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteInstanceProgress with error', async () => { + it('invokes checkBatchCreateInstancesProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3061,69 +3190,71 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteInstanceProgress(''), + client.checkBatchCreateInstancesProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance without error using callback', async () => { + it('invokes updateInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.failoverInstance = + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.failoverInstance( + client.updateInstance( request, ( err?: Error | null, @@ -3147,80 +3278,82 @@ describe('v1beta.AlloyDBAdminClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with call error', async () => { + it('invokes updateInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.failoverInstance(request), expectedError); + await assert.rejects(client.updateInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes failoverInstance with LRO error', async () => { + it('invokes updateInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() ); + request.instance ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', - ['name'] + '.google.cloud.alloydb.v1beta.UpdateInstanceRequest', + ['instance', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall( + client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.failoverInstance(request); + const [operation] = await client.updateInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.failoverInstance as SinonStub + client.innerApiCalls.updateInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkFailoverInstanceProgress without error', async () => { + it('invokes checkUpdateInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3234,7 +3367,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress( + const decodedOperation = await client.checkUpdateInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3242,7 +3375,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkFailoverInstanceProgress with error', async () => { + it('invokes checkUpdateInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3255,25 +3388,25 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkFailoverInstanceProgress(''), + client.checkUpdateInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestartInstanceRequest', + '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3281,32 +3414,32 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); + const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance without error using callback', async () => { + it('invokes deleteInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestartInstanceRequest', + '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3314,15 +3447,15 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartInstance = + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restartInstance( + client.deleteInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -3335,86 +3468,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.protobuf.IEmpty, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with call error', async () => { + it('invokes deleteInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestartInstanceRequest', + '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restartInstance(request), expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartInstance with LRO error', async () => { + it('invokes deleteInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.RestartInstanceRequest', + '.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restartInstance(request); + const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartInstance as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestartInstanceProgress without error', async () => { + it('invokes checkDeleteInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3428,7 +3561,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress( + const decodedOperation = await client.checkDeleteInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3436,7 +3569,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestartInstanceProgress with error', async () => { + it('invokes checkDeleteInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3449,73 +3582,74 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedError ); await assert.rejects( - client.checkRestartInstanceProgress(''), + client.checkDeleteInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createBackup', () => { - it('invokes createBackup without error', async () => { + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); + client.innerApiCalls.failoverInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup without error using callback', async () => { + it('invokes failoverInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = + client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createBackup( + client.failoverInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -3528,86 +3662,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with call error', async () => { + it('invokes failoverInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createBackup(request), expectedError); + await assert.rejects(client.failoverInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with LRO error', async () => { + it('invokes failoverInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.CreateBackupRequest', - ['parent'] + '.google.cloud.alloydb.v1beta.FailoverInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createBackup(request); + const [operation] = await client.failoverInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.failoverInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateBackupProgress without error', async () => { + it('invokes checkFailoverInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3621,7 +3755,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress( + const decodedOperation = await client.checkFailoverInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3629,7 +3763,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateBackupProgress with error', async () => { + it('invokes checkFailoverInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3641,73 +3775,74 @@ describe('v1beta.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + await assert.rejects( + client.checkFailoverInstanceProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { + describe('injectFault', () => { + it('invokes injectFault without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1beta.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup without error using callback', async () => { + it('invokes injectFault without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1beta.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = + client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateBackup( + client.injectFault( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -3720,88 +3855,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with call error', async () => { + it('invokes injectFault with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1beta.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.injectFault = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateBackup(request), expectedError); + await assert.rejects(client.injectFault(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with LRO error', async () => { + it('invokes injectFault with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.alloydb.v1beta.InjectFaultRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.injectFault = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateBackup(request); + const [operation] = await client.injectFault(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.injectFault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateBackupProgress without error', async () => { + it('invokes checkInjectFaultProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3815,7 +3948,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress( + const decodedOperation = await client.checkInjectFaultProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3823,7 +3956,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateBackupProgress with error', async () => { + it('invokes checkInjectFaultProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -3835,23 +3968,23 @@ describe('v1beta.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + await assert.rejects(client.checkInjectFaultProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + '.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3859,31 +3992,32 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); + client.innerApiCalls.restartInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup without error using callback', async () => { + it('invokes restartInstance without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + '.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -3891,15 +4025,15 @@ describe('v1beta.AlloyDBAdminClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteBackup( + client.restartInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata > | null ) => { @@ -3912,86 +4046,86 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IInstance, protos.google.cloud.alloydb.v1beta.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with call error', async () => { + it('invokes restartInstance with call error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + '.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteBackup(request), expectedError); + await assert.rejects(client.restartInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with LRO error', async () => { + it('invokes restartInstance with LRO error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + '.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteBackup(request); + const [operation] = await client.restartInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.restartInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteBackupProgress without error', async () => { + it('invokes checkRestartInstanceProgress without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4005,7 +4139,7 @@ describe('v1beta.AlloyDBAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress( + const decodedOperation = await client.checkRestartInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -4013,7 +4147,7 @@ describe('v1beta.AlloyDBAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteBackupProgress with error', async () => { + it('invokes checkRestartInstanceProgress with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -4025,73 +4159,965 @@ describe('v1beta.AlloyDBAdminClient', () => { undefined, expectedError ); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + await assert.rejects( + client.checkRestartInstanceProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listClusters', () => { - it('invokes listClusters without error', async () => { + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.alloydb.v1beta.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.alloydb.v1beta.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters without error using callback', async () => { + it('invokes listInstances without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), ]; - client.innerApiCalls.listClusters = + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listClusters( + client.listInstances( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1beta.ICluster[] | null + result?: protos.google.cloud.alloydb.v1beta.IInstance[] | null ) => { if (err) { reject(err); @@ -4104,74 +5130,80 @@ describe('v1beta.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters with error', async () => { + it('invokes listInstances with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall( + client.innerApiCalls.listInstances = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listClusters(request), expectedError); + await assert.rejects(client.listInstances(request), expectedError); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listInstances as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClustersStream without error', async () => { + it('invokes listInstancesStream without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), ]; - client.descriptors.page.listClusters.createStream = + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + (response: protos.google.cloud.alloydb.v1beta.Instance) => { responses.push(response); } ); @@ -4185,12 +5217,12 @@ describe('v1beta.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4198,32 +5230,30 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('invokes listClustersStream with error', async () => { + it('invokes listInstancesStream with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listClustersStream(request); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + (response: protos.google.cloud.alloydb.v1beta.Instance) => { responses.push(response); } ); @@ -4236,12 +5266,12 @@ describe('v1beta.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listInstances, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4249,42 +5279,48 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters without error', async () => { + it('uses async iteration with listInstances without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ), ]; - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; - const iterable = client.listClustersAsync(request); + const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; + const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4292,39 +5328,39 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listClusters with error', async () => { + it('uses async iteration with listInstances with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListClustersRequest', + '.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); + const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; + const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listInstances.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listInstances.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4333,80 +5369,68 @@ describe('v1beta.AlloyDBAdminClient', () => { }); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { + describe('listBackups', () => { + it('invokes listBackups without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances without error using callback', async () => { + it('invokes listBackups without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), ]; - client.innerApiCalls.listInstances = + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listInstances( + client.listBackups( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1beta.IInstance[] | null + result?: protos.google.cloud.alloydb.v1beta.IBackup[] | null ) => { if (err) { reject(err); @@ -4419,80 +5443,74 @@ describe('v1beta.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances with error', async () => { + it('invokes listBackups with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall( + client.innerApiCalls.listBackups = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listInstances(request), expectedError); + await assert.rejects(client.listBackups(request), expectedError); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listBackups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstancesStream without error', async () => { + it('invokes listBackupsStream without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), ]; - client.descriptors.page.listInstances.createStream = + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; + const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Instance) => { + (response: protos.google.cloud.alloydb.v1beta.Backup) => { responses.push(response); } ); @@ -4506,12 +5524,12 @@ describe('v1beta.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4519,30 +5537,32 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('invokes listInstancesStream with error', async () => { + it('invokes listBackupsStream with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; + const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Instance) => { + (response: protos.google.cloud.alloydb.v1beta.Backup) => { responses.push(response); } ); @@ -4555,12 +5575,12 @@ describe('v1beta.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listBackups, request) ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4568,48 +5588,42 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances without error', async () => { + it('uses async iteration with listBackups without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), ]; - client.descriptors.page.listInstances.asyncIterate = + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; - const iterable = client.listInstancesAsync(request); + const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; + const iterable = client.listBackupsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4617,39 +5631,41 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listInstances with error', async () => { + it('uses async iteration with listBackups with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListInstancesRequest', + '.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; + const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4658,68 +5674,83 @@ describe('v1beta.AlloyDBAdminClient', () => { }); }); - describe('listBackups', () => { - it('invokes listBackups without error', async () => { + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); + client.innerApiCalls.listSupportedDatabaseFlags = + stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups without error using callback', async () => { + it('invokes listSupportedDatabaseFlags without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), ]; - client.innerApiCalls.listBackups = + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listBackups( + client.listSupportedDatabaseFlags( request, ( err?: Error | null, - result?: protos.google.cloud.alloydb.v1beta.IBackup[] | null + result?: + | protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] + | null ) => { if (err) { reject(err); @@ -4732,74 +5763,86 @@ describe('v1beta.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackups with error', async () => { + it('invokes listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall( + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listBackups(request), expectedError); + await assert.rejects( + client.listSupportedDatabaseFlags(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub + client.innerApiCalls.listSupportedDatabaseFlags as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listBackupsStream without error', async () => { + it('invokes listSupportedDatabaseFlagsStream without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.createStream = + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; + const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = + []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Backup) => { + ( + response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag + ) => { responses.push(response); } ); @@ -4813,12 +5856,18 @@ describe('v1beta.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4826,32 +5875,33 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('invokes listBackupsStream with error', async () => { + it('invokes listSupportedDatabaseFlagsStream with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listBackupsStream(request); + client.descriptors.page.listSupportedDatabaseFlags.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; + const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = + []; stream.on( 'data', - (response: protos.google.cloud.alloydb.v1beta.Backup) => { + ( + response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag + ) => { responses.push(response); } ); @@ -4864,12 +5914,18 @@ describe('v1beta.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) ); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4877,42 +5933,53 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups without error', async () => { + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), + generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() + ), ]; - client.descriptors.page.listBackups.asyncIterate = + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; - const iterable = client.listBackupsAsync(request); + const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = + []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4920,41 +5987,44 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listBackups with error', async () => { + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListBackupsRequest', + '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listBackupsAsync(request); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; + const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) + ( + client.descriptors.page.listSupportedDatabaseFlags + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4963,83 +6033,68 @@ describe('v1beta.AlloyDBAdminClient', () => { }); }); - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { + describe('listUsers', () => { + it('invokes listUsers without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = - stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags without error using callback', async () => { + it('invokes listUsers without error using callback', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), ]; - client.innerApiCalls.listSupportedDatabaseFlags = + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( + client.listUsers( request, ( err?: Error | null, - result?: - | protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] - | null + result?: protos.google.cloud.alloydb.v1beta.IUser[] | null ) => { if (err) { reject(err); @@ -5052,86 +6107,71 @@ describe('v1beta.AlloyDBAdminClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlags with error', async () => { + it('invokes listUsers with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.listSupportedDatabaseFlags(request), - expectedError - ); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); const actualRequest = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSupportedDatabaseFlags as SinonStub + client.innerApiCalls.listUsers as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSupportedDatabaseFlagsStream without error', async () => { + it('invokes listUsersStream without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1beta.User[] = []; stream.on( 'data', - ( - response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag - ) => { + (response: protos.google.cloud.alloydb.v1beta.User) => { responses.push(response); } ); @@ -5145,18 +6185,12 @@ describe('v1beta.AlloyDBAdminClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5164,33 +6198,32 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('invokes listSupportedDatabaseFlagsStream with error', async () => { + it('invokes listUsersStream with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listUsersStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1beta.User[] = []; stream.on( 'data', - ( - response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag - ) => { + (response: protos.google.cloud.alloydb.v1beta.User) => { responses.push(response); } ); @@ -5203,18 +6236,12 @@ describe('v1beta.AlloyDBAdminClient', () => { }); await assert.rejects(promise, expectedError); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request) + .calledWith(client.innerApiCalls.listUsers, request) ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .createStream as SinonStub - ) + (client.descriptors.page.listUsers.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5222,53 +6249,41 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + it('uses async iteration with listUsers without error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), - generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() - ), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = - []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); + const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; + const iterable = client.listUsersAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5276,44 +6291,40 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + it('uses async iteration with listUsers with error', async () => { const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', + '.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listUsersAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = - []; + const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listUsers.asyncIterate as SinonStub).getCall(0) + .args[1], request ); assert( - ( - client.descriptors.page.listSupportedDatabaseFlags - .asyncIterate as SinonStub - ) + (client.descriptors.page.listUsers.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6594,5 +7605,81 @@ describe('v1beta.AlloyDBAdminClient', () => { ); }); }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + user: 'userValue', + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'userValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); From 64af37afa0abccf87378b4813a26fbaba3ae8bb8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 17:02:13 +0000 Subject: [PATCH 36/46] feat: [dialogflow-cx] add support for flexible webhook (#4334) - [ ] Regenerate this pull request now. docs: update synthesize speech configs's documentation PiperOrigin-RevId: 539265734 Source-Link: https://togithub.com/googleapis/googleapis/commit/091bc8c603d028cab2ea8074417ef9f191adb869 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/ca652d5e3b92aac32c1aa28589e0421c3e5b7bc5 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6ImNhNjUyZDVlM2I5MmFhYzMyYzFhYTI4NTg5ZTA0MjFjM2U1YjdiYzUifQ== BEGIN_NESTED_COMMIT feat: [dialogflow-cx] add support for flexible webhook docs: update synthesize speech configs's documentation PiperOrigin-RevId: 539265592 Source-Link: https://togithub.com/googleapis/googleapis/commit/2f59906698328d577734707dd442dd00db7b6320 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b92963b88b826eafc045c886b04962b4cc29e8ef Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6ImI5Mjk2M2I4OGI4MjZlYWZjMDQ1Yzg4NmIwNDk2MmI0Y2MyOWU4ZWYifQ== END_NESTED_COMMIT --- .../cloud/dialogflow/cx/v3/audio_config.proto | 17 +- .../cloud/dialogflow/cx/v3/test_case.proto | 3 +- .../cloud/dialogflow/cx/v3/webhook.proto | 57 ++ .../dialogflow/cx/v3beta1/audio_config.proto | 17 +- .../dialogflow/cx/v3beta1/test_case.proto | 3 +- .../cloud/dialogflow/cx/v3beta1/webhook.proto | 57 ++ .../protos/protos.d.ts | 92 ++++ .../protos/protos.js | 488 +++++++++++++++++- .../protos/protos.json | 100 ++++ 9 files changed, 820 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto index 74f864bc2f9c..7f18827cb96c 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/audio_config.proto @@ -320,6 +320,9 @@ message OutputAudioConfig { int32 sample_rate_hertz = 2; // Optional. Configuration of how speech should be synthesized. + // If not specified, + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings] + // is applied. SynthesizeSpeechConfig synthesize_speech_config = 3; } @@ -331,12 +334,16 @@ message TextToSpeechSettings { // // These settings affect: // - // - The synthesize configuration used in [phone - // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway). + // - The [phone + // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) + // synthesize configuration set via + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings]. // - // - You no longer need to specify + // - How speech is synthesized when invoking + // [session][google.cloud.dialogflow.cx.v3.Sessions] APIs. + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3.Agent.text_to_speech_settings] + // only applies if // [OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3.OutputAudioConfig.synthesize_speech_config] - // when invoking API calls. Your agent will use the pre-configured options - // for speech synthesizing. + // is not specified. map synthesize_speech_configs = 1; } diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto index 22d69531ce30..27729be22092 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/test_case.proto @@ -403,7 +403,8 @@ message TestRunDifference { // The type of diff. DiffType type = 1; - // A description of the diff, showing the actual output vs expected output. + // A human readable description of the diff, showing the actual output vs + // expected output. string description = 2; } diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto index d721b1711442..c9d54aed044d 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/webhook.proto @@ -101,6 +101,45 @@ message Webhook { // Represents configuration for a generic web service. message GenericWebService { + // Represents the type of webhook configuration. + enum WebhookType { + // Default value. This value is unused. + WEBHOOK_TYPE_UNSPECIFIED = 0; + + // Represents a standard webhook. + STANDARD = 1; + + // Represents a flexible webhook. + FLEXIBLE = 2; + } + + // HTTP method to use when calling webhooks. + enum HttpMethod { + // HTTP method not specified. + HTTP_METHOD_UNSPECIFIED = 0; + + // HTTP POST Method. + POST = 1; + + // HTTP GET Method. + GET = 2; + + // HTTP HEAD Method. + HEAD = 3; + + // HTTP PUT Method. + PUT = 4; + + // HTTP DELETE Method. + DELETE = 5; + + // HTTP PATCH Method. + PATCH = 6; + + // HTTP OPTIONS Method. + OPTIONS = 7; + } + // Required. The webhook URI for receiving POST requests. It must use https // protocol. string uri = 1 [(google.api.field_behavior) = REQUIRED]; @@ -129,6 +168,24 @@ message Webhook { // ``` repeated bytes allowed_ca_certs = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the webhook. + WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HTTP method for the flexible webhook calls. Standard webhook + // always uses POST. + HttpMethod http_method = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines a custom JSON object as request body to send to + // flexible webhook. + string request_body = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maps the values extracted from specific fields of the flexible + // webhook response into session parameters. + // - Key: session parameter name + // - Value: field path in the webhook response + map parameter_mapping = 9 + [(google.api.field_behavior) = OPTIONAL]; } // Represents configuration for a [Service diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto index 7c6cf8bf9cbc..bea17e17a6c1 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto @@ -320,6 +320,9 @@ message OutputAudioConfig { int32 sample_rate_hertz = 2; // Optional. Configuration of how speech should be synthesized. + // If not specified, + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings] + // is applied. SynthesizeSpeechConfig synthesize_speech_config = 3; } @@ -331,12 +334,16 @@ message TextToSpeechSettings { // // These settings affect: // - // - The synthesize configuration used in [phone - // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway). + // - The [phone + // gateway](https://cloud.google.com/dialogflow/cx/docs/concept/integration/phone-gateway) + // synthesize configuration set via + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings]. // - // - You no longer need to specify + // - How speech is synthesized when invoking + // [session][google.cloud.dialogflow.cx.v3beta1.Sessions] APIs. + // [Agent.text_to_speech_settings][google.cloud.dialogflow.cx.v3beta1.Agent.text_to_speech_settings] + // only applies if // [OutputAudioConfig.synthesize_speech_config][google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig.synthesize_speech_config] - // when invoking API calls. Your agent will use the pre-configured options - // for speech synthesizing. + // is not specified. map synthesize_speech_configs = 1; } diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto index 62e0d5e6d7b3..6f2d256100b3 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/test_case.proto @@ -406,7 +406,8 @@ message TestRunDifference { // The type of diff. DiffType type = 1; - // A description of the diff, showing the actual output vs expected output. + // A human readable description of the diff, showing the actual output vs + // expected output. string description = 2; } diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto index 878f34ccbd70..e88e3ee91aea 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto @@ -101,6 +101,45 @@ message Webhook { // Represents configuration for a generic web service. message GenericWebService { + // Represents the type of webhook configuration. + enum WebhookType { + // Default value. This value is unused. + WEBHOOK_TYPE_UNSPECIFIED = 0; + + // Represents a standard webhook. + STANDARD = 1; + + // Represents a flexible webhook. + FLEXIBLE = 2; + } + + // HTTP method to use when calling webhooks. + enum HttpMethod { + // HTTP method not specified. + HTTP_METHOD_UNSPECIFIED = 0; + + // HTTP POST Method. + POST = 1; + + // HTTP GET Method. + GET = 2; + + // HTTP HEAD Method. + HEAD = 3; + + // HTTP PUT Method. + PUT = 4; + + // HTTP DELETE Method. + DELETE = 5; + + // HTTP PATCH Method. + PATCH = 6; + + // HTTP OPTIONS Method. + OPTIONS = 7; + } + // Required. The webhook URI for receiving POST requests. It must use https // protocol. string uri = 1 [(google.api.field_behavior) = REQUIRED]; @@ -129,6 +168,24 @@ message Webhook { // ``` repeated bytes allowed_ca_certs = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the webhook. + WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HTTP method for the flexible webhook calls. Standard webhook + // always uses POST. + HttpMethod http_method = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines a custom JSON object as request body to send to + // flexible webhook. + string request_body = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maps the values extracted from specific fields of the flexible + // webhook response into session parameters. + // - Key: session parameter name + // - Value: field path in the webhook response + map parameter_mapping = 9 + [(google.api.field_behavior) = OPTIONAL]; } // Represents configuration for a [Service diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts index 4e6b853011ff..460cc452d771 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts @@ -23348,6 +23348,18 @@ export namespace google { /** GenericWebService allowedCaCerts */ allowedCaCerts?: (Uint8Array[]|null); + + /** GenericWebService webhookType */ + webhookType?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|null); + + /** GenericWebService httpMethod */ + httpMethod?: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|null); + + /** GenericWebService requestBody */ + requestBody?: (string|null); + + /** GenericWebService parameterMapping */ + parameterMapping?: ({ [k: string]: string }|null); } /** Represents a GenericWebService. */ @@ -23374,6 +23386,18 @@ export namespace google { /** GenericWebService allowedCaCerts. */ public allowedCaCerts: Uint8Array[]; + /** GenericWebService webhookType. */ + public webhookType: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType); + + /** GenericWebService httpMethod. */ + public httpMethod: (google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod); + + /** GenericWebService requestBody. */ + public requestBody: string; + + /** GenericWebService parameterMapping. */ + public parameterMapping: { [k: string]: string }; + /** * Creates a new GenericWebService instance using the specified properties. * @param [properties] Properties to set @@ -23452,6 +23476,28 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace GenericWebService { + + /** WebhookType enum. */ + enum WebhookType { + WEBHOOK_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + FLEXIBLE = 2 + } + + /** HttpMethod enum. */ + enum HttpMethod { + HTTP_METHOD_UNSPECIFIED = 0, + POST = 1, + GET = 2, + HEAD = 3, + PUT = 4, + DELETE = 5, + PATCH = 6, + OPTIONS = 7 + } + } + /** Properties of a ServiceDirectoryConfig. */ interface IServiceDirectoryConfig { @@ -53663,6 +53709,18 @@ export namespace google { /** GenericWebService allowedCaCerts */ allowedCaCerts?: (Uint8Array[]|null); + + /** GenericWebService webhookType */ + webhookType?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|null); + + /** GenericWebService httpMethod */ + httpMethod?: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|null); + + /** GenericWebService requestBody */ + requestBody?: (string|null); + + /** GenericWebService parameterMapping */ + parameterMapping?: ({ [k: string]: string }|null); } /** Represents a GenericWebService. */ @@ -53689,6 +53747,18 @@ export namespace google { /** GenericWebService allowedCaCerts. */ public allowedCaCerts: Uint8Array[]; + /** GenericWebService webhookType. */ + public webhookType: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType); + + /** GenericWebService httpMethod. */ + public httpMethod: (google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|keyof typeof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod); + + /** GenericWebService requestBody. */ + public requestBody: string; + + /** GenericWebService parameterMapping. */ + public parameterMapping: { [k: string]: string }; + /** * Creates a new GenericWebService instance using the specified properties. * @param [properties] Properties to set @@ -53767,6 +53837,28 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace GenericWebService { + + /** WebhookType enum. */ + enum WebhookType { + WEBHOOK_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + FLEXIBLE = 2 + } + + /** HttpMethod enum. */ + enum HttpMethod { + HTTP_METHOD_UNSPECIFIED = 0, + POST = 1, + GET = 2, + HEAD = 3, + PUT = 4, + DELETE = 5, + PATCH = 6, + OPTIONS = 7 + } + } + /** Properties of a ServiceDirectoryConfig. */ interface IServiceDirectoryConfig { diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.js b/packages/google-cloud-dialogflow-cx/protos/protos.js index bd0c5b68ddf5..ba2c64de63cf 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.js +++ b/packages/google-cloud-dialogflow-cx/protos/protos.js @@ -55602,6 +55602,10 @@ * @property {string|null} [password] GenericWebService password * @property {Object.|null} [requestHeaders] GenericWebService requestHeaders * @property {Array.|null} [allowedCaCerts] GenericWebService allowedCaCerts + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType|null} [webhookType] GenericWebService webhookType + * @property {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod|null} [httpMethod] GenericWebService httpMethod + * @property {string|null} [requestBody] GenericWebService requestBody + * @property {Object.|null} [parameterMapping] GenericWebService parameterMapping */ /** @@ -55615,6 +55619,7 @@ function GenericWebService(properties) { this.requestHeaders = {}; this.allowedCaCerts = []; + this.parameterMapping = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55661,6 +55666,38 @@ */ GenericWebService.prototype.allowedCaCerts = $util.emptyArray; + /** + * GenericWebService webhookType. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType} webhookType + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.webhookType = 0; + + /** + * GenericWebService httpMethod. + * @member {google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod} httpMethod + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.httpMethod = 0; + + /** + * GenericWebService requestBody. + * @member {string} requestBody + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestBody = ""; + + /** + * GenericWebService parameterMapping. + * @member {Object.} parameterMapping + * @memberof google.cloud.dialogflow.cx.v3.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.parameterMapping = $util.emptyObject; + /** * Creates a new GenericWebService instance using the specified properties. * @function create @@ -55697,6 +55734,15 @@ if (message.allowedCaCerts != null && message.allowedCaCerts.length) for (var i = 0; i < message.allowedCaCerts.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.allowedCaCerts[i]); + if (message.webhookType != null && Object.hasOwnProperty.call(message, "webhookType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.httpMethod); + if (message.requestBody != null && Object.hasOwnProperty.call(message, "requestBody")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.requestBody); + if (message.parameterMapping != null && Object.hasOwnProperty.call(message, "parameterMapping")) + for (var keys = Object.keys(message.parameterMapping), 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.parameterMapping[keys[i]]).ldelim(); return writer; }; @@ -55772,6 +55818,41 @@ message.allowedCaCerts.push(reader.bytes()); break; } + case 6: { + message.webhookType = reader.int32(); + break; + } + case 7: { + message.httpMethod = reader.int32(); + break; + } + case 8: { + message.requestBody = reader.string(); + break; + } + case 9: { + if (message.parameterMapping === $util.emptyObject) + message.parameterMapping = {}; + 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.parameterMapping[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -55831,6 +55912,40 @@ if (!(message.allowedCaCerts[i] && typeof message.allowedCaCerts[i].length === "number" || $util.isString(message.allowedCaCerts[i]))) return "allowedCaCerts: buffer[] expected"; } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + switch (message.webhookType) { + default: + return "webhookType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + switch (message.httpMethod) { + default: + return "httpMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + if (!$util.isString(message.requestBody)) + return "requestBody: string expected"; + if (message.parameterMapping != null && message.hasOwnProperty("parameterMapping")) { + if (!$util.isObject(message.parameterMapping)) + return "parameterMapping: object expected"; + var key = Object.keys(message.parameterMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameterMapping[key[i]])) + return "parameterMapping: string{k:string} expected"; + } return null; }; @@ -55869,6 +55984,75 @@ else if (object.allowedCaCerts[i].length >= 0) message.allowedCaCerts[i] = object.allowedCaCerts[i]; } + switch (object.webhookType) { + default: + if (typeof object.webhookType === "number") { + message.webhookType = object.webhookType; + break; + } + break; + case "WEBHOOK_TYPE_UNSPECIFIED": + case 0: + message.webhookType = 0; + break; + case "STANDARD": + case 1: + message.webhookType = 1; + break; + case "FLEXIBLE": + case 2: + message.webhookType = 2; + break; + } + switch (object.httpMethod) { + default: + if (typeof object.httpMethod === "number") { + message.httpMethod = object.httpMethod; + break; + } + break; + case "HTTP_METHOD_UNSPECIFIED": + case 0: + message.httpMethod = 0; + break; + case "POST": + case 1: + message.httpMethod = 1; + break; + case "GET": + case 2: + message.httpMethod = 2; + break; + case "HEAD": + case 3: + message.httpMethod = 3; + break; + case "PUT": + case 4: + message.httpMethod = 4; + break; + case "DELETE": + case 5: + message.httpMethod = 5; + break; + case "PATCH": + case 6: + message.httpMethod = 6; + break; + case "OPTIONS": + case 7: + message.httpMethod = 7; + break; + } + if (object.requestBody != null) + message.requestBody = String(object.requestBody); + if (object.parameterMapping) { + if (typeof object.parameterMapping !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.parameterMapping: object expected"); + message.parameterMapping = {}; + for (var keys = Object.keys(object.parameterMapping), i = 0; i < keys.length; ++i) + message.parameterMapping[keys[i]] = String(object.parameterMapping[keys[i]]); + } return message; }; @@ -55887,12 +56071,17 @@ var object = {}; if (options.arrays || options.defaults) object.allowedCaCerts = []; - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.requestHeaders = {}; + object.parameterMapping = {}; + } if (options.defaults) { object.uri = ""; object.username = ""; object.password = ""; + object.webhookType = options.enums === String ? "WEBHOOK_TYPE_UNSPECIFIED" : 0; + object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; + object.requestBody = ""; } if (message.uri != null && message.hasOwnProperty("uri")) object.uri = message.uri; @@ -55911,6 +56100,17 @@ for (var j = 0; j < message.allowedCaCerts.length; ++j) object.allowedCaCerts[j] = options.bytes === String ? $util.base64.encode(message.allowedCaCerts[j], 0, message.allowedCaCerts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.allowedCaCerts[j]) : message.allowedCaCerts[j]; } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + object.webhookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType[message.webhookType] === undefined ? message.webhookType : $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType[message.webhookType] : message.webhookType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod[message.httpMethod] : message.httpMethod; + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + object.requestBody = message.requestBody; + if (message.parameterMapping && (keys2 = Object.keys(message.parameterMapping)).length) { + object.parameterMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameterMapping[keys2[j]] = message.parameterMapping[keys2[j]]; + } return object; }; @@ -55940,6 +56140,48 @@ return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3.Webhook.GenericWebService"; }; + /** + * WebhookType enum. + * @name google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.WebhookType + * @enum {number} + * @property {number} WEBHOOK_TYPE_UNSPECIFIED=0 WEBHOOK_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} FLEXIBLE=2 FLEXIBLE value + */ + GenericWebService.WebhookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "FLEXIBLE"] = 2; + return values; + })(); + + /** + * HttpMethod enum. + * @name google.cloud.dialogflow.cx.v3.Webhook.GenericWebService.HttpMethod + * @enum {number} + * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value + * @property {number} POST=1 POST value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} PUT=4 PUT value + * @property {number} DELETE=5 DELETE value + * @property {number} PATCH=6 PATCH value + * @property {number} OPTIONS=7 OPTIONS value + */ + GenericWebService.HttpMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "POST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "PUT"] = 4; + values[valuesById[5] = "DELETE"] = 5; + values[valuesById[6] = "PATCH"] = 6; + values[valuesById[7] = "OPTIONS"] = 7; + return values; + })(); + return GenericWebService; })(); @@ -127735,6 +127977,10 @@ * @property {string|null} [password] GenericWebService password * @property {Object.|null} [requestHeaders] GenericWebService requestHeaders * @property {Array.|null} [allowedCaCerts] GenericWebService allowedCaCerts + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType|null} [webhookType] GenericWebService webhookType + * @property {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod|null} [httpMethod] GenericWebService httpMethod + * @property {string|null} [requestBody] GenericWebService requestBody + * @property {Object.|null} [parameterMapping] GenericWebService parameterMapping */ /** @@ -127748,6 +127994,7 @@ function GenericWebService(properties) { this.requestHeaders = {}; this.allowedCaCerts = []; + this.parameterMapping = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -127794,6 +128041,38 @@ */ GenericWebService.prototype.allowedCaCerts = $util.emptyArray; + /** + * GenericWebService webhookType. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType} webhookType + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.webhookType = 0; + + /** + * GenericWebService httpMethod. + * @member {google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod} httpMethod + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.httpMethod = 0; + + /** + * GenericWebService requestBody. + * @member {string} requestBody + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.requestBody = ""; + + /** + * GenericWebService parameterMapping. + * @member {Object.} parameterMapping + * @memberof google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService + * @instance + */ + GenericWebService.prototype.parameterMapping = $util.emptyObject; + /** * Creates a new GenericWebService instance using the specified properties. * @function create @@ -127830,6 +128109,15 @@ if (message.allowedCaCerts != null && message.allowedCaCerts.length) for (var i = 0; i < message.allowedCaCerts.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.allowedCaCerts[i]); + if (message.webhookType != null && Object.hasOwnProperty.call(message, "webhookType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.httpMethod); + if (message.requestBody != null && Object.hasOwnProperty.call(message, "requestBody")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.requestBody); + if (message.parameterMapping != null && Object.hasOwnProperty.call(message, "parameterMapping")) + for (var keys = Object.keys(message.parameterMapping), 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.parameterMapping[keys[i]]).ldelim(); return writer; }; @@ -127905,6 +128193,41 @@ message.allowedCaCerts.push(reader.bytes()); break; } + case 6: { + message.webhookType = reader.int32(); + break; + } + case 7: { + message.httpMethod = reader.int32(); + break; + } + case 8: { + message.requestBody = reader.string(); + break; + } + case 9: { + if (message.parameterMapping === $util.emptyObject) + message.parameterMapping = {}; + 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.parameterMapping[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -127964,6 +128287,40 @@ if (!(message.allowedCaCerts[i] && typeof message.allowedCaCerts[i].length === "number" || $util.isString(message.allowedCaCerts[i]))) return "allowedCaCerts: buffer[] expected"; } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + switch (message.webhookType) { + default: + return "webhookType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + switch (message.httpMethod) { + default: + return "httpMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + if (!$util.isString(message.requestBody)) + return "requestBody: string expected"; + if (message.parameterMapping != null && message.hasOwnProperty("parameterMapping")) { + if (!$util.isObject(message.parameterMapping)) + return "parameterMapping: object expected"; + var key = Object.keys(message.parameterMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameterMapping[key[i]])) + return "parameterMapping: string{k:string} expected"; + } return null; }; @@ -128002,6 +128359,75 @@ else if (object.allowedCaCerts[i].length >= 0) message.allowedCaCerts[i] = object.allowedCaCerts[i]; } + switch (object.webhookType) { + default: + if (typeof object.webhookType === "number") { + message.webhookType = object.webhookType; + break; + } + break; + case "WEBHOOK_TYPE_UNSPECIFIED": + case 0: + message.webhookType = 0; + break; + case "STANDARD": + case 1: + message.webhookType = 1; + break; + case "FLEXIBLE": + case 2: + message.webhookType = 2; + break; + } + switch (object.httpMethod) { + default: + if (typeof object.httpMethod === "number") { + message.httpMethod = object.httpMethod; + break; + } + break; + case "HTTP_METHOD_UNSPECIFIED": + case 0: + message.httpMethod = 0; + break; + case "POST": + case 1: + message.httpMethod = 1; + break; + case "GET": + case 2: + message.httpMethod = 2; + break; + case "HEAD": + case 3: + message.httpMethod = 3; + break; + case "PUT": + case 4: + message.httpMethod = 4; + break; + case "DELETE": + case 5: + message.httpMethod = 5; + break; + case "PATCH": + case 6: + message.httpMethod = 6; + break; + case "OPTIONS": + case 7: + message.httpMethod = 7; + break; + } + if (object.requestBody != null) + message.requestBody = String(object.requestBody); + if (object.parameterMapping) { + if (typeof object.parameterMapping !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.parameterMapping: object expected"); + message.parameterMapping = {}; + for (var keys = Object.keys(object.parameterMapping), i = 0; i < keys.length; ++i) + message.parameterMapping[keys[i]] = String(object.parameterMapping[keys[i]]); + } return message; }; @@ -128020,12 +128446,17 @@ var object = {}; if (options.arrays || options.defaults) object.allowedCaCerts = []; - if (options.objects || options.defaults) + if (options.objects || options.defaults) { object.requestHeaders = {}; + object.parameterMapping = {}; + } if (options.defaults) { object.uri = ""; object.username = ""; object.password = ""; + object.webhookType = options.enums === String ? "WEBHOOK_TYPE_UNSPECIFIED" : 0; + object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; + object.requestBody = ""; } if (message.uri != null && message.hasOwnProperty("uri")) object.uri = message.uri; @@ -128044,6 +128475,17 @@ for (var j = 0; j < message.allowedCaCerts.length; ++j) object.allowedCaCerts[j] = options.bytes === String ? $util.base64.encode(message.allowedCaCerts[j], 0, message.allowedCaCerts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.allowedCaCerts[j]) : message.allowedCaCerts[j]; } + if (message.webhookType != null && message.hasOwnProperty("webhookType")) + object.webhookType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType[message.webhookType] === undefined ? message.webhookType : $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType[message.webhookType] : message.webhookType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod[message.httpMethod] : message.httpMethod; + if (message.requestBody != null && message.hasOwnProperty("requestBody")) + object.requestBody = message.requestBody; + if (message.parameterMapping && (keys2 = Object.keys(message.parameterMapping)).length) { + object.parameterMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameterMapping[keys2[j]] = message.parameterMapping[keys2[j]]; + } return object; }; @@ -128073,6 +128515,48 @@ return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService"; }; + /** + * WebhookType enum. + * @name google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.WebhookType + * @enum {number} + * @property {number} WEBHOOK_TYPE_UNSPECIFIED=0 WEBHOOK_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} FLEXIBLE=2 FLEXIBLE value + */ + GenericWebService.WebhookType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "FLEXIBLE"] = 2; + return values; + })(); + + /** + * HttpMethod enum. + * @name google.cloud.dialogflow.cx.v3beta1.Webhook.GenericWebService.HttpMethod + * @enum {number} + * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value + * @property {number} POST=1 POST value + * @property {number} GET=2 GET value + * @property {number} HEAD=3 HEAD value + * @property {number} PUT=4 PUT value + * @property {number} DELETE=5 DELETE value + * @property {number} PATCH=6 PATCH value + * @property {number} OPTIONS=7 OPTIONS value + */ + GenericWebService.HttpMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "POST"] = 1; + values[valuesById[2] = "GET"] = 2; + values[valuesById[3] = "HEAD"] = 3; + values[valuesById[4] = "PUT"] = 4; + values[valuesById[5] = "DELETE"] = 5; + values[valuesById[6] = "PATCH"] = 6; + values[valuesById[7] = "OPTIONS"] = 7; + return values; + })(); + return GenericWebService; })(); diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.json b/packages/google-cloud-dialogflow-cx/protos/protos.json index f050e436f91e..cdc54caff5dd 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.json +++ b/packages/google-cloud-dialogflow-cx/protos/protos.json @@ -6023,6 +6023,56 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "webhookType": { + "type": "WebhookType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpMethod": { + "type": "HttpMethod", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestBody": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterMapping": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "WebhookType": { + "values": { + "WEBHOOK_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "FLEXIBLE": 2 + } + }, + "HttpMethod": { + "values": { + "HTTP_METHOD_UNSPECIFIED": 0, + "POST": 1, + "GET": 2, + "HEAD": 3, + "PUT": 4, + "DELETE": 5, + "PATCH": 6, + "OPTIONS": 7 + } } } }, @@ -13695,6 +13745,56 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "webhookType": { + "type": "WebhookType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpMethod": { + "type": "HttpMethod", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestBody": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterMapping": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "WebhookType": { + "values": { + "WEBHOOK_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "FLEXIBLE": 2 + } + }, + "HttpMethod": { + "values": { + "HTTP_METHOD_UNSPECIFIED": 0, + "POST": 1, + "GET": 2, + "HEAD": 3, + "PUT": 4, + "DELETE": 5, + "PATCH": 6, + "OPTIONS": 7 + } } } }, From 0552bb983dae0d565a68fd9ab315c40492f13e46 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:06:13 +0000 Subject: [PATCH 37/46] feat: [securitycenter] Add user agent and DLP parent type fields to finding's list of attributes (#4332) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 539195531 Source-Link: https://togithub.com/googleapis/googleapis/commit/0b212ba3117718d381810f0d0e0c3d2640920516 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/64c1a0032f89ffafde49424ea137640b868348d4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiI2NGMxYTAwMzJmODlmZmFmZGU0OTQyNGVhMTM3NjQwYjg2ODM0OGQ0In0= --- .../google-cloud-securitycenter/README.md | 177 +++++++++--------- .../cloud/securitycenter/v1/access.proto | 3 + .../v1/cloud_dlp_data_profile.proto | 15 ++ .../v1/cloud_dlp_inspection.proto | 4 +- .../cloud/securitycenter/v1/compliance.proto | 8 +- .../securitycenter/v1/contact_details.proto | 2 +- .../cloud/securitycenter/v1/container.proto | 11 +- .../cloud/securitycenter/v1/database.proto | 34 ++-- .../securitycenter/v1/exfiltration.proto | 22 ++- .../google/cloud/securitycenter/v1/file.proto | 3 +- .../cloud/securitycenter/v1/iam_binding.proto | 4 +- .../securitycenter/v1/kernel_rootkit.proto | 18 +- .../cloud/securitycenter/v1/kubernetes.proto | 75 ++++---- .../cloud/securitycenter/v1/label.proto | 10 +- .../v1/organization_settings.proto | 6 +- .../cloud/securitycenter/v1/process.proto | 20 +- .../v1/securitycenter_service.proto | 12 +- .../protos/protos.d.ts | 22 +++ .../protos/protos.js | 89 ++++++++- .../protos/protos.json | 17 ++ .../samples/README.md | 18 -- ...security_center.create_big_query_export.js | 6 +- .../v1/security_center.create_mute_config.js | 6 +- .../src/v1/security_center_client.ts | 12 +- 24 files changed, 368 insertions(+), 226 deletions(-) diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 77a116da6de4..e2b20b45d2a3 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Google Cloud Security Command Center: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-securitycenter) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) @@ -81,97 +81,96 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-securitycenter/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Security_center.bulk_mute_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js,samples/README.md) | -| Security_center.create_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_big_query_export.js,samples/README.md) | -| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_finding.js,samples/README.md) | -| Security_center.create_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js,samples/README.md) | -| Security_center.create_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js,samples/README.md) | -| Security_center.create_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js,samples/README.md) | -| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_source.js,samples/README.md) | -| Security_center.delete_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js,samples/README.md) | -| Security_center.delete_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js,samples/README.md) | -| Security_center.delete_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js,samples/README.md) | -| Security_center.delete_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js,samples/README.md) | -| Security_center.get_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_big_query_export.js,samples/README.md) | -| Security_center.get_effective_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js,samples/README.md) | -| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_iam_policy.js,samples/README.md) | -| Security_center.get_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js,samples/README.md) | -| Security_center.get_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js,samples/README.md) | -| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js,samples/README.md) | -| Security_center.get_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js,samples/README.md) | -| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_source.js,samples/README.md) | -| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.group_assets.js,samples/README.md) | -| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.group_findings.js,samples/README.md) | -| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_assets.js,samples/README.md) | -| Security_center.list_big_query_exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js,samples/README.md) | -| Security_center.list_descendant_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js,samples/README.md) | -| Security_center.list_effective_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js,samples/README.md) | -| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_findings.js,samples/README.md) | -| Security_center.list_mute_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_mute_configs.js,samples/README.md) | -| Security_center.list_notification_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_notification_configs.js,samples/README.md) | -| Security_center.list_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js,samples/README.md) | -| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_sources.js,samples/README.md) | -| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js,samples/README.md) | -| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_finding_state.js,samples/README.md) | -| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_iam_policy.js,samples/README.md) | -| Security_center.set_mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_mute.js,samples/README.md) | -| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js,samples/README.md) | -| Security_center.update_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_big_query_export.js,samples/README.md) | -| Security_center.update_external_system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_external_system.js,samples/README.md) | -| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_finding.js,samples/README.md) | -| Security_center.update_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js,samples/README.md) | -| Security_center.update_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js,samples/README.md) | -| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js,samples/README.md) | -| Security_center.update_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js,samples/README.md) | -| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_security_marks.js,samples/README.md) | -| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_source.js,samples/README.md) | -| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.create_finding.js,samples/README.md) | -| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.create_source.js,samples/README.md) | -| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js,samples/README.md) | -| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js,samples/README.md) | -| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.get_source.js,samples/README.md) | -| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.group_assets.js,samples/README.md) | -| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.group_findings.js,samples/README.md) | -| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_assets.js,samples/README.md) | -| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_findings.js,samples/README.md) | -| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_sources.js,samples/README.md) | -| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js,samples/README.md) | -| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js,samples/README.md) | -| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js,samples/README.md) | -| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js,samples/README.md) | -| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_finding.js,samples/README.md) | -| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js,samples/README.md) | -| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js,samples/README.md) | -| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_source.js,samples/README.md) | -| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js,samples/README.md) | -| Security_center.create_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js,samples/README.md) | -| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js,samples/README.md) | -| Security_center.delete_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js,samples/README.md) | -| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js,samples/README.md) | -| Security_center.get_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js,samples/README.md) | -| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js,samples/README.md) | -| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js,samples/README.md) | -| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js,samples/README.md) | -| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js,samples/README.md) | -| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js,samples/README.md) | -| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js,samples/README.md) | -| Security_center.list_notification_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js,samples/README.md) | -| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js,samples/README.md) | -| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js,samples/README.md) | -| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js,samples/README.md) | -| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js,samples/README.md) | -| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js,samples/README.md) | -| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js,samples/README.md) | -| Security_center.update_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js,samples/README.md) | -| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js,samples/README.md) | -| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js,samples/README.md) | -| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/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-securitycenter/samples/quickstart.js,samples/README.md) | -| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/test/quickstart.test.js,samples/README.md) | +| Security_center.bulk_mute_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.bulk_mute_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_big_query_export.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_security_health_analytics_custom_module.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.create_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.delete_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.delete_big_query_export.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.delete_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_mute_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.delete_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.delete_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.delete_security_health_analytics_custom_module.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_big_query_export.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_effective_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_effective_security_health_analytics_custom_module.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_mute_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_security_health_analytics_custom_module.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.get_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.group_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.group_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_big_query_exports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_big_query_exports.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_descendant_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_descendant_security_health_analytics_custom_modules.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_effective_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_effective_security_health_analytics_custom_modules.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_mute_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_mute_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_mute_configs.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_notification_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_notification_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_notification_configs.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_security_health_analytics_custom_modules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_security_health_analytics_custom_modules.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.list_sources.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.run_asset_discovery.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_finding_state.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_mute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.set_mute.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.set_mute.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.test_iam_permissions.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_big_query_export | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_big_query_export.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_big_query_export.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_external_system | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_external_system.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_external_system.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_mute_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_mute_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_security_health_analytics_custom_module | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_security_health_analytics_custom_module.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_security_marks.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1/security_center.update_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.create_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.create_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.get_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.get_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.group_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.group_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.list_sources.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.run_asset_discovery.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.set_finding_state.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.set_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.test_iam_permissions.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_security_marks.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1beta1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1beta1/security_center.update_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.create_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.create_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.create_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.delete_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.delete_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.get_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.get_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.get_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.group_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.group_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.group_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_assets.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_findings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_findings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_notification_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_notification_configs.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.list_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.list_sources.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.run_asset_discovery | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.run_asset_discovery.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_finding_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.set_finding_state.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.set_iam_policy.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.test_iam_permissions.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_finding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_finding.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_notification_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_notification_config.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_organization_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_organization_settings.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_security_marks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_security_marks.js,packages/google-cloud-securitycenter/samples/README.md) | +| Security_center.update_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js) | [![Open in Cloud 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-securitycenter/samples/generated/v1p1beta1/security_center.update_source.js,packages/google-cloud-securitycenter/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/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-securitycenter/samples/quickstart.js,packages/google-cloud-securitycenter/samples/README.md) | diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto index d30e670f5a69..b8b0e77f2c9a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/access.proto @@ -46,6 +46,9 @@ message Access { // system shell or an embedded or standalone application. string user_agent_family = 4; + // The caller's user agent string associated with the finding. + string user_agent = 12; + // This is the API service that the service account made a call to, e.g. // "iam.googleapis.com" string service_name = 5; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto index 2a513f1dc037..8bb30eb50f2e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_data_profile.proto @@ -34,9 +34,24 @@ option (google.api.resource_definition) = { // The [data profile](https://cloud.google.com/dlp/docs/data-profiles) // associated with the finding. message CloudDlpDataProfile { + // Parents for configurations that produce data profile findings. + enum ParentType { + // Unspecified parent type. + PARENT_TYPE_UNSPECIFIED = 0; + + // Organization-level configurations. + ORGANIZATION = 1; + + // Project-level configurations. + PROJECT = 2; + } + // Name of the data profile, for example, // `projects/123/locations/europe/tableProfiles/8383929`. string data_profile = 1 [(google.api.resource_reference) = { type: "dlp.googleapis.com/TableDataProfile" }]; + + // The resource hierarchy level at which the data profile was generated. + ParentType parent_type = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto index 5d76ee71ee98..bfab2e93424b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/cloud_dlp_inspection.proto @@ -40,8 +40,8 @@ message CloudDlpInspection { string inspect_job = 1 [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; - // The [type of - // information](https://cloud.google.com/dlp/docs/infotypes-reference) found, + // The type of information (or + // *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found, // for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`. string info_type = 2; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto index bc183bb5e37d..466808dfa94e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/compliance.proto @@ -27,13 +27,13 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Contains compliance information about a security standard indicating unmet // recommendations. message Compliance { - // Refers to industry wide standards or benchmarks e.g. "cis", "pci", "owasp", - // etc. + // Industry-wide compliance standards or benchmarks, such as CIS, PCI, and + // OWASP. string standard = 1; - // Version of the standard/benchmark e.g. 1.1 + // Version of the standard or benchmark, for example, 1.1 string version = 2; - // Policies within the standard/benchmark e.g. A.12.4.1 + // Policies within the standard or benchmark, for example, A.12.4.1 repeated string ids = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto index 741ad8fae1da..f2e9bf0329be 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/contact_details.proto @@ -24,7 +24,7 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// The details pertaining to specific contacts +// Details about specific contacts message ContactDetails { // A list of contacts repeated Contact contacts = 1; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto index c90168991f6a..dab20aea310a 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/container.proto @@ -28,16 +28,15 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Container associated with the finding. message Container { - // Container name. + // Name of the container. string name = 1; - // Container image URI provided when configuring a pod/container. - // May identify a container image version using mutable tags. + // Container image URI provided when configuring a pod or container. This + // string can identify a container image version using mutable tags. string uri = 2; - // Optional container image id, when provided by the container runtime. - // Uniquely identifies the container image launched using a container image - // digest. + // Optional container image ID, if provided by the container runtime. Uniquely + // identifies the container image launched using a container image digest. string image_id = 3; // Container labels, as provided by the container runtime. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto index 70bf35161032..2e5f51b86141 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/database.proto @@ -24,29 +24,35 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Represents database access information, such as queries. -// A database may be a sub-resource of an instance (as in the case of CloudSQL -// instances or Cloud Spanner instances), or the database instance itself. -// Some database resources may not have the full resource name populated -// because these resource types are not yet supported by Cloud Asset Inventory -// (e.g. CloudSQL databases). In these cases only the display name will be +// Represents database access information, such as queries. A database may be a +// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud +// Spanner instances), or the database instance itself. Some database resources +// might not have the [full resource +// name](https://google.aip.dev/122#full-resource-names) populated because these +// resource types, such as Cloud SQL databases, are not yet supported by Cloud +// Asset Inventory. In these cases only the display name is provided. +// Some database resources may not have the [full resource +// name](https://google.aip.dev/122#full-resource-names) populated because +// these resource types are not yet supported by Cloud Asset Inventory (e.g. +// Cloud SQL databases). In these cases only the display name will be // provided. message Database { - // The full resource name of the database the user connected to, if it is - // supported by CAI. (https://google.aip.dev/122#full-resource-names) + // The [full resource name](https://google.aip.dev/122#full-resource-names) of + // the database that the user connected to, if it is supported by Cloud Asset + // Inventory. string name = 1; - // The human readable name of the database the user connected to. + // The human-readable name of the database that the user connected to. string display_name = 2; - // The username used to connect to the DB. This may not necessarily be an IAM - // principal, and has no required format. + // The username used to connect to the database. The username might not be an + // IAM principal and does not have a set format. string user_name = 3; - // The SQL statement associated with the relevant access. + // The SQL statement that is associated with the database access. string query = 4; - // The target usernames/roles/groups of a SQL privilege grant (not an IAM - // policy change). + // The target usernames, roles, or groups of an SQL privilege grant, which is + // not an IAM policy change. repeated string grantees = 5; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto index 4c3735dedf28..071c162a6348 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/exfiltration.proto @@ -24,10 +24,10 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Exfiltration represents a data exfiltration attempt of one or more -// sources to one or more targets. Sources represent the source -// of data that is exfiltrated, and Targets represents the destination the -// data was copied to. +// Exfiltration represents a data exfiltration attempt from one or more sources +// to one or more targets. The `sources` attribute lists the sources of the +// exfiltrated data. The `targets` attribute lists the destinations the data was +// copied to. message Exfiltration { // If there are multiple sources, then the data is considered "joined" between // them. For instance, BigQuery can join multiple tables, and each @@ -39,14 +39,16 @@ message Exfiltration { repeated ExfilResource targets = 2; } -// Resource that has been exfiltrated or exfiltrated_to. +// Resource where data was exfiltrated from or exfiltrated to. message ExfilResource { - // Resource's URI (https://google.aip.dev/122#full-resource-names) + // The resource's [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name). string name = 1; - // Subcomponents of the asset that is exfiltrated - these could be - // URIs used during exfiltration, table names, databases, filenames, etc. - // For example, multiple tables may be exfiltrated from the same CloudSQL - // instance, or multiple files from the same Cloud Storage bucket. + // Subcomponents of the asset that was exfiltrated, like URIs used during + // exfiltration, table names, databases, and filenames. For example, multiple + // tables might have been exfiltrated from the same Cloud SQL instance, or + // multiple files might have been exfiltrated from the same Cloud Storage + // bucket. repeated string components = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto index 4d7a459590c8..618e7b7eacc6 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/file.proto @@ -46,7 +46,6 @@ message File { // True when the hash covers only a prefix of the file. bool partially_hashed = 5; - // Prefix of the file contents as a JSON encoded string. - // (Currently only populated for Malicious Script Executed findings.) + // Prefix of the file contents as a JSON-encoded string. string contents = 6; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto index 533ac4bdadc8..3aee0bc5f05e 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/iam_binding.proto @@ -46,7 +46,7 @@ message IamBinding { // For example, "roles/viewer", "roles/editor", or "roles/owner". string role = 2; - // A single identity requesting access for a Cloud Platform resource, - // e.g. "foo@google.com". + // A single identity requesting access for a Cloud Platform resource, for + // example, "foo@google.com". string member = 3; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto index 6af2840bf068..ee516db4a39d 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kernel_rootkit.proto @@ -26,37 +26,37 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Kernel mode rootkit signatures. message KernelRootkit { - // Rootkit name when available. + // Rootkit name, when available. string name = 1; - // True when unexpected modifications of kernel code memory are present. + // True if unexpected modifications of kernel code memory are present. bool unexpected_code_modification = 2; - // True when unexpected modifications of kernel read-only data memory are + // True if unexpected modifications of kernel read-only data memory are // present. bool unexpected_read_only_data_modification = 3; - // True when `ftrace` points are present with callbacks pointing to regions + // True if `ftrace` points are present with callbacks pointing to regions // that are not in the expected kernel or module code range. bool unexpected_ftrace_handler = 4; - // True when `kprobe` points are present with callbacks pointing to regions + // True if `kprobe` points are present with callbacks pointing to regions // that are not in the expected kernel or module code range. bool unexpected_kprobe_handler = 5; - // True when kernel code pages that are not in the expected kernel or module + // True if kernel code pages that are not in the expected kernel or module // code regions are present. bool unexpected_kernel_code_pages = 6; - // True when system call handlers that are are not in the expected kernel or + // True if system call handlers that are are not in the expected kernel or // module code regions are present. bool unexpected_system_call_handler = 7; - // True when interrupt handlers that are are not in the expected kernel or + // True if interrupt handlers that are are not in the expected kernel or // module code regions are present. bool unexpected_interrupt_handler = 8; - // True when unexpected processes in the scheduler run queue are present. Such + // True if unexpected processes in the scheduler run queue are present. Such // processes are in the run queue, but not in the process task list. bool unexpected_processes_in_runqueue = 9; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto index ac1df835116c..fc79be79ba66 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/kubernetes.proto @@ -29,7 +29,7 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Kubernetes-related attributes. message Kubernetes { - // Kubernetes Pod. + // A Kubernetes Pod. message Pod { // Kubernetes Pod namespace. string ns = 1; @@ -45,16 +45,16 @@ message Kubernetes { repeated Container containers = 4; } - // Kubernetes Nodes associated with the finding. + // Kubernetes nodes associated with the finding. message Node { - // Full Resource name of the Compute Engine VM running the - // cluster node. + // [Full resource name](https://google.aip.dev/122#full-resource-names) of + // the Compute Engine VM running the cluster node. string name = 1; } - // Provides GKE Node Pool information. + // Provides GKE node pool information. message NodePool { - // Kubernetes Node pool name. + // Kubernetes node pool name. string name = 1; // Nodes associated with the finding. @@ -87,10 +87,10 @@ message Kubernetes { // Represents a Kubernetes RoleBinding or ClusterRoleBinding. message Binding { - // Namespace for binding. + // Namespace for the binding. string ns = 1; - // Name for binding. + // Name for the binding. string name = 2; // The Role or ClusterRole referenced by the binding. @@ -101,9 +101,9 @@ message Kubernetes { repeated Subject subjects = 4; } - // Represents a Kubernetes Subject. + // Represents a Kubernetes subject. message Subject { - // Auth types that can be used for Subject's kind field. + // Auth types that can be used for the subject's kind field. enum AuthType { // Authentication is not specified. AUTH_TYPE_UNSPECIFIED = 0; @@ -111,27 +111,29 @@ message Kubernetes { // User with valid certificate. USER = 1; - // Users managed by Kubernetes API with credentials stored as Secrets. + // Users managed by Kubernetes API with credentials stored as secrets. SERVICEACCOUNT = 2; // Collection of users. GROUP = 3; } - // Authentication type for subject. + // Authentication type for the subject. AuthType kind = 1; - // Namespace for subject. + // Namespace for the subject. string ns = 2; - // Name for subject. + // Name for the subject. string name = 3; } - // Conveys information about a Kubernetes access review (e.g. kubectl auth - // can-i ...) that was involved in a finding. + // Conveys information about a Kubernetes access review (such as one returned + // by a [`kubectl auth + // can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) + // command) that was involved in a finding. message AccessReview { - // Group is the API Group of the Resource. "*" means all. + // The API group of the resource. "*" means all. string group = 1; // Namespace of the action being requested. Currently, there is no @@ -139,43 +141,50 @@ message Kubernetes { // are represented by "" (empty). string ns = 2; - // Name is the name of the resource being requested. Empty means all. + // The name of the resource being requested. Empty means all. string name = 3; - // Resource is the optional resource type requested. "*" means all. + // The optional resource type requested. "*" means all. string resource = 4; - // Subresource is the optional subresource type. + // The optional subresource type. string subresource = 5; - // Verb is a Kubernetes resource API verb, like: get, list, watch, create, - // update, delete, proxy. "*" means all. + // A Kubernetes resource API verb, like get, list, watch, create, update, + // delete, proxy. "*" means all. string verb = 6; - // Version is the API Version of the Resource. "*" means all. + // The API version of the resource. "*" means all. string version = 7; } - // Kubernetes Pods associated with the finding. This field will contain Pod - // records for each container that is owned by a Pod. + // Kubernetes + // [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod) + // associated with the finding. This field contains Pod records for each + // container that is owned by a Pod. repeated Pod pods = 1; - // Provides Kubernetes Node information. + // Provides Kubernetes + // [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes) + // information. repeated Node nodes = 2; - // GKE Node Pools associated with the finding. This field will - // contain NodePool information for each Node, when it is available. + // GKE [node + // pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools) + // associated with the finding. This field contains node pool information for + // each node, when it is available. repeated NodePool node_pools = 3; - // Provides Kubernetes role information for findings that involve - // Roles or ClusterRoles. + // Provides Kubernetes role information for findings that involve [Roles or + // ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). repeated Role roles = 4; // Provides Kubernetes role binding information for findings that involve - // RoleBindings or ClusterRoleBindings. + // [RoleBindings or + // ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control). repeated Binding bindings = 5; - // Provides information on any Kubernetes access reviews (i.e. privilege - // checks) relevant to the finding. + // Provides information on any Kubernetes access reviews (privilege checks) + // relevant to the finding. repeated AccessReview access_reviews = 6; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto index 0760c82d8408..3a256e5689fc 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/label.proto @@ -24,12 +24,14 @@ option java_package = "com.google.cloud.securitycenter.v1"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; option ruby_package = "Google::Cloud::SecurityCenter::V1"; -// Label represents a generic name=value label. Label has separate name and -// value fields to support filtering with contains(). +// Represents a generic name-value label. A label has separate name and value +// fields to support filtering with the `contains()` function. For more +// information, see [Filtering on array-type +// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering). message Label { - // Label name. + // Name of the label. string name = 1; - // Label value. + // Value that corresponds to the label's name. string value = 2; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto index 66880a17c63b..eaf8dbc9cc1b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto @@ -75,9 +75,9 @@ message OrganizationSettings { string name = 1; // A flag that indicates if Asset Discovery should be enabled. If the flag is - // set to `true`, then discovery of assets will occur. If it is set to `false, - // all historical assets will remain, but discovery of future assets will not - // occur. + // set to `true`, then discovery of assets will occur. If it is set to + // `false`, all historical assets will remain, but discovery of future assets + // will not occur. bool enable_asset_discovery = 2; // The configuration used for Asset Discovery runs. diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto index 3ec0a5c29f1b..5f960cc643a0 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/process.proto @@ -28,8 +28,9 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // Represents an operating system process. message Process { - // The process name visible in utilities like `top` and `ps`; it can - // be accessed via `/proc/[pid]/comm` and changed with `prctl(PR_SET_NAME)`. + // The process name, as displayed in utilities like `top` and `ps`. This name + // can be accessed through `/proc/[pid]/comm` and changed with + // `prctl(PR_SET_NAME)`. string name = 12; // File information for the process executable. @@ -38,10 +39,9 @@ message Process { // File information for libraries loaded by the process. repeated File libraries = 4; - // When the process represents the invocation of a script, - // `binary` provides information about the interpreter while `script` - // provides information about the script file provided to the - // interpreter. + // When the process represents the invocation of a script, `binary` provides + // information about the interpreter, while `script` provides information + // about the script file provided to the interpreter. File script = 5; // Process arguments as JSON encoded strings. @@ -56,15 +56,15 @@ message Process { // True if `env_variables` is incomplete. bool env_variables_truncated = 9; - // The process id. + // The process ID. int64 pid = 10; - // The parent process id. + // The parent process ID. int64 parent_pid = 11; } -// EnvironmentVariable is a name-value pair to store environment variables for -// Process. +// A name-value pair representing an environment variable used in an operating +// system process. message EnvironmentVariable { // Environment variable name as a JSON encoded string. string name = 1; diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto index 052c9cebccb2..0957861595b7 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -804,9 +804,9 @@ message CreateMuteConfigRequest { MuteConfig mute_config = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Unique identifier provided by the client within the parent scope. - // It must consist of lower case letters, numbers, and hyphen, with the first - // character a letter, the last a letter or a number, and a 63 character - // maximum. + // It must consist of only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. string mute_config_id = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -2148,9 +2148,9 @@ message CreateBigQueryExportRequest { BigQueryExport big_query_export = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Unique identifier provided by the client within the parent scope. - // It must consist of lower case letters, numbers, and hyphen, with the first - // character a letter, the last a letter or a number, and a 63 character - // maximum. + // It must consist of only lowercase letters, numbers, and hyphens, must start + // with a letter, must end with either a letter or a number, and must be 63 + // characters or less. string big_query_export_id = 3 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index 5de8ed01e6a5..b22cfd399054 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -41,6 +41,9 @@ export namespace google { /** Access userAgentFamily */ userAgentFamily?: (string|null); + /** Access userAgent */ + userAgent?: (string|null); + /** Access serviceName */ serviceName?: (string|null); @@ -81,6 +84,9 @@ export namespace google { /** Access userAgentFamily. */ public userAgentFamily: string; + /** Access userAgent. */ + public userAgent: string; + /** Access serviceName. */ public serviceName: string; @@ -1117,6 +1123,9 @@ export namespace google { /** CloudDlpDataProfile dataProfile */ dataProfile?: (string|null); + + /** CloudDlpDataProfile parentType */ + parentType?: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null); } /** Represents a CloudDlpDataProfile. */ @@ -1131,6 +1140,9 @@ export namespace google { /** CloudDlpDataProfile dataProfile. */ public dataProfile: string; + /** CloudDlpDataProfile parentType. */ + public parentType: (google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|keyof typeof google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType); + /** * Creates a new CloudDlpDataProfile instance using the specified properties. * @param [properties] Properties to set @@ -1209,6 +1221,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace CloudDlpDataProfile { + + /** ParentType enum. */ + enum ParentType { + PARENT_TYPE_UNSPECIFIED = 0, + ORGANIZATION = 1, + PROJECT = 2 + } + } + /** Properties of a CloudDlpInspection. */ interface ICloudDlpInspection { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index 77ffcdf89058..2621a62ec52d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -76,6 +76,7 @@ * @property {string|null} [callerIp] Access callerIp * @property {google.cloud.securitycenter.v1.IGeolocation|null} [callerIpGeo] Access callerIpGeo * @property {string|null} [userAgentFamily] Access userAgentFamily + * @property {string|null} [userAgent] Access userAgent * @property {string|null} [serviceName] Access serviceName * @property {string|null} [methodName] Access methodName * @property {string|null} [principalSubject] Access principalSubject @@ -132,6 +133,14 @@ */ Access.prototype.userAgentFamily = ""; + /** + * Access userAgent. + * @member {string} userAgent + * @memberof google.cloud.securitycenter.v1.Access + * @instance + */ + Access.prototype.userAgent = ""; + /** * Access serviceName. * @member {string} serviceName @@ -225,6 +234,8 @@ $root.google.cloud.securitycenter.v1.ServiceAccountDelegationInfo.encode(message.serviceAccountDelegationInfo[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.userName); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.userAgent); return writer; }; @@ -275,6 +286,10 @@ message.userAgentFamily = reader.string(); break; } + case 12: { + message.userAgent = reader.string(); + break; + } case 5: { message.serviceName = reader.string(); break; @@ -350,6 +365,9 @@ if (message.userAgentFamily != null && message.hasOwnProperty("userAgentFamily")) if (!$util.isString(message.userAgentFamily)) return "userAgentFamily: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; if (message.serviceName != null && message.hasOwnProperty("serviceName")) if (!$util.isString(message.serviceName)) return "serviceName: string expected"; @@ -400,6 +418,8 @@ } if (object.userAgentFamily != null) message.userAgentFamily = String(object.userAgentFamily); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); if (object.serviceName != null) message.serviceName = String(object.serviceName); if (object.methodName != null) @@ -448,6 +468,7 @@ object.principalSubject = ""; object.serviceAccountKeyName = ""; object.userName = ""; + object.userAgent = ""; } if (message.principalEmail != null && message.hasOwnProperty("principalEmail")) object.principalEmail = message.principalEmail; @@ -472,6 +493,8 @@ } if (message.userName != null && message.hasOwnProperty("userName")) object.userName = message.userName; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; return object; }; @@ -2892,6 +2915,7 @@ * @memberof google.cloud.securitycenter.v1 * @interface ICloudDlpDataProfile * @property {string|null} [dataProfile] CloudDlpDataProfile dataProfile + * @property {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType|null} [parentType] CloudDlpDataProfile parentType */ /** @@ -2917,6 +2941,14 @@ */ CloudDlpDataProfile.prototype.dataProfile = ""; + /** + * CloudDlpDataProfile parentType. + * @member {google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType} parentType + * @memberof google.cloud.securitycenter.v1.CloudDlpDataProfile + * @instance + */ + CloudDlpDataProfile.prototype.parentType = 0; + /** * Creates a new CloudDlpDataProfile instance using the specified properties. * @function create @@ -2943,6 +2975,8 @@ writer = $Writer.create(); if (message.dataProfile != null && Object.hasOwnProperty.call(message, "dataProfile")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataProfile); + if (message.parentType != null && Object.hasOwnProperty.call(message, "parentType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parentType); return writer; }; @@ -2981,6 +3015,10 @@ message.dataProfile = reader.string(); break; } + case 2: { + message.parentType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -3019,6 +3057,15 @@ if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) if (!$util.isString(message.dataProfile)) return "dataProfile: string expected"; + if (message.parentType != null && message.hasOwnProperty("parentType")) + switch (message.parentType) { + default: + return "parentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -3036,6 +3083,26 @@ var message = new $root.google.cloud.securitycenter.v1.CloudDlpDataProfile(); if (object.dataProfile != null) message.dataProfile = String(object.dataProfile); + switch (object.parentType) { + default: + if (typeof object.parentType === "number") { + message.parentType = object.parentType; + break; + } + break; + case "PARENT_TYPE_UNSPECIFIED": + case 0: + message.parentType = 0; + break; + case "ORGANIZATION": + case 1: + message.parentType = 1; + break; + case "PROJECT": + case 2: + message.parentType = 2; + break; + } return message; }; @@ -3052,10 +3119,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.dataProfile = ""; + object.parentType = options.enums === String ? "PARENT_TYPE_UNSPECIFIED" : 0; + } if (message.dataProfile != null && message.hasOwnProperty("dataProfile")) object.dataProfile = message.dataProfile; + if (message.parentType != null && message.hasOwnProperty("parentType")) + object.parentType = options.enums === String ? $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] === undefined ? message.parentType : $root.google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType[message.parentType] : message.parentType; return object; }; @@ -3085,6 +3156,22 @@ return typeUrlPrefix + "/google.cloud.securitycenter.v1.CloudDlpDataProfile"; }; + /** + * ParentType enum. + * @name google.cloud.securitycenter.v1.CloudDlpDataProfile.ParentType + * @enum {number} + * @property {number} PARENT_TYPE_UNSPECIFIED=0 PARENT_TYPE_UNSPECIFIED value + * @property {number} ORGANIZATION=1 ORGANIZATION value + * @property {number} PROJECT=2 PROJECT value + */ + CloudDlpDataProfile.ParentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORGANIZATION"] = 1; + values[valuesById[2] = "PROJECT"] = 2; + return values; + })(); + return CloudDlpDataProfile; })(); diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index c60db2ca4ed5..431f67b9d738 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -37,6 +37,10 @@ "type": "string", "id": 4 }, + "userAgent": { + "type": "string", + "id": 12 + }, "serviceName": { "type": "string", "id": 5 @@ -270,6 +274,19 @@ "options": { "(google.api.resource_reference).type": "dlp.googleapis.com/TableDataProfile" } + }, + "parentType": { + "type": "ParentType", + "id": 2 + } + }, + "nested": { + "ParentType": { + "values": { + "PARENT_TYPE_UNSPECIFIED": 0, + "ORGANIZATION": 1, + "PROJECT": 2 + } } } }, diff --git a/packages/google-cloud-securitycenter/samples/README.md b/packages/google-cloud-securitycenter/samples/README.md index 0502886dfe4b..b2fc0143d918 100644 --- a/packages/google-cloud-securitycenter/samples/README.md +++ b/packages/google-cloud-securitycenter/samples/README.md @@ -98,7 +98,6 @@ * [Security_center.update_security_marks](#security_center.update_security_marks) * [Security_center.update_source](#security_center.update_source) * [Quickstart](#quickstart) - * [Quickstart.test](#quickstart.test) ## Before you begin @@ -1572,23 +1571,6 @@ __Usage:__ `node quickstart.js [organization]` ------ - - - - -### Quickstart.test - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-securitycenter/samples/test/quickstart.test.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-securitycenter/samples/test/quickstart.test.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-securitycenter/samples/test/quickstart.test.js` - - diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js index f5ffc8a929f0..3a4ec8aae8fc 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_big_query_export.js @@ -40,9 +40,9 @@ function main(parent, bigQueryExport, bigQueryExportId) { // const bigQueryExport = {} /** * Required. Unique identifier provided by the client within the parent scope. - * It must consist of lower case letters, numbers, and hyphen, with the first - * character a letter, the last a letter or a number, and a 63 character - * maximum. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. */ // const bigQueryExportId = 'abc123' diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js index dec237a4b8e8..fa1931c07a7d 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js +++ b/packages/google-cloud-securitycenter/samples/generated/v1/security_center.create_mute_config.js @@ -40,9 +40,9 @@ function main(parent, muteConfig, muteConfigId) { // const muteConfig = {} /** * Required. Unique identifier provided by the client within the parent scope. - * It must consist of lower case letters, numbers, and hyphen, with the first - * character a letter, the last a letter or a number, and a 63 character - * maximum. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. */ // const muteConfigId = 'abc123' diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 398b70badfb6..4a98f55b28a6 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -927,9 +927,9 @@ export class SecurityCenterClient { * Required. The mute config being created. * @param {string} request.muteConfigId * Required. Unique identifier provided by the client within the parent scope. - * It must consist of lower case letters, numbers, and hyphen, with the first - * character a letter, the last a letter or a number, and a 63 character - * maximum. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3446,9 +3446,9 @@ export class SecurityCenterClient { * Required. The BigQuery export being created. * @param {string} request.bigQueryExportId * Required. Unique identifier provided by the client within the parent scope. - * It must consist of lower case letters, numbers, and hyphen, with the first - * character a letter, the last a letter or a number, and a 63 character - * maximum. + * It must consist of only lowercase letters, numbers, and hyphens, must start + * with a letter, must end with either a letter or a number, and must be 63 + * characters or less. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. From f5b153353788f4df4fee6d19a6cd013fe6bb29f5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:02:13 +0000 Subject: [PATCH 38/46] feat: [container] add API for GPU driver installation config (#4330) - [ ] Regenerate this pull request now. --- feat: add SecurityPostureConfig API field to allow customers to enable GKE Security Posture capabilities for their clusters --- feat: add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters PiperOrigin-RevId: 539136563 Source-Link: https://togithub.com/googleapis/googleapis/commit/ca49cb95bdb183eb7d6009414dd2cfccdb727d61 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b7903fd0e95031cce1ed78dbb82f44d7c3ba5ba1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiYjc5MDNmZDBlOTUwMzFjY2UxZWQ3OGRiYjgyZjQ0ZDdjM2JhNWJhMSJ9 BEGIN_NESTED_COMMIT feat: [container] add API for GPU driver installation config --- feat: add SecurityPostureConfig API field to allow customers to enable GKE Security Posture capabilities for their clusters --- feat: add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters PiperOrigin-RevId: 538770734 Source-Link: https://togithub.com/googleapis/googleapis/commit/b7e93121d514f1ab1f2b446de0969125a18914c8 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/0988e7e1feed3b087096b2167dc262320ead297a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNvbnRhaW5lci8uT3dsQm90LnlhbWwiLCJoIjoiMDk4OGU3ZTFmZWVkM2IwODcwOTZiMjE2N2RjMjYyMzIwZWFkMjk3YSJ9 END_NESTED_COMMIT --- .../google/container/v1/cluster_service.proto | 78 + .../container/v1beta1/cluster_service.proto | 78 + packages/google-container/protos/protos.d.ts | 740 ++++++ packages/google-container/protos/protos.js | 1974 ++++++++++++++++- packages/google-container/protos/protos.json | 240 ++ 5 files changed, 3108 insertions(+), 2 deletions(-) diff --git a/packages/google-container/protos/google/container/v1/cluster_service.proto b/packages/google-container/protos/google/container/v1/cluster_service.proto index c987f852c737..8fb8cccfbf4f 100644 --- a/packages/google-container/protos/google/container/v1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1/cluster_service.proto @@ -1911,6 +1911,9 @@ message Cluster { // Fleet information for the cluster. Fleet fleet = 140; + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; + // Beta APIs Config K8sBetaAPIConfig enable_k8s_beta_apis = 143; } @@ -1921,6 +1924,40 @@ message K8sBetaAPIConfig { repeated string enabled_apis = 1; } +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + // Node pool configs that apply to all auto-provisioned node pools // in autopilot clusters and node auto-provisioning enabled clusters. message NodePoolAutoConfig { @@ -2145,9 +2182,15 @@ message ClusterUpdate { // Kubernetes open source beta apis enabled on the cluster. Only beta apis K8sBetaAPIConfig enable_k8s_beta_apis = 122; + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + // Enable/Disable FQDN Network Policy for the cluster. optional bool desired_enable_fqdn_network_policy = 126; + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + // Desired Beta APIs to be enabled for cluster. K8sBetaAPIConfig desired_k8s_beta_apis = 131; } @@ -3956,6 +3999,9 @@ message AcceleratorConfig { // The configuration for GPU sharing options. optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; } // GPUSharingConfig represents the GPU sharing configuration for Hardware @@ -3977,6 +4023,28 @@ message GPUSharingConfig { optional GPUSharingStrategy gpu_sharing_strategy = 2; } +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + // WorkloadMetadataConfig defines the metadata configuration to expose to // workloads on the node pool. message WorkloadMetadataConfig { @@ -4785,6 +4853,16 @@ message SecurityBulletinEvent { message Autopilot { // Enable Autopilot bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; } // LoggingConfig is cluster logging configuration. diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index 41d6237108f1..e983ce2a0ea7 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -2098,6 +2098,9 @@ message Cluster { // Fleet information for the cluster. Fleet fleet = 140; + + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig security_posture_config = 145; } // Kubernetes open source beta apis enabled on the cluster. @@ -2157,6 +2160,40 @@ message ProtectConfig { optional WorkloadVulnerabilityMode workload_vulnerability_mode = 2; } +// SecurityPostureConfig defines the flags needed to enable/disable features for +// the Security Posture API. +message SecurityPostureConfig { + // Mode defines enablement mode for GKE Security posture features. + enum Mode { + // Default value not specified. + MODE_UNSPECIFIED = 0; + + // Disables Security Posture features on the cluster. + DISABLED = 1; + + // Applies Security Posture features on the cluster. + BASIC = 2; + } + + // VulnerabilityMode defines enablement mode for vulnerability scanning. + enum VulnerabilityMode { + // Default value not specified. + VULNERABILITY_MODE_UNSPECIFIED = 0; + + // Disables vulnerability scanning on the cluster. + VULNERABILITY_DISABLED = 1; + + // Applies basic vulnerability scanning on the cluster. + VULNERABILITY_BASIC = 2; + } + + // Sets which mode to use for Security Posture features. + optional Mode mode = 1; + + // Sets which mode to use for vulnerability scanning. + optional VulnerabilityMode vulnerability_mode = 2; +} + // Subset of Nodepool message that has defaults. message NodePoolDefaults { // Subset of NodeConfig message that has defaults. @@ -2405,9 +2442,15 @@ message ClusterUpdate { // Kubernetes open source beta apis enabled on the cluster. Only beta apis K8sBetaAPIConfig enable_k8s_beta_apis = 122; + // Enable/Disable Security Posture API features for the cluster. + SecurityPostureConfig desired_security_posture_config = 124; + // Enable/Disable FQDN Network Policy for the cluster. optional bool desired_enable_fqdn_network_policy = 126; + // The desired workload policy configuration for the autopilot cluster. + WorkloadPolicyConfig desired_autopilot_workload_policy_config = 128; + // Beta APIs enabled for cluster. K8sBetaAPIConfig desired_k8s_beta_apis = 131; } @@ -4326,6 +4369,9 @@ message AcceleratorConfig { // The configuration for GPU sharing options. optional GPUSharingConfig gpu_sharing_config = 5; + + // The configuration for auto installation of GPU driver. + optional GPUDriverInstallationConfig gpu_driver_installation_config = 6; } // GPUSharingConfig represents the GPU sharing configuration for Hardware @@ -4347,6 +4393,28 @@ message GPUSharingConfig { optional GPUSharingStrategy gpu_sharing_strategy = 2; } +// GPUDriverInstallationConfig specifies the version of GPU driver to be auto +// installed. +message GPUDriverInstallationConfig { + // The GPU driver version to install. + enum GPUDriverVersion { + // Default value is to not install any GPU driver. + GPU_DRIVER_VERSION_UNSPECIFIED = 0; + + // Disable GPU driver auto installation and needs manual installation + INSTALLATION_DISABLED = 1; + + // "Default" GPU driver in COS and Ubuntu. + DEFAULT = 2; + + // "Latest" GPU driver in COS. + LATEST = 3; + } + + // Mode for how the GPU driver is installed. + optional GPUDriverVersion gpu_driver_version = 1; +} + // ManagedPrometheusConfig defines the configuration for // Google Cloud Managed Service for Prometheus. message ManagedPrometheusConfig { @@ -5132,6 +5200,16 @@ message Master {} message Autopilot { // Enable Autopilot bool enabled = 1; + + // Workload policy configuration for Autopilot. + WorkloadPolicyConfig workload_policy_config = 2; +} + +// WorkloadPolicyConfig is the configuration of workload policy for autopilot +// clusters. +message WorkloadPolicyConfig { + // If true, workloads can use NET_ADMIN capability. + optional bool allow_net_admin = 1; } // NotificationConfig is the configuration of notifications. diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index f2ef51f0ed81..31c4621cfe45 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -5629,6 +5629,9 @@ export namespace google { /** Cluster fleet */ fleet?: (google.container.v1.IFleet|null); + /** Cluster securityPostureConfig */ + securityPostureConfig?: (google.container.v1.ISecurityPostureConfig|null); + /** Cluster enableK8sBetaApis */ enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); } @@ -5834,6 +5837,9 @@ export namespace google { /** Cluster fleet. */ public fleet?: (google.container.v1.IFleet|null); + /** Cluster securityPostureConfig. */ + public securityPostureConfig?: (google.container.v1.ISecurityPostureConfig|null); + /** Cluster enableK8sBetaApis. */ public enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); @@ -6029,6 +6035,132 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a SecurityPostureConfig. */ + interface ISecurityPostureConfig { + + /** SecurityPostureConfig mode */ + mode?: (google.container.v1.SecurityPostureConfig.Mode|keyof typeof google.container.v1.SecurityPostureConfig.Mode|null); + + /** SecurityPostureConfig vulnerabilityMode */ + vulnerabilityMode?: (google.container.v1.SecurityPostureConfig.VulnerabilityMode|keyof typeof google.container.v1.SecurityPostureConfig.VulnerabilityMode|null); + } + + /** Represents a SecurityPostureConfig. */ + class SecurityPostureConfig implements ISecurityPostureConfig { + + /** + * Constructs a new SecurityPostureConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.ISecurityPostureConfig); + + /** SecurityPostureConfig mode. */ + public mode?: (google.container.v1.SecurityPostureConfig.Mode|keyof typeof google.container.v1.SecurityPostureConfig.Mode|null); + + /** SecurityPostureConfig vulnerabilityMode. */ + public vulnerabilityMode?: (google.container.v1.SecurityPostureConfig.VulnerabilityMode|keyof typeof google.container.v1.SecurityPostureConfig.VulnerabilityMode|null); + + /** SecurityPostureConfig _mode. */ + public _mode?: "mode"; + + /** SecurityPostureConfig _vulnerabilityMode. */ + public _vulnerabilityMode?: "vulnerabilityMode"; + + /** + * Creates a new SecurityPostureConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPostureConfig instance + */ + public static create(properties?: google.container.v1.ISecurityPostureConfig): google.container.v1.SecurityPostureConfig; + + /** + * Encodes the specified SecurityPostureConfig message. Does not implicitly {@link google.container.v1.SecurityPostureConfig.verify|verify} messages. + * @param message SecurityPostureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.ISecurityPostureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPostureConfig message, length delimited. Does not implicitly {@link google.container.v1.SecurityPostureConfig.verify|verify} messages. + * @param message SecurityPostureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.ISecurityPostureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.SecurityPostureConfig; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.SecurityPostureConfig; + + /** + * Verifies a SecurityPostureConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPostureConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPostureConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.SecurityPostureConfig; + + /** + * Creates a plain object from a SecurityPostureConfig message. Also converts values to other types if specified. + * @param message SecurityPostureConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.SecurityPostureConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPostureConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPostureConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityPostureConfig { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + BASIC = 2 + } + + /** VulnerabilityMode enum. */ + enum VulnerabilityMode { + VULNERABILITY_MODE_UNSPECIFIED = 0, + VULNERABILITY_DISABLED = 1, + VULNERABILITY_BASIC = 2 + } + } + /** Properties of a NodePoolAutoConfig. */ interface INodePoolAutoConfig { @@ -6461,9 +6593,15 @@ export namespace google { /** ClusterUpdate enableK8sBetaApis */ enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + /** ClusterUpdate desiredSecurityPostureConfig */ + desiredSecurityPostureConfig?: (google.container.v1.ISecurityPostureConfig|null); + /** ClusterUpdate desiredEnableFqdnNetworkPolicy */ desiredEnableFqdnNetworkPolicy?: (boolean|null); + /** ClusterUpdate desiredAutopilotWorkloadPolicyConfig */ + desiredAutopilotWorkloadPolicyConfig?: (google.container.v1.IWorkloadPolicyConfig|null); + /** ClusterUpdate desiredK8sBetaApis */ desiredK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); } @@ -6609,9 +6747,15 @@ export namespace google { /** ClusterUpdate enableK8sBetaApis. */ public enableK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); + /** ClusterUpdate desiredSecurityPostureConfig. */ + public desiredSecurityPostureConfig?: (google.container.v1.ISecurityPostureConfig|null); + /** ClusterUpdate desiredEnableFqdnNetworkPolicy. */ public desiredEnableFqdnNetworkPolicy?: (boolean|null); + /** ClusterUpdate desiredAutopilotWorkloadPolicyConfig. */ + public desiredAutopilotWorkloadPolicyConfig?: (google.container.v1.IWorkloadPolicyConfig|null); + /** ClusterUpdate desiredK8sBetaApis. */ public desiredK8sBetaApis?: (google.container.v1.IK8sBetaAPIConfig|null); @@ -13775,6 +13919,9 @@ export namespace google { /** AcceleratorConfig gpuSharingConfig */ gpuSharingConfig?: (google.container.v1.IGPUSharingConfig|null); + + /** AcceleratorConfig gpuDriverInstallationConfig */ + gpuDriverInstallationConfig?: (google.container.v1.IGPUDriverInstallationConfig|null); } /** Represents an AcceleratorConfig. */ @@ -13798,9 +13945,15 @@ export namespace google { /** AcceleratorConfig gpuSharingConfig. */ public gpuSharingConfig?: (google.container.v1.IGPUSharingConfig|null); + /** AcceleratorConfig gpuDriverInstallationConfig. */ + public gpuDriverInstallationConfig?: (google.container.v1.IGPUDriverInstallationConfig|null); + /** AcceleratorConfig _gpuSharingConfig. */ public _gpuSharingConfig?: "gpuSharingConfig"; + /** AcceleratorConfig _gpuDriverInstallationConfig. */ + public _gpuDriverInstallationConfig?: "gpuDriverInstallationConfig"; + /** * Creates a new AcceleratorConfig instance using the specified properties. * @param [properties] Properties to set @@ -13994,6 +14147,117 @@ export namespace google { } } + /** Properties of a GPUDriverInstallationConfig. */ + interface IGPUDriverInstallationConfig { + + /** GPUDriverInstallationConfig gpuDriverVersion */ + gpuDriverVersion?: (google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|keyof typeof google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|null); + } + + /** Represents a GPUDriverInstallationConfig. */ + class GPUDriverInstallationConfig implements IGPUDriverInstallationConfig { + + /** + * Constructs a new GPUDriverInstallationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IGPUDriverInstallationConfig); + + /** GPUDriverInstallationConfig gpuDriverVersion. */ + public gpuDriverVersion?: (google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|keyof typeof google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|null); + + /** GPUDriverInstallationConfig _gpuDriverVersion. */ + public _gpuDriverVersion?: "gpuDriverVersion"; + + /** + * Creates a new GPUDriverInstallationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GPUDriverInstallationConfig instance + */ + public static create(properties?: google.container.v1.IGPUDriverInstallationConfig): google.container.v1.GPUDriverInstallationConfig; + + /** + * Encodes the specified GPUDriverInstallationConfig message. Does not implicitly {@link google.container.v1.GPUDriverInstallationConfig.verify|verify} messages. + * @param message GPUDriverInstallationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IGPUDriverInstallationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GPUDriverInstallationConfig message, length delimited. Does not implicitly {@link google.container.v1.GPUDriverInstallationConfig.verify|verify} messages. + * @param message GPUDriverInstallationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IGPUDriverInstallationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.GPUDriverInstallationConfig; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.GPUDriverInstallationConfig; + + /** + * Verifies a GPUDriverInstallationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GPUDriverInstallationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GPUDriverInstallationConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.GPUDriverInstallationConfig; + + /** + * Creates a plain object from a GPUDriverInstallationConfig message. Also converts values to other types if specified. + * @param message GPUDriverInstallationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.GPUDriverInstallationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GPUDriverInstallationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GPUDriverInstallationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GPUDriverInstallationConfig { + + /** GPUDriverVersion enum. */ + enum GPUDriverVersion { + GPU_DRIVER_VERSION_UNSPECIFIED = 0, + INSTALLATION_DISABLED = 1, + DEFAULT = 2, + LATEST = 3 + } + } + /** Properties of a WorkloadMetadataConfig. */ interface IWorkloadMetadataConfig { @@ -18839,6 +19103,9 @@ export namespace google { /** Autopilot enabled */ enabled?: (boolean|null); + + /** Autopilot workloadPolicyConfig */ + workloadPolicyConfig?: (google.container.v1.IWorkloadPolicyConfig|null); } /** Represents an Autopilot. */ @@ -18853,6 +19120,9 @@ export namespace google { /** Autopilot enabled. */ public enabled: boolean; + /** Autopilot workloadPolicyConfig. */ + public workloadPolicyConfig?: (google.container.v1.IWorkloadPolicyConfig|null); + /** * Creates a new Autopilot instance using the specified properties. * @param [properties] Properties to set @@ -18931,6 +19201,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a WorkloadPolicyConfig. */ + interface IWorkloadPolicyConfig { + + /** WorkloadPolicyConfig allowNetAdmin */ + allowNetAdmin?: (boolean|null); + } + + /** Represents a WorkloadPolicyConfig. */ + class WorkloadPolicyConfig implements IWorkloadPolicyConfig { + + /** + * Constructs a new WorkloadPolicyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1.IWorkloadPolicyConfig); + + /** WorkloadPolicyConfig allowNetAdmin. */ + public allowNetAdmin?: (boolean|null); + + /** WorkloadPolicyConfig _allowNetAdmin. */ + public _allowNetAdmin?: "allowNetAdmin"; + + /** + * Creates a new WorkloadPolicyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkloadPolicyConfig instance + */ + public static create(properties?: google.container.v1.IWorkloadPolicyConfig): google.container.v1.WorkloadPolicyConfig; + + /** + * Encodes the specified WorkloadPolicyConfig message. Does not implicitly {@link google.container.v1.WorkloadPolicyConfig.verify|verify} messages. + * @param message WorkloadPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1.IWorkloadPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkloadPolicyConfig message, length delimited. Does not implicitly {@link google.container.v1.WorkloadPolicyConfig.verify|verify} messages. + * @param message WorkloadPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1.IWorkloadPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1.WorkloadPolicyConfig; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1.WorkloadPolicyConfig; + + /** + * Verifies a WorkloadPolicyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkloadPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkloadPolicyConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1.WorkloadPolicyConfig; + + /** + * Creates a plain object from a WorkloadPolicyConfig message. Also converts values to other types if specified. + * @param message WorkloadPolicyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1.WorkloadPolicyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkloadPolicyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkloadPolicyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a LoggingConfig. */ interface ILoggingConfig { @@ -26506,6 +26876,9 @@ export namespace google { /** Cluster fleet */ fleet?: (google.container.v1beta1.IFleet|null); + + /** Cluster securityPostureConfig */ + securityPostureConfig?: (google.container.v1beta1.ISecurityPostureConfig|null); } /** Represents a Cluster. */ @@ -26739,6 +27112,9 @@ export namespace google { /** Cluster fleet. */ public fleet?: (google.container.v1beta1.IFleet|null); + /** Cluster securityPostureConfig. */ + public securityPostureConfig?: (google.container.v1beta1.ISecurityPostureConfig|null); + /** Cluster _nodePoolDefaults. */ public _nodePoolDefaults?: "nodePoolDefaults"; @@ -27165,6 +27541,132 @@ export namespace google { } } + /** Properties of a SecurityPostureConfig. */ + interface ISecurityPostureConfig { + + /** SecurityPostureConfig mode */ + mode?: (google.container.v1beta1.SecurityPostureConfig.Mode|keyof typeof google.container.v1beta1.SecurityPostureConfig.Mode|null); + + /** SecurityPostureConfig vulnerabilityMode */ + vulnerabilityMode?: (google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|keyof typeof google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|null); + } + + /** Represents a SecurityPostureConfig. */ + class SecurityPostureConfig implements ISecurityPostureConfig { + + /** + * Constructs a new SecurityPostureConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.ISecurityPostureConfig); + + /** SecurityPostureConfig mode. */ + public mode?: (google.container.v1beta1.SecurityPostureConfig.Mode|keyof typeof google.container.v1beta1.SecurityPostureConfig.Mode|null); + + /** SecurityPostureConfig vulnerabilityMode. */ + public vulnerabilityMode?: (google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|keyof typeof google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|null); + + /** SecurityPostureConfig _mode. */ + public _mode?: "mode"; + + /** SecurityPostureConfig _vulnerabilityMode. */ + public _vulnerabilityMode?: "vulnerabilityMode"; + + /** + * Creates a new SecurityPostureConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPostureConfig instance + */ + public static create(properties?: google.container.v1beta1.ISecurityPostureConfig): google.container.v1beta1.SecurityPostureConfig; + + /** + * Encodes the specified SecurityPostureConfig message. Does not implicitly {@link google.container.v1beta1.SecurityPostureConfig.verify|verify} messages. + * @param message SecurityPostureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.ISecurityPostureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPostureConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.SecurityPostureConfig.verify|verify} messages. + * @param message SecurityPostureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.ISecurityPostureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.SecurityPostureConfig; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.SecurityPostureConfig; + + /** + * Verifies a SecurityPostureConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPostureConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPostureConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.SecurityPostureConfig; + + /** + * Creates a plain object from a SecurityPostureConfig message. Also converts values to other types if specified. + * @param message SecurityPostureConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.SecurityPostureConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPostureConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityPostureConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityPostureConfig { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + BASIC = 2 + } + + /** VulnerabilityMode enum. */ + enum VulnerabilityMode { + VULNERABILITY_MODE_UNSPECIFIED = 0, + VULNERABILITY_DISABLED = 1, + VULNERABILITY_BASIC = 2 + } + } + /** Properties of a NodePoolDefaults. */ interface INodePoolDefaults { @@ -27618,9 +28120,15 @@ export namespace google { /** ClusterUpdate enableK8sBetaApis */ enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + /** ClusterUpdate desiredSecurityPostureConfig */ + desiredSecurityPostureConfig?: (google.container.v1beta1.ISecurityPostureConfig|null); + /** ClusterUpdate desiredEnableFqdnNetworkPolicy */ desiredEnableFqdnNetworkPolicy?: (boolean|null); + /** ClusterUpdate desiredAutopilotWorkloadPolicyConfig */ + desiredAutopilotWorkloadPolicyConfig?: (google.container.v1beta1.IWorkloadPolicyConfig|null); + /** ClusterUpdate desiredK8sBetaApis */ desiredK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); } @@ -27787,9 +28295,15 @@ export namespace google { /** ClusterUpdate enableK8sBetaApis. */ public enableK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); + /** ClusterUpdate desiredSecurityPostureConfig. */ + public desiredSecurityPostureConfig?: (google.container.v1beta1.ISecurityPostureConfig|null); + /** ClusterUpdate desiredEnableFqdnNetworkPolicy. */ public desiredEnableFqdnNetworkPolicy?: (boolean|null); + /** ClusterUpdate desiredAutopilotWorkloadPolicyConfig. */ + public desiredAutopilotWorkloadPolicyConfig?: (google.container.v1beta1.IWorkloadPolicyConfig|null); + /** ClusterUpdate desiredK8sBetaApis. */ public desiredK8sBetaApis?: (google.container.v1beta1.IK8sBetaAPIConfig|null); @@ -35286,6 +35800,9 @@ export namespace google { /** AcceleratorConfig gpuSharingConfig */ gpuSharingConfig?: (google.container.v1beta1.IGPUSharingConfig|null); + + /** AcceleratorConfig gpuDriverInstallationConfig */ + gpuDriverInstallationConfig?: (google.container.v1beta1.IGPUDriverInstallationConfig|null); } /** Represents an AcceleratorConfig. */ @@ -35312,9 +35829,15 @@ export namespace google { /** AcceleratorConfig gpuSharingConfig. */ public gpuSharingConfig?: (google.container.v1beta1.IGPUSharingConfig|null); + /** AcceleratorConfig gpuDriverInstallationConfig. */ + public gpuDriverInstallationConfig?: (google.container.v1beta1.IGPUDriverInstallationConfig|null); + /** AcceleratorConfig _gpuSharingConfig. */ public _gpuSharingConfig?: "gpuSharingConfig"; + /** AcceleratorConfig _gpuDriverInstallationConfig. */ + public _gpuDriverInstallationConfig?: "gpuDriverInstallationConfig"; + /** * Creates a new AcceleratorConfig instance using the specified properties. * @param [properties] Properties to set @@ -35508,6 +36031,117 @@ export namespace google { } } + /** Properties of a GPUDriverInstallationConfig. */ + interface IGPUDriverInstallationConfig { + + /** GPUDriverInstallationConfig gpuDriverVersion */ + gpuDriverVersion?: (google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|keyof typeof google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|null); + } + + /** Represents a GPUDriverInstallationConfig. */ + class GPUDriverInstallationConfig implements IGPUDriverInstallationConfig { + + /** + * Constructs a new GPUDriverInstallationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IGPUDriverInstallationConfig); + + /** GPUDriverInstallationConfig gpuDriverVersion. */ + public gpuDriverVersion?: (google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|keyof typeof google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|null); + + /** GPUDriverInstallationConfig _gpuDriverVersion. */ + public _gpuDriverVersion?: "gpuDriverVersion"; + + /** + * Creates a new GPUDriverInstallationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GPUDriverInstallationConfig instance + */ + public static create(properties?: google.container.v1beta1.IGPUDriverInstallationConfig): google.container.v1beta1.GPUDriverInstallationConfig; + + /** + * Encodes the specified GPUDriverInstallationConfig message. Does not implicitly {@link google.container.v1beta1.GPUDriverInstallationConfig.verify|verify} messages. + * @param message GPUDriverInstallationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IGPUDriverInstallationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GPUDriverInstallationConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.GPUDriverInstallationConfig.verify|verify} messages. + * @param message GPUDriverInstallationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IGPUDriverInstallationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.GPUDriverInstallationConfig; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.GPUDriverInstallationConfig; + + /** + * Verifies a GPUDriverInstallationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GPUDriverInstallationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GPUDriverInstallationConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.GPUDriverInstallationConfig; + + /** + * Creates a plain object from a GPUDriverInstallationConfig message. Also converts values to other types if specified. + * @param message GPUDriverInstallationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.GPUDriverInstallationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GPUDriverInstallationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GPUDriverInstallationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GPUDriverInstallationConfig { + + /** GPUDriverVersion enum. */ + enum GPUDriverVersion { + GPU_DRIVER_VERSION_UNSPECIFIED = 0, + INSTALLATION_DISABLED = 1, + DEFAULT = 2, + LATEST = 3 + } + } + /** Properties of a ManagedPrometheusConfig. */ interface IManagedPrometheusConfig { @@ -40281,6 +40915,9 @@ export namespace google { /** Autopilot enabled */ enabled?: (boolean|null); + + /** Autopilot workloadPolicyConfig */ + workloadPolicyConfig?: (google.container.v1beta1.IWorkloadPolicyConfig|null); } /** Represents an Autopilot. */ @@ -40295,6 +40932,9 @@ export namespace google { /** Autopilot enabled. */ public enabled: boolean; + /** Autopilot workloadPolicyConfig. */ + public workloadPolicyConfig?: (google.container.v1beta1.IWorkloadPolicyConfig|null); + /** * Creates a new Autopilot instance using the specified properties. * @param [properties] Properties to set @@ -40373,6 +41013,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a WorkloadPolicyConfig. */ + interface IWorkloadPolicyConfig { + + /** WorkloadPolicyConfig allowNetAdmin */ + allowNetAdmin?: (boolean|null); + } + + /** Represents a WorkloadPolicyConfig. */ + class WorkloadPolicyConfig implements IWorkloadPolicyConfig { + + /** + * Constructs a new WorkloadPolicyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.container.v1beta1.IWorkloadPolicyConfig); + + /** WorkloadPolicyConfig allowNetAdmin. */ + public allowNetAdmin?: (boolean|null); + + /** WorkloadPolicyConfig _allowNetAdmin. */ + public _allowNetAdmin?: "allowNetAdmin"; + + /** + * Creates a new WorkloadPolicyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkloadPolicyConfig instance + */ + public static create(properties?: google.container.v1beta1.IWorkloadPolicyConfig): google.container.v1beta1.WorkloadPolicyConfig; + + /** + * Encodes the specified WorkloadPolicyConfig message. Does not implicitly {@link google.container.v1beta1.WorkloadPolicyConfig.verify|verify} messages. + * @param message WorkloadPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.container.v1beta1.IWorkloadPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkloadPolicyConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.WorkloadPolicyConfig.verify|verify} messages. + * @param message WorkloadPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.container.v1beta1.IWorkloadPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.container.v1beta1.WorkloadPolicyConfig; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.container.v1beta1.WorkloadPolicyConfig; + + /** + * Verifies a WorkloadPolicyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkloadPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkloadPolicyConfig + */ + public static fromObject(object: { [k: string]: any }): google.container.v1beta1.WorkloadPolicyConfig; + + /** + * Creates a plain object from a WorkloadPolicyConfig message. Also converts values to other types if specified. + * @param message WorkloadPolicyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.container.v1beta1.WorkloadPolicyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkloadPolicyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkloadPolicyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a NotificationConfig. */ interface INotificationConfig { diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index 0c1cbc25fb33..2dc54592982e 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -12949,6 +12949,7 @@ * @property {google.container.v1.INodePoolAutoConfig|null} [nodePoolAutoConfig] Cluster nodePoolAutoConfig * @property {string|null} [etag] Cluster etag * @property {google.container.v1.IFleet|null} [fleet] Cluster fleet + * @property {google.container.v1.ISecurityPostureConfig|null} [securityPostureConfig] Cluster securityPostureConfig * @property {google.container.v1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] Cluster enableK8sBetaApis */ @@ -13484,6 +13485,14 @@ */ Cluster.prototype.fleet = null; + /** + * Cluster securityPostureConfig. + * @member {google.container.v1.ISecurityPostureConfig|null|undefined} securityPostureConfig + * @memberof google.container.v1.Cluster + * @instance + */ + Cluster.prototype.securityPostureConfig = null; + /** * Cluster enableK8sBetaApis. * @member {google.container.v1.IK8sBetaAPIConfig|null|undefined} enableK8sBetaApis @@ -13665,6 +13674,8 @@ $root.google.container.v1.Fleet.encode(message.fleet, writer.uint32(/* id 140, wireType 2 =*/1122).fork()).ldelim(); if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) $root.google.container.v1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); + if (message.securityPostureConfig != null && Object.hasOwnProperty.call(message, "securityPostureConfig")) + $root.google.container.v1.SecurityPostureConfig.encode(message.securityPostureConfig, writer.uint32(/* id 145, wireType 2 =*/1162).fork()).ldelim(); return writer; }; @@ -13982,6 +13993,10 @@ message.fleet = $root.google.container.v1.Fleet.decode(reader, reader.uint32()); break; } + case 145: { + message.securityPostureConfig = $root.google.container.v1.SecurityPostureConfig.decode(reader, reader.uint32()); + break; + } case 143: { message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); break; @@ -14314,6 +14329,11 @@ if (error) return "fleet." + error; } + if (message.securityPostureConfig != null && message.hasOwnProperty("securityPostureConfig")) { + var error = $root.google.container.v1.SecurityPostureConfig.verify(message.securityPostureConfig); + if (error) + return "securityPostureConfig." + error; + } if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) { var error = $root.google.container.v1.K8sBetaAPIConfig.verify(message.enableK8sBetaApis); if (error) @@ -14620,6 +14640,11 @@ throw TypeError(".google.container.v1.Cluster.fleet: object expected"); message.fleet = $root.google.container.v1.Fleet.fromObject(object.fleet); } + if (object.securityPostureConfig != null) { + if (typeof object.securityPostureConfig !== "object") + throw TypeError(".google.container.v1.Cluster.securityPostureConfig: object expected"); + message.securityPostureConfig = $root.google.container.v1.SecurityPostureConfig.fromObject(object.securityPostureConfig); + } if (object.enableK8sBetaApis != null) { if (typeof object.enableK8sBetaApis !== "object") throw TypeError(".google.container.v1.Cluster.enableK8sBetaApis: object expected"); @@ -14709,6 +14734,7 @@ object.etag = ""; object.fleet = null; object.enableK8sBetaApis = null; + object.securityPostureConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14859,6 +14885,8 @@ object.fleet = $root.google.container.v1.Fleet.toObject(message.fleet, options); if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) object.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.securityPostureConfig != null && message.hasOwnProperty("securityPostureConfig")) + object.securityPostureConfig = $root.google.container.v1.SecurityPostureConfig.toObject(message.securityPostureConfig, options); return object; }; @@ -15134,6 +15162,345 @@ return K8sBetaAPIConfig; })(); + v1.SecurityPostureConfig = (function() { + + /** + * Properties of a SecurityPostureConfig. + * @memberof google.container.v1 + * @interface ISecurityPostureConfig + * @property {google.container.v1.SecurityPostureConfig.Mode|null} [mode] SecurityPostureConfig mode + * @property {google.container.v1.SecurityPostureConfig.VulnerabilityMode|null} [vulnerabilityMode] SecurityPostureConfig vulnerabilityMode + */ + + /** + * Constructs a new SecurityPostureConfig. + * @memberof google.container.v1 + * @classdesc Represents a SecurityPostureConfig. + * @implements ISecurityPostureConfig + * @constructor + * @param {google.container.v1.ISecurityPostureConfig=} [properties] Properties to set + */ + function SecurityPostureConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPostureConfig mode. + * @member {google.container.v1.SecurityPostureConfig.Mode|null|undefined} mode + * @memberof google.container.v1.SecurityPostureConfig + * @instance + */ + SecurityPostureConfig.prototype.mode = null; + + /** + * SecurityPostureConfig vulnerabilityMode. + * @member {google.container.v1.SecurityPostureConfig.VulnerabilityMode|null|undefined} vulnerabilityMode + * @memberof google.container.v1.SecurityPostureConfig + * @instance + */ + SecurityPostureConfig.prototype.vulnerabilityMode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPostureConfig _mode. + * @member {"mode"|undefined} _mode + * @memberof google.container.v1.SecurityPostureConfig + * @instance + */ + Object.defineProperty(SecurityPostureConfig.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPostureConfig _vulnerabilityMode. + * @member {"vulnerabilityMode"|undefined} _vulnerabilityMode + * @memberof google.container.v1.SecurityPostureConfig + * @instance + */ + Object.defineProperty(SecurityPostureConfig.prototype, "_vulnerabilityMode", { + get: $util.oneOfGetter($oneOfFields = ["vulnerabilityMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPostureConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {google.container.v1.ISecurityPostureConfig=} [properties] Properties to set + * @returns {google.container.v1.SecurityPostureConfig} SecurityPostureConfig instance + */ + SecurityPostureConfig.create = function create(properties) { + return new SecurityPostureConfig(properties); + }; + + /** + * Encodes the specified SecurityPostureConfig message. Does not implicitly {@link google.container.v1.SecurityPostureConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {google.container.v1.ISecurityPostureConfig} message SecurityPostureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPostureConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.vulnerabilityMode != null && Object.hasOwnProperty.call(message, "vulnerabilityMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vulnerabilityMode); + return writer; + }; + + /** + * Encodes the specified SecurityPostureConfig message, length delimited. Does not implicitly {@link google.container.v1.SecurityPostureConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {google.container.v1.ISecurityPostureConfig} message SecurityPostureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPostureConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.SecurityPostureConfig} SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPostureConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.SecurityPostureConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + message.vulnerabilityMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.SecurityPostureConfig} SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPostureConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPostureConfig message. + * @function verify + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPostureConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.vulnerabilityMode != null && message.hasOwnProperty("vulnerabilityMode")) { + properties._vulnerabilityMode = 1; + switch (message.vulnerabilityMode) { + default: + return "vulnerabilityMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a SecurityPostureConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.SecurityPostureConfig} SecurityPostureConfig + */ + SecurityPostureConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.SecurityPostureConfig) + return object; + var message = new $root.google.container.v1.SecurityPostureConfig(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": + case 1: + message.mode = 1; + break; + case "BASIC": + case 2: + message.mode = 2; + break; + } + switch (object.vulnerabilityMode) { + default: + if (typeof object.vulnerabilityMode === "number") { + message.vulnerabilityMode = object.vulnerabilityMode; + break; + } + break; + case "VULNERABILITY_MODE_UNSPECIFIED": + case 0: + message.vulnerabilityMode = 0; + break; + case "VULNERABILITY_DISABLED": + case 1: + message.vulnerabilityMode = 1; + break; + case "VULNERABILITY_BASIC": + case 2: + message.vulnerabilityMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SecurityPostureConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {google.container.v1.SecurityPostureConfig} message SecurityPostureConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPostureConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.container.v1.SecurityPostureConfig.Mode[message.mode] === undefined ? message.mode : $root.google.container.v1.SecurityPostureConfig.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.vulnerabilityMode != null && message.hasOwnProperty("vulnerabilityMode")) { + object.vulnerabilityMode = options.enums === String ? $root.google.container.v1.SecurityPostureConfig.VulnerabilityMode[message.vulnerabilityMode] === undefined ? message.vulnerabilityMode : $root.google.container.v1.SecurityPostureConfig.VulnerabilityMode[message.vulnerabilityMode] : message.vulnerabilityMode; + if (options.oneofs) + object._vulnerabilityMode = "vulnerabilityMode"; + } + return object; + }; + + /** + * Converts this SecurityPostureConfig to JSON. + * @function toJSON + * @memberof google.container.v1.SecurityPostureConfig + * @instance + * @returns {Object.} JSON object + */ + SecurityPostureConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPostureConfig + * @function getTypeUrl + * @memberof google.container.v1.SecurityPostureConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPostureConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.SecurityPostureConfig"; + }; + + /** + * Mode enum. + * @name google.container.v1.SecurityPostureConfig.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} BASIC=2 BASIC value + */ + SecurityPostureConfig.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + /** + * VulnerabilityMode enum. + * @name google.container.v1.SecurityPostureConfig.VulnerabilityMode + * @enum {number} + * @property {number} VULNERABILITY_MODE_UNSPECIFIED=0 VULNERABILITY_MODE_UNSPECIFIED value + * @property {number} VULNERABILITY_DISABLED=1 VULNERABILITY_DISABLED value + * @property {number} VULNERABILITY_BASIC=2 VULNERABILITY_BASIC value + */ + SecurityPostureConfig.VulnerabilityMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VULNERABILITY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VULNERABILITY_DISABLED"] = 1; + values[valuesById[2] = "VULNERABILITY_BASIC"] = 2; + return values; + })(); + + return SecurityPostureConfig; + })(); + v1.NodePoolAutoConfig = (function() { /** @@ -15837,7 +16204,9 @@ * @property {google.container.v1.IAdditionalPodRangesConfig|null} [additionalPodRangesConfig] ClusterUpdate additionalPodRangesConfig * @property {google.container.v1.IAdditionalPodRangesConfig|null} [removedAdditionalPodRangesConfig] ClusterUpdate removedAdditionalPodRangesConfig * @property {google.container.v1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] ClusterUpdate enableK8sBetaApis + * @property {google.container.v1.ISecurityPostureConfig|null} [desiredSecurityPostureConfig] ClusterUpdate desiredSecurityPostureConfig * @property {boolean|null} [desiredEnableFqdnNetworkPolicy] ClusterUpdate desiredEnableFqdnNetworkPolicy + * @property {google.container.v1.IWorkloadPolicyConfig|null} [desiredAutopilotWorkloadPolicyConfig] ClusterUpdate desiredAutopilotWorkloadPolicyConfig * @property {google.container.v1.IK8sBetaAPIConfig|null} [desiredK8sBetaApis] ClusterUpdate desiredK8sBetaApis */ @@ -16209,6 +16578,14 @@ */ ClusterUpdate.prototype.enableK8sBetaApis = null; + /** + * ClusterUpdate desiredSecurityPostureConfig. + * @member {google.container.v1.ISecurityPostureConfig|null|undefined} desiredSecurityPostureConfig + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredSecurityPostureConfig = null; + /** * ClusterUpdate desiredEnableFqdnNetworkPolicy. * @member {boolean|null|undefined} desiredEnableFqdnNetworkPolicy @@ -16217,6 +16594,14 @@ */ ClusterUpdate.prototype.desiredEnableFqdnNetworkPolicy = null; + /** + * ClusterUpdate desiredAutopilotWorkloadPolicyConfig. + * @member {google.container.v1.IWorkloadPolicyConfig|null|undefined} desiredAutopilotWorkloadPolicyConfig + * @memberof google.container.v1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredAutopilotWorkloadPolicyConfig = null; + /** * ClusterUpdate desiredK8sBetaApis. * @member {google.container.v1.IK8sBetaAPIConfig|null|undefined} desiredK8sBetaApis @@ -16363,8 +16748,12 @@ $root.google.container.v1.AdditionalPodRangesConfig.encode(message.removedAdditionalPodRangesConfig, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) $root.google.container.v1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.desiredSecurityPostureConfig != null && Object.hasOwnProperty.call(message, "desiredSecurityPostureConfig")) + $root.google.container.v1.SecurityPostureConfig.encode(message.desiredSecurityPostureConfig, writer.uint32(/* id 124, wireType 2 =*/994).fork()).ldelim(); if (message.desiredEnableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "desiredEnableFqdnNetworkPolicy")) writer.uint32(/* id 126, wireType 0 =*/1008).bool(message.desiredEnableFqdnNetworkPolicy); + if (message.desiredAutopilotWorkloadPolicyConfig != null && Object.hasOwnProperty.call(message, "desiredAutopilotWorkloadPolicyConfig")) + $root.google.container.v1.WorkloadPolicyConfig.encode(message.desiredAutopilotWorkloadPolicyConfig, writer.uint32(/* id 128, wireType 2 =*/1026).fork()).ldelim(); if (message.desiredK8sBetaApis != null && Object.hasOwnProperty.call(message, "desiredK8sBetaApis")) $root.google.container.v1.K8sBetaAPIConfig.encode(message.desiredK8sBetaApis, writer.uint32(/* id 131, wireType 2 =*/1050).fork()).ldelim(); return writer; @@ -16579,10 +16968,18 @@ message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); break; } + case 124: { + message.desiredSecurityPostureConfig = $root.google.container.v1.SecurityPostureConfig.decode(reader, reader.uint32()); + break; + } case 126: { message.desiredEnableFqdnNetworkPolicy = reader.bool(); break; } + case 128: { + message.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.decode(reader, reader.uint32()); + break; + } case 131: { message.desiredK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.decode(reader, reader.uint32()); break; @@ -16844,11 +17241,21 @@ if (error) return "enableK8sBetaApis." + error; } + if (message.desiredSecurityPostureConfig != null && message.hasOwnProperty("desiredSecurityPostureConfig")) { + var error = $root.google.container.v1.SecurityPostureConfig.verify(message.desiredSecurityPostureConfig); + if (error) + return "desiredSecurityPostureConfig." + error; + } if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { properties._desiredEnableFqdnNetworkPolicy = 1; if (typeof message.desiredEnableFqdnNetworkPolicy !== "boolean") return "desiredEnableFqdnNetworkPolicy: boolean expected"; } + if (message.desiredAutopilotWorkloadPolicyConfig != null && message.hasOwnProperty("desiredAutopilotWorkloadPolicyConfig")) { + var error = $root.google.container.v1.WorkloadPolicyConfig.verify(message.desiredAutopilotWorkloadPolicyConfig); + if (error) + return "desiredAutopilotWorkloadPolicyConfig." + error; + } if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) { var error = $root.google.container.v1.K8sBetaAPIConfig.verify(message.desiredK8sBetaApis); if (error) @@ -17116,8 +17523,18 @@ throw TypeError(".google.container.v1.ClusterUpdate.enableK8sBetaApis: object expected"); message.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); } + if (object.desiredSecurityPostureConfig != null) { + if (typeof object.desiredSecurityPostureConfig !== "object") + throw TypeError(".google.container.v1.ClusterUpdate.desiredSecurityPostureConfig: object expected"); + message.desiredSecurityPostureConfig = $root.google.container.v1.SecurityPostureConfig.fromObject(object.desiredSecurityPostureConfig); + } if (object.desiredEnableFqdnNetworkPolicy != null) message.desiredEnableFqdnNetworkPolicy = Boolean(object.desiredEnableFqdnNetworkPolicy); + if (object.desiredAutopilotWorkloadPolicyConfig != null) { + if (typeof object.desiredAutopilotWorkloadPolicyConfig !== "object") + throw TypeError(".google.container.v1.ClusterUpdate.desiredAutopilotWorkloadPolicyConfig: object expected"); + message.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.fromObject(object.desiredAutopilotWorkloadPolicyConfig); + } if (object.desiredK8sBetaApis != null) { if (typeof object.desiredK8sBetaApis !== "object") throw TypeError(".google.container.v1.ClusterUpdate.desiredK8sBetaApis: object expected"); @@ -17184,6 +17601,8 @@ object.additionalPodRangesConfig = null; object.removedAdditionalPodRangesConfig = null; object.enableK8sBetaApis = null; + object.desiredSecurityPostureConfig = null; + object.desiredAutopilotWorkloadPolicyConfig = null; object.desiredK8sBetaApis = null; } if (message.desiredNodeVersion != null && message.hasOwnProperty("desiredNodeVersion")) @@ -17280,11 +17699,15 @@ object.removedAdditionalPodRangesConfig = $root.google.container.v1.AdditionalPodRangesConfig.toObject(message.removedAdditionalPodRangesConfig, options); if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) object.enableK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.desiredSecurityPostureConfig != null && message.hasOwnProperty("desiredSecurityPostureConfig")) + object.desiredSecurityPostureConfig = $root.google.container.v1.SecurityPostureConfig.toObject(message.desiredSecurityPostureConfig, options); if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { object.desiredEnableFqdnNetworkPolicy = message.desiredEnableFqdnNetworkPolicy; if (options.oneofs) object._desiredEnableFqdnNetworkPolicy = "desiredEnableFqdnNetworkPolicy"; } + if (message.desiredAutopilotWorkloadPolicyConfig != null && message.hasOwnProperty("desiredAutopilotWorkloadPolicyConfig")) + object.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.toObject(message.desiredAutopilotWorkloadPolicyConfig, options); if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) object.desiredK8sBetaApis = $root.google.container.v1.K8sBetaAPIConfig.toObject(message.desiredK8sBetaApis, options); return object; @@ -35722,6 +36145,7 @@ * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType * @property {string|null} [gpuPartitionSize] AcceleratorConfig gpuPartitionSize * @property {google.container.v1.IGPUSharingConfig|null} [gpuSharingConfig] AcceleratorConfig gpuSharingConfig + * @property {google.container.v1.IGPUDriverInstallationConfig|null} [gpuDriverInstallationConfig] AcceleratorConfig gpuDriverInstallationConfig */ /** @@ -35771,6 +36195,14 @@ */ AcceleratorConfig.prototype.gpuSharingConfig = null; + /** + * AcceleratorConfig gpuDriverInstallationConfig. + * @member {google.container.v1.IGPUDriverInstallationConfig|null|undefined} gpuDriverInstallationConfig + * @memberof google.container.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.gpuDriverInstallationConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -35785,6 +36217,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * AcceleratorConfig _gpuDriverInstallationConfig. + * @member {"gpuDriverInstallationConfig"|undefined} _gpuDriverInstallationConfig + * @memberof google.container.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_gpuDriverInstallationConfig", { + get: $util.oneOfGetter($oneOfFields = ["gpuDriverInstallationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new AcceleratorConfig instance using the specified properties. * @function create @@ -35817,6 +36260,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.gpuPartitionSize); if (message.gpuSharingConfig != null && Object.hasOwnProperty.call(message, "gpuSharingConfig")) $root.google.container.v1.GPUSharingConfig.encode(message.gpuSharingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gpuDriverInstallationConfig != null && Object.hasOwnProperty.call(message, "gpuDriverInstallationConfig")) + $root.google.container.v1.GPUDriverInstallationConfig.encode(message.gpuDriverInstallationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -35867,6 +36312,10 @@ message.gpuSharingConfig = $root.google.container.v1.GPUSharingConfig.decode(reader, reader.uint32()); break; } + case 6: { + message.gpuDriverInstallationConfig = $root.google.container.v1.GPUDriverInstallationConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35920,6 +36369,14 @@ return "gpuSharingConfig." + error; } } + if (message.gpuDriverInstallationConfig != null && message.hasOwnProperty("gpuDriverInstallationConfig")) { + properties._gpuDriverInstallationConfig = 1; + { + var error = $root.google.container.v1.GPUDriverInstallationConfig.verify(message.gpuDriverInstallationConfig); + if (error) + return "gpuDriverInstallationConfig." + error; + } + } return null; }; @@ -35953,6 +36410,11 @@ throw TypeError(".google.container.v1.AcceleratorConfig.gpuSharingConfig: object expected"); message.gpuSharingConfig = $root.google.container.v1.GPUSharingConfig.fromObject(object.gpuSharingConfig); } + if (object.gpuDriverInstallationConfig != null) { + if (typeof object.gpuDriverInstallationConfig !== "object") + throw TypeError(".google.container.v1.AcceleratorConfig.gpuDriverInstallationConfig: object expected"); + message.gpuDriverInstallationConfig = $root.google.container.v1.GPUDriverInstallationConfig.fromObject(object.gpuDriverInstallationConfig); + } return message; }; @@ -35992,6 +36454,11 @@ if (options.oneofs) object._gpuSharingConfig = "gpuSharingConfig"; } + if (message.gpuDriverInstallationConfig != null && message.hasOwnProperty("gpuDriverInstallationConfig")) { + object.gpuDriverInstallationConfig = $root.google.container.v1.GPUDriverInstallationConfig.toObject(message.gpuDriverInstallationConfig, options); + if (options.oneofs) + object._gpuDriverInstallationConfig = "gpuDriverInstallationConfig"; + } return object; }; @@ -36316,6 +36783,274 @@ return GPUSharingConfig; })(); + v1.GPUDriverInstallationConfig = (function() { + + /** + * Properties of a GPUDriverInstallationConfig. + * @memberof google.container.v1 + * @interface IGPUDriverInstallationConfig + * @property {google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|null} [gpuDriverVersion] GPUDriverInstallationConfig gpuDriverVersion + */ + + /** + * Constructs a new GPUDriverInstallationConfig. + * @memberof google.container.v1 + * @classdesc Represents a GPUDriverInstallationConfig. + * @implements IGPUDriverInstallationConfig + * @constructor + * @param {google.container.v1.IGPUDriverInstallationConfig=} [properties] Properties to set + */ + function GPUDriverInstallationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GPUDriverInstallationConfig gpuDriverVersion. + * @member {google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion|null|undefined} gpuDriverVersion + * @memberof google.container.v1.GPUDriverInstallationConfig + * @instance + */ + GPUDriverInstallationConfig.prototype.gpuDriverVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GPUDriverInstallationConfig _gpuDriverVersion. + * @member {"gpuDriverVersion"|undefined} _gpuDriverVersion + * @memberof google.container.v1.GPUDriverInstallationConfig + * @instance + */ + Object.defineProperty(GPUDriverInstallationConfig.prototype, "_gpuDriverVersion", { + get: $util.oneOfGetter($oneOfFields = ["gpuDriverVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GPUDriverInstallationConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1.IGPUDriverInstallationConfig=} [properties] Properties to set + * @returns {google.container.v1.GPUDriverInstallationConfig} GPUDriverInstallationConfig instance + */ + GPUDriverInstallationConfig.create = function create(properties) { + return new GPUDriverInstallationConfig(properties); + }; + + /** + * Encodes the specified GPUDriverInstallationConfig message. Does not implicitly {@link google.container.v1.GPUDriverInstallationConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1.IGPUDriverInstallationConfig} message GPUDriverInstallationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GPUDriverInstallationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gpuDriverVersion != null && Object.hasOwnProperty.call(message, "gpuDriverVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gpuDriverVersion); + return writer; + }; + + /** + * Encodes the specified GPUDriverInstallationConfig message, length delimited. Does not implicitly {@link google.container.v1.GPUDriverInstallationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1.IGPUDriverInstallationConfig} message GPUDriverInstallationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GPUDriverInstallationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GPUDriverInstallationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.GPUDriverInstallationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gpuDriverVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GPUDriverInstallationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GPUDriverInstallationConfig message. + * @function verify + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GPUDriverInstallationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gpuDriverVersion != null && message.hasOwnProperty("gpuDriverVersion")) { + properties._gpuDriverVersion = 1; + switch (message.gpuDriverVersion) { + default: + return "gpuDriverVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a GPUDriverInstallationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + */ + GPUDriverInstallationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.GPUDriverInstallationConfig) + return object; + var message = new $root.google.container.v1.GPUDriverInstallationConfig(); + switch (object.gpuDriverVersion) { + default: + if (typeof object.gpuDriverVersion === "number") { + message.gpuDriverVersion = object.gpuDriverVersion; + break; + } + break; + case "GPU_DRIVER_VERSION_UNSPECIFIED": + case 0: + message.gpuDriverVersion = 0; + break; + case "INSTALLATION_DISABLED": + case 1: + message.gpuDriverVersion = 1; + break; + case "DEFAULT": + case 2: + message.gpuDriverVersion = 2; + break; + case "LATEST": + case 3: + message.gpuDriverVersion = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GPUDriverInstallationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1.GPUDriverInstallationConfig} message GPUDriverInstallationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GPUDriverInstallationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gpuDriverVersion != null && message.hasOwnProperty("gpuDriverVersion")) { + object.gpuDriverVersion = options.enums === String ? $root.google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion[message.gpuDriverVersion] === undefined ? message.gpuDriverVersion : $root.google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion[message.gpuDriverVersion] : message.gpuDriverVersion; + if (options.oneofs) + object._gpuDriverVersion = "gpuDriverVersion"; + } + return object; + }; + + /** + * Converts this GPUDriverInstallationConfig to JSON. + * @function toJSON + * @memberof google.container.v1.GPUDriverInstallationConfig + * @instance + * @returns {Object.} JSON object + */ + GPUDriverInstallationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GPUDriverInstallationConfig + * @function getTypeUrl + * @memberof google.container.v1.GPUDriverInstallationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GPUDriverInstallationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.GPUDriverInstallationConfig"; + }; + + /** + * GPUDriverVersion enum. + * @name google.container.v1.GPUDriverInstallationConfig.GPUDriverVersion + * @enum {number} + * @property {number} GPU_DRIVER_VERSION_UNSPECIFIED=0 GPU_DRIVER_VERSION_UNSPECIFIED value + * @property {number} INSTALLATION_DISABLED=1 INSTALLATION_DISABLED value + * @property {number} DEFAULT=2 DEFAULT value + * @property {number} LATEST=3 LATEST value + */ + GPUDriverInstallationConfig.GPUDriverVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GPU_DRIVER_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLATION_DISABLED"] = 1; + values[valuesById[2] = "DEFAULT"] = 2; + values[valuesById[3] = "LATEST"] = 3; + return values; + })(); + + return GPUDriverInstallationConfig; + })(); + v1.WorkloadMetadataConfig = (function() { /** @@ -48036,6 +48771,7 @@ * @memberof google.container.v1 * @interface IAutopilot * @property {boolean|null} [enabled] Autopilot enabled + * @property {google.container.v1.IWorkloadPolicyConfig|null} [workloadPolicyConfig] Autopilot workloadPolicyConfig */ /** @@ -48061,6 +48797,14 @@ */ Autopilot.prototype.enabled = false; + /** + * Autopilot workloadPolicyConfig. + * @member {google.container.v1.IWorkloadPolicyConfig|null|undefined} workloadPolicyConfig + * @memberof google.container.v1.Autopilot + * @instance + */ + Autopilot.prototype.workloadPolicyConfig = null; + /** * Creates a new Autopilot instance using the specified properties. * @function create @@ -48087,6 +48831,8 @@ writer = $Writer.create(); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.workloadPolicyConfig != null && Object.hasOwnProperty.call(message, "workloadPolicyConfig")) + $root.google.container.v1.WorkloadPolicyConfig.encode(message.workloadPolicyConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -48125,6 +48871,10 @@ message.enabled = reader.bool(); break; } + case 2: { + message.workloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -48163,6 +48913,11 @@ if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; + if (message.workloadPolicyConfig != null && message.hasOwnProperty("workloadPolicyConfig")) { + var error = $root.google.container.v1.WorkloadPolicyConfig.verify(message.workloadPolicyConfig); + if (error) + return "workloadPolicyConfig." + error; + } return null; }; @@ -48180,6 +48935,11 @@ var message = new $root.google.container.v1.Autopilot(); if (object.enabled != null) message.enabled = Boolean(object.enabled); + if (object.workloadPolicyConfig != null) { + if (typeof object.workloadPolicyConfig !== "object") + throw TypeError(".google.container.v1.Autopilot.workloadPolicyConfig: object expected"); + message.workloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.fromObject(object.workloadPolicyConfig); + } return message; }; @@ -48196,10 +48956,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.enabled = false; + object.workloadPolicyConfig = null; + } if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; + if (message.workloadPolicyConfig != null && message.hasOwnProperty("workloadPolicyConfig")) + object.workloadPolicyConfig = $root.google.container.v1.WorkloadPolicyConfig.toObject(message.workloadPolicyConfig, options); return object; }; @@ -48232,6 +48996,227 @@ return Autopilot; })(); + v1.WorkloadPolicyConfig = (function() { + + /** + * Properties of a WorkloadPolicyConfig. + * @memberof google.container.v1 + * @interface IWorkloadPolicyConfig + * @property {boolean|null} [allowNetAdmin] WorkloadPolicyConfig allowNetAdmin + */ + + /** + * Constructs a new WorkloadPolicyConfig. + * @memberof google.container.v1 + * @classdesc Represents a WorkloadPolicyConfig. + * @implements IWorkloadPolicyConfig + * @constructor + * @param {google.container.v1.IWorkloadPolicyConfig=} [properties] Properties to set + */ + function WorkloadPolicyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkloadPolicyConfig allowNetAdmin. + * @member {boolean|null|undefined} allowNetAdmin + * @memberof google.container.v1.WorkloadPolicyConfig + * @instance + */ + WorkloadPolicyConfig.prototype.allowNetAdmin = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WorkloadPolicyConfig _allowNetAdmin. + * @member {"allowNetAdmin"|undefined} _allowNetAdmin + * @memberof google.container.v1.WorkloadPolicyConfig + * @instance + */ + Object.defineProperty(WorkloadPolicyConfig.prototype, "_allowNetAdmin", { + get: $util.oneOfGetter($oneOfFields = ["allowNetAdmin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkloadPolicyConfig instance using the specified properties. + * @function create + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {google.container.v1.IWorkloadPolicyConfig=} [properties] Properties to set + * @returns {google.container.v1.WorkloadPolicyConfig} WorkloadPolicyConfig instance + */ + WorkloadPolicyConfig.create = function create(properties) { + return new WorkloadPolicyConfig(properties); + }; + + /** + * Encodes the specified WorkloadPolicyConfig message. Does not implicitly {@link google.container.v1.WorkloadPolicyConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {google.container.v1.IWorkloadPolicyConfig} message WorkloadPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadPolicyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowNetAdmin != null && Object.hasOwnProperty.call(message, "allowNetAdmin")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowNetAdmin); + return writer; + }; + + /** + * Encodes the specified WorkloadPolicyConfig message, length delimited. Does not implicitly {@link google.container.v1.WorkloadPolicyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {google.container.v1.IWorkloadPolicyConfig} message WorkloadPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadPolicyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1.WorkloadPolicyConfig} WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadPolicyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1.WorkloadPolicyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.allowNetAdmin = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1.WorkloadPolicyConfig} WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadPolicyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkloadPolicyConfig message. + * @function verify + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkloadPolicyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allowNetAdmin != null && message.hasOwnProperty("allowNetAdmin")) { + properties._allowNetAdmin = 1; + if (typeof message.allowNetAdmin !== "boolean") + return "allowNetAdmin: boolean expected"; + } + return null; + }; + + /** + * Creates a WorkloadPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1.WorkloadPolicyConfig} WorkloadPolicyConfig + */ + WorkloadPolicyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1.WorkloadPolicyConfig) + return object; + var message = new $root.google.container.v1.WorkloadPolicyConfig(); + if (object.allowNetAdmin != null) + message.allowNetAdmin = Boolean(object.allowNetAdmin); + return message; + }; + + /** + * Creates a plain object from a WorkloadPolicyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {google.container.v1.WorkloadPolicyConfig} message WorkloadPolicyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkloadPolicyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allowNetAdmin != null && message.hasOwnProperty("allowNetAdmin")) { + object.allowNetAdmin = message.allowNetAdmin; + if (options.oneofs) + object._allowNetAdmin = "allowNetAdmin"; + } + return object; + }; + + /** + * Converts this WorkloadPolicyConfig to JSON. + * @function toJSON + * @memberof google.container.v1.WorkloadPolicyConfig + * @instance + * @returns {Object.} JSON object + */ + WorkloadPolicyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkloadPolicyConfig + * @function getTypeUrl + * @memberof google.container.v1.WorkloadPolicyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkloadPolicyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1.WorkloadPolicyConfig"; + }; + + return WorkloadPolicyConfig; + })(); + v1.LoggingConfig = (function() { /** @@ -65543,6 +66528,7 @@ * @property {google.container.v1beta1.IProtectConfig|null} [protectConfig] Cluster protectConfig * @property {string|null} [etag] Cluster etag * @property {google.container.v1beta1.IFleet|null} [fleet] Cluster fleet + * @property {google.container.v1beta1.ISecurityPostureConfig|null} [securityPostureConfig] Cluster securityPostureConfig */ /** @@ -66157,6 +67143,14 @@ */ Cluster.prototype.fleet = null; + /** + * Cluster securityPostureConfig. + * @member {google.container.v1beta1.ISecurityPostureConfig|null|undefined} securityPostureConfig + * @memberof google.container.v1beta1.Cluster + * @instance + */ + Cluster.prototype.securityPostureConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -66359,6 +67353,8 @@ $root.google.container.v1beta1.Fleet.encode(message.fleet, writer.uint32(/* id 140, wireType 2 =*/1122).fork()).ldelim(); if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); + if (message.securityPostureConfig != null && Object.hasOwnProperty.call(message, "securityPostureConfig")) + $root.google.container.v1beta1.SecurityPostureConfig.encode(message.securityPostureConfig, writer.uint32(/* id 145, wireType 2 =*/1162).fork()).ldelim(); return writer; }; @@ -66716,6 +67712,10 @@ message.fleet = $root.google.container.v1beta1.Fleet.decode(reader, reader.uint32()); break; } + case 145: { + message.securityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -67093,6 +68093,11 @@ if (error) return "fleet." + error; } + if (message.securityPostureConfig != null && message.hasOwnProperty("securityPostureConfig")) { + var error = $root.google.container.v1beta1.SecurityPostureConfig.verify(message.securityPostureConfig); + if (error) + return "securityPostureConfig." + error; + } return null; }; @@ -67438,6 +68443,11 @@ throw TypeError(".google.container.v1beta1.Cluster.fleet: object expected"); message.fleet = $root.google.container.v1beta1.Fleet.fromObject(object.fleet); } + if (object.securityPostureConfig != null) { + if (typeof object.securityPostureConfig !== "object") + throw TypeError(".google.container.v1beta1.Cluster.securityPostureConfig: object expected"); + message.securityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.fromObject(object.securityPostureConfig); + } return message; }; @@ -67530,6 +68540,7 @@ object.etag = ""; object.fleet = null; object.enableK8sBetaApis = null; + object.securityPostureConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -67701,6 +68712,8 @@ object.fleet = $root.google.container.v1beta1.Fleet.toObject(message.fleet, options); if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) object.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.securityPostureConfig != null && message.hasOwnProperty("securityPostureConfig")) + object.securityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.toObject(message.securityPostureConfig, options); return object; }; @@ -68556,6 +69569,345 @@ return ProtectConfig; })(); + v1beta1.SecurityPostureConfig = (function() { + + /** + * Properties of a SecurityPostureConfig. + * @memberof google.container.v1beta1 + * @interface ISecurityPostureConfig + * @property {google.container.v1beta1.SecurityPostureConfig.Mode|null} [mode] SecurityPostureConfig mode + * @property {google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|null} [vulnerabilityMode] SecurityPostureConfig vulnerabilityMode + */ + + /** + * Constructs a new SecurityPostureConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents a SecurityPostureConfig. + * @implements ISecurityPostureConfig + * @constructor + * @param {google.container.v1beta1.ISecurityPostureConfig=} [properties] Properties to set + */ + function SecurityPostureConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPostureConfig mode. + * @member {google.container.v1beta1.SecurityPostureConfig.Mode|null|undefined} mode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @instance + */ + SecurityPostureConfig.prototype.mode = null; + + /** + * SecurityPostureConfig vulnerabilityMode. + * @member {google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode|null|undefined} vulnerabilityMode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @instance + */ + SecurityPostureConfig.prototype.vulnerabilityMode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPostureConfig _mode. + * @member {"mode"|undefined} _mode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @instance + */ + Object.defineProperty(SecurityPostureConfig.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPostureConfig _vulnerabilityMode. + * @member {"vulnerabilityMode"|undefined} _vulnerabilityMode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @instance + */ + Object.defineProperty(SecurityPostureConfig.prototype, "_vulnerabilityMode", { + get: $util.oneOfGetter($oneOfFields = ["vulnerabilityMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPostureConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {google.container.v1beta1.ISecurityPostureConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.SecurityPostureConfig} SecurityPostureConfig instance + */ + SecurityPostureConfig.create = function create(properties) { + return new SecurityPostureConfig(properties); + }; + + /** + * Encodes the specified SecurityPostureConfig message. Does not implicitly {@link google.container.v1beta1.SecurityPostureConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {google.container.v1beta1.ISecurityPostureConfig} message SecurityPostureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPostureConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.vulnerabilityMode != null && Object.hasOwnProperty.call(message, "vulnerabilityMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vulnerabilityMode); + return writer; + }; + + /** + * Encodes the specified SecurityPostureConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.SecurityPostureConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {google.container.v1beta1.ISecurityPostureConfig} message SecurityPostureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPostureConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.SecurityPostureConfig} SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPostureConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.SecurityPostureConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + message.vulnerabilityMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPostureConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.SecurityPostureConfig} SecurityPostureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPostureConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPostureConfig message. + * @function verify + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPostureConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.vulnerabilityMode != null && message.hasOwnProperty("vulnerabilityMode")) { + properties._vulnerabilityMode = 1; + switch (message.vulnerabilityMode) { + default: + return "vulnerabilityMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a SecurityPostureConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.SecurityPostureConfig} SecurityPostureConfig + */ + SecurityPostureConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.SecurityPostureConfig) + return object; + var message = new $root.google.container.v1beta1.SecurityPostureConfig(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": + case 1: + message.mode = 1; + break; + case "BASIC": + case 2: + message.mode = 2; + break; + } + switch (object.vulnerabilityMode) { + default: + if (typeof object.vulnerabilityMode === "number") { + message.vulnerabilityMode = object.vulnerabilityMode; + break; + } + break; + case "VULNERABILITY_MODE_UNSPECIFIED": + case 0: + message.vulnerabilityMode = 0; + break; + case "VULNERABILITY_DISABLED": + case 1: + message.vulnerabilityMode = 1; + break; + case "VULNERABILITY_BASIC": + case 2: + message.vulnerabilityMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SecurityPostureConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {google.container.v1beta1.SecurityPostureConfig} message SecurityPostureConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPostureConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.container.v1beta1.SecurityPostureConfig.Mode[message.mode] === undefined ? message.mode : $root.google.container.v1beta1.SecurityPostureConfig.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.vulnerabilityMode != null && message.hasOwnProperty("vulnerabilityMode")) { + object.vulnerabilityMode = options.enums === String ? $root.google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode[message.vulnerabilityMode] === undefined ? message.vulnerabilityMode : $root.google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode[message.vulnerabilityMode] : message.vulnerabilityMode; + if (options.oneofs) + object._vulnerabilityMode = "vulnerabilityMode"; + } + return object; + }; + + /** + * Converts this SecurityPostureConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.SecurityPostureConfig + * @instance + * @returns {Object.} JSON object + */ + SecurityPostureConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityPostureConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.SecurityPostureConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityPostureConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.SecurityPostureConfig"; + }; + + /** + * Mode enum. + * @name google.container.v1beta1.SecurityPostureConfig.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} BASIC=2 BASIC value + */ + SecurityPostureConfig.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + /** + * VulnerabilityMode enum. + * @name google.container.v1beta1.SecurityPostureConfig.VulnerabilityMode + * @enum {number} + * @property {number} VULNERABILITY_MODE_UNSPECIFIED=0 VULNERABILITY_MODE_UNSPECIFIED value + * @property {number} VULNERABILITY_DISABLED=1 VULNERABILITY_DISABLED value + * @property {number} VULNERABILITY_BASIC=2 VULNERABILITY_BASIC value + */ + SecurityPostureConfig.VulnerabilityMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VULNERABILITY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VULNERABILITY_DISABLED"] = 1; + values[valuesById[2] = "VULNERABILITY_BASIC"] = 2; + return values; + })(); + + return SecurityPostureConfig; + })(); + v1beta1.NodePoolDefaults = (function() { /** @@ -69266,7 +70618,9 @@ * @property {google.container.v1beta1.IAdditionalPodRangesConfig|null} [additionalPodRangesConfig] ClusterUpdate additionalPodRangesConfig * @property {google.container.v1beta1.IAdditionalPodRangesConfig|null} [removedAdditionalPodRangesConfig] ClusterUpdate removedAdditionalPodRangesConfig * @property {google.container.v1beta1.IK8sBetaAPIConfig|null} [enableK8sBetaApis] ClusterUpdate enableK8sBetaApis + * @property {google.container.v1beta1.ISecurityPostureConfig|null} [desiredSecurityPostureConfig] ClusterUpdate desiredSecurityPostureConfig * @property {boolean|null} [desiredEnableFqdnNetworkPolicy] ClusterUpdate desiredEnableFqdnNetworkPolicy + * @property {google.container.v1beta1.IWorkloadPolicyConfig|null} [desiredAutopilotWorkloadPolicyConfig] ClusterUpdate desiredAutopilotWorkloadPolicyConfig * @property {google.container.v1beta1.IK8sBetaAPIConfig|null} [desiredK8sBetaApis] ClusterUpdate desiredK8sBetaApis */ @@ -69694,6 +71048,14 @@ */ ClusterUpdate.prototype.enableK8sBetaApis = null; + /** + * ClusterUpdate desiredSecurityPostureConfig. + * @member {google.container.v1beta1.ISecurityPostureConfig|null|undefined} desiredSecurityPostureConfig + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredSecurityPostureConfig = null; + /** * ClusterUpdate desiredEnableFqdnNetworkPolicy. * @member {boolean|null|undefined} desiredEnableFqdnNetworkPolicy @@ -69702,6 +71064,14 @@ */ ClusterUpdate.prototype.desiredEnableFqdnNetworkPolicy = null; + /** + * ClusterUpdate desiredAutopilotWorkloadPolicyConfig. + * @member {google.container.v1beta1.IWorkloadPolicyConfig|null|undefined} desiredAutopilotWorkloadPolicyConfig + * @memberof google.container.v1beta1.ClusterUpdate + * @instance + */ + ClusterUpdate.prototype.desiredAutopilotWorkloadPolicyConfig = null; + /** * ClusterUpdate desiredK8sBetaApis. * @member {google.container.v1beta1.IK8sBetaAPIConfig|null|undefined} desiredK8sBetaApis @@ -69873,8 +71243,12 @@ $root.google.container.v1beta1.AdditionalPodRangesConfig.encode(message.removedAdditionalPodRangesConfig, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); if (message.enableK8sBetaApis != null && Object.hasOwnProperty.call(message, "enableK8sBetaApis")) $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.enableK8sBetaApis, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.desiredSecurityPostureConfig != null && Object.hasOwnProperty.call(message, "desiredSecurityPostureConfig")) + $root.google.container.v1beta1.SecurityPostureConfig.encode(message.desiredSecurityPostureConfig, writer.uint32(/* id 124, wireType 2 =*/994).fork()).ldelim(); if (message.desiredEnableFqdnNetworkPolicy != null && Object.hasOwnProperty.call(message, "desiredEnableFqdnNetworkPolicy")) writer.uint32(/* id 126, wireType 0 =*/1008).bool(message.desiredEnableFqdnNetworkPolicy); + if (message.desiredAutopilotWorkloadPolicyConfig != null && Object.hasOwnProperty.call(message, "desiredAutopilotWorkloadPolicyConfig")) + $root.google.container.v1beta1.WorkloadPolicyConfig.encode(message.desiredAutopilotWorkloadPolicyConfig, writer.uint32(/* id 128, wireType 2 =*/1026).fork()).ldelim(); if (message.desiredK8sBetaApis != null && Object.hasOwnProperty.call(message, "desiredK8sBetaApis")) $root.google.container.v1beta1.K8sBetaAPIConfig.encode(message.desiredK8sBetaApis, writer.uint32(/* id 131, wireType 2 =*/1050).fork()).ldelim(); return writer; @@ -70117,10 +71491,18 @@ message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.decode(reader, reader.uint32()); break; } + case 124: { + message.desiredSecurityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.decode(reader, reader.uint32()); + break; + } case 126: { message.desiredEnableFqdnNetworkPolicy = reader.bool(); break; } + case 128: { + message.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.decode(reader, reader.uint32()); + break; + } case 131: { message.desiredK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.decode(reader, reader.uint32()); break; @@ -70420,11 +71802,21 @@ if (error) return "enableK8sBetaApis." + error; } + if (message.desiredSecurityPostureConfig != null && message.hasOwnProperty("desiredSecurityPostureConfig")) { + var error = $root.google.container.v1beta1.SecurityPostureConfig.verify(message.desiredSecurityPostureConfig); + if (error) + return "desiredSecurityPostureConfig." + error; + } if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { properties._desiredEnableFqdnNetworkPolicy = 1; if (typeof message.desiredEnableFqdnNetworkPolicy !== "boolean") return "desiredEnableFqdnNetworkPolicy: boolean expected"; } + if (message.desiredAutopilotWorkloadPolicyConfig != null && message.hasOwnProperty("desiredAutopilotWorkloadPolicyConfig")) { + var error = $root.google.container.v1beta1.WorkloadPolicyConfig.verify(message.desiredAutopilotWorkloadPolicyConfig); + if (error) + return "desiredAutopilotWorkloadPolicyConfig." + error; + } if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) { var error = $root.google.container.v1beta1.K8sBetaAPIConfig.verify(message.desiredK8sBetaApis); if (error) @@ -70727,8 +72119,18 @@ throw TypeError(".google.container.v1beta1.ClusterUpdate.enableK8sBetaApis: object expected"); message.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.fromObject(object.enableK8sBetaApis); } + if (object.desiredSecurityPostureConfig != null) { + if (typeof object.desiredSecurityPostureConfig !== "object") + throw TypeError(".google.container.v1beta1.ClusterUpdate.desiredSecurityPostureConfig: object expected"); + message.desiredSecurityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.fromObject(object.desiredSecurityPostureConfig); + } if (object.desiredEnableFqdnNetworkPolicy != null) message.desiredEnableFqdnNetworkPolicy = Boolean(object.desiredEnableFqdnNetworkPolicy); + if (object.desiredAutopilotWorkloadPolicyConfig != null) { + if (typeof object.desiredAutopilotWorkloadPolicyConfig !== "object") + throw TypeError(".google.container.v1beta1.ClusterUpdate.desiredAutopilotWorkloadPolicyConfig: object expected"); + message.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.fromObject(object.desiredAutopilotWorkloadPolicyConfig); + } if (object.desiredK8sBetaApis != null) { if (typeof object.desiredK8sBetaApis !== "object") throw TypeError(".google.container.v1beta1.ClusterUpdate.desiredK8sBetaApis: object expected"); @@ -70801,6 +72203,8 @@ object.additionalPodRangesConfig = null; object.removedAdditionalPodRangesConfig = null; object.enableK8sBetaApis = null; + object.desiredSecurityPostureConfig = null; + object.desiredAutopilotWorkloadPolicyConfig = null; object.desiredK8sBetaApis = null; } if (message.desiredNodeVersion != null && message.hasOwnProperty("desiredNodeVersion")) @@ -70914,11 +72318,15 @@ object.removedAdditionalPodRangesConfig = $root.google.container.v1beta1.AdditionalPodRangesConfig.toObject(message.removedAdditionalPodRangesConfig, options); if (message.enableK8sBetaApis != null && message.hasOwnProperty("enableK8sBetaApis")) object.enableK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.enableK8sBetaApis, options); + if (message.desiredSecurityPostureConfig != null && message.hasOwnProperty("desiredSecurityPostureConfig")) + object.desiredSecurityPostureConfig = $root.google.container.v1beta1.SecurityPostureConfig.toObject(message.desiredSecurityPostureConfig, options); if (message.desiredEnableFqdnNetworkPolicy != null && message.hasOwnProperty("desiredEnableFqdnNetworkPolicy")) { object.desiredEnableFqdnNetworkPolicy = message.desiredEnableFqdnNetworkPolicy; if (options.oneofs) object._desiredEnableFqdnNetworkPolicy = "desiredEnableFqdnNetworkPolicy"; } + if (message.desiredAutopilotWorkloadPolicyConfig != null && message.hasOwnProperty("desiredAutopilotWorkloadPolicyConfig")) + object.desiredAutopilotWorkloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.toObject(message.desiredAutopilotWorkloadPolicyConfig, options); if (message.desiredK8sBetaApis != null && message.hasOwnProperty("desiredK8sBetaApis")) object.desiredK8sBetaApis = $root.google.container.v1beta1.K8sBetaAPIConfig.toObject(message.desiredK8sBetaApis, options); return object; @@ -90174,6 +91582,7 @@ * @property {string|null} [gpuPartitionSize] AcceleratorConfig gpuPartitionSize * @property {number|Long|null} [maxTimeSharedClientsPerGpu] AcceleratorConfig maxTimeSharedClientsPerGpu * @property {google.container.v1beta1.IGPUSharingConfig|null} [gpuSharingConfig] AcceleratorConfig gpuSharingConfig + * @property {google.container.v1beta1.IGPUDriverInstallationConfig|null} [gpuDriverInstallationConfig] AcceleratorConfig gpuDriverInstallationConfig */ /** @@ -90231,6 +91640,14 @@ */ AcceleratorConfig.prototype.gpuSharingConfig = null; + /** + * AcceleratorConfig gpuDriverInstallationConfig. + * @member {google.container.v1beta1.IGPUDriverInstallationConfig|null|undefined} gpuDriverInstallationConfig + * @memberof google.container.v1beta1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.gpuDriverInstallationConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -90245,6 +91662,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * AcceleratorConfig _gpuDriverInstallationConfig. + * @member {"gpuDriverInstallationConfig"|undefined} _gpuDriverInstallationConfig + * @memberof google.container.v1beta1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_gpuDriverInstallationConfig", { + get: $util.oneOfGetter($oneOfFields = ["gpuDriverInstallationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new AcceleratorConfig instance using the specified properties. * @function create @@ -90279,6 +91707,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxTimeSharedClientsPerGpu); if (message.gpuSharingConfig != null && Object.hasOwnProperty.call(message, "gpuSharingConfig")) $root.google.container.v1beta1.GPUSharingConfig.encode(message.gpuSharingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gpuDriverInstallationConfig != null && Object.hasOwnProperty.call(message, "gpuDriverInstallationConfig")) + $root.google.container.v1beta1.GPUDriverInstallationConfig.encode(message.gpuDriverInstallationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -90333,6 +91763,10 @@ message.gpuSharingConfig = $root.google.container.v1beta1.GPUSharingConfig.decode(reader, reader.uint32()); break; } + case 6: { + message.gpuDriverInstallationConfig = $root.google.container.v1beta1.GPUDriverInstallationConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -90389,6 +91823,14 @@ return "gpuSharingConfig." + error; } } + if (message.gpuDriverInstallationConfig != null && message.hasOwnProperty("gpuDriverInstallationConfig")) { + properties._gpuDriverInstallationConfig = 1; + { + var error = $root.google.container.v1beta1.GPUDriverInstallationConfig.verify(message.gpuDriverInstallationConfig); + if (error) + return "gpuDriverInstallationConfig." + error; + } + } return null; }; @@ -90431,6 +91873,11 @@ throw TypeError(".google.container.v1beta1.AcceleratorConfig.gpuSharingConfig: object expected"); message.gpuSharingConfig = $root.google.container.v1beta1.GPUSharingConfig.fromObject(object.gpuSharingConfig); } + if (object.gpuDriverInstallationConfig != null) { + if (typeof object.gpuDriverInstallationConfig !== "object") + throw TypeError(".google.container.v1beta1.AcceleratorConfig.gpuDriverInstallationConfig: object expected"); + message.gpuDriverInstallationConfig = $root.google.container.v1beta1.GPUDriverInstallationConfig.fromObject(object.gpuDriverInstallationConfig); + } return message; }; @@ -90480,6 +91927,11 @@ if (options.oneofs) object._gpuSharingConfig = "gpuSharingConfig"; } + if (message.gpuDriverInstallationConfig != null && message.hasOwnProperty("gpuDriverInstallationConfig")) { + object.gpuDriverInstallationConfig = $root.google.container.v1beta1.GPUDriverInstallationConfig.toObject(message.gpuDriverInstallationConfig, options); + if (options.oneofs) + object._gpuDriverInstallationConfig = "gpuDriverInstallationConfig"; + } return object; }; @@ -90804,6 +92256,274 @@ return GPUSharingConfig; })(); + v1beta1.GPUDriverInstallationConfig = (function() { + + /** + * Properties of a GPUDriverInstallationConfig. + * @memberof google.container.v1beta1 + * @interface IGPUDriverInstallationConfig + * @property {google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|null} [gpuDriverVersion] GPUDriverInstallationConfig gpuDriverVersion + */ + + /** + * Constructs a new GPUDriverInstallationConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents a GPUDriverInstallationConfig. + * @implements IGPUDriverInstallationConfig + * @constructor + * @param {google.container.v1beta1.IGPUDriverInstallationConfig=} [properties] Properties to set + */ + function GPUDriverInstallationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GPUDriverInstallationConfig gpuDriverVersion. + * @member {google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion|null|undefined} gpuDriverVersion + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @instance + */ + GPUDriverInstallationConfig.prototype.gpuDriverVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GPUDriverInstallationConfig _gpuDriverVersion. + * @member {"gpuDriverVersion"|undefined} _gpuDriverVersion + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @instance + */ + Object.defineProperty(GPUDriverInstallationConfig.prototype, "_gpuDriverVersion", { + get: $util.oneOfGetter($oneOfFields = ["gpuDriverVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GPUDriverInstallationConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1beta1.IGPUDriverInstallationConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.GPUDriverInstallationConfig} GPUDriverInstallationConfig instance + */ + GPUDriverInstallationConfig.create = function create(properties) { + return new GPUDriverInstallationConfig(properties); + }; + + /** + * Encodes the specified GPUDriverInstallationConfig message. Does not implicitly {@link google.container.v1beta1.GPUDriverInstallationConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1beta1.IGPUDriverInstallationConfig} message GPUDriverInstallationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GPUDriverInstallationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gpuDriverVersion != null && Object.hasOwnProperty.call(message, "gpuDriverVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gpuDriverVersion); + return writer; + }; + + /** + * Encodes the specified GPUDriverInstallationConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.GPUDriverInstallationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1beta1.IGPUDriverInstallationConfig} message GPUDriverInstallationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GPUDriverInstallationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GPUDriverInstallationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.GPUDriverInstallationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gpuDriverVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GPUDriverInstallationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GPUDriverInstallationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GPUDriverInstallationConfig message. + * @function verify + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GPUDriverInstallationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gpuDriverVersion != null && message.hasOwnProperty("gpuDriverVersion")) { + properties._gpuDriverVersion = 1; + switch (message.gpuDriverVersion) { + default: + return "gpuDriverVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a GPUDriverInstallationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.GPUDriverInstallationConfig} GPUDriverInstallationConfig + */ + GPUDriverInstallationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.GPUDriverInstallationConfig) + return object; + var message = new $root.google.container.v1beta1.GPUDriverInstallationConfig(); + switch (object.gpuDriverVersion) { + default: + if (typeof object.gpuDriverVersion === "number") { + message.gpuDriverVersion = object.gpuDriverVersion; + break; + } + break; + case "GPU_DRIVER_VERSION_UNSPECIFIED": + case 0: + message.gpuDriverVersion = 0; + break; + case "INSTALLATION_DISABLED": + case 1: + message.gpuDriverVersion = 1; + break; + case "DEFAULT": + case 2: + message.gpuDriverVersion = 2; + break; + case "LATEST": + case 3: + message.gpuDriverVersion = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GPUDriverInstallationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {google.container.v1beta1.GPUDriverInstallationConfig} message GPUDriverInstallationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GPUDriverInstallationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gpuDriverVersion != null && message.hasOwnProperty("gpuDriverVersion")) { + object.gpuDriverVersion = options.enums === String ? $root.google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion[message.gpuDriverVersion] === undefined ? message.gpuDriverVersion : $root.google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion[message.gpuDriverVersion] : message.gpuDriverVersion; + if (options.oneofs) + object._gpuDriverVersion = "gpuDriverVersion"; + } + return object; + }; + + /** + * Converts this GPUDriverInstallationConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @instance + * @returns {Object.} JSON object + */ + GPUDriverInstallationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GPUDriverInstallationConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.GPUDriverInstallationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GPUDriverInstallationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.GPUDriverInstallationConfig"; + }; + + /** + * GPUDriverVersion enum. + * @name google.container.v1beta1.GPUDriverInstallationConfig.GPUDriverVersion + * @enum {number} + * @property {number} GPU_DRIVER_VERSION_UNSPECIFIED=0 GPU_DRIVER_VERSION_UNSPECIFIED value + * @property {number} INSTALLATION_DISABLED=1 INSTALLATION_DISABLED value + * @property {number} DEFAULT=2 DEFAULT value + * @property {number} LATEST=3 LATEST value + */ + GPUDriverInstallationConfig.GPUDriverVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GPU_DRIVER_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLATION_DISABLED"] = 1; + values[valuesById[2] = "DEFAULT"] = 2; + values[valuesById[3] = "LATEST"] = 3; + return values; + })(); + + return GPUDriverInstallationConfig; + })(); + v1beta1.ManagedPrometheusConfig = (function() { /** @@ -102157,6 +103877,7 @@ * @memberof google.container.v1beta1 * @interface IAutopilot * @property {boolean|null} [enabled] Autopilot enabled + * @property {google.container.v1beta1.IWorkloadPolicyConfig|null} [workloadPolicyConfig] Autopilot workloadPolicyConfig */ /** @@ -102182,6 +103903,14 @@ */ Autopilot.prototype.enabled = false; + /** + * Autopilot workloadPolicyConfig. + * @member {google.container.v1beta1.IWorkloadPolicyConfig|null|undefined} workloadPolicyConfig + * @memberof google.container.v1beta1.Autopilot + * @instance + */ + Autopilot.prototype.workloadPolicyConfig = null; + /** * Creates a new Autopilot instance using the specified properties. * @function create @@ -102208,6 +103937,8 @@ writer = $Writer.create(); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.workloadPolicyConfig != null && Object.hasOwnProperty.call(message, "workloadPolicyConfig")) + $root.google.container.v1beta1.WorkloadPolicyConfig.encode(message.workloadPolicyConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -102246,6 +103977,10 @@ message.enabled = reader.bool(); break; } + case 2: { + message.workloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -102284,6 +104019,11 @@ if (message.enabled != null && message.hasOwnProperty("enabled")) if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; + if (message.workloadPolicyConfig != null && message.hasOwnProperty("workloadPolicyConfig")) { + var error = $root.google.container.v1beta1.WorkloadPolicyConfig.verify(message.workloadPolicyConfig); + if (error) + return "workloadPolicyConfig." + error; + } return null; }; @@ -102301,6 +104041,11 @@ var message = new $root.google.container.v1beta1.Autopilot(); if (object.enabled != null) message.enabled = Boolean(object.enabled); + if (object.workloadPolicyConfig != null) { + if (typeof object.workloadPolicyConfig !== "object") + throw TypeError(".google.container.v1beta1.Autopilot.workloadPolicyConfig: object expected"); + message.workloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.fromObject(object.workloadPolicyConfig); + } return message; }; @@ -102317,10 +104062,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.enabled = false; + object.workloadPolicyConfig = null; + } if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; + if (message.workloadPolicyConfig != null && message.hasOwnProperty("workloadPolicyConfig")) + object.workloadPolicyConfig = $root.google.container.v1beta1.WorkloadPolicyConfig.toObject(message.workloadPolicyConfig, options); return object; }; @@ -102353,6 +104102,227 @@ return Autopilot; })(); + v1beta1.WorkloadPolicyConfig = (function() { + + /** + * Properties of a WorkloadPolicyConfig. + * @memberof google.container.v1beta1 + * @interface IWorkloadPolicyConfig + * @property {boolean|null} [allowNetAdmin] WorkloadPolicyConfig allowNetAdmin + */ + + /** + * Constructs a new WorkloadPolicyConfig. + * @memberof google.container.v1beta1 + * @classdesc Represents a WorkloadPolicyConfig. + * @implements IWorkloadPolicyConfig + * @constructor + * @param {google.container.v1beta1.IWorkloadPolicyConfig=} [properties] Properties to set + */ + function WorkloadPolicyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkloadPolicyConfig allowNetAdmin. + * @member {boolean|null|undefined} allowNetAdmin + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @instance + */ + WorkloadPolicyConfig.prototype.allowNetAdmin = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WorkloadPolicyConfig _allowNetAdmin. + * @member {"allowNetAdmin"|undefined} _allowNetAdmin + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @instance + */ + Object.defineProperty(WorkloadPolicyConfig.prototype, "_allowNetAdmin", { + get: $util.oneOfGetter($oneOfFields = ["allowNetAdmin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkloadPolicyConfig instance using the specified properties. + * @function create + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {google.container.v1beta1.IWorkloadPolicyConfig=} [properties] Properties to set + * @returns {google.container.v1beta1.WorkloadPolicyConfig} WorkloadPolicyConfig instance + */ + WorkloadPolicyConfig.create = function create(properties) { + return new WorkloadPolicyConfig(properties); + }; + + /** + * Encodes the specified WorkloadPolicyConfig message. Does not implicitly {@link google.container.v1beta1.WorkloadPolicyConfig.verify|verify} messages. + * @function encode + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {google.container.v1beta1.IWorkloadPolicyConfig} message WorkloadPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadPolicyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowNetAdmin != null && Object.hasOwnProperty.call(message, "allowNetAdmin")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowNetAdmin); + return writer; + }; + + /** + * Encodes the specified WorkloadPolicyConfig message, length delimited. Does not implicitly {@link google.container.v1beta1.WorkloadPolicyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {google.container.v1beta1.IWorkloadPolicyConfig} message WorkloadPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadPolicyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.container.v1beta1.WorkloadPolicyConfig} WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadPolicyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.container.v1beta1.WorkloadPolicyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.allowNetAdmin = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkloadPolicyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.container.v1beta1.WorkloadPolicyConfig} WorkloadPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadPolicyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkloadPolicyConfig message. + * @function verify + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkloadPolicyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allowNetAdmin != null && message.hasOwnProperty("allowNetAdmin")) { + properties._allowNetAdmin = 1; + if (typeof message.allowNetAdmin !== "boolean") + return "allowNetAdmin: boolean expected"; + } + return null; + }; + + /** + * Creates a WorkloadPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.container.v1beta1.WorkloadPolicyConfig} WorkloadPolicyConfig + */ + WorkloadPolicyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.container.v1beta1.WorkloadPolicyConfig) + return object; + var message = new $root.google.container.v1beta1.WorkloadPolicyConfig(); + if (object.allowNetAdmin != null) + message.allowNetAdmin = Boolean(object.allowNetAdmin); + return message; + }; + + /** + * Creates a plain object from a WorkloadPolicyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {google.container.v1beta1.WorkloadPolicyConfig} message WorkloadPolicyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkloadPolicyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allowNetAdmin != null && message.hasOwnProperty("allowNetAdmin")) { + object.allowNetAdmin = message.allowNetAdmin; + if (options.oneofs) + object._allowNetAdmin = "allowNetAdmin"; + } + return object; + }; + + /** + * Converts this WorkloadPolicyConfig to JSON. + * @function toJSON + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @instance + * @returns {Object.} JSON object + */ + WorkloadPolicyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkloadPolicyConfig + * @function getTypeUrl + * @memberof google.container.v1beta1.WorkloadPolicyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkloadPolicyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.container.v1beta1.WorkloadPolicyConfig"; + }; + + return WorkloadPolicyConfig; + })(); + v1beta1.NotificationConfig = (function() { /** diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index a512f07fbca3..ffe00e3a904c 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -2083,6 +2083,10 @@ "type": "Fleet", "id": 140 }, + "securityPostureConfig": { + "type": "SecurityPostureConfig", + "id": 145 + }, "enableK8sBetaApis": { "type": "K8sBetaAPIConfig", "id": 143 @@ -2111,6 +2115,52 @@ } } }, + "SecurityPostureConfig": { + "oneofs": { + "_mode": { + "oneof": [ + "mode" + ] + }, + "_vulnerabilityMode": { + "oneof": [ + "vulnerabilityMode" + ] + } + }, + "fields": { + "mode": { + "type": "Mode", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "vulnerabilityMode": { + "type": "VulnerabilityMode", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "BASIC": 2 + } + }, + "VulnerabilityMode": { + "values": { + "VULNERABILITY_MODE_UNSPECIFIED": 0, + "VULNERABILITY_DISABLED": 1, + "VULNERABILITY_BASIC": 2 + } + } + } + }, "NodePoolAutoConfig": { "fields": { "networkTags": { @@ -2333,6 +2383,10 @@ "type": "K8sBetaAPIConfig", "id": 122 }, + "desiredSecurityPostureConfig": { + "type": "SecurityPostureConfig", + "id": 124 + }, "desiredEnableFqdnNetworkPolicy": { "type": "bool", "id": 126, @@ -2340,6 +2394,10 @@ "proto3_optional": true } }, + "desiredAutopilotWorkloadPolicyConfig": { + "type": "WorkloadPolicyConfig", + "id": 128 + }, "desiredK8sBetaApis": { "type": "K8sBetaAPIConfig", "id": 131 @@ -4245,6 +4303,11 @@ "oneof": [ "gpuSharingConfig" ] + }, + "_gpuDriverInstallationConfig": { + "oneof": [ + "gpuDriverInstallationConfig" + ] } }, "fields": { @@ -4266,6 +4329,13 @@ "options": { "proto3_optional": true } + }, + "gpuDriverInstallationConfig": { + "type": "GPUDriverInstallationConfig", + "id": 6, + "options": { + "proto3_optional": true + } } } }, @@ -4299,6 +4369,34 @@ } } }, + "GPUDriverInstallationConfig": { + "oneofs": { + "_gpuDriverVersion": { + "oneof": [ + "gpuDriverVersion" + ] + } + }, + "fields": { + "gpuDriverVersion": { + "type": "GPUDriverVersion", + "id": 1, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "GPUDriverVersion": { + "values": { + "GPU_DRIVER_VERSION_UNSPECIFIED": 0, + "INSTALLATION_DISABLED": 1, + "DEFAULT": 2, + "LATEST": 3 + } + } + } + }, "WorkloadMetadataConfig": { "fields": { "mode": { @@ -5121,6 +5219,28 @@ "enabled": { "type": "bool", "id": 1 + }, + "workloadPolicyConfig": { + "type": "WorkloadPolicyConfig", + "id": 2 + } + } + }, + "WorkloadPolicyConfig": { + "oneofs": { + "_allowNetAdmin": { + "oneof": [ + "allowNetAdmin" + ] + } + }, + "fields": { + "allowNetAdmin": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } } } }, @@ -7529,6 +7649,10 @@ "fleet": { "type": "Fleet", "id": 140 + }, + "securityPostureConfig": { + "type": "SecurityPostureConfig", + "id": 145 } }, "nested": { @@ -7630,6 +7754,52 @@ } } }, + "SecurityPostureConfig": { + "oneofs": { + "_mode": { + "oneof": [ + "mode" + ] + }, + "_vulnerabilityMode": { + "oneof": [ + "vulnerabilityMode" + ] + } + }, + "fields": { + "mode": { + "type": "Mode", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "vulnerabilityMode": { + "type": "VulnerabilityMode", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "BASIC": 2 + } + }, + "VulnerabilityMode": { + "values": { + "VULNERABILITY_MODE_UNSPECIFIED": 0, + "VULNERABILITY_DISABLED": 1, + "VULNERABILITY_BASIC": 2 + } + } + } + }, "NodePoolDefaults": { "fields": { "nodeConfigDefaults": { @@ -7888,6 +8058,10 @@ "type": "K8sBetaAPIConfig", "id": 122 }, + "desiredSecurityPostureConfig": { + "type": "SecurityPostureConfig", + "id": 124 + }, "desiredEnableFqdnNetworkPolicy": { "type": "bool", "id": 126, @@ -7895,6 +8069,10 @@ "proto3_optional": true } }, + "desiredAutopilotWorkloadPolicyConfig": { + "type": "WorkloadPolicyConfig", + "id": 128 + }, "desiredK8sBetaApis": { "type": "K8sBetaAPIConfig", "id": 131 @@ -9944,6 +10122,11 @@ "oneof": [ "gpuSharingConfig" ] + }, + "_gpuDriverInstallationConfig": { + "oneof": [ + "gpuDriverInstallationConfig" + ] } }, "fields": { @@ -9972,6 +10155,13 @@ "options": { "proto3_optional": true } + }, + "gpuDriverInstallationConfig": { + "type": "GPUDriverInstallationConfig", + "id": 6, + "options": { + "proto3_optional": true + } } } }, @@ -10005,6 +10195,34 @@ } } }, + "GPUDriverInstallationConfig": { + "oneofs": { + "_gpuDriverVersion": { + "oneof": [ + "gpuDriverVersion" + ] + } + }, + "fields": { + "gpuDriverVersion": { + "type": "GPUDriverVersion", + "id": 1, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "GPUDriverVersion": { + "values": { + "GPU_DRIVER_VERSION_UNSPECIFIED": 0, + "INSTALLATION_DISABLED": 1, + "DEFAULT": 2, + "LATEST": 3 + } + } + } + }, "ManagedPrometheusConfig": { "fields": { "enabled": { @@ -10790,6 +11008,28 @@ "enabled": { "type": "bool", "id": 1 + }, + "workloadPolicyConfig": { + "type": "WorkloadPolicyConfig", + "id": 2 + } + } + }, + "WorkloadPolicyConfig": { + "oneofs": { + "_allowNetAdmin": { + "oneof": [ + "allowNetAdmin" + ] + } + }, + "fields": { + "allowNetAdmin": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } } } }, From ff77356ca2ccc8f18f9c27e493b76846d963eb19 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 19:30:13 +0000 Subject: [PATCH 39/46] docs: [gkebackup] minor documentation fixes (#4329) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 538564373 Source-Link: https://togithub.com/googleapis/googleapis/commit/477cf967cc10f831ab017a594e06949d0aa914ba Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/51fbcf5f64fd2f1b8eee7f426da712e98cc7d960 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZWJhY2t1cC8uT3dsQm90LnlhbWwiLCJoIjoiNTFmYmNmNWY2NGZkMmYxYjhlZWU3ZjQyNmRhNzEyZTk4Y2M3ZDk2MCJ9 --- packages/google-cloud-gkebackup/README.md | 55 +- .../google/cloud/gkebackup/v1/backup.proto | 107 ++- .../cloud/gkebackup/v1/backup_plan.proto | 39 +- .../google/cloud/gkebackup/v1/common.proto | 8 +- .../google/cloud/gkebackup/v1/gkebackup.proto | 178 ++-- .../google/cloud/gkebackup/v1/restore.proto | 101 ++- .../cloud/gkebackup/v1/restore_plan.proto | 32 +- .../google/cloud/gkebackup/v1/volume.proto | 63 +- .../google-cloud-gkebackup/samples/README.md | 18 - .../v1/backup_for_g_k_e.create_backup.js | 2 +- .../v1/backup_for_g_k_e.create_backup_plan.js | 2 +- .../v1/backup_for_g_k_e.create_restore.js | 2 +- .../backup_for_g_k_e.create_restore_plan.js | 2 +- .../v1/backup_for_g_k_e.delete_backup.js | 6 +- .../v1/backup_for_g_k_e.delete_backup_plan.js | 6 +- .../v1/backup_for_g_k_e.delete_restore.js | 6 +- .../backup_for_g_k_e.delete_restore_plan.js | 6 +- .../v1/backup_for_g_k_e.get_backup.js | 2 +- .../v1/backup_for_g_k_e.get_backup_plan.js | 2 +- .../v1/backup_for_g_k_e.get_restore.js | 2 +- .../v1/backup_for_g_k_e.get_restore_plan.js | 2 +- .../v1/backup_for_g_k_e.get_volume_backup.js | 2 +- .../v1/backup_for_g_k_e.get_volume_restore.js | 2 +- .../v1/backup_for_g_k_e.list_backup_plans.js | 2 +- .../v1/backup_for_g_k_e.list_backups.js | 2 +- .../v1/backup_for_g_k_e.list_restore_plans.js | 2 +- .../v1/backup_for_g_k_e.list_restores.js | 2 +- .../backup_for_g_k_e.list_volume_backups.js | 2 +- .../backup_for_g_k_e.list_volume_restores.js | 2 +- .../v1/backup_for_g_k_e.update_backup.js | 4 +- .../v1/backup_for_g_k_e.update_backup_plan.js | 4 +- .../v1/backup_for_g_k_e.update_restore.js | 4 +- .../backup_for_g_k_e.update_restore_plan.js | 4 +- ...et_metadata.google.cloud.gkebackup.v1.json | 2 +- .../src/v1/backup_for_g_k_e_client.ts | 505 ++++++++++- .../test/gapic_backup_for_g_k_e_v1.ts | 835 +++++++++++++++++- 36 files changed, 1667 insertions(+), 348 deletions(-) diff --git a/packages/google-cloud-gkebackup/README.md b/packages/google-cloud-gkebackup/README.md index 7d1830935260..876fba93f345 100644 --- a/packages/google-cloud-gkebackup/README.md +++ b/packages/google-cloud-gkebackup/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Backup for GKE API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Backup for GKE API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkebackup) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/gke-backup.svg)](https://www.npmjs.org/package/@google-cloud/gke-backup) @@ -58,36 +58,35 @@ npm install @google-cloud/gke-backup ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkebackup/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Backup_for_g_k_e.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js,samples/README.md) | -| Backup_for_g_k_e.create_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js,samples/README.md) | -| Backup_for_g_k_e.create_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js,samples/README.md) | -| Backup_for_g_k_e.create_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js,samples/README.md) | -| Backup_for_g_k_e.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js,samples/README.md) | -| Backup_for_g_k_e.delete_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js,samples/README.md) | -| Backup_for_g_k_e.delete_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js,samples/README.md) | -| Backup_for_g_k_e.delete_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js,samples/README.md) | -| Backup_for_g_k_e.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js,samples/README.md) | -| Backup_for_g_k_e.get_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js,samples/README.md) | -| Backup_for_g_k_e.get_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js,samples/README.md) | -| Backup_for_g_k_e.get_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js,samples/README.md) | -| Backup_for_g_k_e.get_volume_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js,samples/README.md) | -| Backup_for_g_k_e.get_volume_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js,samples/README.md) | -| Backup_for_g_k_e.list_backup_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js,samples/README.md) | -| Backup_for_g_k_e.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js,samples/README.md) | -| Backup_for_g_k_e.list_restore_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js,samples/README.md) | -| Backup_for_g_k_e.list_restores | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js,samples/README.md) | -| Backup_for_g_k_e.list_volume_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js,samples/README.md) | -| Backup_for_g_k_e.list_volume_restores | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js,samples/README.md) | -| Backup_for_g_k_e.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js,samples/README.md) | -| Backup_for_g_k_e.update_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js,samples/README.md) | -| Backup_for_g_k_e.update_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js,samples/README.md) | -| Backup_for_g_k_e.update_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/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-gkebackup/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/test/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-gkebackup/samples/test/quickstart.js,samples/README.md) | +| Backup_for_g_k_e.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.create_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.create_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.create_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.delete_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.delete_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.delete_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_volume_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.get_volume_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_backup_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_restore_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_restores | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_volume_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.list_volume_restores | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.update_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.update_restore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js,packages/google-cloud-gkebackup/samples/README.md) | +| Backup_for_g_k_e.update_restore_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js) | [![Open in Cloud 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-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js,packages/google-cloud-gkebackup/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/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-gkebackup/samples/quickstart.js,packages/google-cloud-gkebackup/samples/README.md) | diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto index 635689d76343..88a95493ada8 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -45,8 +45,8 @@ message Backup { // The source cluster from which this Backup was created. // Valid formats: // - // - projects/*/locations/*/clusters/* - // - projects/*/zones/*/clusters/* + // - `projects/*/locations/*/clusters/*` + // - `projects/*/zones/*/clusters/*` // // This is inherited from the parent BackupPlan's // [cluster][google.cloud.gkebackup.v1.BackupPlan.cluster] field. @@ -93,7 +93,7 @@ message Backup { } // Output only. The fully qualified name of the Backup. - // projects/*/locations/*/backupPlans/*/backups/* + // `projects/*/locations/*/backupPlans/*/backups/*` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -101,14 +101,16 @@ message Backup { string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this Backup resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this Backup resource was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. This flag indicates whether this Backup resource was created manually - // by a user or via a schedule in the BackupPlan. A value of True means that - // the Backup was created manually. + // Output only. This flag indicates whether this Backup resource was created + // manually by a user or via a schedule in the BackupPlan. A value of True + // means that the Backup was created manually. bool manual = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // A set of custom labels supplied by user. @@ -126,80 +128,100 @@ message Backup { // (either at creation time or in a subsequent update). int32 delete_lock_days = 7; - // Output only. The time at which an existing delete lock will expire for this backup - // (calculated from create_time + [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]). - google.protobuf.Timestamp delete_lock_expire_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time at which an existing delete lock will expire for this + // backup (calculated from create_time + + // [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]). + google.protobuf.Timestamp delete_lock_expire_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The age (in days) after which this Backup will be automatically deleted. // Must be an integer value >= 0: // // - If 0, no automatic deletion will occur for this Backup. - // - If not 0, this must be >= [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]. + // - If not 0, this must be >= + // [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days] and + // <= 365. // // Once a Backup is created, this value may only be increased. // // Defaults to the parent BackupPlan's - // [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days] value. + // [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days] + // value. int32 retain_days = 9; - // Output only. The time at which this Backup will be automatically deleted (calculated - // from create_time + [retain_days][google.cloud.gkebackup.v1.Backup.retain_days]). - google.protobuf.Timestamp retain_expire_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time at which this Backup will be automatically deleted + // (calculated from create_time + + // [retain_days][google.cloud.gkebackup.v1.Backup.retain_days]). + google.protobuf.Timestamp retain_expire_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The customer managed encryption key that was used to encrypt the Backup's - // artifacts. Inherited from the parent BackupPlan's - // [encryption_key][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encryption_key] value. + // Output only. The customer managed encryption key that was used to encrypt + // the Backup's artifacts. Inherited from the parent BackupPlan's + // [encryption_key][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encryption_key] + // value. EncryptionKey encryption_key = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Defines the "scope" of the Backup - which namespaced resources in the // cluster were included in the Backup. Inherited from the parent - // BackupPlan's [backup_scope][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.backup_scope] value. + // BackupPlan's + // [backup_scope][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.backup_scope] + // value. oneof backup_scope { // Output only. If True, all namespaces were included in the Backup. bool all_namespaces = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. If set, the list of namespaces that were included in the Backup. - Namespaces selected_namespaces = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. If set, the list of namespaces that were included in the + // Backup. + Namespaces selected_namespaces = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. If set, the list of ProtectedApplications whose resources were included - // in the Backup. - NamespacedNames selected_applications = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. If set, the list of ProtectedApplications whose resources + // were included in the Backup. + NamespacedNames selected_applications = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; } - // Output only. Whether or not the Backup contains volume data. Controlled by the parent - // BackupPlan's - // [include_volume_data][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_volume_data] value. + // Output only. Whether or not the Backup contains volume data. Controlled by + // the parent BackupPlan's + // [include_volume_data][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_volume_data] + // value. bool contains_volume_data = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the - // parent BackupPlan's - // [include_secrets][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_secrets] value. + // Output only. Whether or not the Backup contains Kubernetes Secrets. + // Controlled by the parent BackupPlan's + // [include_secrets][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_secrets] + // value. bool contains_secrets = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Information about the GKE cluster from which this Backup was created. - ClusterMetadata cluster_metadata = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Information about the GKE cluster from which this Backup was + // created. + ClusterMetadata cluster_metadata = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Current state of the Backup State state = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Human-readable description of why the backup is in the current `state`. + // Output only. Human-readable description of why the backup is in the current + // `state`. string state_reason = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Completion time of the Backup - google.protobuf.Timestamp complete_time = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp complete_time = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The total number of Kubernetes resources included in the Backup. + // Output only. The total number of Kubernetes resources included in the + // Backup. int32 resource_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The total number of volume backups contained in the Backup. int32 volume_count = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The total size of the Backup in bytes = config backup size + sum(volume - // backup sizes) + // Output only. The total size of the Backup in bytes = config backup size + + // sum(volume backup sizes) int64 size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a backup from overwriting each other. + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a backup from overwriting each other. // It is strongly suggested that systems make use of the `etag` in the // read-modify-write cycle to perform backup updates in order to avoid // race conditions: An `etag` is returned in the response to `GetBackup`, @@ -215,5 +237,6 @@ message Backup { int32 pod_count = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The size of the config backup in bytes. - int64 config_backup_size_bytes = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + int64 config_backup_size_bytes = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto index f9579e27d07c..6c30cf18b633 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/backup_plan.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -50,7 +50,7 @@ message BackupPlan { int32 backup_delete_lock_days = 1; // The default maximum age of a Backup created via this BackupPlan. - // This field MUST be an integer value >= 0. + // This field MUST be an integer value >= 0 and <= 365. // If specified, a Backup created under this BackupPlan will be // automatically deleted after its age reaches (create_time + // backup_retain_days). @@ -59,7 +59,12 @@ message BackupPlan { // Updating this field does NOT affect existing Backups under it. Backups // created AFTER a successful update will automatically pick up the new // value. - // NOTE: backup_retain_days must be >= [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days]. + // NOTE: backup_retain_days must be >= + // [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days]. + // If + // [cron_schedule][google.cloud.gkebackup.v1.BackupPlan.Schedule.cron_schedule] + // is defined, then this must be + // <= 360 * the creation interval. // // Default: 0 (no automatic deletion) int32 backup_retain_days = 2; @@ -76,7 +81,10 @@ message BackupPlan { // via this BackupPlan. message Schedule { // A standard [cron](https://wikipedia.com/wiki/cron) string that defines a - // repeating schedule for creating Backups via this BackupPlan. + // repeating schedule for creating Backups via this BackupPlan. If this is + // defined, then + // [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days] + // must also be defined. // // Default (empty): no automatic backup creation will occur. string cron_schedule = 1; @@ -127,7 +135,7 @@ message BackupPlan { } // Output only. The full name of the BackupPlan resource. - // Format: projects/*/locations/*/backupPlans/* + // Format: `projects/*/locations/*/backupPlans/*` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -135,21 +143,22 @@ message BackupPlan { string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this BackupPlan resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this BackupPlan resource was last // updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User specified descriptive string for this BackupPlan. string description = 5; - // Required. Immutable. The source cluster from which Backups will be created via - // this BackupPlan. - // Valid formats: + // Required. Immutable. The source cluster from which Backups will be created + // via this BackupPlan. Valid formats: // - // - projects/*/locations/*/clusters/* - // - projects/*/zones/*/clusters/* + // - `projects/*/locations/*/clusters/*` + // - `projects/*/zones/*/clusters/*` string cluster = 6 [ (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = REQUIRED, @@ -167,9 +176,9 @@ message BackupPlan { // Defines a schedule for automatic Backup creation via this BackupPlan. Schedule backup_schedule = 9; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a backup plan from overwriting each other. - // It is strongly suggested that systems make use of the 'etag' in the + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a backup plan from overwriting each + // other. It is strongly suggested that systems make use of the 'etag' in the // read-modify-write cycle to perform BackupPlan updates in order to avoid // race conditions: An `etag` is returned in the response to `GetBackupPlan`, // and systems are expected to put that etag in the request to diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto index 0656bd281011..7521d2468329 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -51,8 +51,8 @@ message NamespacedNames { // artifacts. message EncryptionKey { // Google Cloud KMS encryption key. Format: - // projects/*/locations/*/keyRings/*/cryptoKeys/* + // `projects/*/locations/*/keyRings/*/cryptoKeys/*` string gcp_kms_encryption_key = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; + type: "cloudkms.googleapis.com/CryptoKey" + }]; } diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto index 795fa2cd9064..2f8375d45647 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/gkebackup.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -26,6 +26,7 @@ import "google/cloud/gkebackup/v1/restore.proto"; import "google/cloud/gkebackup/v1/restore_plan.proto"; import "google/cloud/gkebackup/v1/volume.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -49,10 +50,12 @@ option (google.api.resource_definition) = { // manage backup and restore operations for their GKE clusters. service BackupForGKE { option (google.api.default_host) = "gkebackup.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a new BackupPlan in a given location. - rpc CreateBackupPlan(CreateBackupPlanRequest) returns (google.longrunning.Operation) { + rpc CreateBackupPlan(CreateBackupPlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/backupPlans" body: "backup_plan" @@ -65,7 +68,8 @@ service BackupForGKE { } // Lists BackupPlans in a given location. - rpc ListBackupPlans(ListBackupPlansRequest) returns (ListBackupPlansResponse) { + rpc ListBackupPlans(ListBackupPlansRequest) + returns (ListBackupPlansResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/backupPlans" }; @@ -81,7 +85,8 @@ service BackupForGKE { } // Update a BackupPlan. - rpc UpdateBackupPlan(UpdateBackupPlanRequest) returns (google.longrunning.Operation) { + rpc UpdateBackupPlan(UpdateBackupPlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}" body: "backup_plan" @@ -94,7 +99,8 @@ service BackupForGKE { } // Deletes an existing BackupPlan. - rpc DeleteBackupPlan(DeleteBackupPlanRequest) returns (google.longrunning.Operation) { + rpc DeleteBackupPlan(DeleteBackupPlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/backupPlans/*}" }; @@ -160,7 +166,8 @@ service BackupForGKE { } // Lists the VolumeBackups for a given Backup. - rpc ListVolumeBackups(ListVolumeBackupsRequest) returns (ListVolumeBackupsResponse) { + rpc ListVolumeBackups(ListVolumeBackupsRequest) + returns (ListVolumeBackupsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/backupPlans/*/backups/*}/volumeBackups" }; @@ -176,12 +183,14 @@ service BackupForGKE { } // Creates a new RestorePlan in a given location. - rpc CreateRestorePlan(CreateRestorePlanRequest) returns (google.longrunning.Operation) { + rpc CreateRestorePlan(CreateRestorePlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/restorePlans" body: "restore_plan" }; - option (google.api.method_signature) = "parent,restore_plan,restore_plan_id"; + option (google.api.method_signature) = + "parent,restore_plan,restore_plan_id"; option (google.longrunning.operation_info) = { response_type: "RestorePlan" metadata_type: "OperationMetadata" @@ -189,7 +198,8 @@ service BackupForGKE { } // Lists RestorePlans in a given location. - rpc ListRestorePlans(ListRestorePlansRequest) returns (ListRestorePlansResponse) { + rpc ListRestorePlans(ListRestorePlansRequest) + returns (ListRestorePlansResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/restorePlans" }; @@ -205,7 +215,8 @@ service BackupForGKE { } // Update a RestorePlan. - rpc UpdateRestorePlan(UpdateRestorePlanRequest) returns (google.longrunning.Operation) { + rpc UpdateRestorePlan(UpdateRestorePlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{restore_plan.name=projects/*/locations/*/restorePlans/*}" body: "restore_plan" @@ -218,7 +229,8 @@ service BackupForGKE { } // Deletes an existing RestorePlan. - rpc DeleteRestorePlan(DeleteRestorePlanRequest) returns (google.longrunning.Operation) { + rpc DeleteRestorePlan(DeleteRestorePlanRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/restorePlans/*}" }; @@ -230,7 +242,8 @@ service BackupForGKE { } // Creates a new Restore for the given RestorePlan. - rpc CreateRestore(CreateRestoreRequest) returns (google.longrunning.Operation) { + rpc CreateRestore(CreateRestoreRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*/restorePlans/*}/restores" body: "restore" @@ -259,7 +272,8 @@ service BackupForGKE { } // Update a Restore. - rpc UpdateRestore(UpdateRestoreRequest) returns (google.longrunning.Operation) { + rpc UpdateRestore(UpdateRestoreRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{restore.name=projects/*/locations/*/restorePlans/*/restores/*}" body: "restore" @@ -272,7 +286,8 @@ service BackupForGKE { } // Deletes an existing Restore. - rpc DeleteRestore(DeleteRestoreRequest) returns (google.longrunning.Operation) { + rpc DeleteRestore(DeleteRestoreRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/restorePlans/*/restores/*}" }; @@ -284,7 +299,8 @@ service BackupForGKE { } // Lists the VolumeRestores for a given Restore. - rpc ListVolumeRestores(ListVolumeRestoresRequest) returns (ListVolumeRestoresResponse) { + rpc ListVolumeRestores(ListVolumeRestoresRequest) + returns (ListVolumeRestoresResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/restorePlans/*/restores/*}/volumeRestores" }; @@ -303,10 +319,12 @@ service BackupForGKE { // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -319,8 +337,9 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. @@ -330,7 +349,7 @@ message OperationMetadata { // Request message for CreateBackupPlan. message CreateBackupPlanRequest { // Required. The location within which to create the BackupPlan. - // Format: projects/*/locations/* + // Format: `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -355,7 +374,7 @@ message CreateBackupPlanRequest { // Request message for ListBackupPlans. message ListBackupPlansRequest { // Required. The location that contains the BackupPlans to list. - // Format: projects/*/locations/* + // Format: `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -392,10 +411,10 @@ message ListBackupPlansResponse { repeated BackupPlan backup_plans = 1; // A token which may be sent as - // [page_token][google.cloud.gkebackup.v1.ListBackupPlansRequest.page_token] in a subsequent - // `ListBackupPlans` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. + // [page_token][google.cloud.gkebackup.v1.ListBackupPlansRequest.page_token] + // in a subsequent `ListBackupPlans` call to retrieve the next page of + // results. If this field is omitted or empty, then there are no more results + // to return. string next_page_token = 2; // Locations that could not be reached. @@ -405,7 +424,7 @@ message ListBackupPlansResponse { // Request message for GetBackupPlan. message GetBackupPlanRequest { // Required. Fully qualified BackupPlan name. - // Format: projects/*/locations/*/backupPlans/* + // Format: `projects/*/locations/*/backupPlans/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -416,8 +435,8 @@ message GetBackupPlanRequest { // Request message for UpdateBackupPlan. message UpdateBackupPlanRequest { - // Required. A new version of the BackupPlan resource that contains updated fields. - // This may be sparsely populated if an `update_mask` is provided. + // Required. A new version of the BackupPlan resource that contains updated + // fields. This may be sparsely populated if an `update_mask` is provided. BackupPlan backup_plan = 1 [(google.api.field_behavior) = REQUIRED]; // This is used to specify the fields to be overwritten in the @@ -435,7 +454,7 @@ message UpdateBackupPlanRequest { // Request message for DeleteBackupPlan. message DeleteBackupPlanRequest { // Required. Fully qualified BackupPlan name. - // Format: projects/*/locations/*/backupPlans/* + // Format: `projects/*/locations/*/backupPlans/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -444,15 +463,15 @@ message DeleteBackupPlanRequest { ]; // If provided, this value must match the current value of the - // target BackupPlan's [etag][google.cloud.gkebackup.v1.BackupPlan.etag] field or the request is - // rejected. + // target BackupPlan's [etag][google.cloud.gkebackup.v1.BackupPlan.etag] field + // or the request is rejected. string etag = 2; } // Request message for CreateBackup. message CreateBackupRequest { // Required. The BackupPlan within which to create the Backup. - // Format: projects/*/locations/*/backupPlans/* + // Format: `projects/*/locations/*/backupPlans/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -477,7 +496,7 @@ message CreateBackupRequest { // Request message for ListBackups. message ListBackupsRequest { // Required. The BackupPlan that contains the Backups to list. - // Format: projects/*/locations/*/backupPlans/* + // Format: `projects/*/locations/*/backupPlans/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -513,16 +532,17 @@ message ListBackupsResponse { // The list of Backups matching the given criteria. repeated Backup backups = 1; - // A token which may be sent as [page_token][google.cloud.gkebackup.v1.ListBackupsRequest.page_token] in - // a subsequent `ListBackups` call to retrieve the next page of results. If - // this field is omitted or empty, then there are no more results to return. + // A token which may be sent as + // [page_token][google.cloud.gkebackup.v1.ListBackupsRequest.page_token] in a + // subsequent `ListBackups` call to retrieve the next page of results. If this + // field is omitted or empty, then there are no more results to return. string next_page_token = 2; } // Request message for GetBackup. message GetBackupRequest { // Required. Full name of the Backup resource. - // Format: projects/*/locations/*/backupPlans/*/backups/* + // Format: `projects/*/locations/*/backupPlans/*/backups/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -533,8 +553,8 @@ message GetBackupRequest { // Request message for UpdateBackup. message UpdateBackupRequest { - // Required. A new version of the Backup resource that contains updated fields. - // This may be sparsely populated if an `update_mask` is provided. + // Required. A new version of the Backup resource that contains updated + // fields. This may be sparsely populated if an `update_mask` is provided. Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; // This is used to specify the fields to be overwritten in the @@ -551,7 +571,7 @@ message UpdateBackupRequest { // Request message for DeleteBackup. message DeleteBackupRequest { // Required. Name of the Backup resource. - // Format: projects/*/locations/*/backupPlans/*/backups/* + // Format: `projects/*/locations/*/backupPlans/*/backups/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -560,8 +580,8 @@ message DeleteBackupRequest { ]; // If provided, this value must match the current value of the - // target Backup's [etag][google.cloud.gkebackup.v1.Backup.etag] field or the request is - // rejected. + // target Backup's [etag][google.cloud.gkebackup.v1.Backup.etag] field or the + // request is rejected. string etag = 2; // If set to true, any VolumeBackups below this Backup will also be deleted. @@ -573,7 +593,7 @@ message DeleteBackupRequest { // Request message for ListVolumeBackups. message ListVolumeBackupsRequest { // Required. The Backup that contains the VolumeBackups to list. - // Format: projects/*/locations/*/backupPlans/*/backups/* + // Format: `projects/*/locations/*/backupPlans/*/backups/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -610,17 +630,17 @@ message ListVolumeBackupsResponse { repeated VolumeBackup volume_backups = 1; // A token which may be sent as - // [page_token][google.cloud.gkebackup.v1.ListVolumeBackupsRequest.page_token] in a subsequent - // `ListVolumeBackups` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. + // [page_token][google.cloud.gkebackup.v1.ListVolumeBackupsRequest.page_token] + // in a subsequent `ListVolumeBackups` call to retrieve the next page of + // results. If this field is omitted or empty, then there are no more results + // to return. string next_page_token = 2; } // Request message for GetVolumeBackup. message GetVolumeBackupRequest { // Required. Full name of the VolumeBackup resource. - // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/* + // Format: `projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -632,7 +652,7 @@ message GetVolumeBackupRequest { // Request message for CreateRestorePlan. message CreateRestorePlanRequest { // Required. The location within which to create the RestorePlan. - // Format: projects/*/locations/* + // Format: `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -657,7 +677,7 @@ message CreateRestorePlanRequest { // Request message for ListRestorePlans. message ListRestorePlansRequest { // Required. The location that contains the RestorePlans to list. - // Format: projects/*/locations/* + // Format: `projects/*/locations/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -694,10 +714,10 @@ message ListRestorePlansResponse { repeated RestorePlan restore_plans = 1; // A token which may be sent as - // [page_token][google.cloud.gkebackup.v1.ListRestorePlansRequest.page_token] in a subsequent - // `ListRestorePlans` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. + // [page_token][google.cloud.gkebackup.v1.ListRestorePlansRequest.page_token] + // in a subsequent `ListRestorePlans` call to retrieve the next page of + // results. If this field is omitted or empty, then there are no more results + // to return. string next_page_token = 2; // Locations that could not be reached. @@ -707,7 +727,7 @@ message ListRestorePlansResponse { // Request message for GetRestorePlan. message GetRestorePlanRequest { // Required. Fully qualified RestorePlan name. - // Format: projects/*/locations/*/restorePlans/* + // Format: `projects/*/locations/*/restorePlans/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -718,8 +738,8 @@ message GetRestorePlanRequest { // Request message for UpdateRestorePlan. message UpdateRestorePlanRequest { - // Required. A new version of the RestorePlan resource that contains updated fields. - // This may be sparsely populated if an `update_mask` is provided. + // Required. A new version of the RestorePlan resource that contains updated + // fields. This may be sparsely populated if an `update_mask` is provided. RestorePlan restore_plan = 1 [(google.api.field_behavior) = REQUIRED]; // This is used to specify the fields to be overwritten in the @@ -736,7 +756,7 @@ message UpdateRestorePlanRequest { // Request message for DeleteRestorePlan. message DeleteRestorePlanRequest { // Required. Fully qualified RestorePlan name. - // Format: projects/*/locations/*/restorePlans/* + // Format: `projects/*/locations/*/restorePlans/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -745,8 +765,8 @@ message DeleteRestorePlanRequest { ]; // If provided, this value must match the current value of the - // target RestorePlan's [etag][google.cloud.gkebackup.v1.RestorePlan.etag] field or the request is - // rejected. + // target RestorePlan's [etag][google.cloud.gkebackup.v1.RestorePlan.etag] + // field or the request is rejected. string etag = 2; // If set to true, any Restores below this RestorePlan will also be deleted. @@ -758,7 +778,7 @@ message DeleteRestorePlanRequest { // Request message for CreateRestore. message CreateRestoreRequest { // Required. The RestorePlan within which to create the Restore. - // Format: projects/*/locations/*/restorePlans/* + // Format: `projects/*/locations/*/restorePlans/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -783,7 +803,7 @@ message CreateRestoreRequest { // Request message for ListRestores. message ListRestoresRequest { // Required. The RestorePlan that contains the Restores to list. - // Format: projects/*/locations/*/restorePlans/* + // Format: `projects/*/locations/*/restorePlans/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -819,10 +839,10 @@ message ListRestoresResponse { // The list of Restores matching the given criteria. repeated Restore restores = 1; - // A token which may be sent as [page_token][google.cloud.gkebackup.v1.ListRestoresRequest.page_token] - // in a subsequent `ListRestores` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. + // A token which may be sent as + // [page_token][google.cloud.gkebackup.v1.ListRestoresRequest.page_token] in a + // subsequent `ListRestores` call to retrieve the next page of results. If + // this field is omitted or empty, then there are no more results to return. string next_page_token = 2; // Locations that could not be reached. @@ -832,7 +852,7 @@ message ListRestoresResponse { // Request message for GetRestore. message GetRestoreRequest { // Required. Name of the restore resource. - // Format: projects/*/locations/*/restorePlans/*/restores/* + // Format: `projects/*/locations/*/restorePlans/*/restores/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -843,8 +863,8 @@ message GetRestoreRequest { // Request message for UpdateRestore. message UpdateRestoreRequest { - // Required. A new version of the Restore resource that contains updated fields. - // This may be sparsely populated if an `update_mask` is provided. + // Required. A new version of the Restore resource that contains updated + // fields. This may be sparsely populated if an `update_mask` is provided. Restore restore = 1 [(google.api.field_behavior) = REQUIRED]; // This is used to specify the fields to be overwritten in the @@ -861,7 +881,7 @@ message UpdateRestoreRequest { // Request message for DeleteRestore. message DeleteRestoreRequest { // Required. Full name of the Restore - // Format: projects/*/locations/*/restorePlans/*/restores/* + // Format: `projects/*/locations/*/restorePlans/*/restores/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -870,8 +890,8 @@ message DeleteRestoreRequest { ]; // If provided, this value must match the current value of the - // target Restore's [etag][google.cloud.gkebackup.v1.Restore.etag] field or the request is - // rejected. + // target Restore's [etag][google.cloud.gkebackup.v1.Restore.etag] field or + // the request is rejected. string etag = 2; // If set to true, any VolumeRestores below this restore will also be deleted. @@ -883,7 +903,7 @@ message DeleteRestoreRequest { // Request message for ListVolumeRestores. message ListVolumeRestoresRequest { // Required. The Restore that contains the VolumeRestores to list. - // Format: projects/*/locations/*/restorePlans/*/restores/* + // Format: `projects/*/locations/*/restorePlans/*/restores/*` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -920,17 +940,17 @@ message ListVolumeRestoresResponse { repeated VolumeRestore volume_restores = 1; // A token which may be sent as - // [page_token][google.cloud.gkebackup.v1.ListVolumeRestoresRequest.page_token] in a subsequent - // `ListVolumeRestores` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. + // [page_token][google.cloud.gkebackup.v1.ListVolumeRestoresRequest.page_token] + // in a subsequent `ListVolumeRestores` call to retrieve the next page of + // results. If this field is omitted or empty, then there are no more results + // to return. string next_page_token = 2; } // Request message for GetVolumeRestore. message GetVolumeRestoreRequest { // Required. Full name of the VolumeRestore resource. - // Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/* + // Format: `projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto index 7f97e56c7318..f83b872a47b4 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -63,7 +63,7 @@ message Restore { } // Output only. The full name of the Restore resource. - // Format: projects/*/locations/*/restorePlans/*/restores/* + // Format: `projects/*/locations/*/restorePlans/*/restores/*` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -71,19 +71,23 @@ message Restore { string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this Restore resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this Restore resource was last // updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User specified descriptive string for this Restore. string description = 5; - // Required. Immutable. A reference to the [Backup][google.cloud.gkebackup.v1.Backup] used as the source from which this Restore - // will restore. Note that this Backup must be a sub-resource of the - // RestorePlan's [backup_plan][google.cloud.gkebackup.v1.RestorePlan.backup_plan]. - // Format: projects/*/locations/*/backupPlans/*/backups/*. + // Required. Immutable. A reference to the + // [Backup][google.cloud.gkebackup.v1.Backup] used as the source from which + // this Restore will restore. Note that this Backup must be a sub-resource of + // the RestorePlan's + // [backup_plan][google.cloud.gkebackup.v1.RestorePlan.backup_plan]. Format: + // `projects/*/locations/*/backupPlans/*/backups/*`. string backup = 6 [ (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = REQUIRED, @@ -95,10 +99,11 @@ message Restore { // Output only. The target cluster into which this Restore will restore data. // Valid formats: // - // - projects/*/locations/*/clusters/* - // - projects/*/zones/*/clusters/* + // - `projects/*/locations/*/clusters/*` + // - `projects/*/zones/*/clusters/*` // - // Inherited from parent RestorePlan's [cluster][google.cloud.gkebackup.v1.RestorePlan.cluster] value. + // Inherited from parent RestorePlan's + // [cluster][google.cloud.gkebackup.v1.RestorePlan.cluster] value. string cluster = 7 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -106,7 +111,8 @@ message Restore { } ]; - // Output only. Configuration of the Restore. Inherited from parent RestorePlan's + // Output only. Configuration of the Restore. Inherited from parent + // RestorePlan's // [restore_config][google.cloud.gkebackup.v1.RestorePlan.restore_config]. RestoreConfig restore_config = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -116,27 +122,31 @@ message Restore { // Output only. The current state of the Restore. State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Human-readable description of why the Restore is in its current state. + // Output only. Human-readable description of why the Restore is in its + // current state. string state_reason = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Timestamp of when the restore operation completed. - google.protobuf.Timestamp complete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp complete_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Number of resources restored during the restore execution. - int32 resources_restored_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + int32 resources_restored_count = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Number of resources excluded during the restore execution. - int32 resources_excluded_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + int32 resources_excluded_count = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Number of resources that failed to be restored during the restore - // execution. + // Output only. Number of resources that failed to be restored during the + // restore execution. int32 resources_failed_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Number of volumes restored during the restore execution. int32 volumes_restored_count = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a restore from overwriting each other. + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a restore from overwriting each other. // It is strongly suggested that systems make use of the `etag` in the // read-modify-write cycle to perform restore updates in order to avoid // race conditions: An `etag` is returned in the response to `GetRestore`, @@ -149,22 +159,22 @@ message Restore { // Configuration of a restore. // Next id: 9 message RestoreConfig { - // Defines how volume data should be restored + // Defines how volume data should be restored. enum VolumeDataRestorePolicy { // Unspecified (illegal). VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0; - // For each PVC to be restored, will create a new underlying volume (and PV) + // For each PVC to be restored, create a new underlying volume and PV // from the corresponding VolumeBackup contained within the Backup. RESTORE_VOLUME_DATA_FROM_BACKUP = 1; // For each PVC to be restored, attempt to reuse the original PV contained - // in the Backup (with its original underlying volume). Note that option + // in the Backup (with its original underlying volume). This option // is likely only usable when restoring a workload to its original cluster. REUSE_VOLUME_HANDLE_FROM_BACKUP = 2; - // For each PVC to be restored, PVCs will be created without any particular - // action to restore data. In this case, the normal Kubernetes provisioning + // For each PVC to be restored, create PVC without any particular + // action to restore data. In this case, the normal Kubernetes provisioning // logic would kick in, and this would likely result in either dynamically // provisioning blank PVs or binding to statically provisioned PVs. NO_VOLUME_DATA_RESTORATION = 3; @@ -181,8 +191,8 @@ message RestoreConfig { USE_EXISTING_VERSION = 1; // Delete the existing version before re-creating it from the Backup. - // Note that this is a dangerous option which could cause unintentional - // data loss if used inappropriately - for example, deleting a CRD will + // This is a dangerous option which could cause unintentional + // data loss if used inappropriately. For example, deleting a CRD will // cause Kubernetes to delete all CRs of that type. USE_BACKUP_VERSION = 2; } @@ -224,12 +234,28 @@ message RestoreConfig { string resource_kind = 2; } - // Identifies the cluster-scoped resources to restore from the Backup. + // Defines the scope of cluster-scoped resources to restore. + // + // Some group kinds are not reasonable choices for a restore, and will cause + // an error if selected here. Any scope selection that would restore + // "all valid" resources automatically excludes these group kinds. + // - gkebackup.gke.io/BackupJob + // - gkebackup.gke.io/RestoreJob + // - metrics.k8s.io/NodeMetrics + // - migration.k8s.io/StorageState + // - migration.k8s.io/StorageVersionMigration + // - Node + // - snapshot.storage.k8s.io/VolumeSnapshotContent + // - storage.k8s.io/CSINode + // + // Some group kinds are driven by restore configuration elsewhere, + // and will cause an error if selected here. + // - Namespace + // - PersistentVolume message ClusterResourceRestoreScope { - // A list of "types" of cluster-scoped resources to be restored from the - // Backup. An empty list means that NO cluster-scoped resources will be - // restored. Note that Namespaces and PersistentVolume restoration is - // handled separately and is not governed by this field. + // A list of cluster-scoped resource group kinds to restore from the + // backup. If specified, only the selected resources will be restored. + // Mutually exclusive to any other field in the message. repeated GroupKind selected_group_kinds = 1; } @@ -270,7 +296,7 @@ message RestoreConfig { // value does not match this expression. If this field is NOT specified, // then ALL fields matched by the target_json_path expression will undergo // substitution. Note that an empty (e.g., "", rather than unspecified) - // value for for this field will only match empty fields. + // value for this field will only match empty fields. string original_value_pattern = 4; // This is the new value to set for any fields that pass the filtering and @@ -287,7 +313,8 @@ message RestoreConfig { // Defines the behavior for handling the situation where cluster-scoped // resources being restored already exist in the target cluster. This MUST be // set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if - // [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope] is not empty. + // [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope] + // is not empty. ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; // Defines the behavior for handling the situation where sets of namespaced @@ -302,6 +329,12 @@ message RestoreConfig { // Specifies the namespaced resources to restore from the Backup. // Only one of the entries may be specified. If not specified, NO namespaced // resources will be restored. + // + // Note: Resources will never be restored into *managed* namespaces such as + // `kube-system`, `kube-public`, or `kube-node-lease`. These namespaces + // are silently skipped when + // [all_namespaces][google.cloud.gkebackup.v1.RestoreConfig.all_namespaces] is + // selected. Listing them explicitly will result in an error. oneof namespaced_resource_restore_scope { // Restore all namespaced resources in the Backup if set to "True". // Specifying this field to "False" is an error. diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto index 32bc31b62d84..8102f3570c3e 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/restore_plan.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -39,7 +39,7 @@ message RestorePlan { }; // Output only. The full name of the RestorePlan resource. - // Format: projects/*/locations/*/restorePlans/*. + // Format: `projects/*/locations/*/restorePlans/*`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -48,18 +48,21 @@ message RestorePlan { // Output only. The timestamp when this RestorePlan resource was // created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this RestorePlan resource was last // updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User specified descriptive string for this RestorePlan. string description = 5; - // Required. Immutable. A reference to the [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may be used as the - // source for Restores created via this RestorePlan. - // Format: projects/*/locations/*/backupPlans/*. + // Required. Immutable. A reference to the + // [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may + // be used as the source for Restores created via this RestorePlan. Format: + // `projects/*/locations/*/backupPlans/*`. string backup_plan = 6 [ (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = REQUIRED, @@ -68,13 +71,12 @@ message RestorePlan { } ]; - // Required. Immutable. The target cluster into which Restores created via this RestorePlan - // will restore data. NOTE: the cluster's region must be the same as the - // RestorePlan. - // Valid formats: + // Required. Immutable. The target cluster into which Restores created via + // this RestorePlan will restore data. NOTE: the cluster's region must be the + // same as the RestorePlan. Valid formats: // - // - projects/*/locations/*/clusters/* - // - projects/*/zones/*/clusters/* + // - `projects/*/locations/*/clusters/*` + // - `projects/*/zones/*/clusters/*` string cluster = 7 [ (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = REQUIRED, @@ -89,8 +91,8 @@ message RestorePlan { // A set of custom labels supplied by user. map labels = 9; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a restore from overwriting each other. + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a restore from overwriting each other. // It is strongly suggested that systems make use of the `etag` in the // read-modify-write cycle to perform restore updates in order to avoid // race conditions: An `etag` is returned in the response to `GetRestorePlan`, diff --git a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto index a7914291c361..37c62f2c528b 100644 --- a/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto +++ b/packages/google-cloud-gkebackup/protos/google/cloud/gkebackup/v1/volume.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -79,7 +79,7 @@ message VolumeBackup { } // Output only. The full name of the VolumeBackup resource. - // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*. + // Format: `projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -88,45 +88,50 @@ message VolumeBackup { // Output only. The timestamp when this VolumeBackup resource was // created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this VolumeBackup resource was last // updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A reference to the source Kubernetes PVC from which this VolumeBackup - // was created. + // Output only. A reference to the source Kubernetes PVC from which this + // VolumeBackup was created. NamespacedName source_pvc = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A storage system-specific opaque handle to the underlying volume backup. + // Output only. A storage system-specific opaque handle to the underlying + // volume backup. string volume_backup_handle = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The format used for the volume backup. VolumeBackupFormat format = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The aggregate size of the underlying artifacts associated with this - // VolumeBackup in the backup storage. This may change over time when + // Output only. The aggregate size of the underlying artifacts associated with + // this VolumeBackup in the backup storage. This may change over time when // multiple backups of the same volume share the same backup storage // location. In particular, this is likely to increase in size when // the immediately preceding backup of the same volume is deleted. int64 storage_bytes = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The minimum size of the disk to which this VolumeBackup can be restored. + // Output only. The minimum size of the disk to which this VolumeBackup can be + // restored. int64 disk_size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the associated underlying volume backup // operation completed. - google.protobuf.Timestamp complete_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp complete_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current state of this VolumeBackup. State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A human readable message explaining why the VolumeBackup is in its current - // state. + // Output only. A human readable message explaining why the VolumeBackup is in + // its current state. string state_message = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a volume backup from overwriting each + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a volume backup from overwriting each // other. It is strongly suggested that systems make use of the `etag` in the // read-modify-write cycle to perform volume backup updates in order to avoid // race conditions. @@ -173,7 +178,7 @@ message VolumeRestore { } // Output only. Full name of the VolumeRestore resource. - // Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*. + // Format: `projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server generated global unique identifier of @@ -182,21 +187,24 @@ message VolumeRestore { // Output only. The timestamp when this VolumeRestore resource was // created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when this VolumeRestore resource was last // updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The full name of the VolumeBackup from which the volume will be restored. - // Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*. + // Output only. The full name of the VolumeBackup from which the volume will + // be restored. Format: + // `projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*`. string volume_backup = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The reference to the target Kubernetes PVC to be restored. NamespacedName target_pvc = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A storage system-specific opaque handler to the underlying volume created - // for the target PVC from the volume backup. + // Output only. A storage system-specific opaque handler to the underlying + // volume created for the target PVC from the volume backup. string volume_handle = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The type of volume provisioned @@ -204,17 +212,18 @@ message VolumeRestore { // Output only. The timestamp when the associated underlying volume // restoration completed. - google.protobuf.Timestamp complete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp complete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current state of this VolumeRestore. State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A human readable message explaining why the VolumeRestore is in its - // current state. + // Output only. A human readable message explaining why the VolumeRestore is + // in its current state. string state_message = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. `etag` is used for optimistic concurrency control as a way to help - // prevent simultaneous updates of a volume restore from overwriting each + // Output only. `etag` is used for optimistic concurrency control as a way to + // help prevent simultaneous updates of a volume restore from overwriting each // other. It is strongly suggested that systems make use of the `etag` in the // read-modify-write cycle to perform volume restore updates in order to avoid // race conditions. diff --git a/packages/google-cloud-gkebackup/samples/README.md b/packages/google-cloud-gkebackup/samples/README.md index 22df24931c23..b96406c53673 100644 --- a/packages/google-cloud-gkebackup/samples/README.md +++ b/packages/google-cloud-gkebackup/samples/README.md @@ -37,7 +37,6 @@ * [Backup_for_g_k_e.update_restore](#backup_for_g_k_e.update_restore) * [Backup_for_g_k_e.update_restore_plan](#backup_for_g_k_e.update_restore_plan) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -474,23 +473,6 @@ __Usage:__ `node packages/google-cloud-gkebackup/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkebackup/samples/test/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-gkebackup/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-gkebackup/samples/test/quickstart.js` - - diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js index 2bb6efaeaeea..2fd927baffb7 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The BackupPlan within which to create the Backup. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js index 59accae5572d..a2d2b30919d5 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_backup_plan.js @@ -30,7 +30,7 @@ function main(parent, backupPlan, backupPlanId) { */ /** * Required. The location within which to create the BackupPlan. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js index 1c4b59fe3ab8..4b7c85e214f9 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore.js @@ -30,7 +30,7 @@ function main(parent, restore, restoreId) { */ /** * Required. The RestorePlan within which to create the Restore. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js index 3857a5611ca7..9aedf0eccca0 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.create_restore_plan.js @@ -30,7 +30,7 @@ function main(parent, restorePlan, restorePlanId) { */ /** * Required. The location within which to create the RestorePlan. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js index 911f0e3b68ca..c6e2561ad2e4 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup.js @@ -30,13 +30,13 @@ function main(name) { */ /** * Required. Name of the Backup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` */ // const name = 'abc123' /** * If provided, this value must match the current value of the - * target Backup's etag google.cloud.gkebackup.v1.Backup.etag field or the request is - * rejected. + * target Backup's etag google.cloud.gkebackup.v1.Backup.etag field or the + * request is rejected. */ // const etag = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js index 8a8c0b8142f1..77fa7928e78e 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_backup_plan.js @@ -30,13 +30,13 @@ function main(name) { */ /** * Required. Fully qualified BackupPlan name. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` */ // const name = 'abc123' /** * If provided, this value must match the current value of the - * target BackupPlan's etag google.cloud.gkebackup.v1.BackupPlan.etag field or the request is - * rejected. + * target BackupPlan's etag google.cloud.gkebackup.v1.BackupPlan.etag field + * or the request is rejected. */ // const etag = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js index 487e48d44252..d40ce70f44fe 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore.js @@ -30,13 +30,13 @@ function main(name) { */ /** * Required. Full name of the Restore - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` */ // const name = 'abc123' /** * If provided, this value must match the current value of the - * target Restore's etag google.cloud.gkebackup.v1.Restore.etag field or the request is - * rejected. + * target Restore's etag google.cloud.gkebackup.v1.Restore.etag field or + * the request is rejected. */ // const etag = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js index 75784a998bd5..6bde8df7d837 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.delete_restore_plan.js @@ -30,13 +30,13 @@ function main(name) { */ /** * Required. Fully qualified RestorePlan name. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` */ // const name = 'abc123' /** * If provided, this value must match the current value of the - * target RestorePlan's etag google.cloud.gkebackup.v1.RestorePlan.etag field or the request is - * rejected. + * target RestorePlan's etag google.cloud.gkebackup.v1.RestorePlan.etag + * field or the request is rejected. */ // const etag = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js index 6db15e4bfbaa..e6af6b59405e 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Full name of the Backup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js index 50e69cabd8d9..dc49b190bd5d 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_backup_plan.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Fully qualified BackupPlan name. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js index 8ca8227b8a51..2029130e967b 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Name of the restore resource. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js index 313b2440f7e8..a87d83e5bd68 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_restore_plan.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Fully qualified RestorePlan name. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js index 431506b05463..b3cd5d78a738 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_backup.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Full name of the VolumeBackup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js index b13a77727ff9..545ef9b8f5ee 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.get_volume_restore.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Full name of the VolumeRestore resource. - * Format: projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/*` */ // const name = 'abc123' diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js index f808ca6ced79..e81931bff1d8 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backup_plans.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The location that contains the BackupPlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js index 8df08eb5fe50..90c2a8a7d295 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_backups.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The BackupPlan that contains the Backups to list. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js index cac33ec5e8e3..3163e412a3ee 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restore_plans.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The location that contains the RestorePlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js index b70d32dea7fb..16d1bf0fceb8 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_restores.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The RestorePlan that contains the Restores to list. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js index 01f5aee4eb5e..c7503443c4b9 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_backups.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The Backup that contains the VolumeBackups to list. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js index 221323dfc207..1a27640625db 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.list_volume_restores.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The Restore that contains the VolumeRestores to list. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js index 349d357a9454..a042cccd1800 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup.js @@ -29,8 +29,8 @@ function main(backup) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A new version of the Backup resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the Backup resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. */ // const backup = {} /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js index 045b8bd0d83c..b7556d4835aa 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_backup_plan.js @@ -29,8 +29,8 @@ function main(backupPlan) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A new version of the BackupPlan resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the BackupPlan resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. */ // const backupPlan = {} /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js index f61d1e6646fb..335e0a8f1496 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore.js @@ -29,8 +29,8 @@ function main(restore) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A new version of the Restore resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the Restore resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. */ // const restore = {} /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js index 1be85e274a35..d13113bd6885 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js +++ b/packages/google-cloud-gkebackup/samples/generated/v1/backup_for_g_k_e.update_restore_plan.js @@ -29,8 +29,8 @@ function main(restorePlan) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A new version of the RestorePlan resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the RestorePlan resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. */ // const restorePlan = {} /** diff --git a/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json b/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json index e0676b2b23c0..2d7902ddeffd 100644 --- a/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json +++ b/packages/google-cloud-gkebackup/samples/generated/v1/snippet_metadata.google.cloud.gkebackup.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkebackup", - "version": "0.3.0", + "version": "0.3.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts index 895e3ca9c145..833d94908cb0 100644 --- a/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts +++ b/packages/google-cloud-gkebackup/src/v1/backup_for_g_k_e_client.ts @@ -27,6 +27,10 @@ import type { LROperation, PaginationCallback, GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -62,6 +66,8 @@ export class BackupForGKEClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; backupForGKEStub?: Promise<{[name: string]: Function}>; @@ -159,6 +165,12 @@ export class BackupForGKEClient { 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}`]; @@ -660,7 +672,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Fully qualified BackupPlan name. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -746,7 +758,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Full name of the Backup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -830,7 +842,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Full name of the VolumeBackup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/* /volumeBackups/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -922,7 +934,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Fully qualified RestorePlan name. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1014,7 +1026,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the restore resource. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1100,7 +1112,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Full name of the VolumeRestore resource. - * Format: projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/* /volumeRestores/*` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1193,7 +1205,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location within which to create the BackupPlan. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {google.cloud.gkebackup.v1.BackupPlan} request.backupPlan * Required. The BackupPlan resource object to create. * @param {string} request.backupPlanId @@ -1342,8 +1354,8 @@ export class BackupForGKEClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.gkebackup.v1.BackupPlan} request.backupPlan - * Required. A new version of the BackupPlan resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the BackupPlan resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. * @param {google.protobuf.FieldMask} request.updateMask * This is used to specify the fields to be overwritten in the * BackupPlan targeted for update. The values for each of these @@ -1492,11 +1504,11 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Fully qualified BackupPlan name. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {string} request.etag * If provided, this value must match the current value of the - * target BackupPlan's {@link google.cloud.gkebackup.v1.BackupPlan.etag|etag} field or the request is - * rejected. + * target BackupPlan's {@link google.cloud.gkebackup.v1.BackupPlan.etag|etag} field + * or the request is rejected. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1635,7 +1647,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The BackupPlan within which to create the Backup. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {google.cloud.gkebackup.v1.Backup} request.backup * The Backup resource to create. * @param {string} request.backupId @@ -1784,8 +1796,8 @@ export class BackupForGKEClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.gkebackup.v1.Backup} request.backup - * Required. A new version of the Backup resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the Backup resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. * @param {google.protobuf.FieldMask} request.updateMask * This is used to specify the fields to be overwritten in the * Backup targeted for update. The values for each of these @@ -1933,11 +1945,11 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the Backup resource. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` * @param {string} request.etag * If provided, this value must match the current value of the - * target Backup's {@link google.cloud.gkebackup.v1.Backup.etag|etag} field or the request is - * rejected. + * target Backup's {@link google.cloud.gkebackup.v1.Backup.etag|etag} field or the + * request is rejected. * @param {boolean} request.force * If set to true, any VolumeBackups below this Backup will also be deleted. * Otherwise, the request will only succeed if the Backup has no @@ -2080,7 +2092,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location within which to create the RestorePlan. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {google.cloud.gkebackup.v1.RestorePlan} request.restorePlan * Required. The RestorePlan resource object to create. * @param {string} request.restorePlanId @@ -2229,8 +2241,8 @@ export class BackupForGKEClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.gkebackup.v1.RestorePlan} request.restorePlan - * Required. A new version of the RestorePlan resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the RestorePlan resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. * @param {google.protobuf.FieldMask} request.updateMask * This is used to specify the fields to be overwritten in the * RestorePlan targeted for update. The values for each of these @@ -2378,11 +2390,11 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Fully qualified RestorePlan name. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {string} request.etag * If provided, this value must match the current value of the - * target RestorePlan's {@link google.cloud.gkebackup.v1.RestorePlan.etag|etag} field or the request is - * rejected. + * target RestorePlan's {@link google.cloud.gkebackup.v1.RestorePlan.etag|etag} + * field or the request is rejected. * @param {boolean} request.force * If set to true, any Restores below this RestorePlan will also be deleted. * Otherwise, the request will only succeed if the RestorePlan has no @@ -2525,7 +2537,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The RestorePlan within which to create the Restore. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {google.cloud.gkebackup.v1.Restore} request.restore * Required. The restore resource to create. * @param {string} request.restoreId @@ -2674,8 +2686,8 @@ export class BackupForGKEClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.gkebackup.v1.Restore} request.restore - * Required. A new version of the Restore resource that contains updated fields. - * This may be sparsely populated if an `update_mask` is provided. + * Required. A new version of the Restore resource that contains updated + * fields. This may be sparsely populated if an `update_mask` is provided. * @param {google.protobuf.FieldMask} request.updateMask * This is used to specify the fields to be overwritten in the * Restore targeted for update. The values for each of these @@ -2823,11 +2835,11 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.name * Required. Full name of the Restore - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` * @param {string} request.etag * If provided, this value must match the current value of the - * target Restore's {@link google.cloud.gkebackup.v1.Restore.etag|etag} field or the request is - * rejected. + * target Restore's {@link google.cloud.gkebackup.v1.Restore.etag|etag} field or + * the request is rejected. * @param {boolean} request.force * If set to true, any VolumeRestores below this restore will also be deleted. * Otherwise, the request will only succeed if the restore has no @@ -2970,7 +2982,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the BackupPlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3083,7 +3095,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the BackupPlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3144,7 +3156,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the BackupPlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3204,7 +3216,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The BackupPlan that contains the Backups to list. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3311,7 +3323,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The BackupPlan that contains the Backups to list. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3372,7 +3384,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The BackupPlan that contains the Backups to list. - * Format: projects/* /locations/* /backupPlans/* + * Format: `projects/* /locations/* /backupPlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3432,7 +3444,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Backup that contains the VolumeBackups to list. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3545,7 +3557,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Backup that contains the VolumeBackups to list. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3606,7 +3618,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Backup that contains the VolumeBackups to list. - * Format: projects/* /locations/* /backupPlans/* /backups/* + * Format: `projects/* /locations/* /backupPlans/* /backups/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3666,7 +3678,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the RestorePlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3779,7 +3791,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the RestorePlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3840,7 +3852,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The location that contains the RestorePlans to list. - * Format: projects/* /locations/* + * Format: `projects/* /locations/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -3900,7 +3912,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The RestorePlan that contains the Restores to list. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4007,7 +4019,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The RestorePlan that contains the Restores to list. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4068,7 +4080,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The RestorePlan that contains the Restores to list. - * Format: projects/* /locations/* /restorePlans/* + * Format: `projects/* /locations/* /restorePlans/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4128,7 +4140,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Restore that contains the VolumeRestores to list. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4241,7 +4253,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Restore that contains the VolumeRestores to list. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4302,7 +4314,7 @@ export class BackupForGKEClient { * The request object that will be sent. * @param {string} request.parent * Required. The Restore that contains the VolumeRestores to list. - * Format: projects/* /locations/* /restorePlans/* /restores/* + * Format: `projects/* /locations/* /restorePlans/* /restores/*` * @param {number} request.pageSize * The target number of results to return in a single response. * If not specified, a default value will be chosen by the service. @@ -4355,6 +4367,401 @@ export class BackupForGKEClient { 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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 { + 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * 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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * 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 -- // -------------------- @@ -4817,6 +5224,8 @@ export class BackupForGKEClient { return this.backupForGKEStub.then(stub => { this._terminated = true; stub.close(); + this.iamClient.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts b/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts index 66faf858e8f3..3794e25c098d 100644 --- a/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts +++ b/packages/google-cloud-gkebackup/test/gapic_backup_for_g_k_e_v1.ts @@ -25,7 +25,13 @@ import * as backupforgkeModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +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 @@ -5274,6 +5280,833 @@ describe('v1.BackupForGKEClient', () => { ); }); }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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 backupforgkeModule.v1.BackupForGKEClient({ + 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('backup', () => { From f12063c60a4c8ea05e6269babe2eaa6775974c6f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:18:51 -0700 Subject: [PATCH 40/46] feat: [vmwareengine] Adding private connection CRUD, updating management subnets and time-limited PC features (#4328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Adding private connection CRUD, updating management subnets and time-limited PC features PiperOrigin-RevId: 538382998 Source-Link: https://github.com/googleapis/googleapis/commit/e51050b46b19ddbfc74386942fd5a1f781a912df Source-Link: https://github.com/googleapis/googleapis-gen/commit/3bbb92be95f03a8df4e5747eeec924752392c396 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZtd2FyZWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiM2JiYjkyYmU5NWYwM2E4ZGY0ZTU3NDdlZWVjOTI0NzUyMzkyYzM5NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- packages/google-cloud-vmwareengine/README.md | 77 +- .../cloud/vmwareengine/v1/vmwareengine.proto | 384 +- .../v1/vmwareengine_resources.proto | 243 +- .../protos/protos.d.ts | 1649 +- .../protos/protos.js | 15860 ++++++++++------ .../protos/protos.json | 603 +- .../samples/README.md | 150 +- ...metadata.google.cloud.vmwareengine.v1.json | 374 +- ...vmware_engine.create_private_connection.js | 100 + ...vmware_engine.delete_private_connection.js | 81 + .../vmware_engine.get_private_connection.js | 65 + .../generated/v1/vmware_engine.get_subnet.js | 65 + ....list_private_connection_peering_routes.js | 80 + .../vmware_engine.list_private_connections.js | 113 + ...vmware_engine.update_private_connection.js | 86 + .../v1/vmware_engine.update_subnet.js | 71 + .../src/v1/gapic_metadata.json | 88 + .../src/v1/vmware_engine_client.ts | 3222 +++- .../src/v1/vmware_engine_client_config.json | 40 + .../test/gapic_vmware_engine_v1.ts | 3062 ++- 20 files changed, 18939 insertions(+), 7474 deletions(-) create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js create mode 100644 packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js diff --git a/packages/google-cloud-vmwareengine/README.md b/packages/google-cloud-vmwareengine/README.md index c160f4c5f176..d964703d3917 100644 --- a/packages/google-cloud-vmwareengine/README.md +++ b/packages/google-cloud-vmwareengine/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [VMware Engine API: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [VMware Engine API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/vmwareengine.svg)](https://www.npmjs.org/package/@google-cloud/vmwareengine) @@ -147,43 +147,50 @@ callListVmwareEngineNetworks(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Vmware_engine.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js,samples/README.md) | -| Vmware_engine.create_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js,samples/README.md) | -| Vmware_engine.create_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js,samples/README.md) | -| Vmware_engine.create_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js,samples/README.md) | -| Vmware_engine.create_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js,samples/README.md) | -| Vmware_engine.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js,samples/README.md) | -| Vmware_engine.delete_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js,samples/README.md) | -| Vmware_engine.delete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js,samples/README.md) | -| Vmware_engine.delete_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js,samples/README.md) | -| Vmware_engine.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js,samples/README.md) | -| Vmware_engine.get_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js,samples/README.md) | -| Vmware_engine.get_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js,samples/README.md) | -| Vmware_engine.get_node_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js,samples/README.md) | -| Vmware_engine.get_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js,samples/README.md) | -| Vmware_engine.get_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js,samples/README.md) | -| Vmware_engine.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js,samples/README.md) | -| Vmware_engine.list_hcx_activation_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js,samples/README.md) | -| Vmware_engine.list_network_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js,samples/README.md) | -| Vmware_engine.list_node_types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js,samples/README.md) | -| Vmware_engine.list_private_clouds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js,samples/README.md) | -| Vmware_engine.list_subnets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js,samples/README.md) | -| Vmware_engine.list_vmware_engine_networks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js,samples/README.md) | -| Vmware_engine.reset_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js,samples/README.md) | -| Vmware_engine.reset_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js,samples/README.md) | -| Vmware_engine.show_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js,samples/README.md) | -| Vmware_engine.show_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js,samples/README.md) | -| Vmware_engine.undelete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js,samples/README.md) | -| Vmware_engine.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js,samples/README.md) | -| Vmware_engine.update_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js,samples/README.md) | -| Vmware_engine.update_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js,samples/README.md) | -| Vmware_engine.update_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/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-vmwareengine/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/test/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-vmwareengine/samples/test/quickstart.js,samples/README.md) | +| Vmware_engine.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.create_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.create_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.create_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.create_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.create_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.delete_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.delete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.delete_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.delete_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_node_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_subnet | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.get_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_hcx_activation_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_network_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_node_types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_private_clouds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_private_connection_peering_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_private_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_subnets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.list_vmware_engine_networks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.reset_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.reset_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.show_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.show_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.undelete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_subnet | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Vmware_engine.update_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js) | [![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,packages/google-cloud-vmwareengine/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/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-vmwareengine/samples/quickstart.js,packages/google-cloud-vmwareengine/samples/README.md) | diff --git a/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto index 035c5bd397b5..eef4dcd7da4a 100644 --- a/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto +++ b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/vmwareengine/v1/vmwareengine_resources.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -224,6 +225,32 @@ service VmwareEngine { option (google.api.method_signature) = "parent"; } + // Gets details of a single subnet. + rpc GetSubnet(GetSubnetRequest) returns (Subnet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateClouds/*/subnets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the parameters of a single subnet. Only fields specified in + // `update_mask` are applied. + // + // *Note*: This API is synchronous and always returns a successful + // `google.longrunning.Operation` (LRO). The returned LRO will only have + // `done` and `response` fields. + rpc UpdateSubnet(UpdateSubnetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{subnet.name=projects/*/locations/*/privateClouds/*/subnets/*}" + body: "subnet" + }; + option (google.api.method_signature) = "subnet,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Subnet" + metadata_type: "OperationMetadata" + }; + } + // Lists node types rpc ListNodeTypes(ListNodeTypesRequest) returns (ListNodeTypesResponse) { option (google.api.http) = { @@ -459,6 +486,83 @@ service VmwareEngine { }; option (google.api.method_signature) = "parent"; } + + // Creates a new private connection that can be used for accessing private + // Clouds. + rpc CreatePrivateConnection(CreatePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/privateConnections" + body: "private_connection" + }; + option (google.api.method_signature) = + "parent,private_connection,private_connection_id"; + option (google.longrunning.operation_info) = { + response_type: "PrivateConnection" + metadata_type: "OperationMetadata" + }; + } + + // Retrieves a `PrivateConnection` resource by its resource name. The resource + // contains details of the private connection, such as connected + // network, routing mode and state. + rpc GetPrivateConnection(GetPrivateConnectionRequest) + returns (PrivateConnection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists `PrivateConnection` resources in a given project and location. + rpc ListPrivateConnections(ListPrivateConnectionsRequest) + returns (ListPrivateConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/privateConnections" + }; + option (google.api.method_signature) = "parent"; + } + + // Modifies a `PrivateConnection` resource. Only `description` and + // `routing_mode` fields can be updated. Only fields specified in `updateMask` + // are applied. + rpc UpdatePrivateConnection(UpdatePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{private_connection.name=projects/*/locations/*/privateConnections/*}" + body: "private_connection" + }; + option (google.api.method_signature) = "private_connection,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PrivateConnection" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a `PrivateConnection` resource. When a private connection is + // deleted for a VMware Engine network, the connected network becomes + // inaccessible to that VMware Engine network. + rpc DeletePrivateConnection(DeletePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists the private connection routes exchanged over a peering connection. + rpc ListPrivateConnectionPeeringRoutes( + ListPrivateConnectionPeeringRoutesRequest) + returns (ListPrivateConnectionPeeringRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/privateConnections/*}/peeringRoutes" + }; + option (google.api.method_signature) = "parent"; + } } // Request message for @@ -877,6 +981,41 @@ message ListSubnetsResponse { // 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; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// Request message for +// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet] +message GetSubnetRequest { + // Required. The resource name of the subnet to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/Subnet" + } + ]; +} + +// Request message for +// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet] +message UpdateSubnetRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // `Subnet` resource by the update. + // The fields specified in the `update_mask` are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Subnet description. + Subnet subnet = 2 [(google.api.field_behavior) = REQUIRED]; } // Represents the metadata of the long-running operation. @@ -1631,3 +1770,246 @@ message ListVmwareEngineNetworksResponse { // Unreachable resources. repeated string unreachable = 3; } + +// Request message for +// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection] +message CreatePrivateConnectionRequest { + // Required. The resource name of the location to create the new private + // connection in. Private connection is a regional resource. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. For example: + // `projects/my-project/locations/us-central1` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmwareengine.googleapis.com/PrivateConnection" + } + ]; + + // Required. The user-provided identifier of the new private connection. + // This identifier must be unique among private connection resources + // within the parent and becomes the final token in the name URI. The + // identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string private_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial description of the new private connection. + PrivateConnection private_connection = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection] +message GetPrivateConnectionRequest { + // Required. The resource name of the private connection to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/privateConnections/my-connection` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateConnection" + } + ]; +} + +// Request message for +// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections] +message ListPrivateConnectionsRequest { + // Required. The resource name of the location to query for + // private connections. Resource names are schemeless URIs that follow the + // conventions in https://cloud.google.com/apis/design/resource_names. For + // example: `projects/my-project/locations/us-central1` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmwareengine.googleapis.com/PrivateConnection" + } + ]; + + // The maximum number of private connections to return in one page. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListPrivateConnections` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListPrivateConnections` must match the call that provided the page + // token. + string page_token = 3; + + // A filter expression that matches resources returned in the response. + // The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value + // must be a string, a number, or a boolean. The comparison operator + // must be `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering a list of private connections, you can + // exclude the ones named `example-connection` by specifying + // `name != "example-connection"`. + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "example-connection") + // (createTime > "2022-09-22T08:15:10.40Z") + // ``` + // + // By default, each expression is an `AND` expression. However, you + // can include `AND` and `OR` expressions explicitly. + // For example: + // ``` + // (name = "example-connection-1") AND + // (createTime > "2021-04-12T08:15:10.40Z") OR + // (name = "example-connection-2") + // ``` + string filter = 4; + + // Sorts list results by a certain order. By default, returned results + // are ordered by `name` in ascending order. + // You can also sort results in descending order based on the `name` value + // using `orderBy="name desc"`. + // Currently, only ordering by `name` is supported. + string order_by = 5; +} + +// Response message for +// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections] +message ListPrivateConnectionsResponse { + // A list of private connections. + repeated PrivateConnection private_connections = 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; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request message for +// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection] +message UpdatePrivateConnectionRequest { + // Required. Private connection description. + PrivateConnection private_connection = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask is used to specify the fields to be overwritten in the + // `PrivateConnection` resource by the update. + // The fields specified in the `update_mask` are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection] +message DeletePrivateConnectionRequest { + // Required. The resource name of the private connection to be deleted. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/privateConnections/my-connection` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateConnection" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes] +message ListPrivateConnectionPeeringRoutesRequest { + // Required. The resource name of the private connection to retrieve peering + // routes from. Resource names are schemeless URIs that follow the conventions + // in https://cloud.google.com/apis/design/resource_names. For example: + // `projects/my-project/locations/us-west1/privateConnections/my-connection` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateConnection" + } + ]; + + // The maximum number of peering routes to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + // call. Provide this to retrieve the subsequent page. When paginating, all + // other parameters provided to `ListPrivateConnectionPeeringRoutes` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for +// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes] +message ListPrivateConnectionPeeringRoutesResponse { + // A list of peering routes. + repeated PeeringRoute peering_routes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine_resources.proto b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine_resources.proto index 4f0a496df033..273a833719e8 100644 --- a/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine_resources.proto +++ b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// 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. @@ -130,6 +130,18 @@ message PrivateCloud { [(google.api.field_behavior) = REQUIRED]; } + // Enum Type defines private cloud type. + enum Type { + // Standard private is a zonal resource, with 3+ nodes. Default type. + STANDARD = 0; + + // Time limited private cloud is a zonal resource, can have only 1 node and + // has limited life span. Will be deleted after defined period of time, + // can be converted into standard private cloud by expanding it up to 3 + // or more nodes. + TIME_LIMITED = 1; + } + // Output only. The resource name of this private cloud. // Resource names are schemeless URIs that follow the conventions in // https://cloud.google.com/apis/design/resource_names. @@ -185,6 +197,9 @@ message PrivateCloud { // Output only. System-generated unique identifier for the resource. string uid = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Type of the private cloud. Defaults to STANDARD. + Type type = 22 [(google.api.field_behavior) = OPTIONAL]; } // A cluster in a private cloud. @@ -273,6 +288,13 @@ message Subnet { // The subnet is being deleted. DELETING = 4; + + // Changes requested in the last operation are being propagated. + RECONCILING = 5; + + // Last operation on the subnet did not succeed. Subnet's payload is + // reverted back to its most recent working state. + FAILED = 6; } // Output only. The resource name of this subnet. @@ -476,6 +498,65 @@ message Vcenter { string fqdn = 6; } +// Exchanged network peering route. +message PeeringRoute { + // The type of the peering route. + enum Type { + // Unspecified peering route type. This is the default value. + TYPE_UNSPECIFIED = 0; + + // Dynamic routes in the peer network. + DYNAMIC_PEERING_ROUTE = 1; + + // Static routes in the peer network. + STATIC_PEERING_ROUTE = 2; + + // Created, updated, and removed automatically by Google Cloud when subnets + // are created, modified, or deleted in the peer network. + SUBNET_PEERING_ROUTE = 3; + } + + // The direction of the exchanged routes. + enum Direction { + // Unspecified exchanged routes direction. This is default. + DIRECTION_UNSPECIFIED = 0; + + // Routes imported from the peer network. + INCOMING = 1; + + // Routes exported to the peer network. + OUTGOING = 2; + } + + // Output only. Destination range of the peering route in CIDR notation. + string dest_range = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the route in the peer VPC network. + Type type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Region containing the next hop of the peering route. This + // field only applies to dynamic routes in the peer VPC network. + string next_hop_region = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The priority of the peering route. + int64 priority = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if the peering route has been imported from a peered + // VPC network; false otherwise. The import happens if the field + // `NetworkPeering.importCustomRoutes` is true for this network, + // `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and + // the import does not result in a route conflict. + bool imported = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Direction of the routes exchanged with the peer network, from + // the VMware Engine network perspective: + // + // * Routes of direction `INCOMING` are imported from the peer network. + // * Routes of direction `OUTGOING` are exported from the intranet VPC network + // of the VMware Engine network. + Direction direction = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Represents a network policy resource. Network policies are regional // resources. You can use a network policy to enable or disable internet access // and external IP access. Network policies are associated with a VMware Engine @@ -688,3 +769,163 @@ message VmwareEngineNetwork { // request. string etag = 10; } + +// Private connection resource that provides connectivity for VMware Engine +// private clouds. +message PrivateConnection { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/PrivateConnection" + pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" + }; + + // Enum State defines possible states of private connection. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The private connection is being created. + CREATING = 1; + + // The private connection is ready. + ACTIVE = 2; + + // The private connection is being updated. + UPDATING = 3; + + // The private connection is being deleted. + DELETING = 4; + + // The private connection is not provisioned, since no private cloud is + // present for which this private connection is needed. + UNPROVISIONED = 5; + + // The private connection is in failed state. + FAILED = 6; + } + + // Enum Type defines possible types of private connection. + enum Type { + // The default value. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // Connection used for establishing [private services + // access](https://cloud.google.com/vpc/docs/private-services-access). + PRIVATE_SERVICE_ACCESS = 1; + + // Connection used for connecting to NetApp Cloud Volumes. + NETAPP_CLOUD_VOLUMES = 2; + + // Connection used for connecting to Dell PowerScale. + DELL_POWERSCALE = 3; + + // Connection used for connecting to third-party services. + THIRD_PARTY_SERVICE = 4; + } + + // Possible types for RoutingMode + enum RoutingMode { + // The default value. This value should never be used. + ROUTING_MODE_UNSPECIFIED = 0; + + // Global Routing Mode + GLOBAL = 1; + + // Regional Routing Mode + REGIONAL = 2; + } + + // Enum PeeringState defines the possible states of peering between service + // network and the vpc network peered to service network + enum PeeringState { + // The default value. This value is used if the peering state is omitted or + // unknown. + PEERING_STATE_UNSPECIFIED = 0; + + // The peering is in active state. + PEERING_ACTIVE = 1; + + // The peering is in inactive state. + PEERING_INACTIVE = 2; + } + + // Output only. The resource name of the private connection. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/privateConnections/my-connection` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this resource. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of this resource. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description for this private connection. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. State of the private connection. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The relative resource name of Legacy VMware Engine network. + // Specify the name in the following form: + // `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + // where `{project}`, `{location}` will be same as specified in private + // connection resource name and `{vmware_engine_network_id}` will be in the + // form of `{location}`-default e.g. + // projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default. + string vmware_engine_network = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Output only. The canonical name of the VMware Engine network in the form: + // `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + string vmware_engine_network_canonical = 9 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Required. Private connection type. + Type type = 10 [(google.api.field_behavior) = REQUIRED]; + + // Output only. VPC network peering id between given network VPC and + // VMwareEngineNetwork. + string peering_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Routing Mode. + // Default value is set to GLOBAL. + // For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or + // REGIONAL, for other types only GLOBAL is supported. + RoutingMode routing_mode = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. System-generated unique identifier for the resource. + string uid = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Service network to create private connection. + // Specify the name in the following form: + // `projects/{project}/global/networks/{network_id}` + // For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking + // VPC, e.g. projects/project-tp/global/networks/servicenetworking. + // For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC, + // e.g. projects/project-tp/global/networks/netapp-tenant-vpc. + // For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g. + // projects/project-tp/global/networks/dell-tenant-vpc. + // For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or + // any other producer VPC to which the VMware Engine Network needs to be + // connected, e.g. projects/project/global/networks/vpc. + string service_network = 16 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. Peering state between service network and VMware Engine + // network. + PeeringState peering_state = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-vmwareengine/protos/protos.d.ts b/packages/google-cloud-vmwareengine/protos/protos.d.ts index 4cc5063e6d06..4087604f562e 100644 --- a/packages/google-cloud-vmwareengine/protos/protos.d.ts +++ b/packages/google-cloud-vmwareengine/protos/protos.d.ts @@ -214,6 +214,34 @@ export namespace google { */ public listSubnets(request: google.cloud.vmwareengine.v1.IListSubnetsRequest): Promise; + /** + * Calls GetSubnet. + * @param request GetSubnetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subnet + */ + public getSubnet(request: google.cloud.vmwareengine.v1.IGetSubnetRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetSubnetCallback): void; + + /** + * Calls GetSubnet. + * @param request GetSubnetRequest message or plain object + * @returns Promise + */ + public getSubnet(request: google.cloud.vmwareengine.v1.IGetSubnetRequest): Promise; + + /** + * Calls UpdateSubnet. + * @param request UpdateSubnetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSubnet(request: google.cloud.vmwareengine.v1.IUpdateSubnetRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnetCallback): void; + + /** + * Calls UpdateSubnet. + * @param request UpdateSubnetRequest message or plain object + * @returns Promise + */ + public updateSubnet(request: google.cloud.vmwareengine.v1.IUpdateSubnetRequest): Promise; + /** * Calls ListNodeTypes. * @param request ListNodeTypesRequest message or plain object @@ -479,6 +507,90 @@ export namespace google { * @returns Promise */ public listVmwareEngineNetworks(request: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest): Promise; + + /** + * Calls CreatePrivateConnection. + * @param request CreatePrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createPrivateConnection(request: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnectionCallback): void; + + /** + * Calls CreatePrivateConnection. + * @param request CreatePrivateConnectionRequest message or plain object + * @returns Promise + */ + public createPrivateConnection(request: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest): Promise; + + /** + * Calls GetPrivateConnection. + * @param request GetPrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PrivateConnection + */ + public getPrivateConnection(request: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnectionCallback): void; + + /** + * Calls GetPrivateConnection. + * @param request GetPrivateConnectionRequest message or plain object + * @returns Promise + */ + public getPrivateConnection(request: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest): Promise; + + /** + * Calls ListPrivateConnections. + * @param request ListPrivateConnectionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPrivateConnectionsResponse + */ + public listPrivateConnections(request: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionsCallback): void; + + /** + * Calls ListPrivateConnections. + * @param request ListPrivateConnectionsRequest message or plain object + * @returns Promise + */ + public listPrivateConnections(request: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest): Promise; + + /** + * Calls UpdatePrivateConnection. + * @param request UpdatePrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePrivateConnection(request: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnectionCallback): void; + + /** + * Calls UpdatePrivateConnection. + * @param request UpdatePrivateConnectionRequest message or plain object + * @returns Promise + */ + public updatePrivateConnection(request: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest): Promise; + + /** + * Calls DeletePrivateConnection. + * @param request DeletePrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePrivateConnection(request: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnectionCallback): void; + + /** + * Calls DeletePrivateConnection. + * @param request DeletePrivateConnectionRequest message or plain object + * @returns Promise + */ + public deletePrivateConnection(request: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest): Promise; + + /** + * Calls ListPrivateConnectionPeeringRoutes. + * @param request ListPrivateConnectionPeeringRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPrivateConnectionPeeringRoutesResponse + */ + public listPrivateConnectionPeeringRoutes(request: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutesCallback): void; + + /** + * Calls ListPrivateConnectionPeeringRoutes. + * @param request ListPrivateConnectionPeeringRoutesRequest message or plain object + * @returns Promise + */ + public listPrivateConnectionPeeringRoutes(request: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest): Promise; } namespace VmwareEngine { @@ -567,6 +679,20 @@ export namespace google { */ type ListSubnetsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListSubnetsResponse) => void; + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getSubnet}. + * @param error Error, if any + * @param [response] Subnet + */ + type GetSubnetCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.Subnet) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateSubnet}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSubnetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNodeTypes}. * @param error Error, if any @@ -699,6 +825,48 @@ export namespace google { * @param [response] ListVmwareEngineNetworksResponse */ type ListVmwareEngineNetworksCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createPrivateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type CreatePrivateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getPrivateConnection}. + * @param error Error, if any + * @param [response] PrivateConnection + */ + type GetPrivateConnectionCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.PrivateConnection) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateConnections}. + * @param error Error, if any + * @param [response] ListPrivateConnectionsResponse + */ + type ListPrivateConnectionsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updatePrivateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePrivateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deletePrivateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePrivateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateConnectionPeeringRoutes}. + * @param error Error, if any + * @param [response] ListPrivateConnectionPeeringRoutesResponse + */ + type ListPrivateConnectionPeeringRoutesCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse) => void; } /** Properties of a ListPrivateCloudsRequest. */ @@ -2262,6 +2430,9 @@ export namespace google { /** ListSubnetsResponse nextPageToken */ nextPageToken?: (string|null); + + /** ListSubnetsResponse unreachable */ + unreachable?: (string[]|null); } /** Represents a ListSubnetsResponse. */ @@ -2279,6 +2450,9 @@ export namespace google { /** ListSubnetsResponse nextPageToken. */ public nextPageToken: string; + /** ListSubnetsResponse unreachable. */ + public unreachable: string[]; + /** * Creates a new ListSubnetsResponse instance using the specified properties. * @param [properties] Properties to set @@ -2357,6 +2531,206 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GetSubnetRequest. */ + interface IGetSubnetRequest { + + /** GetSubnetRequest name */ + name?: (string|null); + } + + /** Represents a GetSubnetRequest. */ + class GetSubnetRequest implements IGetSubnetRequest { + + /** + * Constructs a new GetSubnetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetSubnetRequest); + + /** GetSubnetRequest name. */ + public name: string; + + /** + * Creates a new GetSubnetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSubnetRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetSubnetRequest): google.cloud.vmwareengine.v1.GetSubnetRequest; + + /** + * Encodes the specified GetSubnetRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetSubnetRequest.verify|verify} messages. + * @param message GetSubnetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetSubnetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSubnetRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetSubnetRequest.verify|verify} messages. + * @param message GetSubnetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetSubnetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSubnetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSubnetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.GetSubnetRequest; + + /** + * Decodes a GetSubnetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSubnetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.GetSubnetRequest; + + /** + * Verifies a GetSubnetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSubnetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSubnetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetSubnetRequest; + + /** + * Creates a plain object from a GetSubnetRequest message. Also converts values to other types if specified. + * @param message GetSubnetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetSubnetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSubnetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSubnetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSubnetRequest. */ + interface IUpdateSubnetRequest { + + /** UpdateSubnetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSubnetRequest subnet */ + subnet?: (google.cloud.vmwareengine.v1.ISubnet|null); + } + + /** Represents an UpdateSubnetRequest. */ + class UpdateSubnetRequest implements IUpdateSubnetRequest { + + /** + * Constructs a new UpdateSubnetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdateSubnetRequest); + + /** UpdateSubnetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSubnetRequest subnet. */ + public subnet?: (google.cloud.vmwareengine.v1.ISubnet|null); + + /** + * Creates a new UpdateSubnetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSubnetRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdateSubnetRequest): google.cloud.vmwareengine.v1.UpdateSubnetRequest; + + /** + * Encodes the specified UpdateSubnetRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateSubnetRequest.verify|verify} messages. + * @param message UpdateSubnetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdateSubnetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSubnetRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateSubnetRequest.verify|verify} messages. + * @param message UpdateSubnetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdateSubnetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSubnetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSubnetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.UpdateSubnetRequest; + + /** + * Decodes an UpdateSubnetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSubnetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.UpdateSubnetRequest; + + /** + * Verifies an UpdateSubnetRequest message. + * @param message Plain 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 UpdateSubnetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSubnetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdateSubnetRequest; + + /** + * Creates a plain object from an UpdateSubnetRequest message. Also converts values to other types if specified. + * @param message UpdateSubnetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdateSubnetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSubnetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSubnetRequest + * @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 { @@ -4955,41 +5329,907 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NetworkConfig. */ - interface INetworkConfig { + /** Properties of a CreatePrivateConnectionRequest. */ + interface ICreatePrivateConnectionRequest { - /** NetworkConfig managementCidr */ - managementCidr?: (string|null); + /** CreatePrivateConnectionRequest parent */ + parent?: (string|null); - /** NetworkConfig vmwareEngineNetwork */ - vmwareEngineNetwork?: (string|null); + /** CreatePrivateConnectionRequest privateConnectionId */ + privateConnectionId?: (string|null); - /** NetworkConfig vmwareEngineNetworkCanonical */ - vmwareEngineNetworkCanonical?: (string|null); + /** CreatePrivateConnectionRequest privateConnection */ + privateConnection?: (google.cloud.vmwareengine.v1.IPrivateConnection|null); - /** NetworkConfig managementIpAddressLayoutVersion */ - managementIpAddressLayoutVersion?: (number|null); + /** CreatePrivateConnectionRequest requestId */ + requestId?: (string|null); } - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { + /** Represents a CreatePrivateConnectionRequest. */ + class CreatePrivateConnectionRequest implements ICreatePrivateConnectionRequest { /** - * Constructs a new NetworkConfig. + * Constructs a new CreatePrivateConnectionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.vmwareengine.v1.INetworkConfig); + constructor(properties?: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest); - /** NetworkConfig managementCidr. */ - public managementCidr: string; + /** CreatePrivateConnectionRequest parent. */ + public parent: string; - /** NetworkConfig vmwareEngineNetwork. */ - public vmwareEngineNetwork: string; + /** CreatePrivateConnectionRequest privateConnectionId. */ + public privateConnectionId: string; - /** NetworkConfig vmwareEngineNetworkCanonical. */ - public vmwareEngineNetworkCanonical: string; + /** CreatePrivateConnectionRequest privateConnection. */ + public privateConnection?: (google.cloud.vmwareengine.v1.IPrivateConnection|null); - /** NetworkConfig managementIpAddressLayoutVersion. */ + /** CreatePrivateConnectionRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreatePrivateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePrivateConnectionRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest): google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest; + + /** + * Encodes the specified CreatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @param message CreatePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @param message CreatePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest; + + /** + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest; + + /** + * Verifies a CreatePrivateConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePrivateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest; + + /** + * Creates a plain object from a CreatePrivateConnectionRequest message. Also converts values to other types if specified. + * @param message CreatePrivateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePrivateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePrivateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPrivateConnectionRequest. */ + interface IGetPrivateConnectionRequest { + + /** GetPrivateConnectionRequest name */ + name?: (string|null); + } + + /** Represents a GetPrivateConnectionRequest. */ + class GetPrivateConnectionRequest implements IGetPrivateConnectionRequest { + + /** + * Constructs a new GetPrivateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest); + + /** GetPrivateConnectionRequest name. */ + public name: string; + + /** + * Creates a new GetPrivateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPrivateConnectionRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest): google.cloud.vmwareengine.v1.GetPrivateConnectionRequest; + + /** + * Encodes the specified GetPrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateConnectionRequest.verify|verify} messages. + * @param message GetPrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateConnectionRequest.verify|verify} messages. + * @param message GetPrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.GetPrivateConnectionRequest; + + /** + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.GetPrivateConnectionRequest; + + /** + * Verifies a GetPrivateConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPrivateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetPrivateConnectionRequest; + + /** + * Creates a plain object from a GetPrivateConnectionRequest message. Also converts values to other types if specified. + * @param message GetPrivateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetPrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPrivateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPrivateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrivateConnectionsRequest. */ + interface IListPrivateConnectionsRequest { + + /** ListPrivateConnectionsRequest parent */ + parent?: (string|null); + + /** ListPrivateConnectionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPrivateConnectionsRequest pageToken */ + pageToken?: (string|null); + + /** ListPrivateConnectionsRequest filter */ + filter?: (string|null); + + /** ListPrivateConnectionsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListPrivateConnectionsRequest. */ + class ListPrivateConnectionsRequest implements IListPrivateConnectionsRequest { + + /** + * Constructs a new ListPrivateConnectionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest); + + /** ListPrivateConnectionsRequest parent. */ + public parent: string; + + /** ListPrivateConnectionsRequest pageSize. */ + public pageSize: number; + + /** ListPrivateConnectionsRequest pageToken. */ + public pageToken: string; + + /** ListPrivateConnectionsRequest filter. */ + public filter: string; + + /** ListPrivateConnectionsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListPrivateConnectionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateConnectionsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest): google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest; + + /** + * Encodes the specified ListPrivateConnectionsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @param message ListPrivateConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @param message ListPrivateConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest; + + /** + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest; + + /** + * Verifies a ListPrivateConnectionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateConnectionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest; + + /** + * Creates a plain object from a ListPrivateConnectionsRequest message. Also converts values to other types if specified. + * @param message ListPrivateConnectionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateConnectionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateConnectionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrivateConnectionsResponse. */ + interface IListPrivateConnectionsResponse { + + /** ListPrivateConnectionsResponse privateConnections */ + privateConnections?: (google.cloud.vmwareengine.v1.IPrivateConnection[]|null); + + /** ListPrivateConnectionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListPrivateConnectionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListPrivateConnectionsResponse. */ + class ListPrivateConnectionsResponse implements IListPrivateConnectionsResponse { + + /** + * Constructs a new ListPrivateConnectionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse); + + /** ListPrivateConnectionsResponse privateConnections. */ + public privateConnections: google.cloud.vmwareengine.v1.IPrivateConnection[]; + + /** ListPrivateConnectionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListPrivateConnectionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListPrivateConnectionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateConnectionsResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse): google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse; + + /** + * Encodes the specified ListPrivateConnectionsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @param message ListPrivateConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @param message ListPrivateConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse; + + /** + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse; + + /** + * Verifies a ListPrivateConnectionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateConnectionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse; + + /** + * Creates a plain object from a ListPrivateConnectionsResponse message. Also converts values to other types if specified. + * @param message ListPrivateConnectionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateConnectionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateConnectionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePrivateConnectionRequest. */ + interface IUpdatePrivateConnectionRequest { + + /** UpdatePrivateConnectionRequest privateConnection */ + privateConnection?: (google.cloud.vmwareengine.v1.IPrivateConnection|null); + + /** UpdatePrivateConnectionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePrivateConnectionRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdatePrivateConnectionRequest. */ + class UpdatePrivateConnectionRequest implements IUpdatePrivateConnectionRequest { + + /** + * Constructs a new UpdatePrivateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest); + + /** UpdatePrivateConnectionRequest privateConnection. */ + public privateConnection?: (google.cloud.vmwareengine.v1.IPrivateConnection|null); + + /** UpdatePrivateConnectionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePrivateConnectionRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdatePrivateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePrivateConnectionRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest): google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest; + + /** + * Encodes the specified UpdatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.verify|verify} messages. + * @param message UpdatePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.verify|verify} messages. + * @param message UpdatePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePrivateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest; + + /** + * Decodes an UpdatePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest; + + /** + * Verifies an UpdatePrivateConnectionRequest message. + * @param message Plain 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 UpdatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePrivateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest; + + /** + * Creates a plain object from an UpdatePrivateConnectionRequest message. Also converts values to other types if specified. + * @param message UpdatePrivateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePrivateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePrivateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePrivateConnectionRequest. */ + interface IDeletePrivateConnectionRequest { + + /** DeletePrivateConnectionRequest name */ + name?: (string|null); + + /** DeletePrivateConnectionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeletePrivateConnectionRequest. */ + class DeletePrivateConnectionRequest implements IDeletePrivateConnectionRequest { + + /** + * Constructs a new DeletePrivateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest); + + /** DeletePrivateConnectionRequest name. */ + public name: string; + + /** DeletePrivateConnectionRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeletePrivateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePrivateConnectionRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest): google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest; + + /** + * Encodes the specified DeletePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @param message DeletePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @param message DeletePrivateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest; + + /** + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest; + + /** + * Verifies a DeletePrivateConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePrivateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest; + + /** + * Creates a plain object from a DeletePrivateConnectionRequest message. Also converts values to other types if specified. + * @param message DeletePrivateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePrivateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePrivateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrivateConnectionPeeringRoutesRequest. */ + interface IListPrivateConnectionPeeringRoutesRequest { + + /** ListPrivateConnectionPeeringRoutesRequest parent */ + parent?: (string|null); + + /** ListPrivateConnectionPeeringRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListPrivateConnectionPeeringRoutesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPrivateConnectionPeeringRoutesRequest. */ + class ListPrivateConnectionPeeringRoutesRequest implements IListPrivateConnectionPeeringRoutesRequest { + + /** + * Constructs a new ListPrivateConnectionPeeringRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest); + + /** ListPrivateConnectionPeeringRoutesRequest parent. */ + public parent: string; + + /** ListPrivateConnectionPeeringRoutesRequest pageSize. */ + public pageSize: number; + + /** ListPrivateConnectionPeeringRoutesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPrivateConnectionPeeringRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateConnectionPeeringRoutesRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest.verify|verify} messages. + * @param message ListPrivateConnectionPeeringRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest.verify|verify} messages. + * @param message ListPrivateConnectionPeeringRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateConnectionPeeringRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateConnectionPeeringRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest; + + /** + * Verifies a ListPrivateConnectionPeeringRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateConnectionPeeringRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateConnectionPeeringRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest; + + /** + * Creates a plain object from a ListPrivateConnectionPeeringRoutesRequest message. Also converts values to other types if specified. + * @param message ListPrivateConnectionPeeringRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateConnectionPeeringRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateConnectionPeeringRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrivateConnectionPeeringRoutesResponse. */ + interface IListPrivateConnectionPeeringRoutesResponse { + + /** ListPrivateConnectionPeeringRoutesResponse peeringRoutes */ + peeringRoutes?: (google.cloud.vmwareengine.v1.IPeeringRoute[]|null); + + /** ListPrivateConnectionPeeringRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPrivateConnectionPeeringRoutesResponse. */ + class ListPrivateConnectionPeeringRoutesResponse implements IListPrivateConnectionPeeringRoutesResponse { + + /** + * Constructs a new ListPrivateConnectionPeeringRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse); + + /** ListPrivateConnectionPeeringRoutesResponse peeringRoutes. */ + public peeringRoutes: google.cloud.vmwareengine.v1.IPeeringRoute[]; + + /** ListPrivateConnectionPeeringRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPrivateConnectionPeeringRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateConnectionPeeringRoutesResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.verify|verify} messages. + * @param message ListPrivateConnectionPeeringRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.verify|verify} messages. + * @param message ListPrivateConnectionPeeringRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateConnectionPeeringRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateConnectionPeeringRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse; + + /** + * Verifies a ListPrivateConnectionPeeringRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateConnectionPeeringRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateConnectionPeeringRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse; + + /** + * Creates a plain object from a ListPrivateConnectionPeeringRoutesResponse message. Also converts values to other types if specified. + * @param message ListPrivateConnectionPeeringRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateConnectionPeeringRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateConnectionPeeringRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig managementCidr */ + managementCidr?: (string|null); + + /** NetworkConfig vmwareEngineNetwork */ + vmwareEngineNetwork?: (string|null); + + /** NetworkConfig vmwareEngineNetworkCanonical */ + vmwareEngineNetworkCanonical?: (string|null); + + /** NetworkConfig managementIpAddressLayoutVersion */ + managementIpAddressLayoutVersion?: (number|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INetworkConfig); + + /** NetworkConfig managementCidr. */ + public managementCidr: string; + + /** NetworkConfig vmwareEngineNetwork. */ + public vmwareEngineNetwork: string; + + /** NetworkConfig vmwareEngineNetworkCanonical. */ + public vmwareEngineNetworkCanonical: string; + + /** NetworkConfig managementIpAddressLayoutVersion. */ public managementIpAddressLayoutVersion: number; /** @@ -5214,6 +6454,9 @@ export namespace google { /** PrivateCloud uid */ uid?: (string|null); + + /** PrivateCloud type */ + type?: (google.cloud.vmwareengine.v1.PrivateCloud.Type|keyof typeof google.cloud.vmwareengine.v1.PrivateCloud.Type|null); } /** Represents a PrivateCloud. */ @@ -5264,6 +6507,9 @@ export namespace google { /** PrivateCloud uid. */ public uid: string; + /** PrivateCloud type. */ + public type: (google.cloud.vmwareengine.v1.PrivateCloud.Type|keyof typeof google.cloud.vmwareengine.v1.PrivateCloud.Type); + /** * Creates a new PrivateCloud instance using the specified properties. * @param [properties] Properties to set @@ -5457,6 +6703,12 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Type enum. */ + enum Type { + STANDARD = 0, + TIME_LIMITED = 1 + } } /** Properties of a Cluster. */ @@ -5734,7 +6986,9 @@ export namespace google { ACTIVE = 1, CREATING = 2, UPDATING = 3, - DELETING = 4 + DELETING = 4, + RECONCILING = 5, + FAILED = 6 } } @@ -6487,6 +7741,151 @@ export namespace google { } } + /** Properties of a PeeringRoute. */ + interface IPeeringRoute { + + /** PeeringRoute destRange */ + destRange?: (string|null); + + /** PeeringRoute type */ + type?: (google.cloud.vmwareengine.v1.PeeringRoute.Type|keyof typeof google.cloud.vmwareengine.v1.PeeringRoute.Type|null); + + /** PeeringRoute nextHopRegion */ + nextHopRegion?: (string|null); + + /** PeeringRoute priority */ + priority?: (number|Long|string|null); + + /** PeeringRoute imported */ + imported?: (boolean|null); + + /** PeeringRoute direction */ + direction?: (google.cloud.vmwareengine.v1.PeeringRoute.Direction|keyof typeof google.cloud.vmwareengine.v1.PeeringRoute.Direction|null); + } + + /** Represents a PeeringRoute. */ + class PeeringRoute implements IPeeringRoute { + + /** + * Constructs a new PeeringRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IPeeringRoute); + + /** PeeringRoute destRange. */ + public destRange: string; + + /** PeeringRoute type. */ + public type: (google.cloud.vmwareengine.v1.PeeringRoute.Type|keyof typeof google.cloud.vmwareengine.v1.PeeringRoute.Type); + + /** PeeringRoute nextHopRegion. */ + public nextHopRegion: string; + + /** PeeringRoute priority. */ + public priority: (number|Long|string); + + /** PeeringRoute imported. */ + public imported: boolean; + + /** PeeringRoute direction. */ + public direction: (google.cloud.vmwareengine.v1.PeeringRoute.Direction|keyof typeof google.cloud.vmwareengine.v1.PeeringRoute.Direction); + + /** + * Creates a new PeeringRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns PeeringRoute instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IPeeringRoute): google.cloud.vmwareengine.v1.PeeringRoute; + + /** + * Encodes the specified PeeringRoute message. Does not implicitly {@link google.cloud.vmwareengine.v1.PeeringRoute.verify|verify} messages. + * @param message PeeringRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IPeeringRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeeringRoute message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PeeringRoute.verify|verify} messages. + * @param message PeeringRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IPeeringRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeeringRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.PeeringRoute; + + /** + * Decodes a PeeringRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.PeeringRoute; + + /** + * Verifies a PeeringRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeeringRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeeringRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.PeeringRoute; + + /** + * Creates a plain object from a PeeringRoute message. Also converts values to other types if specified. + * @param message PeeringRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.PeeringRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeeringRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeeringRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PeeringRoute { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + DYNAMIC_PEERING_ROUTE = 1, + STATIC_PEERING_ROUTE = 2, + SUBNET_PEERING_ROUTE = 3 + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + INCOMING = 1, + OUTGOING = 2 + } + } + /** Properties of a NetworkPolicy. */ interface INetworkPolicy { @@ -7031,6 +8430,212 @@ export namespace google { LEGACY = 1 } } + + /** Properties of a PrivateConnection. */ + interface IPrivateConnection { + + /** PrivateConnection name */ + name?: (string|null); + + /** PrivateConnection createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection description */ + description?: (string|null); + + /** PrivateConnection state */ + state?: (google.cloud.vmwareengine.v1.PrivateConnection.State|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.State|null); + + /** PrivateConnection vmwareEngineNetwork */ + vmwareEngineNetwork?: (string|null); + + /** PrivateConnection vmwareEngineNetworkCanonical */ + vmwareEngineNetworkCanonical?: (string|null); + + /** PrivateConnection type */ + type?: (google.cloud.vmwareengine.v1.PrivateConnection.Type|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.Type|null); + + /** PrivateConnection peeringId */ + peeringId?: (string|null); + + /** PrivateConnection routingMode */ + routingMode?: (google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode|null); + + /** PrivateConnection uid */ + uid?: (string|null); + + /** PrivateConnection serviceNetwork */ + serviceNetwork?: (string|null); + + /** PrivateConnection peeringState */ + peeringState?: (google.cloud.vmwareengine.v1.PrivateConnection.PeeringState|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.PeeringState|null); + } + + /** Represents a PrivateConnection. */ + class PrivateConnection implements IPrivateConnection { + + /** + * Constructs a new PrivateConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IPrivateConnection); + + /** PrivateConnection name. */ + public name: string; + + /** PrivateConnection createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection description. */ + public description: string; + + /** PrivateConnection state. */ + public state: (google.cloud.vmwareengine.v1.PrivateConnection.State|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.State); + + /** PrivateConnection vmwareEngineNetwork. */ + public vmwareEngineNetwork: string; + + /** PrivateConnection vmwareEngineNetworkCanonical. */ + public vmwareEngineNetworkCanonical: string; + + /** PrivateConnection type. */ + public type: (google.cloud.vmwareengine.v1.PrivateConnection.Type|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.Type); + + /** PrivateConnection peeringId. */ + public peeringId: string; + + /** PrivateConnection routingMode. */ + public routingMode: (google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode); + + /** PrivateConnection uid. */ + public uid: string; + + /** PrivateConnection serviceNetwork. */ + public serviceNetwork: string; + + /** PrivateConnection peeringState. */ + public peeringState: (google.cloud.vmwareengine.v1.PrivateConnection.PeeringState|keyof typeof google.cloud.vmwareengine.v1.PrivateConnection.PeeringState); + + /** + * Creates a new PrivateConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateConnection instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IPrivateConnection): google.cloud.vmwareengine.v1.PrivateConnection; + + /** + * Encodes the specified PrivateConnection message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateConnection.verify|verify} messages. + * @param message PrivateConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IPrivateConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateConnection message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateConnection.verify|verify} messages. + * @param message PrivateConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IPrivateConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmwareengine.v1.PrivateConnection; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmwareengine.v1.PrivateConnection; + + /** + * Verifies a PrivateConnection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivateConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.PrivateConnection; + + /** + * Creates a plain object from a PrivateConnection message. Also converts values to other types if specified. + * @param message PrivateConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.PrivateConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateConnection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrivateConnection { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + UPDATING = 3, + DELETING = 4, + UNPROVISIONED = 5, + FAILED = 6 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRIVATE_SERVICE_ACCESS = 1, + NETAPP_CLOUD_VOLUMES = 2, + DELL_POWERSCALE = 3, + THIRD_PARTY_SERVICE = 4 + } + + /** RoutingMode enum. */ + enum RoutingMode { + ROUTING_MODE_UNSPECIFIED = 0, + GLOBAL = 1, + REGIONAL = 2 + } + + /** PeeringState enum. */ + enum PeeringState { + PEERING_STATE_UNSPECIFIED = 0, + PEERING_ACTIVE = 1, + PEERING_INACTIVE = 2 + } + } } } } diff --git a/packages/google-cloud-vmwareengine/protos/protos.js b/packages/google-cloud-vmwareengine/protos/protos.js index 516fcc77e6ba..02d0cfcf1fc3 100644 --- a/packages/google-cloud-vmwareengine/protos/protos.js +++ b/packages/google-cloud-vmwareengine/protos/protos.js @@ -494,6 +494,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getSubnet}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetSubnetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.Subnet} [response] Subnet + */ + + /** + * Calls GetSubnet. + * @function getSubnet + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest} request GetSubnetRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetSubnetCallback} callback Node-style callback called with the error, if any, and Subnet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getSubnet = function getSubnet(request, callback) { + return this.rpcCall(getSubnet, $root.google.cloud.vmwareengine.v1.GetSubnetRequest, $root.google.cloud.vmwareengine.v1.Subnet, request, callback); + }, "name", { value: "GetSubnet" }); + + /** + * Calls GetSubnet. + * @function getSubnet + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest} request GetSubnetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateSubnet}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdateSubnetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSubnet. + * @function updateSubnet + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest} request UpdateSubnetRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updateSubnet = function updateSubnet(request, callback) { + return this.rpcCall(updateSubnet, $root.google.cloud.vmwareengine.v1.UpdateSubnetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSubnet" }); + + /** + * Calls UpdateSubnet. + * @function updateSubnet + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest} request UpdateSubnetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNodeTypes}. * @memberof google.cloud.vmwareengine.v1.VmwareEngine @@ -1121,6 +1187,204 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createPrivateConnection}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreatePrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreatePrivateConnection. + * @function createPrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest} request CreatePrivateConnectionRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createPrivateConnection = function createPrivateConnection(request, callback) { + return this.rpcCall(createPrivateConnection, $root.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreatePrivateConnection" }); + + /** + * Calls CreatePrivateConnection. + * @function createPrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest} request CreatePrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getPrivateConnection}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetPrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.PrivateConnection} [response] PrivateConnection + */ + + /** + * Calls GetPrivateConnection. + * @function getPrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest} request GetPrivateConnectionRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnectionCallback} callback Node-style callback called with the error, if any, and PrivateConnection + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getPrivateConnection = function getPrivateConnection(request, callback) { + return this.rpcCall(getPrivateConnection, $root.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest, $root.google.cloud.vmwareengine.v1.PrivateConnection, request, callback); + }, "name", { value: "GetPrivateConnection" }); + + /** + * Calls GetPrivateConnection. + * @function getPrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest} request GetPrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateConnections}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListPrivateConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} [response] ListPrivateConnectionsResponse + */ + + /** + * Calls ListPrivateConnections. + * @function listPrivateConnections + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest} request ListPrivateConnectionsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionsCallback} callback Node-style callback called with the error, if any, and ListPrivateConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listPrivateConnections = function listPrivateConnections(request, callback) { + return this.rpcCall(listPrivateConnections, $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest, $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse, request, callback); + }, "name", { value: "ListPrivateConnections" }); + + /** + * Calls ListPrivateConnections. + * @function listPrivateConnections + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest} request ListPrivateConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updatePrivateConnection}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdatePrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdatePrivateConnection. + * @function updatePrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest} request UpdatePrivateConnectionRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updatePrivateConnection = function updatePrivateConnection(request, callback) { + return this.rpcCall(updatePrivateConnection, $root.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdatePrivateConnection" }); + + /** + * Calls UpdatePrivateConnection. + * @function updatePrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest} request UpdatePrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deletePrivateConnection}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef DeletePrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeletePrivateConnection. + * @function deletePrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest} request DeletePrivateConnectionRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.deletePrivateConnection = function deletePrivateConnection(request, callback) { + return this.rpcCall(deletePrivateConnection, $root.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeletePrivateConnection" }); + + /** + * Calls DeletePrivateConnection. + * @function deletePrivateConnection + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest} request DeletePrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateConnectionPeeringRoutes}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListPrivateConnectionPeeringRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} [response] ListPrivateConnectionPeeringRoutesResponse + */ + + /** + * Calls ListPrivateConnectionPeeringRoutes. + * @function listPrivateConnectionPeeringRoutes + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest} request ListPrivateConnectionPeeringRoutesRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutesCallback} callback Node-style callback called with the error, if any, and ListPrivateConnectionPeeringRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listPrivateConnectionPeeringRoutes = function listPrivateConnectionPeeringRoutes(request, callback) { + return this.rpcCall(listPrivateConnectionPeeringRoutes, $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest, $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse, request, callback); + }, "name", { value: "ListPrivateConnectionPeeringRoutes" }); + + /** + * Calls ListPrivateConnectionPeeringRoutes. + * @function listPrivateConnectionPeeringRoutes + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest} request ListPrivateConnectionPeeringRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return VmwareEngine; })(); @@ -4847,6 +5111,7 @@ * @interface IListSubnetsResponse * @property {Array.|null} [subnets] ListSubnetsResponse subnets * @property {string|null} [nextPageToken] ListSubnetsResponse nextPageToken + * @property {Array.|null} [unreachable] ListSubnetsResponse unreachable */ /** @@ -4859,6 +5124,7 @@ */ function ListSubnetsResponse(properties) { this.subnets = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4881,6 +5147,14 @@ */ ListSubnetsResponse.prototype.nextPageToken = ""; + /** + * ListSubnetsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @instance + */ + ListSubnetsResponse.prototype.unreachable = $util.emptyArray; + /** * Creates a new ListSubnetsResponse instance using the specified properties. * @function create @@ -4910,6 +5184,9 @@ $root.google.cloud.vmwareengine.v1.Subnet.encode(message.subnets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; @@ -4954,6 +5231,12 @@ message.nextPageToken = reader.string(); break; } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -5001,6 +5284,13 @@ if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; @@ -5028,6 +5318,13 @@ } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListSubnetsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; @@ -5044,8 +5341,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.subnets = []; + object.unreachable = []; + } if (options.defaults) object.nextPageToken = ""; if (message.subnets && message.subnets.length) { @@ -5055,6 +5354,11 @@ } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; @@ -5087,30 +5391,24 @@ return ListSubnetsResponse; })(); - v1.OperationMetadata = (function() { + v1.GetSubnetRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a GetSubnetRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IGetSubnetRequest + * @property {string|null} [name] GetSubnetRequest name */ /** - * Constructs a new OperationMetadata. + * Constructs a new GetSubnetRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a GetSubnetRequest. + * @implements IGetSubnetRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function GetSubnetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5118,159 +5416,75 @@ } /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * GetSubnetRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @instance */ - OperationMetadata.prototype.createTime = null; + GetSubnetRequest.prototype.name = ""; /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance + * Creates a new GetSubnetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetSubnetRequest} GetSubnetRequest instance */ - OperationMetadata.prototype.endTime = null; + GetSubnetRequest.create = function create(properties) { + return new GetSubnetRequest(properties); + }; /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance + * Encodes the specified GetSubnetRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetSubnetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest} message GetSubnetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - OperationMetadata.prototype.target = ""; + GetSubnetRequest.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; + }; /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance + * Encodes the specified GetSubnetRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetSubnetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetSubnetRequest} message GetSubnetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - OperationMetadata.prototype.verb = ""; + GetSubnetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @static - * @param {google.cloud.vmwareengine.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmwareengine.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @static - * @param {google.cloud.vmwareengine.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.OperationMetadata - * @static - * @param {google.cloud.vmwareengine.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. + * Decodes a GetSubnetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.vmwareengine.v1.GetSubnetRequest} GetSubnetRequest * @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) { + GetSubnetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetSubnetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.name = reader.string(); break; } default: @@ -5282,184 +5496,123 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetSubnetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.vmwareengine.v1.GetSubnetRequest} GetSubnetRequest * @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) { + GetSubnetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a GetSubnetRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @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) { + GetSubnetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetSubnetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.vmwareengine.v1.GetSubnetRequest} GetSubnetRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.OperationMetadata) + GetSubnetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetSubnetRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.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.vmwareengine.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.vmwareengine.v1.GetSubnetRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a GetSubnetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @static - * @param {google.cloud.vmwareengine.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.vmwareengine.v1.GetSubnetRequest} message GetSubnetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + GetSubnetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this GetSubnetRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + GetSubnetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for GetSubnetRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @memberof google.cloud.vmwareengine.v1.GetSubnetRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSubnetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetSubnetRequest"; }; - return OperationMetadata; + return GetSubnetRequest; })(); - v1.ListNodeTypesRequest = (function() { + v1.UpdateSubnetRequest = (function() { /** - * Properties of a ListNodeTypesRequest. + * Properties of an UpdateSubnetRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListNodeTypesRequest - * @property {string|null} [parent] ListNodeTypesRequest parent - * @property {number|null} [pageSize] ListNodeTypesRequest pageSize - * @property {string|null} [pageToken] ListNodeTypesRequest pageToken - * @property {string|null} [filter] ListNodeTypesRequest filter + * @interface IUpdateSubnetRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubnetRequest updateMask + * @property {google.cloud.vmwareengine.v1.ISubnet|null} [subnet] UpdateSubnetRequest subnet */ /** - * Constructs a new ListNodeTypesRequest. + * Constructs a new UpdateSubnetRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListNodeTypesRequest. - * @implements IListNodeTypesRequest + * @classdesc Represents an UpdateSubnetRequest. + * @implements IUpdateSubnetRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest=} [properties] Properties to set */ - function ListNodeTypesRequest(properties) { + function UpdateSubnetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5467,117 +5620,89 @@ } /** - * ListNodeTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest - * @instance - */ - ListNodeTypesRequest.prototype.parent = ""; - - /** - * ListNodeTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest - * @instance - */ - ListNodeTypesRequest.prototype.pageSize = 0; - - /** - * ListNodeTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * UpdateSubnetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @instance */ - ListNodeTypesRequest.prototype.pageToken = ""; + UpdateSubnetRequest.prototype.updateMask = null; /** - * ListNodeTypesRequest filter. - * @member {string} filter - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * UpdateSubnetRequest subnet. + * @member {google.cloud.vmwareengine.v1.ISubnet|null|undefined} subnet + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @instance */ - ListNodeTypesRequest.prototype.filter = ""; + UpdateSubnetRequest.prototype.subnet = null; /** - * Creates a new ListNodeTypesRequest instance using the specified properties. + * Creates a new UpdateSubnetRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest instance + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateSubnetRequest} UpdateSubnetRequest instance */ - ListNodeTypesRequest.create = function create(properties) { - return new ListNodeTypesRequest(properties); + UpdateSubnetRequest.create = function create(properties) { + return new UpdateSubnetRequest(properties); }; /** - * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * Encodes the specified UpdateSubnetRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateSubnetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest} message UpdateSubnetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNodeTypesRequest.encode = function encode(message, writer) { + UpdateSubnetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subnet != null && Object.hasOwnProperty.call(message, "subnet")) + $root.google.cloud.vmwareengine.v1.Subnet.encode(message.subnet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * Encodes the specified UpdateSubnetRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateSubnetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateSubnetRequest} message UpdateSubnetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNodeTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSubnetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNodeTypesRequest message from the specified reader or buffer. + * Decodes an UpdateSubnetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @returns {google.cloud.vmwareengine.v1.UpdateSubnetRequest} UpdateSubnetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNodeTypesRequest.decode = function decode(reader, length) { + UpdateSubnetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdateSubnetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); + message.subnet = $root.google.cloud.vmwareengine.v1.Subnet.decode(reader, reader.uint32()); break; } default: @@ -5589,151 +5714,147 @@ }; /** - * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSubnetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @returns {google.cloud.vmwareengine.v1.UpdateSubnetRequest} UpdateSubnetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNodeTypesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSubnetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNodeTypesRequest message. + * Verifies an UpdateSubnetRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNodeTypesRequest.verify = function verify(message) { + UpdateSubnetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.subnet != null && message.hasOwnProperty("subnet")) { + var error = $root.google.cloud.vmwareengine.v1.Subnet.verify(message.subnet); + if (error) + return "subnet." + error; + } return null; }; /** - * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSubnetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @returns {google.cloud.vmwareengine.v1.UpdateSubnetRequest} UpdateSubnetRequest */ - ListNodeTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest) + UpdateSubnetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateSubnetRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest(); - 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); + var message = new $root.google.cloud.vmwareengine.v1.UpdateSubnetRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateSubnetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.subnet != null) { + if (typeof object.subnet !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateSubnetRequest.subnet: object expected"); + message.subnet = $root.google.cloud.vmwareengine.v1.Subnet.fromObject(object.subnet); + } return message; }; /** - * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSubnetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static - * @param {google.cloud.vmwareengine.v1.ListNodeTypesRequest} message ListNodeTypesRequest + * @param {google.cloud.vmwareengine.v1.UpdateSubnetRequest} message UpdateSubnetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNodeTypesRequest.toObject = function toObject(message, options) { + UpdateSubnetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.updateMask = null; + object.subnet = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.subnet != null && message.hasOwnProperty("subnet")) + object.subnet = $root.google.cloud.vmwareengine.v1.Subnet.toObject(message.subnet, options); return object; }; /** - * Converts this ListNodeTypesRequest to JSON. + * Converts this UpdateSubnetRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @instance * @returns {Object.} JSON object */ - ListNodeTypesRequest.prototype.toJSON = function toJSON() { + UpdateSubnetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListNodeTypesRequest + * Gets the default type url for UpdateSubnetRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @memberof google.cloud.vmwareengine.v1.UpdateSubnetRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListNodeTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSubnetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateSubnetRequest"; }; - return ListNodeTypesRequest; + return UpdateSubnetRequest; })(); - v1.ListNodeTypesResponse = (function() { + v1.OperationMetadata = (function() { /** - * Properties of a ListNodeTypesResponse. + * Properties of an OperationMetadata. * @memberof google.cloud.vmwareengine.v1 - * @interface IListNodeTypesResponse - * @property {Array.|null} [nodeTypes] ListNodeTypesResponse nodeTypes - * @property {string|null} [nextPageToken] ListNodeTypesResponse nextPageToken - * @property {Array.|null} [unreachable] ListNodeTypesResponse unreachable + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion */ /** - * Constructs a new ListNodeTypesResponse. + * Constructs a new OperationMetadata. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListNodeTypesResponse. - * @implements IListNodeTypesResponse + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata * @constructor - * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IOperationMetadata=} [properties] Properties to set */ - function ListNodeTypesResponse(properties) { - this.nodeTypes = []; - this.unreachable = []; + function OperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5741,113 +5862,163 @@ } /** - * ListNodeTypesResponse nodeTypes. - * @member {Array.} nodeTypes - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @instance */ - ListNodeTypesResponse.prototype.nodeTypes = $util.emptyArray; + OperationMetadata.prototype.createTime = null; /** - * ListNodeTypesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @instance */ - ListNodeTypesResponse.prototype.nextPageToken = ""; + OperationMetadata.prototype.endTime = null; /** - * ListNodeTypesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @instance */ - ListNodeTypesResponse.prototype.unreachable = $util.emptyArray; + OperationMetadata.prototype.target = ""; /** - * Creates a new ListNodeTypesResponse instance using the specified properties. + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse instance + * @param {google.cloud.vmwareengine.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata instance */ - ListNodeTypesResponse.create = function create(properties) { - return new ListNodeTypesResponse(properties); + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); }; /** - * Encodes the specified ListNodeTypesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmwareengine.v1.OperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNodeTypesResponse.encode = function encode(message, writer) { + OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeTypes != null && message.nodeTypes.length) - for (var i = 0; i < message.nodeTypes.length; ++i) - $root.google.cloud.vmwareengine.v1.NodeType.encode(message.nodeTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); return writer; }; /** - * Encodes the specified ListNodeTypesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.OperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static - * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNodeTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNodeTypesResponse message from the specified reader or buffer. + * Decodes an OperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.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.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNodeTypesResponse.decode = function decode(reader, length) { + 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.vmwareengine.v1.ListNodeTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.OperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.nodeTypes && message.nodeTypes.length)) - message.nodeTypes = []; - message.nodeTypes.push($root.google.cloud.vmwareengine.v1.NodeType.decode(reader, reader.uint32())); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.nextPageToken = reader.string(); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.target = reader.string(); break; } - default: - reader.skipType(tag & 7); + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } } @@ -5855,169 +6026,184 @@ }; /** - * Decodes a ListNodeTypesResponse message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNodeTypesResponse.decodeDelimited = function decodeDelimited(reader) { + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNodeTypesResponse message. + * Verifies an OperationMetadata message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNodeTypesResponse.verify = function verify(message) { + OperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.nodeTypes != null && message.hasOwnProperty("nodeTypes")) { - if (!Array.isArray(message.nodeTypes)) - return "nodeTypes: array expected"; - for (var i = 0; i < message.nodeTypes.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.NodeType.verify(message.nodeTypes[i]); - if (error) - return "nodeTypes." + error; - } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; return null; }; /** - * Creates a ListNodeTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata */ - ListNodeTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse) + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.OperationMetadata) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse(); - if (object.nodeTypes) { - if (!Array.isArray(object.nodeTypes)) - throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: array expected"); - message.nodeTypes = []; - for (var i = 0; i < object.nodeTypes.length; ++i) { - if (typeof object.nodeTypes[i] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: object expected"); - message.nodeTypes[i] = $root.google.cloud.vmwareengine.v1.NodeType.fromObject(object.nodeTypes[i]); - } + var message = new $root.google.cloud.vmwareengine.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); return message; }; /** - * Creates a plain object from a ListNodeTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static - * @param {google.cloud.vmwareengine.v1.ListNodeTypesResponse} message ListNodeTypesResponse + * @param {google.cloud.vmwareengine.v1.OperationMetadata} message OperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNodeTypesResponse.toObject = function toObject(message, options) { + OperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.nodeTypes = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.nodeTypes && message.nodeTypes.length) { - object.nodeTypes = []; - for (var j = 0; j < message.nodeTypes.length; ++j) - object.nodeTypes[j] = $root.google.cloud.vmwareengine.v1.NodeType.toObject(message.nodeTypes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; return object; }; /** - * Converts this ListNodeTypesResponse to JSON. + * Converts this OperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @instance * @returns {Object.} JSON object */ - ListNodeTypesResponse.prototype.toJSON = function toJSON() { + OperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListNodeTypesResponse + * Gets the default type url for OperationMetadata * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @memberof google.cloud.vmwareengine.v1.OperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListNodeTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesResponse"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.OperationMetadata"; }; - return ListNodeTypesResponse; + return OperationMetadata; })(); - v1.GetNodeTypeRequest = (function() { + v1.ListNodeTypesRequest = (function() { /** - * Properties of a GetNodeTypeRequest. + * Properties of a ListNodeTypesRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IGetNodeTypeRequest - * @property {string|null} [name] GetNodeTypeRequest name + * @interface IListNodeTypesRequest + * @property {string|null} [parent] ListNodeTypesRequest parent + * @property {number|null} [pageSize] ListNodeTypesRequest pageSize + * @property {string|null} [pageToken] ListNodeTypesRequest pageToken + * @property {string|null} [filter] ListNodeTypesRequest filter */ /** - * Constructs a new GetNodeTypeRequest. + * Constructs a new ListNodeTypesRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a GetNodeTypeRequest. - * @implements IGetNodeTypeRequest + * @classdesc Represents a ListNodeTypesRequest. + * @implements IListNodeTypesRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set */ - function GetNodeTypeRequest(properties) { + function ListNodeTypesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6025,75 +6211,117 @@ } /** - * GetNodeTypeRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * ListNodeTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @instance */ - GetNodeTypeRequest.prototype.name = ""; + ListNodeTypesRequest.prototype.parent = ""; /** - * Creates a new GetNodeTypeRequest instance using the specified properties. + * ListNodeTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.pageSize = 0; + + /** + * ListNodeTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.pageToken = ""; + + /** + * ListNodeTypesRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.filter = ""; + + /** + * Creates a new ListNodeTypesRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest instance + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest instance */ - GetNodeTypeRequest.create = function create(properties) { - return new GetNodeTypeRequest(properties); + ListNodeTypesRequest.create = function create(properties) { + return new ListNodeTypesRequest(properties); }; /** - * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNodeTypeRequest.encode = function encode(message, writer) { + ListNodeTypesRequest.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.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 GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNodeTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNodeTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNodeTypeRequest message from the specified reader or buffer. + * Decodes a ListNodeTypesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNodeTypeRequest.decode = function decode(reader, length) { + ListNodeTypesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + 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: @@ -6105,122 +6333,151 @@ }; /** - * Decodes a GetNodeTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNodeTypeRequest.decodeDelimited = function decodeDelimited(reader) { + ListNodeTypesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNodeTypeRequest message. + * Verifies a ListNodeTypesRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNodeTypeRequest.verify = function verify(message) { + ListNodeTypesRequest.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.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 GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest */ - GetNodeTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest) + ListNodeTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest(); + 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 GetNodeTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static - * @param {google.cloud.vmwareengine.v1.GetNodeTypeRequest} message GetNodeTypeRequest + * @param {google.cloud.vmwareengine.v1.ListNodeTypesRequest} message ListNodeTypesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNodeTypeRequest.toObject = function toObject(message, options) { + ListNodeTypesRequest.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; + 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 GetNodeTypeRequest to JSON. + * Converts this ListNodeTypesRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @instance * @returns {Object.} JSON object */ - GetNodeTypeRequest.prototype.toJSON = function toJSON() { + ListNodeTypesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetNodeTypeRequest + * Gets the default type url for ListNodeTypesRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetNodeTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListNodeTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNodeTypeRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesRequest"; }; - return GetNodeTypeRequest; + return ListNodeTypesRequest; })(); - v1.ShowNsxCredentialsRequest = (function() { + v1.ListNodeTypesResponse = (function() { /** - * Properties of a ShowNsxCredentialsRequest. + * Properties of a ListNodeTypesResponse. * @memberof google.cloud.vmwareengine.v1 - * @interface IShowNsxCredentialsRequest - * @property {string|null} [privateCloud] ShowNsxCredentialsRequest privateCloud + * @interface IListNodeTypesResponse + * @property {Array.|null} [nodeTypes] ListNodeTypesResponse nodeTypes + * @property {string|null} [nextPageToken] ListNodeTypesResponse nextPageToken + * @property {Array.|null} [unreachable] ListNodeTypesResponse unreachable */ /** - * Constructs a new ShowNsxCredentialsRequest. + * Constructs a new ListNodeTypesResponse. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ShowNsxCredentialsRequest. - * @implements IShowNsxCredentialsRequest + * @classdesc Represents a ListNodeTypesResponse. + * @implements IListNodeTypesResponse * @constructor - * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set */ - function ShowNsxCredentialsRequest(properties) { + function ListNodeTypesResponse(properties) { + this.nodeTypes = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6228,75 +6485,109 @@ } /** - * ShowNsxCredentialsRequest privateCloud. - * @member {string} privateCloud - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * ListNodeTypesResponse nodeTypes. + * @member {Array.} nodeTypes + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @instance */ - ShowNsxCredentialsRequest.prototype.privateCloud = ""; + ListNodeTypesResponse.prototype.nodeTypes = $util.emptyArray; /** - * Creates a new ShowNsxCredentialsRequest instance using the specified properties. + * ListNodeTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + */ + ListNodeTypesResponse.prototype.nextPageToken = ""; + + /** + * ListNodeTypesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + */ + ListNodeTypesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListNodeTypesResponse instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static - * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest instance + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse instance */ - ShowNsxCredentialsRequest.create = function create(properties) { - return new ShowNsxCredentialsRequest(properties); + ListNodeTypesResponse.create = function create(properties) { + return new ListNodeTypesResponse(properties); }; /** - * Encodes the specified ShowNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * Encodes the specified ListNodeTypesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static - * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShowNsxCredentialsRequest.encode = function encode(message, writer) { + ListNodeTypesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.nodeTypes != null && message.nodeTypes.length) + for (var i = 0; i < message.nodeTypes.length; ++i) + $root.google.cloud.vmwareengine.v1.NodeType.encode(message.nodeTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified ShowNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * Encodes the specified ListNodeTypesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static - * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShowNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNodeTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer. + * Decodes a ListNodeTypesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShowNsxCredentialsRequest.decode = function decode(reader, length) { + ListNodeTypesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.privateCloud = reader.string(); + if (!(message.nodeTypes && message.nodeTypes.length)) + message.nodeTypes = []; + message.nodeTypes.push($root.google.cloud.vmwareengine.v1.NodeType.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -6308,122 +6599,169 @@ }; /** - * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNodeTypesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShowNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + ListNodeTypesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ShowNsxCredentialsRequest message. + * Verifies a ListNodeTypesResponse message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ShowNsxCredentialsRequest.verify = function verify(message) { + ListNodeTypesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) - if (!$util.isString(message.privateCloud)) - return "privateCloud: string expected"; + if (message.nodeTypes != null && message.hasOwnProperty("nodeTypes")) { + if (!Array.isArray(message.nodeTypes)) + return "nodeTypes: array expected"; + for (var i = 0; i < message.nodeTypes.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeType.verify(message.nodeTypes[i]); + if (error) + return "nodeTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a ShowNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNodeTypesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse */ - ShowNsxCredentialsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest) + ListNodeTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse) return object; - var message = new $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest(); - if (object.privateCloud != null) - message.privateCloud = String(object.privateCloud); + var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse(); + if (object.nodeTypes) { + if (!Array.isArray(object.nodeTypes)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: array expected"); + message.nodeTypes = []; + for (var i = 0; i < object.nodeTypes.length; ++i) { + if (typeof object.nodeTypes[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: object expected"); + message.nodeTypes[i] = $root.google.cloud.vmwareengine.v1.NodeType.fromObject(object.nodeTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a ShowNsxCredentialsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNodeTypesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static - * @param {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} message ShowNsxCredentialsRequest + * @param {google.cloud.vmwareengine.v1.ListNodeTypesResponse} message ListNodeTypesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ShowNsxCredentialsRequest.toObject = function toObject(message, options) { + ListNodeTypesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.nodeTypes = []; + object.unreachable = []; + } if (options.defaults) - object.privateCloud = ""; - if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) - object.privateCloud = message.privateCloud; + object.nextPageToken = ""; + if (message.nodeTypes && message.nodeTypes.length) { + object.nodeTypes = []; + for (var j = 0; j < message.nodeTypes.length; ++j) + object.nodeTypes[j] = $root.google.cloud.vmwareengine.v1.NodeType.toObject(message.nodeTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this ShowNsxCredentialsRequest to JSON. + * Converts this ListNodeTypesResponse to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @instance * @returns {Object.} JSON object */ - ShowNsxCredentialsRequest.prototype.toJSON = function toJSON() { + ListNodeTypesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ShowNsxCredentialsRequest + * Gets the default type url for ListNodeTypesResponse * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ShowNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListNodeTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesResponse"; }; - return ShowNsxCredentialsRequest; + return ListNodeTypesResponse; })(); - v1.ShowVcenterCredentialsRequest = (function() { + v1.GetNodeTypeRequest = (function() { /** - * Properties of a ShowVcenterCredentialsRequest. + * Properties of a GetNodeTypeRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IShowVcenterCredentialsRequest - * @property {string|null} [privateCloud] ShowVcenterCredentialsRequest privateCloud + * @interface IGetNodeTypeRequest + * @property {string|null} [name] GetNodeTypeRequest name */ /** - * Constructs a new ShowVcenterCredentialsRequest. + * Constructs a new GetNodeTypeRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ShowVcenterCredentialsRequest. - * @implements IShowVcenterCredentialsRequest + * @classdesc Represents a GetNodeTypeRequest. + * @implements IGetNodeTypeRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set */ - function ShowVcenterCredentialsRequest(properties) { + function GetNodeTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6431,75 +6769,75 @@ } /** - * ShowVcenterCredentialsRequest privateCloud. - * @member {string} privateCloud - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * GetNodeTypeRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @instance */ - ShowVcenterCredentialsRequest.prototype.privateCloud = ""; + GetNodeTypeRequest.prototype.name = ""; /** - * Creates a new ShowVcenterCredentialsRequest instance using the specified properties. + * Creates a new GetNodeTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static - * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest instance + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest instance */ - ShowVcenterCredentialsRequest.create = function create(properties) { - return new ShowVcenterCredentialsRequest(properties); + GetNodeTypeRequest.create = function create(properties) { + return new GetNodeTypeRequest(properties); }; /** - * Encodes the specified ShowVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static - * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShowVcenterCredentialsRequest.encode = function encode(message, writer) { + GetNodeTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ShowVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * Encodes the specified GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static - * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShowVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNodeTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer. + * Decodes a GetNodeTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShowVcenterCredentialsRequest.decode = function decode(reader, length) { + GetNodeTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.privateCloud = reader.string(); + message.name = reader.string(); break; } default: @@ -6511,123 +6849,122 @@ }; /** - * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNodeTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShowVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + GetNodeTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ShowVcenterCredentialsRequest message. + * Verifies a GetNodeTypeRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ShowVcenterCredentialsRequest.verify = function verify(message) { + GetNodeTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) - if (!$util.isString(message.privateCloud)) - return "privateCloud: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ShowVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest */ - ShowVcenterCredentialsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest) + GetNodeTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest(); - if (object.privateCloud != null) - message.privateCloud = String(object.privateCloud); + var message = new $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ShowVcenterCredentialsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNodeTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static - * @param {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest + * @param {google.cloud.vmwareengine.v1.GetNodeTypeRequest} message GetNodeTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ShowVcenterCredentialsRequest.toObject = function toObject(message, options) { + GetNodeTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.privateCloud = ""; - if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) - object.privateCloud = message.privateCloud; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ShowVcenterCredentialsRequest to JSON. + * Converts this GetNodeTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @instance * @returns {Object.} JSON object */ - ShowVcenterCredentialsRequest.prototype.toJSON = function toJSON() { + GetNodeTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ShowVcenterCredentialsRequest + * Gets the default type url for GetNodeTypeRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ShowVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetNodeTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNodeTypeRequest"; }; - return ShowVcenterCredentialsRequest; + return GetNodeTypeRequest; })(); - v1.ResetNsxCredentialsRequest = (function() { + v1.ShowNsxCredentialsRequest = (function() { /** - * Properties of a ResetNsxCredentialsRequest. + * Properties of a ShowNsxCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IResetNsxCredentialsRequest - * @property {string|null} [privateCloud] ResetNsxCredentialsRequest privateCloud - * @property {string|null} [requestId] ResetNsxCredentialsRequest requestId + * @interface IShowNsxCredentialsRequest + * @property {string|null} [privateCloud] ShowNsxCredentialsRequest privateCloud */ /** - * Constructs a new ResetNsxCredentialsRequest. + * Constructs a new ShowNsxCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ResetNsxCredentialsRequest. - * @implements IResetNsxCredentialsRequest + * @classdesc Represents a ShowNsxCredentialsRequest. + * @implements IShowNsxCredentialsRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set */ - function ResetNsxCredentialsRequest(properties) { + function ShowNsxCredentialsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6635,80 +6972,70 @@ } /** - * ResetNsxCredentialsRequest privateCloud. + * ShowNsxCredentialsRequest privateCloud. * @member {string} privateCloud - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest - * @instance - */ - ResetNsxCredentialsRequest.prototype.privateCloud = ""; - - /** - * ResetNsxCredentialsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @instance */ - ResetNsxCredentialsRequest.prototype.requestId = ""; + ShowNsxCredentialsRequest.prototype.privateCloud = ""; /** - * Creates a new ResetNsxCredentialsRequest instance using the specified properties. + * Creates a new ShowNsxCredentialsRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest instance + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest instance */ - ResetNsxCredentialsRequest.create = function create(properties) { - return new ResetNsxCredentialsRequest(properties); + ShowNsxCredentialsRequest.create = function create(properties) { + return new ShowNsxCredentialsRequest(properties); }; /** - * Encodes the specified ResetNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * Encodes the specified ShowNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetNsxCredentialsRequest.encode = function encode(message, writer) { + ShowNsxCredentialsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified ResetNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * Encodes the specified ShowNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ShowNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer. + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetNsxCredentialsRequest.decode = function decode(reader, length) { + ShowNsxCredentialsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6716,10 +7043,6 @@ message.privateCloud = reader.string(); break; } - case 2: { - message.requestId = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -6729,132 +7052,122 @@ }; /** - * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + ShowNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResetNsxCredentialsRequest message. + * Verifies a ShowNsxCredentialsRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResetNsxCredentialsRequest.verify = function verify(message) { + ShowNsxCredentialsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) if (!$util.isString(message.privateCloud)) return "privateCloud: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates a ResetNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ShowNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest */ - ResetNsxCredentialsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest) + ShowNsxCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest(); + var message = new $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest(); if (object.privateCloud != null) message.privateCloud = String(object.privateCloud); - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ResetNsxCredentialsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ShowNsxCredentialsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} message ResetNsxCredentialsRequest + * @param {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} message ShowNsxCredentialsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResetNsxCredentialsRequest.toObject = function toObject(message, options) { + ShowNsxCredentialsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.privateCloud = ""; - object.requestId = ""; - } if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) object.privateCloud = message.privateCloud; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this ResetNsxCredentialsRequest to JSON. + * Converts this ShowNsxCredentialsRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @instance * @returns {Object.} JSON object */ - ResetNsxCredentialsRequest.prototype.toJSON = function toJSON() { + ShowNsxCredentialsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResetNsxCredentialsRequest + * Gets the default type url for ShowNsxCredentialsRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResetNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ShowNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"; }; - return ResetNsxCredentialsRequest; + return ShowNsxCredentialsRequest; })(); - v1.ResetVcenterCredentialsRequest = (function() { + v1.ShowVcenterCredentialsRequest = (function() { /** - * Properties of a ResetVcenterCredentialsRequest. + * Properties of a ShowVcenterCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IResetVcenterCredentialsRequest - * @property {string|null} [privateCloud] ResetVcenterCredentialsRequest privateCloud - * @property {string|null} [requestId] ResetVcenterCredentialsRequest requestId + * @interface IShowVcenterCredentialsRequest + * @property {string|null} [privateCloud] ShowVcenterCredentialsRequest privateCloud */ /** - * Constructs a new ResetVcenterCredentialsRequest. + * Constructs a new ShowVcenterCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ResetVcenterCredentialsRequest. - * @implements IResetVcenterCredentialsRequest + * @classdesc Represents a ShowVcenterCredentialsRequest. + * @implements IShowVcenterCredentialsRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set */ - function ResetVcenterCredentialsRequest(properties) { + function ShowVcenterCredentialsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6862,80 +7175,70 @@ } /** - * ResetVcenterCredentialsRequest privateCloud. + * ShowVcenterCredentialsRequest privateCloud. * @member {string} privateCloud - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest - * @instance - */ - ResetVcenterCredentialsRequest.prototype.privateCloud = ""; - - /** - * ResetVcenterCredentialsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @instance */ - ResetVcenterCredentialsRequest.prototype.requestId = ""; + ShowVcenterCredentialsRequest.prototype.privateCloud = ""; /** - * Creates a new ResetVcenterCredentialsRequest instance using the specified properties. + * Creates a new ShowVcenterCredentialsRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest instance + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest instance */ - ResetVcenterCredentialsRequest.create = function create(properties) { - return new ResetVcenterCredentialsRequest(properties); + ShowVcenterCredentialsRequest.create = function create(properties) { + return new ShowVcenterCredentialsRequest(properties); }; /** - * Encodes the specified ResetVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * Encodes the specified ShowVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetVcenterCredentialsRequest.encode = function encode(message, writer) { + ShowVcenterCredentialsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified ResetVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * Encodes the specified ShowVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ShowVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer. + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetVcenterCredentialsRequest.decode = function decode(reader, length) { + ShowVcenterCredentialsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6943,10 +7246,6 @@ message.privateCloud = reader.string(); break; } - case 2: { - message.requestId = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -6956,135 +7255,123 @@ }; /** - * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + ShowVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResetVcenterCredentialsRequest message. + * Verifies a ShowVcenterCredentialsRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResetVcenterCredentialsRequest.verify = function verify(message) { + ShowVcenterCredentialsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) if (!$util.isString(message.privateCloud)) return "privateCloud: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates a ResetVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ShowVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest */ - ResetVcenterCredentialsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest) + ShowVcenterCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest(); + var message = new $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest(); if (object.privateCloud != null) message.privateCloud = String(object.privateCloud); - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ResetVcenterCredentialsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ShowVcenterCredentialsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest + * @param {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResetVcenterCredentialsRequest.toObject = function toObject(message, options) { + ShowVcenterCredentialsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.privateCloud = ""; - object.requestId = ""; - } if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) object.privateCloud = message.privateCloud; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this ResetVcenterCredentialsRequest to JSON. + * Converts this ShowVcenterCredentialsRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @instance * @returns {Object.} JSON object */ - ResetVcenterCredentialsRequest.prototype.toJSON = function toJSON() { + ShowVcenterCredentialsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResetVcenterCredentialsRequest + * Gets the default type url for ShowVcenterCredentialsRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResetVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ShowVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"; }; - return ResetVcenterCredentialsRequest; + return ShowVcenterCredentialsRequest; })(); - v1.ListHcxActivationKeysResponse = (function() { + v1.ResetNsxCredentialsRequest = (function() { /** - * Properties of a ListHcxActivationKeysResponse. + * Properties of a ResetNsxCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListHcxActivationKeysResponse - * @property {Array.|null} [hcxActivationKeys] ListHcxActivationKeysResponse hcxActivationKeys - * @property {string|null} [nextPageToken] ListHcxActivationKeysResponse nextPageToken - * @property {Array.|null} [unreachable] ListHcxActivationKeysResponse unreachable + * @interface IResetNsxCredentialsRequest + * @property {string|null} [privateCloud] ResetNsxCredentialsRequest privateCloud + * @property {string|null} [requestId] ResetNsxCredentialsRequest requestId */ /** - * Constructs a new ListHcxActivationKeysResponse. + * Constructs a new ResetNsxCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListHcxActivationKeysResponse. - * @implements IListHcxActivationKeysResponse + * @classdesc Represents a ResetNsxCredentialsRequest. + * @implements IResetNsxCredentialsRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set */ - function ListHcxActivationKeysResponse(properties) { - this.hcxActivationKeys = []; - this.unreachable = []; + function ResetNsxCredentialsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7092,109 +7379,89 @@ } /** - * ListHcxActivationKeysResponse hcxActivationKeys. - * @member {Array.} hcxActivationKeys - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse - * @instance - */ - ListHcxActivationKeysResponse.prototype.hcxActivationKeys = $util.emptyArray; - - /** - * ListHcxActivationKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * ResetNsxCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @instance */ - ListHcxActivationKeysResponse.prototype.nextPageToken = ""; + ResetNsxCredentialsRequest.prototype.privateCloud = ""; /** - * ListHcxActivationKeysResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * ResetNsxCredentialsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @instance */ - ListHcxActivationKeysResponse.prototype.unreachable = $util.emptyArray; + ResetNsxCredentialsRequest.prototype.requestId = ""; /** - * Creates a new ListHcxActivationKeysResponse instance using the specified properties. + * Creates a new ResetNsxCredentialsRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse instance + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest instance */ - ListHcxActivationKeysResponse.create = function create(properties) { - return new ListHcxActivationKeysResponse(properties); + ResetNsxCredentialsRequest.create = function create(properties) { + return new ResetNsxCredentialsRequest(properties); }; /** - * Encodes the specified ListHcxActivationKeysResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * Encodes the specified ResetNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHcxActivationKeysResponse.encode = function encode(message, writer) { + ResetNsxCredentialsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hcxActivationKeys != null && message.hcxActivationKeys.length) - for (var i = 0; i < message.hcxActivationKeys.length; ++i) - $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified ListHcxActivationKeysResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * Encodes the specified ResetNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHcxActivationKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + ResetNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer. + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHcxActivationKeysResponse.decode = function decode(reader, length) { + ResetNsxCredentialsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.hcxActivationKeys && message.hcxActivationKeys.length)) - message.hcxActivationKeys = []; - message.hcxActivationKeys.push($root.google.cloud.vmwareengine.v1.HcxActivationKey.decode(reader, reader.uint32())); + message.privateCloud = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.requestId = reader.string(); break; } default: @@ -7206,171 +7473,132 @@ }; /** - * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer, length delimited. + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHcxActivationKeysResponse.decodeDelimited = function decodeDelimited(reader) { + ResetNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListHcxActivationKeysResponse message. + * Verifies a ResetNsxCredentialsRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListHcxActivationKeysResponse.verify = function verify(message) { + ResetNsxCredentialsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hcxActivationKeys != null && message.hasOwnProperty("hcxActivationKeys")) { - if (!Array.isArray(message.hcxActivationKeys)) - return "hcxActivationKeys: array expected"; - for (var i = 0; i < message.hcxActivationKeys.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKeys[i]); - if (error) - return "hcxActivationKeys." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListHcxActivationKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ResetNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest */ - ListHcxActivationKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse) + ResetNsxCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse(); - if (object.hcxActivationKeys) { - if (!Array.isArray(object.hcxActivationKeys)) - throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: array expected"); - message.hcxActivationKeys = []; - for (var i = 0; i < object.hcxActivationKeys.length; ++i) { - if (typeof object.hcxActivationKeys[i] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: object expected"); - message.hcxActivationKeys[i] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKeys[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } + var message = new $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListHcxActivationKeysResponse message. Also converts values to other types if specified. + * Creates a plain object from a ResetNsxCredentialsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} message ListHcxActivationKeysResponse + * @param {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} message ResetNsxCredentialsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListHcxActivationKeysResponse.toObject = function toObject(message, options) { + ResetNsxCredentialsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.hcxActivationKeys = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.hcxActivationKeys && message.hcxActivationKeys.length) { - object.hcxActivationKeys = []; - for (var j = 0; j < message.hcxActivationKeys.length; ++j) - object.hcxActivationKeys[j] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKeys[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.privateCloud = ""; + object.requestId = ""; } + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListHcxActivationKeysResponse to JSON. + * Converts this ResetNsxCredentialsRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @instance * @returns {Object.} JSON object */ - ListHcxActivationKeysResponse.prototype.toJSON = function toJSON() { + ResetNsxCredentialsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListHcxActivationKeysResponse + * Gets the default type url for ResetNsxCredentialsRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListHcxActivationKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResetNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"; }; - return ListHcxActivationKeysResponse; + return ResetNsxCredentialsRequest; })(); - v1.ListHcxActivationKeysRequest = (function() { + v1.ResetVcenterCredentialsRequest = (function() { /** - * Properties of a ListHcxActivationKeysRequest. + * Properties of a ResetVcenterCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListHcxActivationKeysRequest - * @property {string|null} [parent] ListHcxActivationKeysRequest parent - * @property {number|null} [pageSize] ListHcxActivationKeysRequest pageSize - * @property {string|null} [pageToken] ListHcxActivationKeysRequest pageToken + * @interface IResetVcenterCredentialsRequest + * @property {string|null} [privateCloud] ResetVcenterCredentialsRequest privateCloud + * @property {string|null} [requestId] ResetVcenterCredentialsRequest requestId */ /** - * Constructs a new ListHcxActivationKeysRequest. + * Constructs a new ResetVcenterCredentialsRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListHcxActivationKeysRequest. - * @implements IListHcxActivationKeysRequest + * @classdesc Represents a ResetVcenterCredentialsRequest. + * @implements IResetVcenterCredentialsRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set */ - function ListHcxActivationKeysRequest(properties) { + function ResetVcenterCredentialsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7378,103 +7606,89 @@ } /** - * ListHcxActivationKeysRequest parent. - * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest - * @instance - */ - ListHcxActivationKeysRequest.prototype.parent = ""; - - /** - * ListHcxActivationKeysRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * ResetVcenterCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @instance */ - ListHcxActivationKeysRequest.prototype.pageSize = 0; + ResetVcenterCredentialsRequest.prototype.privateCloud = ""; /** - * ListHcxActivationKeysRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * ResetVcenterCredentialsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @instance */ - ListHcxActivationKeysRequest.prototype.pageToken = ""; + ResetVcenterCredentialsRequest.prototype.requestId = ""; /** - * Creates a new ListHcxActivationKeysRequest instance using the specified properties. + * Creates a new ResetVcenterCredentialsRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest instance + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest instance */ - ListHcxActivationKeysRequest.create = function create(properties) { - return new ListHcxActivationKeysRequest(properties); + ResetVcenterCredentialsRequest.create = function create(properties) { + return new ResetVcenterCredentialsRequest(properties); }; /** - * Encodes the specified ListHcxActivationKeysRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * Encodes the specified ResetVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHcxActivationKeysRequest.encode = function encode(message, writer) { + ResetVcenterCredentialsRequest.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.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified ListHcxActivationKeysRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * Encodes the specified ResetVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHcxActivationKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + ResetVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer. + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHcxActivationKeysRequest.decode = function decode(reader, length) { + ResetVcenterCredentialsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.privateCloud = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); + message.requestId = reader.string(); break; } default: @@ -7486,139 +7700,135 @@ }; /** - * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer, length delimited. + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHcxActivationKeysRequest.decodeDelimited = function decodeDelimited(reader) { + ResetVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListHcxActivationKeysRequest message. + * Verifies a ResetVcenterCredentialsRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListHcxActivationKeysRequest.verify = function verify(message) { + ResetVcenterCredentialsRequest.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.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListHcxActivationKeysRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ResetVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest */ - ListHcxActivationKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest) + ResetVcenterCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest(); - 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); + var message = new $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListHcxActivationKeysRequest message. Also converts values to other types if specified. + * Creates a plain object from a ResetVcenterCredentialsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static - * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} message ListHcxActivationKeysRequest + * @param {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListHcxActivationKeysRequest.toObject = function toObject(message, options) { + ResetVcenterCredentialsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.privateCloud = ""; + object.requestId = ""; } - 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.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListHcxActivationKeysRequest to JSON. + * Converts this ResetVcenterCredentialsRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @instance * @returns {Object.} JSON object */ - ListHcxActivationKeysRequest.prototype.toJSON = function toJSON() { + ResetVcenterCredentialsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListHcxActivationKeysRequest + * Gets the default type url for ResetVcenterCredentialsRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListHcxActivationKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResetVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"; }; - return ListHcxActivationKeysRequest; + return ResetVcenterCredentialsRequest; })(); - v1.GetHcxActivationKeyRequest = (function() { + v1.ListHcxActivationKeysResponse = (function() { /** - * Properties of a GetHcxActivationKeyRequest. + * Properties of a ListHcxActivationKeysResponse. * @memberof google.cloud.vmwareengine.v1 - * @interface IGetHcxActivationKeyRequest - * @property {string|null} [name] GetHcxActivationKeyRequest name + * @interface IListHcxActivationKeysResponse + * @property {Array.|null} [hcxActivationKeys] ListHcxActivationKeysResponse hcxActivationKeys + * @property {string|null} [nextPageToken] ListHcxActivationKeysResponse nextPageToken + * @property {Array.|null} [unreachable] ListHcxActivationKeysResponse unreachable */ /** - * Constructs a new GetHcxActivationKeyRequest. + * Constructs a new ListHcxActivationKeysResponse. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a GetHcxActivationKeyRequest. - * @implements IGetHcxActivationKeyRequest + * @classdesc Represents a ListHcxActivationKeysResponse. + * @implements IListHcxActivationKeysResponse * @constructor - * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set */ - function GetHcxActivationKeyRequest(properties) { + function ListHcxActivationKeysResponse(properties) { + this.hcxActivationKeys = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7626,75 +7836,109 @@ } /** - * GetHcxActivationKeyRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * ListHcxActivationKeysResponse hcxActivationKeys. + * @member {Array.} hcxActivationKeys + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @instance */ - GetHcxActivationKeyRequest.prototype.name = ""; + ListHcxActivationKeysResponse.prototype.hcxActivationKeys = $util.emptyArray; /** - * Creates a new GetHcxActivationKeyRequest instance using the specified properties. + * ListHcxActivationKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + */ + ListHcxActivationKeysResponse.prototype.nextPageToken = ""; + + /** + * ListHcxActivationKeysResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + */ + ListHcxActivationKeysResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListHcxActivationKeysResponse instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static - * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest instance + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse instance */ - GetHcxActivationKeyRequest.create = function create(properties) { - return new GetHcxActivationKeyRequest(properties); + ListHcxActivationKeysResponse.create = function create(properties) { + return new ListHcxActivationKeysResponse(properties); }; /** - * Encodes the specified GetHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * Encodes the specified ListHcxActivationKeysResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static - * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetHcxActivationKeyRequest.encode = function encode(message, writer) { + ListHcxActivationKeysResponse.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.hcxActivationKeys != null && message.hcxActivationKeys.length) + for (var i = 0; i < message.hcxActivationKeys.length; ++i) + $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKeys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified GetHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * Encodes the specified ListHcxActivationKeysResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static - * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHcxActivationKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer. + * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetHcxActivationKeyRequest.decode = function decode(reader, length) { + ListHcxActivationKeysResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.hcxActivationKeys && message.hcxActivationKeys.length)) + message.hcxActivationKeys = []; + message.hcxActivationKeys.push($root.google.cloud.vmwareengine.v1.HcxActivationKey.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -7706,125 +7950,171 @@ }; /** - * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListHcxActivationKeysResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetHcxActivationKeyRequest message. + * Verifies a ListHcxActivationKeysResponse message. * @function verify - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetHcxActivationKeyRequest.verify = function verify(message) { + ListHcxActivationKeysResponse.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.hcxActivationKeys != null && message.hasOwnProperty("hcxActivationKeys")) { + if (!Array.isArray(message.hcxActivationKeys)) + return "hcxActivationKeys: array expected"; + for (var i = 0; i < message.hcxActivationKeys.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKeys[i]); + if (error) + return "hcxActivationKeys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a GetHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHcxActivationKeysResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse */ - GetHcxActivationKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest) + ListHcxActivationKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse) return object; - var message = new $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse(); + if (object.hcxActivationKeys) { + if (!Array.isArray(object.hcxActivationKeys)) + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: array expected"); + message.hcxActivationKeys = []; + for (var i = 0; i < object.hcxActivationKeys.length; ++i) { + if (typeof object.hcxActivationKeys[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: object expected"); + message.hcxActivationKeys[i] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKeys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a GetHcxActivationKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHcxActivationKeysResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static - * @param {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} message GetHcxActivationKeyRequest + * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} message ListHcxActivationKeysResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetHcxActivationKeyRequest.toObject = function toObject(message, options) { + ListHcxActivationKeysResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.hcxActivationKeys = []; + object.unreachable = []; + } if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.hcxActivationKeys && message.hcxActivationKeys.length) { + object.hcxActivationKeys = []; + for (var j = 0; j < message.hcxActivationKeys.length; ++j) + object.hcxActivationKeys[j] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKeys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this GetHcxActivationKeyRequest to JSON. + * Converts this ListHcxActivationKeysResponse to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @instance * @returns {Object.} JSON object */ - GetHcxActivationKeyRequest.prototype.toJSON = function toJSON() { + ListHcxActivationKeysResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetHcxActivationKeyRequest + * Gets the default type url for ListHcxActivationKeysResponse * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHcxActivationKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"; }; - return GetHcxActivationKeyRequest; + return ListHcxActivationKeysResponse; })(); - v1.CreateHcxActivationKeyRequest = (function() { + v1.ListHcxActivationKeysRequest = (function() { /** - * Properties of a CreateHcxActivationKeyRequest. + * Properties of a ListHcxActivationKeysRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface ICreateHcxActivationKeyRequest - * @property {string|null} [parent] CreateHcxActivationKeyRequest parent - * @property {google.cloud.vmwareengine.v1.IHcxActivationKey|null} [hcxActivationKey] CreateHcxActivationKeyRequest hcxActivationKey - * @property {string|null} [hcxActivationKeyId] CreateHcxActivationKeyRequest hcxActivationKeyId - * @property {string|null} [requestId] CreateHcxActivationKeyRequest requestId + * @interface IListHcxActivationKeysRequest + * @property {string|null} [parent] ListHcxActivationKeysRequest parent + * @property {number|null} [pageSize] ListHcxActivationKeysRequest pageSize + * @property {string|null} [pageToken] ListHcxActivationKeysRequest pageToken */ /** - * Constructs a new CreateHcxActivationKeyRequest. + * Constructs a new ListHcxActivationKeysRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a CreateHcxActivationKeyRequest. - * @implements ICreateHcxActivationKeyRequest + * @classdesc Represents a ListHcxActivationKeysRequest. + * @implements IListHcxActivationKeysRequest * @constructor - * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set */ - function CreateHcxActivationKeyRequest(properties) { + function ListHcxActivationKeysRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7832,100 +8122,90 @@ } /** - * CreateHcxActivationKeyRequest parent. + * ListHcxActivationKeysRequest parent. * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest - * @instance - */ - CreateHcxActivationKeyRequest.prototype.parent = ""; - - /** - * CreateHcxActivationKeyRequest hcxActivationKey. - * @member {google.cloud.vmwareengine.v1.IHcxActivationKey|null|undefined} hcxActivationKey - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @instance */ - CreateHcxActivationKeyRequest.prototype.hcxActivationKey = null; + ListHcxActivationKeysRequest.prototype.parent = ""; /** - * CreateHcxActivationKeyRequest hcxActivationKeyId. - * @member {string} hcxActivationKeyId - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * ListHcxActivationKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @instance */ - CreateHcxActivationKeyRequest.prototype.hcxActivationKeyId = ""; + ListHcxActivationKeysRequest.prototype.pageSize = 0; /** - * CreateHcxActivationKeyRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * ListHcxActivationKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @instance */ - CreateHcxActivationKeyRequest.prototype.requestId = ""; + ListHcxActivationKeysRequest.prototype.pageToken = ""; /** - * Creates a new CreateHcxActivationKeyRequest instance using the specified properties. + * Creates a new ListHcxActivationKeysRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest instance + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest instance */ - CreateHcxActivationKeyRequest.create = function create(properties) { - return new CreateHcxActivationKeyRequest(properties); + ListHcxActivationKeysRequest.create = function create(properties) { + return new ListHcxActivationKeysRequest(properties); }; /** - * Encodes the specified CreateHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * Encodes the specified ListHcxActivationKeysRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateHcxActivationKeyRequest.encode = function encode(message, writer) { + ListHcxActivationKeysRequest.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.hcxActivationKey != null && Object.hasOwnProperty.call(message, "hcxActivationKey")) - $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.hcxActivationKeyId != null && Object.hasOwnProperty.call(message, "hcxActivationKeyId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.hcxActivationKeyId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + 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 CreateHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * Encodes the specified ListHcxActivationKeysRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHcxActivationKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer. + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateHcxActivationKeyRequest.decode = function decode(reader, length) { + ListHcxActivationKeysRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -7934,15 +8214,11 @@ break; } case 2: { - message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 3: { - message.hcxActivationKeyId = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); + message.pageToken = reader.string(); break; } default: @@ -7954,156 +8230,139 @@ }; /** - * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { + ListHcxActivationKeysRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateHcxActivationKeyRequest message. + * Verifies a ListHcxActivationKeysRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateHcxActivationKeyRequest.verify = function verify(message) { + ListHcxActivationKeysRequest.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.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) { - var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKey); - if (error) - return "hcxActivationKey." + error; - } - if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) - if (!$util.isString(message.hcxActivationKeyId)) - return "hcxActivationKeyId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: 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 CreateHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHcxActivationKeysRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest */ - CreateHcxActivationKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest) + ListHcxActivationKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest(); + var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.hcxActivationKey != null) { - if (typeof object.hcxActivationKey !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.hcxActivationKey: object expected"); - message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKey); - } - if (object.hcxActivationKeyId != null) - message.hcxActivationKeyId = String(object.hcxActivationKeyId); - if (object.requestId != null) - message.requestId = String(object.requestId); + 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 CreateHcxActivationKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHcxActivationKeysRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static - * @param {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest + * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} message ListHcxActivationKeysRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateHcxActivationKeyRequest.toObject = function toObject(message, options) { + ListHcxActivationKeysRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.hcxActivationKey = null; - object.hcxActivationKeyId = ""; - object.requestId = ""; + object.pageSize = 0; + object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) - object.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKey, options); - if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) - object.hcxActivationKeyId = message.hcxActivationKeyId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + 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 CreateHcxActivationKeyRequest to JSON. + * Converts this ListHcxActivationKeysRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @instance * @returns {Object.} JSON object */ - CreateHcxActivationKeyRequest.prototype.toJSON = function toJSON() { + ListHcxActivationKeysRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateHcxActivationKeyRequest + * Gets the default type url for ListHcxActivationKeysRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHcxActivationKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"; }; - return CreateHcxActivationKeyRequest; + return ListHcxActivationKeysRequest; })(); - v1.ListNetworkPoliciesRequest = (function() { + v1.GetHcxActivationKeyRequest = (function() { /** - * Properties of a ListNetworkPoliciesRequest. + * Properties of a GetHcxActivationKeyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListNetworkPoliciesRequest - * @property {string|null} [parent] ListNetworkPoliciesRequest parent - * @property {number|null} [pageSize] ListNetworkPoliciesRequest pageSize - * @property {string|null} [pageToken] ListNetworkPoliciesRequest pageToken - * @property {string|null} [filter] ListNetworkPoliciesRequest filter - * @property {string|null} [orderBy] ListNetworkPoliciesRequest orderBy + * @interface IGetHcxActivationKeyRequest + * @property {string|null} [name] GetHcxActivationKeyRequest name */ /** - * Constructs a new ListNetworkPoliciesRequest. + * Constructs a new GetHcxActivationKeyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListNetworkPoliciesRequest. - * @implements IListNetworkPoliciesRequest + * @classdesc Represents a GetHcxActivationKeyRequest. + * @implements IGetHcxActivationKeyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set */ - function ListNetworkPoliciesRequest(properties) { + function GetHcxActivationKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8111,131 +8370,75 @@ } /** - * ListNetworkPoliciesRequest parent. - * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest - * @instance - */ - ListNetworkPoliciesRequest.prototype.parent = ""; - - /** - * ListNetworkPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest - * @instance - */ - ListNetworkPoliciesRequest.prototype.pageSize = 0; - - /** - * ListNetworkPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest - * @instance - */ - ListNetworkPoliciesRequest.prototype.pageToken = ""; - - /** - * ListNetworkPoliciesRequest filter. - * @member {string} filter - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest - * @instance - */ - ListNetworkPoliciesRequest.prototype.filter = ""; - - /** - * ListNetworkPoliciesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * GetHcxActivationKeyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @instance */ - ListNetworkPoliciesRequest.prototype.orderBy = ""; + GetHcxActivationKeyRequest.prototype.name = ""; /** - * Creates a new ListNetworkPoliciesRequest instance using the specified properties. + * Creates a new GetHcxActivationKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest instance + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest instance */ - ListNetworkPoliciesRequest.create = function create(properties) { - return new ListNetworkPoliciesRequest(properties); + GetHcxActivationKeyRequest.create = function create(properties) { + return new GetHcxActivationKeyRequest(properties); }; /** - * Encodes the specified ListNetworkPoliciesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * Encodes the specified GetHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNetworkPoliciesRequest.encode = function encode(message, writer) { + GetHcxActivationKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListNetworkPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * Encodes the specified GetHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNetworkPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer. + * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNetworkPoliciesRequest.decode = function decode(reader, length) { + GetHcxActivationKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.name = reader.string(); break; } default: @@ -8247,159 +8450,125 @@ }; /** - * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNetworkPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + GetHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNetworkPoliciesRequest message. + * Verifies a GetHcxActivationKeyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNetworkPoliciesRequest.verify = function verify(message) { + GetHcxActivationKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListNetworkPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest */ - ListNetworkPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest) + GetHcxActivationKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListNetworkPoliciesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetHcxActivationKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} message ListNetworkPoliciesRequest + * @param {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} message GetHcxActivationKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNetworkPoliciesRequest.toObject = function toObject(message, options) { + GetHcxActivationKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListNetworkPoliciesRequest to JSON. + * Converts this GetHcxActivationKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @instance * @returns {Object.} JSON object */ - ListNetworkPoliciesRequest.prototype.toJSON = function toJSON() { + GetHcxActivationKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListNetworkPoliciesRequest + * Gets the default type url for GetHcxActivationKeyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListNetworkPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"; }; - return ListNetworkPoliciesRequest; + return GetHcxActivationKeyRequest; })(); - v1.ListNetworkPoliciesResponse = (function() { + v1.CreateHcxActivationKeyRequest = (function() { /** - * Properties of a ListNetworkPoliciesResponse. + * Properties of a CreateHcxActivationKeyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListNetworkPoliciesResponse - * @property {Array.|null} [networkPolicies] ListNetworkPoliciesResponse networkPolicies - * @property {string|null} [nextPageToken] ListNetworkPoliciesResponse nextPageToken - * @property {Array.|null} [unreachable] ListNetworkPoliciesResponse unreachable + * @interface ICreateHcxActivationKeyRequest + * @property {string|null} [parent] CreateHcxActivationKeyRequest parent + * @property {google.cloud.vmwareengine.v1.IHcxActivationKey|null} [hcxActivationKey] CreateHcxActivationKeyRequest hcxActivationKey + * @property {string|null} [hcxActivationKeyId] CreateHcxActivationKeyRequest hcxActivationKeyId + * @property {string|null} [requestId] CreateHcxActivationKeyRequest requestId */ /** - * Constructs a new ListNetworkPoliciesResponse. + * Constructs a new CreateHcxActivationKeyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListNetworkPoliciesResponse. - * @implements IListNetworkPoliciesResponse + * @classdesc Represents a CreateHcxActivationKeyRequest. + * @implements ICreateHcxActivationKeyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set */ - function ListNetworkPoliciesResponse(properties) { - this.networkPolicies = []; - this.unreachable = []; + function CreateHcxActivationKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8407,109 +8576,117 @@ } /** - * ListNetworkPoliciesResponse networkPolicies. - * @member {Array.} networkPolicies - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * CreateHcxActivationKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @instance */ - ListNetworkPoliciesResponse.prototype.networkPolicies = $util.emptyArray; + CreateHcxActivationKeyRequest.prototype.parent = ""; /** - * ListNetworkPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * CreateHcxActivationKeyRequest hcxActivationKey. + * @member {google.cloud.vmwareengine.v1.IHcxActivationKey|null|undefined} hcxActivationKey + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @instance */ - ListNetworkPoliciesResponse.prototype.nextPageToken = ""; + CreateHcxActivationKeyRequest.prototype.hcxActivationKey = null; /** - * ListNetworkPoliciesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * CreateHcxActivationKeyRequest hcxActivationKeyId. + * @member {string} hcxActivationKeyId + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @instance */ - ListNetworkPoliciesResponse.prototype.unreachable = $util.emptyArray; + CreateHcxActivationKeyRequest.prototype.hcxActivationKeyId = ""; /** - * Creates a new ListNetworkPoliciesResponse instance using the specified properties. + * CreateHcxActivationKeyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + */ + CreateHcxActivationKeyRequest.prototype.requestId = ""; + + /** + * Creates a new CreateHcxActivationKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse instance + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest instance */ - ListNetworkPoliciesResponse.create = function create(properties) { - return new ListNetworkPoliciesResponse(properties); + CreateHcxActivationKeyRequest.create = function create(properties) { + return new CreateHcxActivationKeyRequest(properties); }; /** - * Encodes the specified ListNetworkPoliciesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * Encodes the specified CreateHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNetworkPoliciesResponse.encode = function encode(message, writer) { + CreateHcxActivationKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.networkPolicies != null && message.networkPolicies.length) - for (var i = 0; i < message.networkPolicies.length; ++i) - $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.hcxActivationKey != null && Object.hasOwnProperty.call(message, "hcxActivationKey")) + $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hcxActivationKeyId != null && Object.hasOwnProperty.call(message, "hcxActivationKeyId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hcxActivationKeyId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified ListNetworkPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * Encodes the specified CreateHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNetworkPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer. + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNetworkPoliciesResponse.decode = function decode(reader, length) { + CreateHcxActivationKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.networkPolicies && message.networkPolicies.length)) - message.networkPolicies = []; - message.networkPolicies.push($root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.hcxActivationKeyId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); break; } default: @@ -8521,169 +8698,156 @@ }; /** - * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNetworkPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNetworkPoliciesResponse message. + * Verifies a CreateHcxActivationKeyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNetworkPoliciesResponse.verify = function verify(message) { + CreateHcxActivationKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.networkPolicies != null && message.hasOwnProperty("networkPolicies")) { - if (!Array.isArray(message.networkPolicies)) - return "networkPolicies: array expected"; - for (var i = 0; i < message.networkPolicies.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicies[i]); - if (error) - return "networkPolicies." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) { + var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKey); + if (error) + return "hcxActivationKey." + error; } + if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) + if (!$util.isString(message.hcxActivationKeyId)) + return "hcxActivationKeyId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListNetworkPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest */ - ListNetworkPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse) + CreateHcxActivationKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse(); - if (object.networkPolicies) { - if (!Array.isArray(object.networkPolicies)) - throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: array expected"); - message.networkPolicies = []; - for (var i = 0; i < object.networkPolicies.length; ++i) { - if (typeof object.networkPolicies[i] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: object expected"); - message.networkPolicies[i] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicies[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + var message = new $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.hcxActivationKey != null) { + if (typeof object.hcxActivationKey !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.hcxActivationKey: object expected"); + message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKey); } + if (object.hcxActivationKeyId != null) + message.hcxActivationKeyId = String(object.hcxActivationKeyId); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListNetworkPoliciesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateHcxActivationKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static - * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} message ListNetworkPoliciesResponse + * @param {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNetworkPoliciesResponse.toObject = function toObject(message, options) { + CreateHcxActivationKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.networkPolicies = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.networkPolicies && message.networkPolicies.length) { - object.networkPolicies = []; - for (var j = 0; j < message.networkPolicies.length; ++j) - object.networkPolicies[j] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicies[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.parent = ""; + object.hcxActivationKey = null; + object.hcxActivationKeyId = ""; + object.requestId = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) + object.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKey, options); + if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) + object.hcxActivationKeyId = message.hcxActivationKeyId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListNetworkPoliciesResponse to JSON. + * Converts this CreateHcxActivationKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @instance * @returns {Object.} JSON object */ - ListNetworkPoliciesResponse.prototype.toJSON = function toJSON() { + CreateHcxActivationKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListNetworkPoliciesResponse + * Gets the default type url for CreateHcxActivationKeyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListNetworkPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"; }; - return ListNetworkPoliciesResponse; + return CreateHcxActivationKeyRequest; })(); - v1.GetNetworkPolicyRequest = (function() { + v1.ListNetworkPoliciesRequest = (function() { /** - * Properties of a GetNetworkPolicyRequest. + * Properties of a ListNetworkPoliciesRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IGetNetworkPolicyRequest - * @property {string|null} [name] GetNetworkPolicyRequest name + * @interface IListNetworkPoliciesRequest + * @property {string|null} [parent] ListNetworkPoliciesRequest parent + * @property {number|null} [pageSize] ListNetworkPoliciesRequest pageSize + * @property {string|null} [pageToken] ListNetworkPoliciesRequest pageToken + * @property {string|null} [filter] ListNetworkPoliciesRequest filter + * @property {string|null} [orderBy] ListNetworkPoliciesRequest orderBy */ /** - * Constructs a new GetNetworkPolicyRequest. + * Constructs a new ListNetworkPoliciesRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a GetNetworkPolicyRequest. - * @implements IGetNetworkPolicyRequest + * @classdesc Represents a ListNetworkPoliciesRequest. + * @implements IListNetworkPoliciesRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set */ - function GetNetworkPolicyRequest(properties) { + function ListNetworkPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8691,75 +8855,131 @@ } /** - * GetNetworkPolicyRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * ListNetworkPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @instance */ - GetNetworkPolicyRequest.prototype.name = ""; + ListNetworkPoliciesRequest.prototype.parent = ""; /** - * Creates a new GetNetworkPolicyRequest instance using the specified properties. + * ListNetworkPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.pageSize = 0; + + /** + * ListNetworkPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.pageToken = ""; + + /** + * ListNetworkPoliciesRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.filter = ""; + + /** + * ListNetworkPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListNetworkPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest instance + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest instance */ - GetNetworkPolicyRequest.create = function create(properties) { - return new GetNetworkPolicyRequest(properties); + ListNetworkPoliciesRequest.create = function create(properties) { + return new ListNetworkPoliciesRequest(properties); }; /** - * Encodes the specified GetNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified ListNetworkPoliciesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNetworkPolicyRequest.encode = function encode(message, writer) { + ListNetworkPoliciesRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified GetNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified ListNetworkPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNetworkPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer. + * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNetworkPolicyRequest.decode = function decode(reader, length) { + ListNetworkPoliciesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -8771,124 +8991,159 @@ }; /** - * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + ListNetworkPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNetworkPolicyRequest message. + * Verifies a ListNetworkPoliciesRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNetworkPolicyRequest.verify = function verify(message) { + ListNetworkPoliciesRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a GetNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNetworkPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest */ - GetNetworkPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest) + ListNetworkPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a GetNetworkPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNetworkPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static - * @param {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} message GetNetworkPolicyRequest + * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} message ListNetworkPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNetworkPolicyRequest.toObject = function toObject(message, options) { + ListNetworkPoliciesRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this GetNetworkPolicyRequest to JSON. + * Converts this ListNetworkPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @instance * @returns {Object.} JSON object */ - GetNetworkPolicyRequest.prototype.toJSON = function toJSON() { + ListNetworkPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetNetworkPolicyRequest + * Gets the default type url for ListNetworkPoliciesRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListNetworkPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"; }; - return GetNetworkPolicyRequest; + return ListNetworkPoliciesRequest; })(); - v1.UpdateNetworkPolicyRequest = (function() { + v1.ListNetworkPoliciesResponse = (function() { /** - * Properties of an UpdateNetworkPolicyRequest. + * Properties of a ListNetworkPoliciesResponse. * @memberof google.cloud.vmwareengine.v1 - * @interface IUpdateNetworkPolicyRequest - * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] UpdateNetworkPolicyRequest networkPolicy - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNetworkPolicyRequest updateMask - * @property {string|null} [requestId] UpdateNetworkPolicyRequest requestId + * @interface IListNetworkPoliciesResponse + * @property {Array.|null} [networkPolicies] ListNetworkPoliciesResponse networkPolicies + * @property {string|null} [nextPageToken] ListNetworkPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListNetworkPoliciesResponse unreachable */ /** - * Constructs a new UpdateNetworkPolicyRequest. + * Constructs a new ListNetworkPoliciesResponse. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents an UpdateNetworkPolicyRequest. - * @implements IUpdateNetworkPolicyRequest + * @classdesc Represents a ListNetworkPoliciesResponse. + * @implements IListNetworkPoliciesResponse * @constructor - * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set */ - function UpdateNetworkPolicyRequest(properties) { + function ListNetworkPoliciesResponse(properties) { + this.networkPolicies = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8896,103 +9151,109 @@ } /** - * UpdateNetworkPolicyRequest networkPolicy. - * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * ListNetworkPoliciesResponse networkPolicies. + * @member {Array.} networkPolicies + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @instance */ - UpdateNetworkPolicyRequest.prototype.networkPolicy = null; + ListNetworkPoliciesResponse.prototype.networkPolicies = $util.emptyArray; /** - * UpdateNetworkPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * ListNetworkPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @instance */ - UpdateNetworkPolicyRequest.prototype.updateMask = null; + ListNetworkPoliciesResponse.prototype.nextPageToken = ""; /** - * UpdateNetworkPolicyRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * ListNetworkPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @instance */ - UpdateNetworkPolicyRequest.prototype.requestId = ""; + ListNetworkPoliciesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateNetworkPolicyRequest instance using the specified properties. + * Creates a new ListNetworkPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static - * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest instance + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse instance */ - UpdateNetworkPolicyRequest.create = function create(properties) { - return new UpdateNetworkPolicyRequest(properties); + ListNetworkPoliciesResponse.create = function create(properties) { + return new ListNetworkPoliciesResponse(properties); }; /** - * Encodes the specified UpdateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified ListNetworkPoliciesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static - * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateNetworkPolicyRequest.encode = function encode(message, writer) { + ListNetworkPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) - $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, 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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.networkPolicies != null && message.networkPolicies.length) + for (var i = 0; i < message.networkPolicies.length; ++i) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified ListNetworkPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static - * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNetworkPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer. + * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateNetworkPolicyRequest.decode = function decode(reader, length) { + ListNetworkPoliciesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); + if (!(message.networkPolicies && message.networkPolicies.length)) + message.networkPolicies = []; + message.networkPolicies.push($root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32())); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -9004,152 +9265,169 @@ }; /** - * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + ListNetworkPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateNetworkPolicyRequest message. + * Verifies a ListNetworkPoliciesResponse message. * @function verify - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateNetworkPolicyRequest.verify = function verify(message) { + ListNetworkPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { - var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); - if (error) - return "networkPolicy." + error; + if (message.networkPolicies != null && message.hasOwnProperty("networkPolicies")) { + if (!Array.isArray(message.networkPolicies)) + return "networkPolicies: array expected"; + for (var i = 0; i < message.networkPolicies.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicies[i]); + if (error) + return "networkPolicies." + error; + } } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNetworkPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse */ - UpdateNetworkPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest) + ListNetworkPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse) return object; - var message = new $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest(); - if (object.networkPolicy != null) { - if (typeof object.networkPolicy !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.networkPolicy: object expected"); - message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); + var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse(); + if (object.networkPolicies) { + if (!Array.isArray(object.networkPolicies)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: array expected"); + message.networkPolicies = []; + for (var i = 0; i < object.networkPolicies.length; ++i) { + if (typeof object.networkPolicies[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: object expected"); + message.networkPolicies[i] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicies[i]); + } } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateNetworkPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNetworkPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static - * @param {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest + * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} message ListNetworkPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateNetworkPolicyRequest.toObject = function toObject(message, options) { + ListNetworkPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.networkPolicy = null; - object.updateMask = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.networkPolicies = []; + object.unreachable = []; } - if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) - object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateNetworkPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest - * @instance + if (options.defaults) + object.nextPageToken = ""; + if (message.networkPolicies && message.networkPolicies.length) { + object.networkPolicies = []; + for (var j = 0; j < message.networkPolicies.length; ++j) + object.networkPolicies[j] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListNetworkPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @instance * @returns {Object.} JSON object */ - UpdateNetworkPolicyRequest.prototype.toJSON = function toJSON() { + ListNetworkPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateNetworkPolicyRequest + * Gets the default type url for ListNetworkPoliciesResponse * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListNetworkPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"; }; - return UpdateNetworkPolicyRequest; + return ListNetworkPoliciesResponse; })(); - v1.CreateNetworkPolicyRequest = (function() { + v1.GetNetworkPolicyRequest = (function() { /** - * Properties of a CreateNetworkPolicyRequest. + * Properties of a GetNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface ICreateNetworkPolicyRequest - * @property {string|null} [parent] CreateNetworkPolicyRequest parent - * @property {string|null} [networkPolicyId] CreateNetworkPolicyRequest networkPolicyId - * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] CreateNetworkPolicyRequest networkPolicy - * @property {string|null} [requestId] CreateNetworkPolicyRequest requestId + * @interface IGetNetworkPolicyRequest + * @property {string|null} [name] GetNetworkPolicyRequest name */ /** - * Constructs a new CreateNetworkPolicyRequest. + * Constructs a new GetNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a CreateNetworkPolicyRequest. - * @implements ICreateNetworkPolicyRequest + * @classdesc Represents a GetNetworkPolicyRequest. + * @implements IGetNetworkPolicyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set */ - function CreateNetworkPolicyRequest(properties) { + function GetNetworkPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9157,117 +9435,75 @@ } /** - * CreateNetworkPolicyRequest parent. - * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest - * @instance - */ - CreateNetworkPolicyRequest.prototype.parent = ""; - - /** - * CreateNetworkPolicyRequest networkPolicyId. - * @member {string} networkPolicyId - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest - * @instance - */ - CreateNetworkPolicyRequest.prototype.networkPolicyId = ""; - - /** - * CreateNetworkPolicyRequest networkPolicy. - * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest - * @instance - */ - CreateNetworkPolicyRequest.prototype.networkPolicy = null; - - /** - * CreateNetworkPolicyRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * GetNetworkPolicyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @instance */ - CreateNetworkPolicyRequest.prototype.requestId = ""; + GetNetworkPolicyRequest.prototype.name = ""; /** - * Creates a new CreateNetworkPolicyRequest instance using the specified properties. + * Creates a new GetNetworkPolicyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest instance + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest instance */ - CreateNetworkPolicyRequest.create = function create(properties) { - return new CreateNetworkPolicyRequest(properties); + GetNetworkPolicyRequest.create = function create(properties) { + return new GetNetworkPolicyRequest(properties); }; /** - * Encodes the specified CreateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified GetNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNetworkPolicyRequest.encode = function encode(message, writer) { + GetNetworkPolicyRequest.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.networkPolicyId != null && Object.hasOwnProperty.call(message, "networkPolicyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkPolicyId); - if (message.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) - $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified GetNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer. + * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNetworkPolicyRequest.decode = function decode(reader, length) { + GetNetworkPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.networkPolicyId = reader.string(); - break; - } - case 3: { - message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); + message.name = reader.string(); break; } default: @@ -9279,153 +9515,124 @@ }; /** - * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + GetNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateNetworkPolicyRequest message. + * Verifies a GetNetworkPolicyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateNetworkPolicyRequest.verify = function verify(message) { + GetNetworkPolicyRequest.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.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) - if (!$util.isString(message.networkPolicyId)) - return "networkPolicyId: string expected"; - if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { - var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); - if (error) - return "networkPolicy." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest */ - CreateNetworkPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest) + GetNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.networkPolicyId != null) - message.networkPolicyId = String(object.networkPolicyId); - if (object.networkPolicy != null) { - if (typeof object.networkPolicy !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.networkPolicy: object expected"); - message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); - } - if (object.requestId != null) - message.requestId = String(object.requestId); + var message = new $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateNetworkPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNetworkPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} message CreateNetworkPolicyRequest + * @param {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} message GetNetworkPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateNetworkPolicyRequest.toObject = function toObject(message, options) { + GetNetworkPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.networkPolicyId = ""; - object.networkPolicy = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) - object.networkPolicyId = message.networkPolicyId; - if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) - object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateNetworkPolicyRequest to JSON. + * Converts this GetNetworkPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @instance * @returns {Object.} JSON object */ - CreateNetworkPolicyRequest.prototype.toJSON = function toJSON() { + GetNetworkPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateNetworkPolicyRequest + * Gets the default type url for GetNetworkPolicyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"; }; - return CreateNetworkPolicyRequest; + return GetNetworkPolicyRequest; })(); - v1.DeleteNetworkPolicyRequest = (function() { + v1.UpdateNetworkPolicyRequest = (function() { /** - * Properties of a DeleteNetworkPolicyRequest. + * Properties of an UpdateNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IDeleteNetworkPolicyRequest - * @property {string|null} [name] DeleteNetworkPolicyRequest name - * @property {string|null} [requestId] DeleteNetworkPolicyRequest requestId - */ - + * @interface IUpdateNetworkPolicyRequest + * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] UpdateNetworkPolicyRequest networkPolicy + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNetworkPolicyRequest updateMask + * @property {string|null} [requestId] UpdateNetworkPolicyRequest requestId + */ + /** - * Constructs a new DeleteNetworkPolicyRequest. + * Constructs a new UpdateNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a DeleteNetworkPolicyRequest. - * @implements IDeleteNetworkPolicyRequest + * @classdesc Represents an UpdateNetworkPolicyRequest. + * @implements IUpdateNetworkPolicyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set */ - function DeleteNetworkPolicyRequest(properties) { + function UpdateNetworkPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9433,88 +9640,102 @@ } /** - * DeleteNetworkPolicyRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * UpdateNetworkPolicyRequest networkPolicy. + * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @instance */ - DeleteNetworkPolicyRequest.prototype.name = ""; + UpdateNetworkPolicyRequest.prototype.networkPolicy = null; /** - * DeleteNetworkPolicyRequest requestId. + * UpdateNetworkPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @instance + */ + UpdateNetworkPolicyRequest.prototype.updateMask = null; + + /** + * UpdateNetworkPolicyRequest requestId. * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @instance */ - DeleteNetworkPolicyRequest.prototype.requestId = ""; + UpdateNetworkPolicyRequest.prototype.requestId = ""; /** - * Creates a new DeleteNetworkPolicyRequest instance using the specified properties. + * Creates a new UpdateNetworkPolicyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest instance + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest instance */ - DeleteNetworkPolicyRequest.create = function create(properties) { - return new DeleteNetworkPolicyRequest(properties); + UpdateNetworkPolicyRequest.create = function create(properties) { + return new UpdateNetworkPolicyRequest(properties); }; /** - * Encodes the specified DeleteNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified UpdateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNetworkPolicyRequest.encode = function encode(message, writer) { + UpdateNetworkPolicyRequest.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.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, 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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified DeleteNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * Encodes the specified UpdateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer. + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNetworkPolicyRequest.decode = function decode(reader, length) { + UpdateNetworkPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); break; } case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { message.requestId = reader.string(); break; } @@ -9527,35 +9748,42 @@ }; /** - * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteNetworkPolicyRequest message. + * Verifies an UpdateNetworkPolicyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteNetworkPolicyRequest.verify = function verify(message) { + UpdateNetworkPolicyRequest.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.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); + if (error) + return "networkPolicy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; @@ -9563,98 +9791,109 @@ }; /** - * Creates a DeleteNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest */ - DeleteNetworkPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest) + UpdateNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest(); + if (object.networkPolicy != null) { + if (typeof object.networkPolicy !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.networkPolicy: object expected"); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } if (object.requestId != null) message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a DeleteNetworkPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateNetworkPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest + * @param {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteNetworkPolicyRequest.toObject = function toObject(message, options) { + UpdateNetworkPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.networkPolicy = null; + object.updateMask = null; object.requestId = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) + object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; /** - * Converts this DeleteNetworkPolicyRequest to JSON. + * Converts this UpdateNetworkPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @instance * @returns {Object.} JSON object */ - DeleteNetworkPolicyRequest.prototype.toJSON = function toJSON() { + UpdateNetworkPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteNetworkPolicyRequest + * Gets the default type url for UpdateNetworkPolicyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"; }; - return DeleteNetworkPolicyRequest; + return UpdateNetworkPolicyRequest; })(); - v1.CreateVmwareEngineNetworkRequest = (function() { + v1.CreateNetworkPolicyRequest = (function() { /** - * Properties of a CreateVmwareEngineNetworkRequest. + * Properties of a CreateNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface ICreateVmwareEngineNetworkRequest - * @property {string|null} [parent] CreateVmwareEngineNetworkRequest parent - * @property {string|null} [vmwareEngineNetworkId] CreateVmwareEngineNetworkRequest vmwareEngineNetworkId - * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] CreateVmwareEngineNetworkRequest vmwareEngineNetwork - * @property {string|null} [requestId] CreateVmwareEngineNetworkRequest requestId + * @interface ICreateNetworkPolicyRequest + * @property {string|null} [parent] CreateNetworkPolicyRequest parent + * @property {string|null} [networkPolicyId] CreateNetworkPolicyRequest networkPolicyId + * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] CreateNetworkPolicyRequest networkPolicy + * @property {string|null} [requestId] CreateNetworkPolicyRequest requestId */ /** - * Constructs a new CreateVmwareEngineNetworkRequest. + * Constructs a new CreateNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a CreateVmwareEngineNetworkRequest. - * @implements ICreateVmwareEngineNetworkRequest + * @classdesc Represents a CreateNetworkPolicyRequest. + * @implements ICreateNetworkPolicyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set */ - function CreateVmwareEngineNetworkRequest(properties) { + function CreateNetworkPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9662,100 +9901,100 @@ } /** - * CreateVmwareEngineNetworkRequest parent. + * CreateNetworkPolicyRequest parent. * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @instance */ - CreateVmwareEngineNetworkRequest.prototype.parent = ""; + CreateNetworkPolicyRequest.prototype.parent = ""; /** - * CreateVmwareEngineNetworkRequest vmwareEngineNetworkId. - * @member {string} vmwareEngineNetworkId - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * CreateNetworkPolicyRequest networkPolicyId. + * @member {string} networkPolicyId + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @instance */ - CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetworkId = ""; + CreateNetworkPolicyRequest.prototype.networkPolicyId = ""; /** - * CreateVmwareEngineNetworkRequest vmwareEngineNetwork. - * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * CreateNetworkPolicyRequest networkPolicy. + * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @instance */ - CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; + CreateNetworkPolicyRequest.prototype.networkPolicy = null; /** - * CreateVmwareEngineNetworkRequest requestId. + * CreateNetworkPolicyRequest requestId. * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @instance */ - CreateVmwareEngineNetworkRequest.prototype.requestId = ""; + CreateNetworkPolicyRequest.prototype.requestId = ""; /** - * Creates a new CreateVmwareEngineNetworkRequest instance using the specified properties. + * Creates a new CreateNetworkPolicyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest instance + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest instance */ - CreateVmwareEngineNetworkRequest.create = function create(properties) { - return new CreateVmwareEngineNetworkRequest(properties); + CreateNetworkPolicyRequest.create = function create(properties) { + return new CreateNetworkPolicyRequest(properties); }; /** - * Encodes the specified CreateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified CreateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateVmwareEngineNetworkRequest.encode = function encode(message, writer) { + CreateNetworkPolicyRequest.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.vmwareEngineNetworkId != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmwareEngineNetworkId); - if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) - $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.networkPolicyId != null && Object.hasOwnProperty.call(message, "networkPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkPolicyId); + if (message.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified CreateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified CreateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer. + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateVmwareEngineNetworkRequest.decode = function decode(reader, length) { + CreateNetworkPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9764,11 +10003,11 @@ break; } case 2: { - message.vmwareEngineNetworkId = reader.string(); + message.networkPolicyId = reader.string(); break; } case 3: { - message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); break; } case 4: { @@ -9784,42 +10023,42 @@ }; /** - * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + CreateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateVmwareEngineNetworkRequest message. + * Verifies a CreateNetworkPolicyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateVmwareEngineNetworkRequest.verify = function verify(message) { + CreateNetworkPolicyRequest.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.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) - if (!$util.isString(message.vmwareEngineNetworkId)) - return "vmwareEngineNetworkId: string expected"; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { - var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); + if (message.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) + if (!$util.isString(message.networkPolicyId)) + return "networkPolicyId: string expected"; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); if (error) - return "vmwareEngineNetwork." + error; + return "networkPolicy." + error; } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) @@ -9828,25 +10067,25 @@ }; /** - * Creates a CreateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest */ - CreateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest) + CreateNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); + var message = new $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.vmwareEngineNetworkId != null) - message.vmwareEngineNetworkId = String(object.vmwareEngineNetworkId); - if (object.vmwareEngineNetwork != null) { - if (typeof object.vmwareEngineNetwork !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); - message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); + if (object.networkPolicyId != null) + message.networkPolicyId = String(object.networkPolicyId); + if (object.networkPolicy != null) { + if (typeof object.networkPolicy !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.networkPolicy: object expected"); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); } if (object.requestId != null) message.requestId = String(object.requestId); @@ -9854,84 +10093,83 @@ }; /** - * Creates a plain object from a CreateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateNetworkPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest + * @param {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} message CreateNetworkPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + CreateNetworkPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.vmwareEngineNetworkId = ""; - object.vmwareEngineNetwork = null; + object.networkPolicyId = ""; + object.networkPolicy = null; object.requestId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) - object.vmwareEngineNetworkId = message.vmwareEngineNetworkId; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); + if (message.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) + object.networkPolicyId = message.networkPolicyId; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) + object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; /** - * Converts this CreateVmwareEngineNetworkRequest to JSON. + * Converts this CreateNetworkPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @instance * @returns {Object.} JSON object */ - CreateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + CreateNetworkPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateVmwareEngineNetworkRequest + * Gets the default type url for CreateNetworkPolicyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"; }; - return CreateVmwareEngineNetworkRequest; + return CreateNetworkPolicyRequest; })(); - v1.UpdateVmwareEngineNetworkRequest = (function() { + v1.DeleteNetworkPolicyRequest = (function() { /** - * Properties of an UpdateVmwareEngineNetworkRequest. + * Properties of a DeleteNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IUpdateVmwareEngineNetworkRequest - * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] UpdateVmwareEngineNetworkRequest vmwareEngineNetwork - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVmwareEngineNetworkRequest updateMask - * @property {string|null} [requestId] UpdateVmwareEngineNetworkRequest requestId + * @interface IDeleteNetworkPolicyRequest + * @property {string|null} [name] DeleteNetworkPolicyRequest name + * @property {string|null} [requestId] DeleteNetworkPolicyRequest requestId */ /** - * Constructs a new UpdateVmwareEngineNetworkRequest. + * Constructs a new DeleteNetworkPolicyRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents an UpdateVmwareEngineNetworkRequest. - * @implements IUpdateVmwareEngineNetworkRequest + * @classdesc Represents a DeleteNetworkPolicyRequest. + * @implements IDeleteNetworkPolicyRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set */ - function UpdateVmwareEngineNetworkRequest(properties) { + function DeleteNetworkPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9939,102 +10177,88 @@ } /** - * UpdateVmwareEngineNetworkRequest vmwareEngineNetwork. - * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest - * @instance - */ - UpdateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; - - /** - * UpdateVmwareEngineNetworkRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * DeleteNetworkPolicyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @instance */ - UpdateVmwareEngineNetworkRequest.prototype.updateMask = null; + DeleteNetworkPolicyRequest.prototype.name = ""; /** - * UpdateVmwareEngineNetworkRequest requestId. + * DeleteNetworkPolicyRequest requestId. * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @instance */ - UpdateVmwareEngineNetworkRequest.prototype.requestId = ""; + DeleteNetworkPolicyRequest.prototype.requestId = ""; /** - * Creates a new UpdateVmwareEngineNetworkRequest instance using the specified properties. + * Creates a new DeleteNetworkPolicyRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest instance + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest instance */ - UpdateVmwareEngineNetworkRequest.create = function create(properties) { - return new UpdateVmwareEngineNetworkRequest(properties); + DeleteNetworkPolicyRequest.create = function create(properties) { + return new DeleteNetworkPolicyRequest(properties); }; /** - * Encodes the specified UpdateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified DeleteNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVmwareEngineNetworkRequest.encode = function encode(message, writer) { + DeleteNetworkPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) - $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified UpdateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified DeleteNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer. + * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateVmwareEngineNetworkRequest.decode = function decode(reader, length) { + DeleteNetworkPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { message.requestId = reader.string(); break; } @@ -10047,42 +10271,35 @@ }; /** - * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateVmwareEngineNetworkRequest message. + * Verifies a DeleteNetworkPolicyRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateVmwareEngineNetworkRequest.verify = function verify(message) { + DeleteNetworkPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { - var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); - if (error) - return "vmwareEngineNetwork." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; @@ -10090,108 +10307,98 @@ }; /** - * Creates an UpdateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest */ - UpdateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest) + DeleteNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); - if (object.vmwareEngineNetwork != null) { - if (typeof object.vmwareEngineNetwork !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); - message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest(); + if (object.name != null) + message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteNetworkPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static - * @param {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest + * @param {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + DeleteNetworkPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.vmwareEngineNetwork = null; - object.updateMask = null; + object.name = ""; object.requestId = ""; } - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; return object; }; /** - * Converts this UpdateVmwareEngineNetworkRequest to JSON. + * Converts this DeleteNetworkPolicyRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @instance * @returns {Object.} JSON object */ - UpdateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + DeleteNetworkPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateVmwareEngineNetworkRequest + * Gets the default type url for DeleteNetworkPolicyRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"; }; - return UpdateVmwareEngineNetworkRequest; + return DeleteNetworkPolicyRequest; })(); - v1.DeleteVmwareEngineNetworkRequest = (function() { + v1.CreateVmwareEngineNetworkRequest = (function() { /** - * Properties of a DeleteVmwareEngineNetworkRequest. + * Properties of a CreateVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IDeleteVmwareEngineNetworkRequest - * @property {string|null} [name] DeleteVmwareEngineNetworkRequest name - * @property {string|null} [requestId] DeleteVmwareEngineNetworkRequest requestId - * @property {string|null} [etag] DeleteVmwareEngineNetworkRequest etag + * @interface ICreateVmwareEngineNetworkRequest + * @property {string|null} [parent] CreateVmwareEngineNetworkRequest parent + * @property {string|null} [vmwareEngineNetworkId] CreateVmwareEngineNetworkRequest vmwareEngineNetworkId + * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] CreateVmwareEngineNetworkRequest vmwareEngineNetwork + * @property {string|null} [requestId] CreateVmwareEngineNetworkRequest requestId */ /** - * Constructs a new DeleteVmwareEngineNetworkRequest. + * Constructs a new CreateVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a DeleteVmwareEngineNetworkRequest. - * @implements IDeleteVmwareEngineNetworkRequest + * @classdesc Represents a CreateVmwareEngineNetworkRequest. + * @implements ICreateVmwareEngineNetworkRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set */ - function DeleteVmwareEngineNetworkRequest(properties) { + function CreateVmwareEngineNetworkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10199,103 +10406,117 @@ } /** - * DeleteVmwareEngineNetworkRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * CreateVmwareEngineNetworkRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @instance */ - DeleteVmwareEngineNetworkRequest.prototype.name = ""; + CreateVmwareEngineNetworkRequest.prototype.parent = ""; /** - * DeleteVmwareEngineNetworkRequest requestId. - * @member {string} requestId - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * CreateVmwareEngineNetworkRequest vmwareEngineNetworkId. + * @member {string} vmwareEngineNetworkId + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @instance */ - DeleteVmwareEngineNetworkRequest.prototype.requestId = ""; + CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetworkId = ""; /** - * DeleteVmwareEngineNetworkRequest etag. - * @member {string} etag - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * CreateVmwareEngineNetworkRequest vmwareEngineNetwork. + * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @instance */ - DeleteVmwareEngineNetworkRequest.prototype.etag = ""; + CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; /** - * Creates a new DeleteVmwareEngineNetworkRequest instance using the specified properties. + * CreateVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + */ + CreateVmwareEngineNetworkRequest.prototype.requestId = ""; + + /** + * Creates a new CreateVmwareEngineNetworkRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest instance + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest instance */ - DeleteVmwareEngineNetworkRequest.create = function create(properties) { - return new DeleteVmwareEngineNetworkRequest(properties); + CreateVmwareEngineNetworkRequest.create = function create(properties) { + return new CreateVmwareEngineNetworkRequest(properties); }; /** - * Encodes the specified DeleteVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified CreateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteVmwareEngineNetworkRequest.encode = function encode(message, writer) { + CreateVmwareEngineNetworkRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.vmwareEngineNetworkId != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmwareEngineNetworkId); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified DeleteVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified CreateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer. + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteVmwareEngineNetworkRequest.decode = function decode(reader, length) { + CreateVmwareEngineNetworkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.vmwareEngineNetworkId = reader.string(); break; } case 3: { - message.etag = reader.string(); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); break; } default: @@ -10307,139 +10528,154 @@ }; /** - * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + CreateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteVmwareEngineNetworkRequest message. + * Verifies a CreateVmwareEngineNetworkRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteVmwareEngineNetworkRequest.verify = function verify(message) { + CreateVmwareEngineNetworkRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) + if (!$util.isString(message.vmwareEngineNetworkId)) + return "vmwareEngineNetworkId: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); + if (error) + return "vmwareEngineNetwork." + error; + } if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; return null; }; /** - * Creates a DeleteVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest */ - DeleteVmwareEngineNetworkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest) + CreateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.vmwareEngineNetworkId != null) + message.vmwareEngineNetworkId = String(object.vmwareEngineNetworkId); + if (object.vmwareEngineNetwork != null) { + if (typeof object.vmwareEngineNetwork !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); + } if (object.requestId != null) message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a DeleteVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateVmwareEngineNetworkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest + * @param {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + CreateVmwareEngineNetworkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; + object.parent = ""; + object.vmwareEngineNetworkId = ""; + object.vmwareEngineNetwork = null; object.requestId = ""; - object.etag = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) + object.vmwareEngineNetworkId = message.vmwareEngineNetworkId; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; return object; }; /** - * Converts this DeleteVmwareEngineNetworkRequest to JSON. + * Converts this CreateVmwareEngineNetworkRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @instance * @returns {Object.} JSON object */ - DeleteVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + CreateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteVmwareEngineNetworkRequest + * Gets the default type url for CreateVmwareEngineNetworkRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"; }; - return DeleteVmwareEngineNetworkRequest; + return CreateVmwareEngineNetworkRequest; })(); - v1.GetVmwareEngineNetworkRequest = (function() { + v1.UpdateVmwareEngineNetworkRequest = (function() { /** - * Properties of a GetVmwareEngineNetworkRequest. + * Properties of an UpdateVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IGetVmwareEngineNetworkRequest - * @property {string|null} [name] GetVmwareEngineNetworkRequest name + * @interface IUpdateVmwareEngineNetworkRequest + * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] UpdateVmwareEngineNetworkRequest vmwareEngineNetwork + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVmwareEngineNetworkRequest updateMask + * @property {string|null} [requestId] UpdateVmwareEngineNetworkRequest requestId */ /** - * Constructs a new GetVmwareEngineNetworkRequest. + * Constructs a new UpdateVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a GetVmwareEngineNetworkRequest. - * @implements IGetVmwareEngineNetworkRequest + * @classdesc Represents an UpdateVmwareEngineNetworkRequest. + * @implements IUpdateVmwareEngineNetworkRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set */ - function GetVmwareEngineNetworkRequest(properties) { + function UpdateVmwareEngineNetworkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10447,75 +10683,103 @@ } /** - * GetVmwareEngineNetworkRequest name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * UpdateVmwareEngineNetworkRequest vmwareEngineNetwork. + * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @instance */ - GetVmwareEngineNetworkRequest.prototype.name = ""; + UpdateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; /** - * Creates a new GetVmwareEngineNetworkRequest instance using the specified properties. + * UpdateVmwareEngineNetworkRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + */ + UpdateVmwareEngineNetworkRequest.prototype.updateMask = null; + + /** + * UpdateVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + */ + UpdateVmwareEngineNetworkRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateVmwareEngineNetworkRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest instance + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest instance */ - GetVmwareEngineNetworkRequest.create = function create(properties) { - return new GetVmwareEngineNetworkRequest(properties); + UpdateVmwareEngineNetworkRequest.create = function create(properties) { + return new UpdateVmwareEngineNetworkRequest(properties); }; /** - * Encodes the specified GetVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified UpdateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVmwareEngineNetworkRequest.encode = function encode(message, writer) { + UpdateVmwareEngineNetworkRequest.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.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, 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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified GetVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * Encodes the specified UpdateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer. + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVmwareEngineNetworkRequest.decode = function decode(reader, length) { + UpdateVmwareEngineNetworkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); break; } default: @@ -10527,126 +10791,151 @@ }; /** - * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetVmwareEngineNetworkRequest message. + * Verifies an UpdateVmwareEngineNetworkRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetVmwareEngineNetworkRequest.verify = function verify(message) { + UpdateVmwareEngineNetworkRequest.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.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); + if (error) + return "vmwareEngineNetwork." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a GetVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest */ - GetVmwareEngineNetworkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest) + UpdateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); + if (object.vmwareEngineNetwork != null) { + if (typeof object.vmwareEngineNetwork !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a GetVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateVmwareEngineNetworkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest + * @param {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + UpdateVmwareEngineNetworkRequest.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; + if (options.defaults) { + object.vmwareEngineNetwork = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this GetVmwareEngineNetworkRequest to JSON. + * Converts this UpdateVmwareEngineNetworkRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @instance * @returns {Object.} JSON object */ - GetVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + UpdateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetVmwareEngineNetworkRequest + * Gets the default type url for UpdateVmwareEngineNetworkRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"; }; - return GetVmwareEngineNetworkRequest; + return UpdateVmwareEngineNetworkRequest; })(); - v1.ListVmwareEngineNetworksRequest = (function() { + v1.DeleteVmwareEngineNetworkRequest = (function() { /** - * Properties of a ListVmwareEngineNetworksRequest. + * Properties of a DeleteVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListVmwareEngineNetworksRequest - * @property {string|null} [parent] ListVmwareEngineNetworksRequest parent - * @property {number|null} [pageSize] ListVmwareEngineNetworksRequest pageSize - * @property {string|null} [pageToken] ListVmwareEngineNetworksRequest pageToken - * @property {string|null} [filter] ListVmwareEngineNetworksRequest filter - * @property {string|null} [orderBy] ListVmwareEngineNetworksRequest orderBy + * @interface IDeleteVmwareEngineNetworkRequest + * @property {string|null} [name] DeleteVmwareEngineNetworkRequest name + * @property {string|null} [requestId] DeleteVmwareEngineNetworkRequest requestId + * @property {string|null} [etag] DeleteVmwareEngineNetworkRequest etag */ /** - * Constructs a new ListVmwareEngineNetworksRequest. + * Constructs a new DeleteVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListVmwareEngineNetworksRequest. - * @implements IListVmwareEngineNetworksRequest + * @classdesc Represents a DeleteVmwareEngineNetworkRequest. + * @implements IDeleteVmwareEngineNetworkRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set */ - function ListVmwareEngineNetworksRequest(properties) { + function DeleteVmwareEngineNetworkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10654,131 +10943,103 @@ } /** - * ListVmwareEngineNetworksRequest parent. - * @member {string} parent - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest - * @instance - */ - ListVmwareEngineNetworksRequest.prototype.parent = ""; - - /** - * ListVmwareEngineNetworksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest - * @instance - */ - ListVmwareEngineNetworksRequest.prototype.pageSize = 0; - - /** - * ListVmwareEngineNetworksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * DeleteVmwareEngineNetworkRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @instance */ - ListVmwareEngineNetworksRequest.prototype.pageToken = ""; + DeleteVmwareEngineNetworkRequest.prototype.name = ""; /** - * ListVmwareEngineNetworksRequest filter. - * @member {string} filter - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * DeleteVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @instance */ - ListVmwareEngineNetworksRequest.prototype.filter = ""; + DeleteVmwareEngineNetworkRequest.prototype.requestId = ""; /** - * ListVmwareEngineNetworksRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * DeleteVmwareEngineNetworkRequest etag. + * @member {string} etag + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @instance */ - ListVmwareEngineNetworksRequest.prototype.orderBy = ""; + DeleteVmwareEngineNetworkRequest.prototype.etag = ""; /** - * Creates a new ListVmwareEngineNetworksRequest instance using the specified properties. + * Creates a new DeleteVmwareEngineNetworkRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest instance + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest instance */ - ListVmwareEngineNetworksRequest.create = function create(properties) { - return new ListVmwareEngineNetworksRequest(properties); + DeleteVmwareEngineNetworkRequest.create = function create(properties) { + return new DeleteVmwareEngineNetworkRequest(properties); }; /** - * Encodes the specified ListVmwareEngineNetworksRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * Encodes the specified DeleteVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVmwareEngineNetworksRequest.encode = function encode(message, writer) { + DeleteVmwareEngineNetworkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); return writer; }; /** - * Encodes the specified ListVmwareEngineNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * Encodes the specified DeleteVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVmwareEngineNetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer. + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVmwareEngineNetworksRequest.decode = function decode(reader, length) { + DeleteVmwareEngineNetworkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.requestId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.etag = reader.string(); break; } default: @@ -10790,159 +11051,139 @@ }; /** - * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVmwareEngineNetworksRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVmwareEngineNetworksRequest message. + * Verifies a DeleteVmwareEngineNetworkRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVmwareEngineNetworksRequest.verify = function verify(message) { + DeleteVmwareEngineNetworkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a ListVmwareEngineNetworksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest */ - ListVmwareEngineNetworksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest) + DeleteVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a ListVmwareEngineNetworksRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteVmwareEngineNetworkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest + * @param {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVmwareEngineNetworksRequest.toObject = function toObject(message, options) { + DeleteVmwareEngineNetworkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.name = ""; + object.requestId = ""; + object.etag = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this ListVmwareEngineNetworksRequest to JSON. + * Converts this DeleteVmwareEngineNetworkRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @instance * @returns {Object.} JSON object */ - ListVmwareEngineNetworksRequest.prototype.toJSON = function toJSON() { + DeleteVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVmwareEngineNetworksRequest + * Gets the default type url for DeleteVmwareEngineNetworkRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVmwareEngineNetworksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"; }; - return ListVmwareEngineNetworksRequest; + return DeleteVmwareEngineNetworkRequest; })(); - v1.ListVmwareEngineNetworksResponse = (function() { + v1.GetVmwareEngineNetworkRequest = (function() { /** - * Properties of a ListVmwareEngineNetworksResponse. + * Properties of a GetVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IListVmwareEngineNetworksResponse - * @property {Array.|null} [vmwareEngineNetworks] ListVmwareEngineNetworksResponse vmwareEngineNetworks - * @property {string|null} [nextPageToken] ListVmwareEngineNetworksResponse nextPageToken - * @property {Array.|null} [unreachable] ListVmwareEngineNetworksResponse unreachable + * @interface IGetVmwareEngineNetworkRequest + * @property {string|null} [name] GetVmwareEngineNetworkRequest name */ /** - * Constructs a new ListVmwareEngineNetworksResponse. + * Constructs a new GetVmwareEngineNetworkRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a ListVmwareEngineNetworksResponse. - * @implements IListVmwareEngineNetworksResponse + * @classdesc Represents a GetVmwareEngineNetworkRequest. + * @implements IGetVmwareEngineNetworkRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set */ - function ListVmwareEngineNetworksResponse(properties) { - this.vmwareEngineNetworks = []; - this.unreachable = []; + function GetVmwareEngineNetworkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10950,109 +11191,75 @@ } /** - * ListVmwareEngineNetworksResponse vmwareEngineNetworks. - * @member {Array.} vmwareEngineNetworks - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse - * @instance - */ - ListVmwareEngineNetworksResponse.prototype.vmwareEngineNetworks = $util.emptyArray; - - /** - * ListVmwareEngineNetworksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse - * @instance - */ - ListVmwareEngineNetworksResponse.prototype.nextPageToken = ""; - - /** - * ListVmwareEngineNetworksResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * GetVmwareEngineNetworkRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @instance */ - ListVmwareEngineNetworksResponse.prototype.unreachable = $util.emptyArray; + GetVmwareEngineNetworkRequest.prototype.name = ""; /** - * Creates a new ListVmwareEngineNetworksResponse instance using the specified properties. + * Creates a new GetVmwareEngineNetworkRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse instance + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest instance */ - ListVmwareEngineNetworksResponse.create = function create(properties) { - return new ListVmwareEngineNetworksResponse(properties); + GetVmwareEngineNetworkRequest.create = function create(properties) { + return new GetVmwareEngineNetworkRequest(properties); }; /** - * Encodes the specified ListVmwareEngineNetworksResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * Encodes the specified GetVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVmwareEngineNetworksResponse.encode = function encode(message, writer) { + GetVmwareEngineNetworkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vmwareEngineNetworks != null && message.vmwareEngineNetworks.length) - for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) - $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListVmwareEngineNetworksResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * Encodes the specified GetVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListVmwareEngineNetworksResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer. + * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVmwareEngineNetworksResponse.decode = function decode(reader, length) { + GetVmwareEngineNetworkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.vmwareEngineNetworks && message.vmwareEngineNetworks.length)) - message.vmwareEngineNetworks = []; - message.vmwareEngineNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.name = reader.string(); break; } default: @@ -11064,172 +11271,126 @@ }; /** - * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer, length delimited. + * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListVmwareEngineNetworksResponse.decodeDelimited = function decodeDelimited(reader) { + GetVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListVmwareEngineNetworksResponse message. + * Verifies a GetVmwareEngineNetworkRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListVmwareEngineNetworksResponse.verify = function verify(message) { + GetVmwareEngineNetworkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vmwareEngineNetworks != null && message.hasOwnProperty("vmwareEngineNetworks")) { - if (!Array.isArray(message.vmwareEngineNetworks)) - return "vmwareEngineNetworks: array expected"; - for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetworks[i]); - if (error) - return "vmwareEngineNetworks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListVmwareEngineNetworksResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest */ - ListVmwareEngineNetworksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse) + GetVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse(); - if (object.vmwareEngineNetworks) { - if (!Array.isArray(object.vmwareEngineNetworks)) - throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: array expected"); - message.vmwareEngineNetworks = []; - for (var i = 0; i < object.vmwareEngineNetworks.length; ++i) { - if (typeof object.vmwareEngineNetworks[i] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: object expected"); - message.vmwareEngineNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetworks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } + var message = new $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListVmwareEngineNetworksResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetVmwareEngineNetworkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static - * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse + * @param {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListVmwareEngineNetworksResponse.toObject = function toObject(message, options) { + GetVmwareEngineNetworkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.vmwareEngineNetworks = []; - object.unreachable = []; - } if (options.defaults) - object.nextPageToken = ""; - if (message.vmwareEngineNetworks && message.vmwareEngineNetworks.length) { - object.vmwareEngineNetworks = []; - for (var j = 0; j < message.vmwareEngineNetworks.length; ++j) - object.vmwareEngineNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetworks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListVmwareEngineNetworksResponse to JSON. + * Converts this GetVmwareEngineNetworkRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @instance * @returns {Object.} JSON object */ - ListVmwareEngineNetworksResponse.prototype.toJSON = function toJSON() { + GetVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListVmwareEngineNetworksResponse + * Gets the default type url for GetVmwareEngineNetworkRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListVmwareEngineNetworksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"; }; - return ListVmwareEngineNetworksResponse; + return GetVmwareEngineNetworkRequest; })(); - v1.NetworkConfig = (function() { + v1.ListVmwareEngineNetworksRequest = (function() { /** - * Properties of a NetworkConfig. + * Properties of a ListVmwareEngineNetworksRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface INetworkConfig - * @property {string|null} [managementCidr] NetworkConfig managementCidr - * @property {string|null} [vmwareEngineNetwork] NetworkConfig vmwareEngineNetwork - * @property {string|null} [vmwareEngineNetworkCanonical] NetworkConfig vmwareEngineNetworkCanonical - * @property {number|null} [managementIpAddressLayoutVersion] NetworkConfig managementIpAddressLayoutVersion + * @interface IListVmwareEngineNetworksRequest + * @property {string|null} [parent] ListVmwareEngineNetworksRequest parent + * @property {number|null} [pageSize] ListVmwareEngineNetworksRequest pageSize + * @property {string|null} [pageToken] ListVmwareEngineNetworksRequest pageToken + * @property {string|null} [filter] ListVmwareEngineNetworksRequest filter + * @property {string|null} [orderBy] ListVmwareEngineNetworksRequest orderBy */ /** - * Constructs a new NetworkConfig. + * Constructs a new ListVmwareEngineNetworksRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a NetworkConfig. - * @implements INetworkConfig + * @classdesc Represents a ListVmwareEngineNetworksRequest. + * @implements IListVmwareEngineNetworksRequest * @constructor - * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set */ - function NetworkConfig(properties) { + function ListVmwareEngineNetworksRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11237,117 +11398,131 @@ } /** - * NetworkConfig managementCidr. - * @member {string} managementCidr - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * ListVmwareEngineNetworksRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @instance */ - NetworkConfig.prototype.managementCidr = ""; + ListVmwareEngineNetworksRequest.prototype.parent = ""; /** - * NetworkConfig vmwareEngineNetwork. - * @member {string} vmwareEngineNetwork - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * ListVmwareEngineNetworksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @instance */ - NetworkConfig.prototype.vmwareEngineNetwork = ""; + ListVmwareEngineNetworksRequest.prototype.pageSize = 0; /** - * NetworkConfig vmwareEngineNetworkCanonical. - * @member {string} vmwareEngineNetworkCanonical - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * ListVmwareEngineNetworksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @instance */ - NetworkConfig.prototype.vmwareEngineNetworkCanonical = ""; + ListVmwareEngineNetworksRequest.prototype.pageToken = ""; /** - * NetworkConfig managementIpAddressLayoutVersion. - * @member {number} managementIpAddressLayoutVersion - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * ListVmwareEngineNetworksRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @instance */ - NetworkConfig.prototype.managementIpAddressLayoutVersion = 0; + ListVmwareEngineNetworksRequest.prototype.filter = ""; /** - * Creates a new NetworkConfig instance using the specified properties. + * ListVmwareEngineNetworksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.orderBy = ""; + + /** + * Creates a new ListVmwareEngineNetworksRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static - * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig instance + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest instance */ - NetworkConfig.create = function create(properties) { - return new NetworkConfig(properties); + ListVmwareEngineNetworksRequest.create = function create(properties) { + return new ListVmwareEngineNetworksRequest(properties); }; /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * Encodes the specified ListVmwareEngineNetworksRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static - * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkConfig.encode = function encode(message, writer) { + ListVmwareEngineNetworksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.managementCidr != null && Object.hasOwnProperty.call(message, "managementCidr")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.managementCidr); - if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmwareEngineNetwork); - if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.vmwareEngineNetworkCanonical); - if (message.managementIpAddressLayoutVersion != null && Object.hasOwnProperty.call(message, "managementIpAddressLayoutVersion")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.managementIpAddressLayoutVersion); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * Encodes the specified ListVmwareEngineNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static - * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListVmwareEngineNetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NetworkConfig message from the specified reader or buffer. + * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkConfig.decode = function decode(reader, length) { + ListVmwareEngineNetworksRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: { - message.managementCidr = reader.string(); + case 1: { + message.parent = reader.string(); break; } - case 5: { - message.vmwareEngineNetwork = reader.string(); + case 2: { + message.pageSize = reader.int32(); break; } - case 6: { - message.vmwareEngineNetworkCanonical = reader.string(); + case 3: { + message.pageToken = reader.string(); break; } - case 8: { - message.managementIpAddressLayoutVersion = reader.int32(); + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -11359,148 +11534,159 @@ }; /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + ListVmwareEngineNetworksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NetworkConfig message. + * Verifies a ListVmwareEngineNetworksRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NetworkConfig.verify = function verify(message) { + ListVmwareEngineNetworksRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) - if (!$util.isString(message.managementCidr)) - return "managementCidr: string expected"; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - if (!$util.isString(message.vmwareEngineNetwork)) - return "vmwareEngineNetwork: string expected"; - if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) - if (!$util.isString(message.vmwareEngineNetworkCanonical)) - return "vmwareEngineNetworkCanonical: string expected"; - if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) - if (!$util.isInteger(message.managementIpAddressLayoutVersion)) - return "managementIpAddressLayoutVersion: integer expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListVmwareEngineNetworksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest */ - NetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkConfig) + ListVmwareEngineNetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.NetworkConfig(); - if (object.managementCidr != null) - message.managementCidr = String(object.managementCidr); - if (object.vmwareEngineNetwork != null) - message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); - if (object.vmwareEngineNetworkCanonical != null) - message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); - if (object.managementIpAddressLayoutVersion != null) - message.managementIpAddressLayoutVersion = object.managementIpAddressLayoutVersion | 0; + var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListVmwareEngineNetworksRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static - * @param {google.cloud.vmwareengine.v1.NetworkConfig} message NetworkConfig + * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NetworkConfig.toObject = function toObject(message, options) { + ListVmwareEngineNetworksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.managementCidr = ""; - object.vmwareEngineNetwork = ""; - object.vmwareEngineNetworkCanonical = ""; - object.managementIpAddressLayoutVersion = 0; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) - object.managementCidr = message.managementCidr; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - object.vmwareEngineNetwork = message.vmwareEngineNetwork; - if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) - object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; - if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) - object.managementIpAddressLayoutVersion = message.managementIpAddressLayoutVersion; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this NetworkConfig to JSON. + * Converts this ListVmwareEngineNetworksRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @instance * @returns {Object.} JSON object */ - NetworkConfig.prototype.toJSON = function toJSON() { + ListVmwareEngineNetworksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NetworkConfig + * Gets the default type url for ListVmwareEngineNetworksRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVmwareEngineNetworksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkConfig"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"; }; - return NetworkConfig; + return ListVmwareEngineNetworksRequest; })(); - v1.NodeTypeConfig = (function() { + v1.ListVmwareEngineNetworksResponse = (function() { /** - * Properties of a NodeTypeConfig. + * Properties of a ListVmwareEngineNetworksResponse. * @memberof google.cloud.vmwareengine.v1 - * @interface INodeTypeConfig - * @property {number|null} [nodeCount] NodeTypeConfig nodeCount - * @property {number|null} [customCoreCount] NodeTypeConfig customCoreCount + * @interface IListVmwareEngineNetworksResponse + * @property {Array.|null} [vmwareEngineNetworks] ListVmwareEngineNetworksResponse vmwareEngineNetworks + * @property {string|null} [nextPageToken] ListVmwareEngineNetworksResponse nextPageToken + * @property {Array.|null} [unreachable] ListVmwareEngineNetworksResponse unreachable */ /** - * Constructs a new NodeTypeConfig. + * Constructs a new ListVmwareEngineNetworksResponse. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a NodeTypeConfig. - * @implements INodeTypeConfig + * @classdesc Represents a ListVmwareEngineNetworksResponse. + * @implements IListVmwareEngineNetworksResponse * @constructor - * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set */ - function NodeTypeConfig(properties) { + function ListVmwareEngineNetworksResponse(properties) { + this.vmwareEngineNetworks = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11508,89 +11694,109 @@ } /** - * NodeTypeConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * ListVmwareEngineNetworksResponse vmwareEngineNetworks. + * @member {Array.} vmwareEngineNetworks + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @instance */ - NodeTypeConfig.prototype.nodeCount = 0; + ListVmwareEngineNetworksResponse.prototype.vmwareEngineNetworks = $util.emptyArray; /** - * NodeTypeConfig customCoreCount. - * @member {number} customCoreCount - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * ListVmwareEngineNetworksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @instance */ - NodeTypeConfig.prototype.customCoreCount = 0; + ListVmwareEngineNetworksResponse.prototype.nextPageToken = ""; /** - * Creates a new NodeTypeConfig instance using the specified properties. + * ListVmwareEngineNetworksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @instance + */ + ListVmwareEngineNetworksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListVmwareEngineNetworksResponse instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static - * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig instance + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse instance */ - NodeTypeConfig.create = function create(properties) { - return new NodeTypeConfig(properties); + ListVmwareEngineNetworksResponse.create = function create(properties) { + return new ListVmwareEngineNetworksResponse(properties); }; /** - * Encodes the specified NodeTypeConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * Encodes the specified ListVmwareEngineNetworksResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static - * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeTypeConfig.encode = function encode(message, writer) { + ListVmwareEngineNetworksResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - if (message.customCoreCount != null && Object.hasOwnProperty.call(message, "customCoreCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.customCoreCount); + if (message.vmwareEngineNetworks != null && message.vmwareEngineNetworks.length) + for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified NodeTypeConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * Encodes the specified ListVmwareEngineNetworksResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static - * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeTypeConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListVmwareEngineNetworksResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NodeTypeConfig message from the specified reader or buffer. + * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeTypeConfig.decode = function decode(reader, length) { + ListVmwareEngineNetworksResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NodeTypeConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.nodeCount = reader.int32(); + if (!(message.vmwareEngineNetworks && message.vmwareEngineNetworks.length)) + message.vmwareEngineNetworks = []; + message.vmwareEngineNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32())); break; } case 2: { - message.customCoreCount = reader.int32(); + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -11602,143 +11808,172 @@ }; /** - * Decodes a NodeTypeConfig message from the specified reader or buffer, length delimited. + * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeTypeConfig.decodeDelimited = function decodeDelimited(reader) { + ListVmwareEngineNetworksResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeTypeConfig message. + * Verifies a ListVmwareEngineNetworksResponse message. * @function verify - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeTypeConfig.verify = function verify(message) { + ListVmwareEngineNetworksResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) - if (!$util.isInteger(message.customCoreCount)) - return "customCoreCount: integer expected"; + if (message.vmwareEngineNetworks != null && message.hasOwnProperty("vmwareEngineNetworks")) { + if (!Array.isArray(message.vmwareEngineNetworks)) + return "vmwareEngineNetworks: array expected"; + for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetworks[i]); + if (error) + return "vmwareEngineNetworks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a NodeTypeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListVmwareEngineNetworksResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse */ - NodeTypeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.NodeTypeConfig) + ListVmwareEngineNetworksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse) return object; - var message = new $root.google.cloud.vmwareengine.v1.NodeTypeConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.customCoreCount != null) - message.customCoreCount = object.customCoreCount | 0; + var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse(); + if (object.vmwareEngineNetworks) { + if (!Array.isArray(object.vmwareEngineNetworks)) + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: array expected"); + message.vmwareEngineNetworks = []; + for (var i = 0; i < object.vmwareEngineNetworks.length; ++i) { + if (typeof object.vmwareEngineNetworks[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: object expected"); + message.vmwareEngineNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetworks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } return message; }; /** - * Creates a plain object from a NodeTypeConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListVmwareEngineNetworksResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static - * @param {google.cloud.vmwareengine.v1.NodeTypeConfig} message NodeTypeConfig + * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeTypeConfig.toObject = function toObject(message, options) { + ListVmwareEngineNetworksResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.nodeCount = 0; - object.customCoreCount = 0; + if (options.arrays || options.defaults) { + object.vmwareEngineNetworks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.vmwareEngineNetworks && message.vmwareEngineNetworks.length) { + object.vmwareEngineNetworks = []; + for (var j = 0; j < message.vmwareEngineNetworks.length; ++j) + object.vmwareEngineNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetworks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) - object.customCoreCount = message.customCoreCount; return object; }; /** - * Converts this NodeTypeConfig to JSON. + * Converts this ListVmwareEngineNetworksResponse to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @instance * @returns {Object.} JSON object */ - NodeTypeConfig.prototype.toJSON = function toJSON() { + ListVmwareEngineNetworksResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NodeTypeConfig + * Gets the default type url for ListVmwareEngineNetworksResponse * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeTypeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListVmwareEngineNetworksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeTypeConfig"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"; }; - return NodeTypeConfig; + return ListVmwareEngineNetworksResponse; })(); - v1.PrivateCloud = (function() { + v1.CreatePrivateConnectionRequest = (function() { /** - * Properties of a PrivateCloud. + * Properties of a CreatePrivateConnectionRequest. * @memberof google.cloud.vmwareengine.v1 - * @interface IPrivateCloud - * @property {string|null} [name] PrivateCloud name - * @property {google.protobuf.ITimestamp|null} [createTime] PrivateCloud createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] PrivateCloud updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] PrivateCloud deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] PrivateCloud expireTime - * @property {google.cloud.vmwareengine.v1.PrivateCloud.State|null} [state] PrivateCloud state - * @property {google.cloud.vmwareengine.v1.INetworkConfig|null} [networkConfig] PrivateCloud networkConfig - * @property {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null} [managementCluster] PrivateCloud managementCluster - * @property {string|null} [description] PrivateCloud description - * @property {google.cloud.vmwareengine.v1.IHcx|null} [hcx] PrivateCloud hcx - * @property {google.cloud.vmwareengine.v1.INsx|null} [nsx] PrivateCloud nsx - * @property {google.cloud.vmwareengine.v1.IVcenter|null} [vcenter] PrivateCloud vcenter - * @property {string|null} [uid] PrivateCloud uid + * @interface ICreatePrivateConnectionRequest + * @property {string|null} [parent] CreatePrivateConnectionRequest parent + * @property {string|null} [privateConnectionId] CreatePrivateConnectionRequest privateConnectionId + * @property {google.cloud.vmwareengine.v1.IPrivateConnection|null} [privateConnection] CreatePrivateConnectionRequest privateConnection + * @property {string|null} [requestId] CreatePrivateConnectionRequest requestId */ /** - * Constructs a new PrivateCloud. + * Constructs a new CreatePrivateConnectionRequest. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a PrivateCloud. - * @implements IPrivateCloud + * @classdesc Represents a CreatePrivateConnectionRequest. + * @implements ICreatePrivateConnectionRequest * @constructor - * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest=} [properties] Properties to set */ - function PrivateCloud(properties) { + function CreatePrivateConnectionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11746,190 +11981,345 @@ } /** - * PrivateCloud name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * CreatePrivateConnectionRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest * @instance */ - PrivateCloud.prototype.name = ""; + CreatePrivateConnectionRequest.prototype.parent = ""; /** - * PrivateCloud createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * CreatePrivateConnectionRequest privateConnectionId. + * @member {string} privateConnectionId + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest * @instance */ - PrivateCloud.prototype.createTime = null; + CreatePrivateConnectionRequest.prototype.privateConnectionId = ""; /** - * PrivateCloud updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * CreatePrivateConnectionRequest privateConnection. + * @member {google.cloud.vmwareengine.v1.IPrivateConnection|null|undefined} privateConnection + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest * @instance */ - PrivateCloud.prototype.updateTime = null; + CreatePrivateConnectionRequest.prototype.privateConnection = null; /** - * PrivateCloud deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * CreatePrivateConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest * @instance */ - PrivateCloud.prototype.deleteTime = null; + CreatePrivateConnectionRequest.prototype.requestId = ""; /** - * PrivateCloud expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Creates a new CreatePrivateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest instance */ - PrivateCloud.prototype.expireTime = null; + CreatePrivateConnectionRequest.create = function create(properties) { + return new CreatePrivateConnectionRequest(properties); + }; /** - * PrivateCloud state. - * @member {google.cloud.vmwareengine.v1.PrivateCloud.State} state - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Encodes the specified CreatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest} message CreatePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PrivateCloud.prototype.state = 0; + CreatePrivateConnectionRequest.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.privateConnectionId != null && Object.hasOwnProperty.call(message, "privateConnectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateConnectionId); + if (message.privateConnection != null && Object.hasOwnProperty.call(message, "privateConnection")) + $root.google.cloud.vmwareengine.v1.PrivateConnection.encode(message.privateConnection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; /** - * PrivateCloud networkConfig. - * @member {google.cloud.vmwareengine.v1.INetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Encodes the specified CreatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest} message CreatePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PrivateCloud.prototype.networkConfig = null; + CreatePrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * PrivateCloud managementCluster. - * @member {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null|undefined} managementCluster - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateCloud.prototype.managementCluster = null; + CreatePrivateConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.privateConnectionId = reader.string(); + break; + } + case 3: { + message.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * PrivateCloud description. - * @member {string} description - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateCloud.prototype.description = ""; + CreatePrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * PrivateCloud hcx. - * @member {google.cloud.vmwareengine.v1.IHcx|null|undefined} hcx - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + * Verifies a CreatePrivateConnectionRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateCloud.prototype.hcx = null; - - /** - * PrivateCloud nsx. - * @member {google.cloud.vmwareengine.v1.INsx|null|undefined} nsx - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @instance + CreatePrivateConnectionRequest.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.privateConnectionId != null && message.hasOwnProperty("privateConnectionId")) + if (!$util.isString(message.privateConnectionId)) + return "privateConnectionId: string expected"; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateConnection.verify(message.privateConnection); + if (error) + return "privateConnection." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest */ - PrivateCloud.prototype.nsx = null; + CreatePrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.privateConnectionId != null) + message.privateConnectionId = String(object.privateConnectionId); + if (object.privateConnection != null) { + if (typeof object.privateConnection !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest.privateConnection: object expected"); + message.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.fromObject(object.privateConnection); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; /** - * PrivateCloud vcenter. - * @member {google.cloud.vmwareengine.v1.IVcenter|null|undefined} vcenter - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * Creates a plain object from a CreatePrivateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest} message CreatePrivateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePrivateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.privateConnectionId = ""; + object.privateConnection = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.privateConnectionId != null && message.hasOwnProperty("privateConnectionId")) + object.privateConnectionId = message.privateConnectionId; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) + object.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.toObject(message.privateConnection, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreatePrivateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest * @instance + * @returns {Object.} JSON object */ - PrivateCloud.prototype.vcenter = null; + CreatePrivateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * PrivateCloud uid. - * @member {string} uid - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * Gets the default type url for CreatePrivateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"; + }; + + return CreatePrivateConnectionRequest; + })(); + + v1.GetPrivateConnectionRequest = (function() { + + /** + * Properties of a GetPrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetPrivateConnectionRequest + * @property {string|null} [name] GetPrivateConnectionRequest name + */ + + /** + * Constructs a new GetPrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetPrivateConnectionRequest. + * @implements IGetPrivateConnectionRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest=} [properties] Properties to set + */ + function GetPrivateConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrivateConnectionRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @instance */ - PrivateCloud.prototype.uid = ""; + GetPrivateConnectionRequest.prototype.name = ""; /** - * Creates a new PrivateCloud instance using the specified properties. + * Creates a new GetPrivateConnectionRequest instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud instance + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest instance */ - PrivateCloud.create = function create(properties) { - return new PrivateCloud(properties); + GetPrivateConnectionRequest.create = function create(properties) { + return new GetPrivateConnectionRequest(properties); }; /** - * Encodes the specified PrivateCloud message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * Encodes the specified GetPrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateConnectionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest} message GetPrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateCloud.encode = function encode(message, writer) { + GetPrivateConnectionRequest.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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.vmwareengine.v1.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.managementCluster != null && Object.hasOwnProperty.call(message, "managementCluster")) - $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.encode(message.managementCluster, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); - if (message.hcx != null && Object.hasOwnProperty.call(message, "hcx")) - $root.google.cloud.vmwareengine.v1.Hcx.encode(message.hcx, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.nsx != null && Object.hasOwnProperty.call(message, "nsx")) - $root.google.cloud.vmwareengine.v1.Nsx.encode(message.nsx, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.vcenter != null && Object.hasOwnProperty.call(message, "vcenter")) - $root.google.cloud.vmwareengine.v1.Vcenter.encode(message.vcenter, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 20, wireType 2 =*/162).string(message.uid); return writer; }; /** - * Encodes the specified PrivateCloud message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * Encodes the specified GetPrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateConnectionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest} message GetPrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateCloud.encodeDelimited = function encodeDelimited(message, writer) { + GetPrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivateCloud message from the specified reader or buffer. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @returns {google.cloud.vmwareengine.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateCloud.decode = function decode(reader, length) { + GetPrivateConnectionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PrivateCloud(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11937,54 +12327,6 @@ 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.decode(reader, reader.uint32()); - break; - } - case 11: { - message.description = reader.string(); - break; - } - case 17: { - message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.decode(reader, reader.uint32()); - break; - } - case 18: { - message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.decode(reader, reader.uint32()); - break; - } - case 19: { - message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.decode(reader, reader.uint32()); - break; - } - case 20: { - message.uid = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -11994,608 +12336,4320 @@ }; /** - * Decodes a PrivateCloud message from the specified reader or buffer, length delimited. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @returns {google.cloud.vmwareengine.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateCloud.decodeDelimited = function decodeDelimited(reader) { + GetPrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateCloud message. + * Verifies a GetPrivateConnectionRequest message. * @function verify - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateCloud.verify = function verify(message) { + GetPrivateConnectionRequest.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.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + 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 5: - case 6: - case 7: - break; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.vmwareengine.v1.NetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) { - var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify(message.managementCluster); - if (error) - return "managementCluster." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.hcx != null && message.hasOwnProperty("hcx")) { - var error = $root.google.cloud.vmwareengine.v1.Hcx.verify(message.hcx); - if (error) - return "hcx." + error; - } - if (message.nsx != null && message.hasOwnProperty("nsx")) { - var error = $root.google.cloud.vmwareengine.v1.Nsx.verify(message.nsx); - if (error) - return "nsx." + error; - } - if (message.vcenter != null && message.hasOwnProperty("vcenter")) { - var error = $root.google.cloud.vmwareengine.v1.Vcenter.verify(message.vcenter); - if (error) - return "vcenter." + error; - } - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; return null; }; /** - * Creates a PrivateCloud message from a plain object. Also converts values to their respective internal types. + * Creates a GetPrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @returns {google.cloud.vmwareengine.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest */ - PrivateCloud.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud) + GetPrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest) return object; - var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud(); + var message = new $root.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest(); if (object.name != null) message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.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.vmwareengine.v1.PrivateCloud.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "DELETED": - case 6: - message.state = 6; - break; - case "PURGING": - case 7: - message.state = 7; - break; - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.fromObject(object.networkConfig); - } - if (object.managementCluster != null) { - if (typeof object.managementCluster !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.managementCluster: object expected"); - message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.fromObject(object.managementCluster); - } - if (object.description != null) - message.description = String(object.description); - if (object.hcx != null) { - if (typeof object.hcx !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.hcx: object expected"); - message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.fromObject(object.hcx); - } - if (object.nsx != null) { - if (typeof object.nsx !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.nsx: object expected"); - message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.fromObject(object.nsx); - } - if (object.vcenter != null) { - if (typeof object.vcenter !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.vcenter: object expected"); - message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.fromObject(object.vcenter); - } - if (object.uid != null) - message.uid = String(object.uid); return message; }; /** - * Creates a plain object from a PrivateCloud message. Also converts values to other types if specified. + * Creates a plain object from a GetPrivateConnectionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.vmwareengine.v1.PrivateCloud} message PrivateCloud + * @param {google.cloud.vmwareengine.v1.GetPrivateConnectionRequest} message GetPrivateConnectionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivateCloud.toObject = function toObject(message, options) { + GetPrivateConnectionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.networkConfig = null; - object.managementCluster = null; - object.description = ""; - object.hcx = null; - object.nsx = null; - object.vcenter = null; - object.uid = ""; - } 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] : message.state; - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.toObject(message.networkConfig, options); - if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) - object.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.toObject(message.managementCluster, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.hcx != null && message.hasOwnProperty("hcx")) - object.hcx = $root.google.cloud.vmwareengine.v1.Hcx.toObject(message.hcx, options); - if (message.nsx != null && message.hasOwnProperty("nsx")) - object.nsx = $root.google.cloud.vmwareengine.v1.Nsx.toObject(message.nsx, options); - if (message.vcenter != null && message.hasOwnProperty("vcenter")) - object.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.toObject(message.vcenter, options); - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; return object; }; /** - * Converts this PrivateCloud to JSON. + * Converts this GetPrivateConnectionRequest to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @instance * @returns {Object.} JSON object */ - PrivateCloud.prototype.toJSON = function toJSON() { + GetPrivateConnectionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateCloud + * Gets the default type url for GetPrivateConnectionRequest * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @memberof google.cloud.vmwareengine.v1.GetPrivateConnectionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateCloud.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetPrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"; }; + return GetPrivateConnectionRequest; + })(); + + v1.ListPrivateConnectionsRequest = (function() { + /** - * State enum. - * @name google.cloud.vmwareengine.v1.PrivateCloud.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value - * @property {number} UPDATING=3 UPDATING value - * @property {number} FAILED=5 FAILED value - * @property {number} DELETED=6 DELETED value - * @property {number} PURGING=7 PURGING value + * Properties of a ListPrivateConnectionsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateConnectionsRequest + * @property {string|null} [parent] ListPrivateConnectionsRequest parent + * @property {number|null} [pageSize] ListPrivateConnectionsRequest pageSize + * @property {string|null} [pageToken] ListPrivateConnectionsRequest pageToken + * @property {string|null} [filter] ListPrivateConnectionsRequest filter + * @property {string|null} [orderBy] ListPrivateConnectionsRequest orderBy */ - PrivateCloud.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "DELETED"] = 6; - values[valuesById[7] = "PURGING"] = 7; - return values; - })(); - PrivateCloud.ManagementCluster = (function() { + /** + * Constructs a new ListPrivateConnectionsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateConnectionsRequest. + * @implements IListPrivateConnectionsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest=} [properties] Properties to set + */ + function ListPrivateConnectionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a ManagementCluster. - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @interface IManagementCluster - * @property {string|null} [clusterId] ManagementCluster clusterId - * @property {Object.|null} [nodeTypeConfigs] ManagementCluster nodeTypeConfigs - */ + /** + * ListPrivateConnectionsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.parent = ""; - /** - * Constructs a new ManagementCluster. - * @memberof google.cloud.vmwareengine.v1.PrivateCloud - * @classdesc Represents a ManagementCluster. - * @implements IManagementCluster - * @constructor - * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set - */ - function ManagementCluster(properties) { - this.nodeTypeConfigs = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListPrivateConnectionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.pageSize = 0; - /** - * ManagementCluster clusterId. - * @member {string} clusterId - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @instance - */ - ManagementCluster.prototype.clusterId = ""; + /** + * ListPrivateConnectionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.pageToken = ""; - /** - * ManagementCluster nodeTypeConfigs. - * @member {Object.} nodeTypeConfigs - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @instance - */ - ManagementCluster.prototype.nodeTypeConfigs = $util.emptyObject; + /** + * ListPrivateConnectionsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.filter = ""; - /** - * Creates a new ManagementCluster instance using the specified properties. - * @function create - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster instance - */ - ManagementCluster.create = function create(properties) { - return new ManagementCluster(properties); - }; + /** + * ListPrivateConnectionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.orderBy = ""; - /** - * Encodes the specified ManagementCluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementCluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); - if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) - for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; + /** + * Creates a new ListPrivateConnectionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest instance + */ + ListPrivateConnectionsRequest.create = function create(properties) { + return new ListPrivateConnectionsRequest(properties); + }; - /** - * Encodes the specified ManagementCluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementCluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListPrivateConnectionsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest} message ListPrivateConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; - /** - * Decodes a ManagementCluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementCluster.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.clusterId = reader.string(); - break; - } - case 7: { - if (message.nodeTypeConfigs === $util.emptyObject) - message.nodeTypeConfigs = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.nodeTypeConfigs[key] = value; - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified ListPrivateConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest} message ListPrivateConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); break; } - } - return message; - }; - - /** - * Decodes a ManagementCluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementCluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ManagementCluster message. - * @function verify - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ManagementCluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { - if (!$util.isObject(message.nodeTypeConfigs)) - return "nodeTypeConfigs: object expected"; - var key = Object.keys(message.nodeTypeConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); - if (error) - return "nodeTypeConfigs." + error; + case 2: { + message.pageSize = reader.int32(); + break; } - } - return null; - }; - - /** - * Creates a ManagementCluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster - */ - ManagementCluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster) - return object; - var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster(); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.nodeTypeConfigs) { - if (typeof object.nodeTypeConfigs !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); - message.nodeTypeConfigs = {}; - for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.nodeTypeConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); - message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); + case 3: { + message.pageToken = reader.string(); + break; } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Creates a plain object from a ManagementCluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} message ManagementCluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ManagementCluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.nodeTypeConfigs = {}; - if (options.defaults) - object.clusterId = ""; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - var keys2; - if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { - object.nodeTypeConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); - } - return object; - }; + } + return message; + }; - /** - * Converts this ManagementCluster to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @instance - * @returns {Object.} JSON object - */ - ManagementCluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for ManagementCluster - * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ + /** + * Verifies a ListPrivateConnectionsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateConnectionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListPrivateConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest + */ + ListPrivateConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListPrivateConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest} message ListPrivateConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListPrivateConnectionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPrivateConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateConnectionsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateConnectionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"; + }; + + return ListPrivateConnectionsRequest; + })(); + + v1.ListPrivateConnectionsResponse = (function() { + + /** + * Properties of a ListPrivateConnectionsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateConnectionsResponse + * @property {Array.|null} [privateConnections] ListPrivateConnectionsResponse privateConnections + * @property {string|null} [nextPageToken] ListPrivateConnectionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListPrivateConnectionsResponse unreachable + */ + + /** + * Constructs a new ListPrivateConnectionsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateConnectionsResponse. + * @implements IListPrivateConnectionsResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse=} [properties] Properties to set + */ + function ListPrivateConnectionsResponse(properties) { + this.privateConnections = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrivateConnectionsResponse privateConnections. + * @member {Array.} privateConnections + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @instance + */ + ListPrivateConnectionsResponse.prototype.privateConnections = $util.emptyArray; + + /** + * ListPrivateConnectionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @instance + */ + ListPrivateConnectionsResponse.prototype.nextPageToken = ""; + + /** + * ListPrivateConnectionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @instance + */ + ListPrivateConnectionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListPrivateConnectionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse instance + */ + ListPrivateConnectionsResponse.create = function create(properties) { + return new ListPrivateConnectionsResponse(properties); + }; + + /** + * Encodes the specified ListPrivateConnectionsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse} message ListPrivateConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateConnections != null && message.privateConnections.length) + for (var i = 0; i < message.privateConnections.length; ++i) + $root.google.cloud.vmwareengine.v1.PrivateConnection.encode(message.privateConnections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListPrivateConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse} message ListPrivateConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.privateConnections && message.privateConnections.length)) + message.privateConnections = []; + message.privateConnections.push($root.google.cloud.vmwareengine.v1.PrivateConnection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrivateConnectionsResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateConnections != null && message.hasOwnProperty("privateConnections")) { + if (!Array.isArray(message.privateConnections)) + return "privateConnections: array expected"; + for (var i = 0; i < message.privateConnections.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.PrivateConnection.verify(message.privateConnections[i]); + if (error) + return "privateConnections." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListPrivateConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse + */ + ListPrivateConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse(); + if (object.privateConnections) { + if (!Array.isArray(object.privateConnections)) + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.privateConnections: array expected"); + message.privateConnections = []; + for (var i = 0; i < object.privateConnections.length; ++i) { + if (typeof object.privateConnections[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.privateConnections: object expected"); + message.privateConnections[i] = $root.google.cloud.vmwareengine.v1.PrivateConnection.fromObject(object.privateConnections[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListPrivateConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse} message ListPrivateConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.privateConnections = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.privateConnections && message.privateConnections.length) { + object.privateConnections = []; + for (var j = 0; j < message.privateConnections.length; ++j) + object.privateConnections[j] = $root.google.cloud.vmwareengine.v1.PrivateConnection.toObject(message.privateConnections[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListPrivateConnectionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPrivateConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateConnectionsResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateConnectionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"; + }; + + return ListPrivateConnectionsResponse; + })(); + + v1.UpdatePrivateConnectionRequest = (function() { + + /** + * Properties of an UpdatePrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUpdatePrivateConnectionRequest + * @property {google.cloud.vmwareengine.v1.IPrivateConnection|null} [privateConnection] UpdatePrivateConnectionRequest privateConnection + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePrivateConnectionRequest updateMask + * @property {string|null} [requestId] UpdatePrivateConnectionRequest requestId + */ + + /** + * Constructs a new UpdatePrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UpdatePrivateConnectionRequest. + * @implements IUpdatePrivateConnectionRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest=} [properties] Properties to set + */ + function UpdatePrivateConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePrivateConnectionRequest privateConnection. + * @member {google.cloud.vmwareengine.v1.IPrivateConnection|null|undefined} privateConnection + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @instance + */ + UpdatePrivateConnectionRequest.prototype.privateConnection = null; + + /** + * UpdatePrivateConnectionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @instance + */ + UpdatePrivateConnectionRequest.prototype.updateMask = null; + + /** + * UpdatePrivateConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @instance + */ + UpdatePrivateConnectionRequest.prototype.requestId = ""; + + /** + * Creates a new UpdatePrivateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest} UpdatePrivateConnectionRequest instance + */ + UpdatePrivateConnectionRequest.create = function create(properties) { + return new UpdatePrivateConnectionRequest(properties); + }; + + /** + * Encodes the specified UpdatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest} message UpdatePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePrivateConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateConnection != null && Object.hasOwnProperty.call(message, "privateConnection")) + $root.google.cloud.vmwareengine.v1.PrivateConnection.encode(message.privateConnection, 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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest} message UpdatePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePrivateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest} UpdatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePrivateConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest} UpdatePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePrivateConnectionRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePrivateConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateConnection.verify(message.privateConnection); + if (error) + return "privateConnection." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest} UpdatePrivateConnectionRequest + */ + UpdatePrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest(); + if (object.privateConnection != null) { + if (typeof object.privateConnection !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.privateConnection: object expected"); + message.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.fromObject(object.privateConnection); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdatePrivateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest} message UpdatePrivateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePrivateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateConnection = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) + object.privateConnection = $root.google.cloud.vmwareengine.v1.PrivateConnection.toObject(message.privateConnection, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdatePrivateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePrivateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePrivateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"; + }; + + return UpdatePrivateConnectionRequest; + })(); + + v1.DeletePrivateConnectionRequest = (function() { + + /** + * Properties of a DeletePrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IDeletePrivateConnectionRequest + * @property {string|null} [name] DeletePrivateConnectionRequest name + * @property {string|null} [requestId] DeletePrivateConnectionRequest requestId + */ + + /** + * Constructs a new DeletePrivateConnectionRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a DeletePrivateConnectionRequest. + * @implements IDeletePrivateConnectionRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest=} [properties] Properties to set + */ + function DeletePrivateConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePrivateConnectionRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @instance + */ + DeletePrivateConnectionRequest.prototype.name = ""; + + /** + * DeletePrivateConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @instance + */ + DeletePrivateConnectionRequest.prototype.requestId = ""; + + /** + * Creates a new DeletePrivateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest instance + */ + DeletePrivateConnectionRequest.create = function create(properties) { + return new DeletePrivateConnectionRequest(properties); + }; + + /** + * Encodes the specified DeletePrivateConnectionRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest} message DeletePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePrivateConnectionRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeletePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest} message DeletePrivateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePrivateConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePrivateConnectionRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePrivateConnectionRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeletePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest + */ + DeletePrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeletePrivateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest} message DeletePrivateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePrivateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeletePrivateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePrivateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePrivateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"; + }; + + return DeletePrivateConnectionRequest; + })(); + + v1.ListPrivateConnectionPeeringRoutesRequest = (function() { + + /** + * Properties of a ListPrivateConnectionPeeringRoutesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateConnectionPeeringRoutesRequest + * @property {string|null} [parent] ListPrivateConnectionPeeringRoutesRequest parent + * @property {number|null} [pageSize] ListPrivateConnectionPeeringRoutesRequest pageSize + * @property {string|null} [pageToken] ListPrivateConnectionPeeringRoutesRequest pageToken + */ + + /** + * Constructs a new ListPrivateConnectionPeeringRoutesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateConnectionPeeringRoutesRequest. + * @implements IListPrivateConnectionPeeringRoutesRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest=} [properties] Properties to set + */ + function ListPrivateConnectionPeeringRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrivateConnectionPeeringRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @instance + */ + ListPrivateConnectionPeeringRoutesRequest.prototype.parent = ""; + + /** + * ListPrivateConnectionPeeringRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @instance + */ + ListPrivateConnectionPeeringRoutesRequest.prototype.pageSize = 0; + + /** + * ListPrivateConnectionPeeringRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @instance + */ + ListPrivateConnectionPeeringRoutesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPrivateConnectionPeeringRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest} ListPrivateConnectionPeeringRoutesRequest instance + */ + ListPrivateConnectionPeeringRoutesRequest.create = function create(properties) { + return new ListPrivateConnectionPeeringRoutesRequest(properties); + }; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest} message ListPrivateConnectionPeeringRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionPeeringRoutesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest} message ListPrivateConnectionPeeringRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionPeeringRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest} ListPrivateConnectionPeeringRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionPeeringRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest} ListPrivateConnectionPeeringRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionPeeringRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrivateConnectionPeeringRoutesRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateConnectionPeeringRoutesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPrivateConnectionPeeringRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest} ListPrivateConnectionPeeringRoutesRequest + */ + ListPrivateConnectionPeeringRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPrivateConnectionPeeringRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest} message ListPrivateConnectionPeeringRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateConnectionPeeringRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPrivateConnectionPeeringRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPrivateConnectionPeeringRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateConnectionPeeringRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateConnectionPeeringRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"; + }; + + return ListPrivateConnectionPeeringRoutesRequest; + })(); + + v1.ListPrivateConnectionPeeringRoutesResponse = (function() { + + /** + * Properties of a ListPrivateConnectionPeeringRoutesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateConnectionPeeringRoutesResponse + * @property {Array.|null} [peeringRoutes] ListPrivateConnectionPeeringRoutesResponse peeringRoutes + * @property {string|null} [nextPageToken] ListPrivateConnectionPeeringRoutesResponse nextPageToken + */ + + /** + * Constructs a new ListPrivateConnectionPeeringRoutesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateConnectionPeeringRoutesResponse. + * @implements IListPrivateConnectionPeeringRoutesResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse=} [properties] Properties to set + */ + function ListPrivateConnectionPeeringRoutesResponse(properties) { + this.peeringRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrivateConnectionPeeringRoutesResponse peeringRoutes. + * @member {Array.} peeringRoutes + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @instance + */ + ListPrivateConnectionPeeringRoutesResponse.prototype.peeringRoutes = $util.emptyArray; + + /** + * ListPrivateConnectionPeeringRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @instance + */ + ListPrivateConnectionPeeringRoutesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPrivateConnectionPeeringRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} ListPrivateConnectionPeeringRoutesResponse instance + */ + ListPrivateConnectionPeeringRoutesResponse.create = function create(properties) { + return new ListPrivateConnectionPeeringRoutesResponse(properties); + }; + + /** + * Encodes the specified ListPrivateConnectionPeeringRoutesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse} message ListPrivateConnectionPeeringRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionPeeringRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peeringRoutes != null && message.peeringRoutes.length) + for (var i = 0; i < message.peeringRoutes.length; ++i) + $root.google.cloud.vmwareengine.v1.PeeringRoute.encode(message.peeringRoutes[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 ListPrivateConnectionPeeringRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse} message ListPrivateConnectionPeeringRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateConnectionPeeringRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} ListPrivateConnectionPeeringRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionPeeringRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.peeringRoutes && message.peeringRoutes.length)) + message.peeringRoutes = []; + message.peeringRoutes.push($root.google.cloud.vmwareengine.v1.PeeringRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPrivateConnectionPeeringRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} ListPrivateConnectionPeeringRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateConnectionPeeringRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrivateConnectionPeeringRoutesResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateConnectionPeeringRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peeringRoutes != null && message.hasOwnProperty("peeringRoutes")) { + if (!Array.isArray(message.peeringRoutes)) + return "peeringRoutes: array expected"; + for (var i = 0; i < message.peeringRoutes.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.PeeringRoute.verify(message.peeringRoutes[i]); + if (error) + return "peeringRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPrivateConnectionPeeringRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} ListPrivateConnectionPeeringRoutesResponse + */ + ListPrivateConnectionPeeringRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse(); + if (object.peeringRoutes) { + if (!Array.isArray(object.peeringRoutes)) + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.peeringRoutes: array expected"); + message.peeringRoutes = []; + for (var i = 0; i < object.peeringRoutes.length; ++i) { + if (typeof object.peeringRoutes[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse.peeringRoutes: object expected"); + message.peeringRoutes[i] = $root.google.cloud.vmwareengine.v1.PeeringRoute.fromObject(object.peeringRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPrivateConnectionPeeringRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse} message ListPrivateConnectionPeeringRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateConnectionPeeringRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.peeringRoutes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.peeringRoutes && message.peeringRoutes.length) { + object.peeringRoutes = []; + for (var j = 0; j < message.peeringRoutes.length; ++j) + object.peeringRoutes[j] = $root.google.cloud.vmwareengine.v1.PeeringRoute.toObject(message.peeringRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPrivateConnectionPeeringRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListPrivateConnectionPeeringRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateConnectionPeeringRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateConnectionPeeringRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"; + }; + + return ListPrivateConnectionPeeringRoutesResponse; + })(); + + v1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.vmwareengine.v1 + * @interface INetworkConfig + * @property {string|null} [managementCidr] NetworkConfig managementCidr + * @property {string|null} [vmwareEngineNetwork] NetworkConfig vmwareEngineNetwork + * @property {string|null} [vmwareEngineNetworkCanonical] NetworkConfig vmwareEngineNetworkCanonical + * @property {number|null} [managementIpAddressLayoutVersion] NetworkConfig managementIpAddressLayoutVersion + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig managementCidr. + * @member {string} managementCidr + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.managementCidr = ""; + + /** + * NetworkConfig vmwareEngineNetwork. + * @member {string} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.vmwareEngineNetwork = ""; + + /** + * NetworkConfig vmwareEngineNetworkCanonical. + * @member {string} vmwareEngineNetworkCanonical + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.vmwareEngineNetworkCanonical = ""; + + /** + * NetworkConfig managementIpAddressLayoutVersion. + * @member {number} managementIpAddressLayoutVersion + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.managementIpAddressLayoutVersion = 0; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managementCidr != null && Object.hasOwnProperty.call(message, "managementCidr")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.managementCidr); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmwareEngineNetwork); + if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.vmwareEngineNetworkCanonical); + if (message.managementIpAddressLayoutVersion != null && Object.hasOwnProperty.call(message, "managementIpAddressLayoutVersion")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.managementIpAddressLayoutVersion); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.managementCidr = reader.string(); + break; + } + case 5: { + message.vmwareEngineNetwork = reader.string(); + break; + } + case 6: { + message.vmwareEngineNetworkCanonical = reader.string(); + break; + } + case 8: { + message.managementIpAddressLayoutVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) + if (!$util.isString(message.managementCidr)) + return "managementCidr: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + if (!$util.isString(message.vmwareEngineNetwork)) + return "vmwareEngineNetwork: string expected"; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + if (!$util.isString(message.vmwareEngineNetworkCanonical)) + return "vmwareEngineNetworkCanonical: string expected"; + if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) + if (!$util.isInteger(message.managementIpAddressLayoutVersion)) + return "managementIpAddressLayoutVersion: integer expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkConfig) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NetworkConfig(); + if (object.managementCidr != null) + message.managementCidr = String(object.managementCidr); + if (object.vmwareEngineNetwork != null) + message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); + if (object.vmwareEngineNetworkCanonical != null) + message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); + if (object.managementIpAddressLayoutVersion != null) + message.managementIpAddressLayoutVersion = object.managementIpAddressLayoutVersion | 0; + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.managementCidr = ""; + object.vmwareEngineNetwork = ""; + object.vmwareEngineNetworkCanonical = ""; + object.managementIpAddressLayoutVersion = 0; + } + if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) + object.managementCidr = message.managementCidr; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = message.vmwareEngineNetwork; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) + object.managementIpAddressLayoutVersion = message.managementIpAddressLayoutVersion; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + v1.NodeTypeConfig = (function() { + + /** + * Properties of a NodeTypeConfig. + * @memberof google.cloud.vmwareengine.v1 + * @interface INodeTypeConfig + * @property {number|null} [nodeCount] NodeTypeConfig nodeCount + * @property {number|null} [customCoreCount] NodeTypeConfig customCoreCount + */ + + /** + * Constructs a new NodeTypeConfig. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NodeTypeConfig. + * @implements INodeTypeConfig + * @constructor + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set + */ + function NodeTypeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTypeConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + */ + NodeTypeConfig.prototype.nodeCount = 0; + + /** + * NodeTypeConfig customCoreCount. + * @member {number} customCoreCount + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + */ + NodeTypeConfig.prototype.customCoreCount = 0; + + /** + * Creates a new NodeTypeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig instance + */ + NodeTypeConfig.create = function create(properties) { + return new NodeTypeConfig(properties); + }; + + /** + * Encodes the specified NodeTypeConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + if (message.customCoreCount != null && Object.hasOwnProperty.call(message, "customCoreCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.customCoreCount); + return writer; + }; + + /** + * Encodes the specified NodeTypeConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NodeTypeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + case 2: { + message.customCoreCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTypeConfig message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTypeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) + if (!$util.isInteger(message.customCoreCount)) + return "customCoreCount: integer expected"; + return null; + }; + + /** + * Creates a NodeTypeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + */ + NodeTypeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NodeTypeConfig) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NodeTypeConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.customCoreCount != null) + message.customCoreCount = object.customCoreCount | 0; + return message; + }; + + /** + * Creates a plain object from a NodeTypeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.NodeTypeConfig} message NodeTypeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTypeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeCount = 0; + object.customCoreCount = 0; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) + object.customCoreCount = message.customCoreCount; + return object; + }; + + /** + * Converts this NodeTypeConfig to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeTypeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeTypeConfig + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeTypeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeTypeConfig"; + }; + + return NodeTypeConfig; + })(); + + v1.PrivateCloud = (function() { + + /** + * Properties of a PrivateCloud. + * @memberof google.cloud.vmwareengine.v1 + * @interface IPrivateCloud + * @property {string|null} [name] PrivateCloud name + * @property {google.protobuf.ITimestamp|null} [createTime] PrivateCloud createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PrivateCloud updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] PrivateCloud deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] PrivateCloud expireTime + * @property {google.cloud.vmwareengine.v1.PrivateCloud.State|null} [state] PrivateCloud state + * @property {google.cloud.vmwareengine.v1.INetworkConfig|null} [networkConfig] PrivateCloud networkConfig + * @property {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null} [managementCluster] PrivateCloud managementCluster + * @property {string|null} [description] PrivateCloud description + * @property {google.cloud.vmwareengine.v1.IHcx|null} [hcx] PrivateCloud hcx + * @property {google.cloud.vmwareengine.v1.INsx|null} [nsx] PrivateCloud nsx + * @property {google.cloud.vmwareengine.v1.IVcenter|null} [vcenter] PrivateCloud vcenter + * @property {string|null} [uid] PrivateCloud uid + * @property {google.cloud.vmwareengine.v1.PrivateCloud.Type|null} [type] PrivateCloud type + */ + + /** + * Constructs a new PrivateCloud. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a PrivateCloud. + * @implements IPrivateCloud + * @constructor + * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set + */ + function PrivateCloud(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateCloud name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.name = ""; + + /** + * PrivateCloud createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.createTime = null; + + /** + * PrivateCloud updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.updateTime = null; + + /** + * PrivateCloud deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.deleteTime = null; + + /** + * PrivateCloud expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.expireTime = null; + + /** + * PrivateCloud state. + * @member {google.cloud.vmwareengine.v1.PrivateCloud.State} state + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.state = 0; + + /** + * PrivateCloud networkConfig. + * @member {google.cloud.vmwareengine.v1.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.networkConfig = null; + + /** + * PrivateCloud managementCluster. + * @member {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null|undefined} managementCluster + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.managementCluster = null; + + /** + * PrivateCloud description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.description = ""; + + /** + * PrivateCloud hcx. + * @member {google.cloud.vmwareengine.v1.IHcx|null|undefined} hcx + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.hcx = null; + + /** + * PrivateCloud nsx. + * @member {google.cloud.vmwareengine.v1.INsx|null|undefined} nsx + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.nsx = null; + + /** + * PrivateCloud vcenter. + * @member {google.cloud.vmwareengine.v1.IVcenter|null|undefined} vcenter + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.vcenter = null; + + /** + * PrivateCloud uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.uid = ""; + + /** + * PrivateCloud type. + * @member {google.cloud.vmwareengine.v1.PrivateCloud.Type} type + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.type = 0; + + /** + * Creates a new PrivateCloud instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud instance + */ + PrivateCloud.create = function create(properties) { + return new PrivateCloud(properties); + }; + + /** + * Encodes the specified PrivateCloud message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateCloud.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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.vmwareengine.v1.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.managementCluster != null && Object.hasOwnProperty.call(message, "managementCluster")) + $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.encode(message.managementCluster, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.hcx != null && Object.hasOwnProperty.call(message, "hcx")) + $root.google.cloud.vmwareengine.v1.Hcx.encode(message.hcx, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.nsx != null && Object.hasOwnProperty.call(message, "nsx")) + $root.google.cloud.vmwareengine.v1.Nsx.encode(message.nsx, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vcenter != null && Object.hasOwnProperty.call(message, "vcenter")) + $root.google.cloud.vmwareengine.v1.Vcenter.encode(message.vcenter, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.uid); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.type); + return writer; + }; + + /** + * Encodes the specified PrivateCloud message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateCloud.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateCloud.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PrivateCloud(); + 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.decode(reader, reader.uint32()); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 17: { + message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.decode(reader, reader.uint32()); + break; + } + case 18: { + message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.decode(reader, reader.uint32()); + break; + } + case 19: { + message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.decode(reader, reader.uint32()); + break; + } + case 20: { + message.uid = reader.string(); + break; + } + case 22: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateCloud.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateCloud message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateCloud.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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + 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 5: + case 6: + case 7: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify(message.managementCluster); + if (error) + return "managementCluster." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hcx != null && message.hasOwnProperty("hcx")) { + var error = $root.google.cloud.vmwareengine.v1.Hcx.verify(message.hcx); + if (error) + return "hcx." + error; + } + if (message.nsx != null && message.hasOwnProperty("nsx")) { + var error = $root.google.cloud.vmwareengine.v1.Nsx.verify(message.nsx); + if (error) + return "nsx." + error; + } + if (message.vcenter != null && message.hasOwnProperty("vcenter")) { + var error = $root.google.cloud.vmwareengine.v1.Vcenter.verify(message.vcenter); + if (error) + return "vcenter." + error; + } + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a PrivateCloud message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + */ + PrivateCloud.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud) + return object; + var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.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.vmwareengine.v1.PrivateCloud.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + case "PURGING": + case 7: + message.state = 7; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.fromObject(object.networkConfig); + } + if (object.managementCluster != null) { + if (typeof object.managementCluster !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.managementCluster: object expected"); + message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.fromObject(object.managementCluster); + } + if (object.description != null) + message.description = String(object.description); + if (object.hcx != null) { + if (typeof object.hcx !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.hcx: object expected"); + message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.fromObject(object.hcx); + } + if (object.nsx != null) { + if (typeof object.nsx !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.nsx: object expected"); + message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.fromObject(object.nsx); + } + if (object.vcenter != null) { + if (typeof object.vcenter !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.vcenter: object expected"); + message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.fromObject(object.vcenter); + } + if (object.uid != null) + message.uid = String(object.uid); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "STANDARD": + case 0: + message.type = 0; + break; + case "TIME_LIMITED": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a PrivateCloud message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud} message PrivateCloud + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateCloud.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.networkConfig = null; + object.managementCluster = null; + object.description = ""; + object.hcx = null; + object.nsx = null; + object.vcenter = null; + object.uid = ""; + object.type = options.enums === String ? "STANDARD" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] : message.state; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.toObject(message.networkConfig, options); + if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) + object.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.toObject(message.managementCluster, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hcx != null && message.hasOwnProperty("hcx")) + object.hcx = $root.google.cloud.vmwareengine.v1.Hcx.toObject(message.hcx, options); + if (message.nsx != null && message.hasOwnProperty("nsx")) + object.nsx = $root.google.cloud.vmwareengine.v1.Nsx.toObject(message.nsx, options); + if (message.vcenter != null && message.hasOwnProperty("vcenter")) + object.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.toObject(message.vcenter, options); + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateCloud.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.PrivateCloud.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this PrivateCloud to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + * @returns {Object.} JSON object + */ + PrivateCloud.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateCloud + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateCloud.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.PrivateCloud.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETED=6 DELETED value + * @property {number} PURGING=7 PURGING value + */ + PrivateCloud.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETED"] = 6; + values[valuesById[7] = "PURGING"] = 7; + return values; + })(); + + PrivateCloud.ManagementCluster = (function() { + + /** + * Properties of a ManagementCluster. + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @interface IManagementCluster + * @property {string|null} [clusterId] ManagementCluster clusterId + * @property {Object.|null} [nodeTypeConfigs] ManagementCluster nodeTypeConfigs + */ + + /** + * Constructs a new ManagementCluster. + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @classdesc Represents a ManagementCluster. + * @implements IManagementCluster + * @constructor + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set + */ + function ManagementCluster(properties) { + this.nodeTypeConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagementCluster clusterId. + * @member {string} clusterId + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + */ + ManagementCluster.prototype.clusterId = ""; + + /** + * ManagementCluster nodeTypeConfigs. + * @member {Object.} nodeTypeConfigs + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + */ + ManagementCluster.prototype.nodeTypeConfigs = $util.emptyObject; + + /** + * Creates a new ManagementCluster instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster instance + */ + ManagementCluster.create = function create(properties) { + return new ManagementCluster(properties); + }; + + /** + * Encodes the specified ManagementCluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) + for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ManagementCluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 7: { + if (message.nodeTypeConfigs === $util.emptyObject) + message.nodeTypeConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.nodeTypeConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagementCluster message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagementCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { + if (!$util.isObject(message.nodeTypeConfigs)) + return "nodeTypeConfigs: object expected"; + var key = Object.keys(message.nodeTypeConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); + if (error) + return "nodeTypeConfigs." + error; + } + } + return null; + }; + + /** + * Creates a ManagementCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + */ + ManagementCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster) + return object; + var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.nodeTypeConfigs) { + if (typeof object.nodeTypeConfigs !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs = {}; + for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.nodeTypeConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ManagementCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} message ManagementCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagementCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.nodeTypeConfigs = {}; + if (options.defaults) + object.clusterId = ""; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + var keys2; + if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { + object.nodeTypeConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ManagementCluster to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + * @returns {Object.} JSON object + */ + ManagementCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagementCluster + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ ManagementCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"; - }; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"; + }; + + return ManagementCluster; + })(); + + /** + * Type enum. + * @name google.cloud.vmwareengine.v1.PrivateCloud.Type + * @enum {number} + * @property {number} STANDARD=0 STANDARD value + * @property {number} TIME_LIMITED=1 TIME_LIMITED value + */ + PrivateCloud.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STANDARD"] = 0; + values[valuesById[1] = "TIME_LIMITED"] = 1; + return values; + })(); + + return PrivateCloud; + })(); + + v1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.cloud.vmwareengine.v1.Cluster.State|null} [state] Cluster state + * @property {boolean|null} [management] Cluster management + * @property {string|null} [uid] Cluster uid + * @property {Object.|null} [nodeTypeConfigs] Cluster nodeTypeConfigs + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.nodeTypeConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster state. + * @member {google.cloud.vmwareengine.v1.Cluster.State} state + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster management. + * @member {boolean} management + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.management = false; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster nodeTypeConfigs. + * @member {Object.} nodeTypeConfigs + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.nodeTypeConfigs = $util.emptyObject; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.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 6, wireType 0 =*/48).int32(message.state); + if (message.management != null && Object.hasOwnProperty.call(message, "management")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.management); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.uid); + if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) + for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.management = reader.bool(); + break; + } + case 14: { + message.uid = reader.string(); + break; + } + case 16: { + if (message.nodeTypeConfigs === $util.emptyObject) + message.nodeTypeConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.nodeTypeConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.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: + break; + } + if (message.management != null && message.hasOwnProperty("management")) + if (typeof message.management !== "boolean") + return "management: boolean expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { + if (!$util.isObject(message.nodeTypeConfigs)) + return "nodeTypeConfigs: object expected"; + var key = Object.keys(message.nodeTypeConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); + if (error) + return "nodeTypeConfigs." + error; + } + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Cluster) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.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.vmwareengine.v1.Cluster.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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "REPAIRING": + case 5: + message.state = 5; + break; + } + if (object.management != null) + message.management = Boolean(object.management); + if (object.uid != null) + message.uid = String(object.uid); + if (object.nodeTypeConfigs) { + if (typeof object.nodeTypeConfigs !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs = {}; + for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.nodeTypeConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.nodeTypeConfigs = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.management = false; + object.uid = ""; + } + 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.vmwareengine.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Cluster.State[message.state] : message.state; + if (message.management != null && message.hasOwnProperty("management")) + object.management = message.management; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + var keys2; + if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { + object.nodeTypeConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Cluster"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} REPAIRING=5 REPAIRING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "REPAIRING"] = 5; + return values; + })(); + + return Cluster; + })(); + + v1.Subnet = (function() { + + /** + * Properties of a Subnet. + * @memberof google.cloud.vmwareengine.v1 + * @interface ISubnet + * @property {string|null} [name] Subnet name + * @property {string|null} [ipCidrRange] Subnet ipCidrRange + * @property {string|null} [gatewayIp] Subnet gatewayIp + * @property {string|null} [type] Subnet type + * @property {google.cloud.vmwareengine.v1.Subnet.State|null} [state] Subnet state + */ + + /** + * Constructs a new Subnet. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Subnet. + * @implements ISubnet + * @constructor + * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set + */ + function Subnet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subnet name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.name = ""; + + /** + * Subnet ipCidrRange. + * @member {string} ipCidrRange + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.ipCidrRange = ""; + + /** + * Subnet gatewayIp. + * @member {string} gatewayIp + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.gatewayIp = ""; + + /** + * Subnet type. + * @member {string} type + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.type = ""; + + /** + * Subnet state. + * @member {google.cloud.vmwareengine.v1.Subnet.State} state + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.state = 0; + + /** + * Creates a new Subnet instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet instance + */ + Subnet.create = function create(properties) { + return new Subnet(properties); + }; + + /** + * Encodes the specified Subnet message. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnet.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.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.ipCidrRange); + if (message.gatewayIp != null && Object.hasOwnProperty.call(message, "gatewayIp")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.gatewayIp); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.type); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Subnet message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subnet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Subnet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 7: { + message.ipCidrRange = reader.string(); + break; + } + case 8: { + message.gatewayIp = reader.string(); + break; + } + case 11: { + message.type = reader.string(); + break; + } + case 13: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subnet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subnet message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subnet.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.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) + if (!$util.isString(message.gatewayIp)) + return "gatewayIp: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Subnet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + */ + Subnet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Subnet) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Subnet(); + if (object.name != null) + message.name = String(object.name); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.gatewayIp != null) + message.gatewayIp = String(object.gatewayIp); + if (object.type != null) + message.type = String(object.type); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "RECONCILING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Subnet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.Subnet} message Subnet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subnet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ipCidrRange = ""; + object.gatewayIp = ""; + object.type = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + object.ipCidrRange = message.ipCidrRange; + if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) + object.gatewayIp = message.gatewayIp; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Subnet to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + * @returns {Object.} JSON object + */ + Subnet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subnet + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subnet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Subnet"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Subnet.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} RECONCILING=5 RECONCILING value + * @property {number} FAILED=6 FAILED value + */ + Subnet.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "RECONCILING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + return Subnet; + })(); + + v1.NodeType = (function() { + + /** + * Properties of a NodeType. + * @memberof google.cloud.vmwareengine.v1 + * @interface INodeType + * @property {string|null} [name] NodeType name + * @property {string|null} [nodeTypeId] NodeType nodeTypeId + * @property {string|null} [displayName] NodeType displayName + * @property {number|null} [virtualCpuCount] NodeType virtualCpuCount + * @property {number|null} [totalCoreCount] NodeType totalCoreCount + * @property {number|null} [memoryGb] NodeType memoryGb + * @property {number|null} [diskSizeGb] NodeType diskSizeGb + * @property {Array.|null} [availableCustomCoreCounts] NodeType availableCustomCoreCounts + */ + + /** + * Constructs a new NodeType. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NodeType. + * @implements INodeType + * @constructor + * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set + */ + function NodeType(properties) { + this.availableCustomCoreCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeType name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.name = ""; + + /** + * NodeType nodeTypeId. + * @member {string} nodeTypeId + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.nodeTypeId = ""; + + /** + * NodeType displayName. + * @member {string} displayName + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.displayName = ""; + + /** + * NodeType virtualCpuCount. + * @member {number} virtualCpuCount + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.virtualCpuCount = 0; + + /** + * NodeType totalCoreCount. + * @member {number} totalCoreCount + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.totalCoreCount = 0; + + /** + * NodeType memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.memoryGb = 0; + + /** + * NodeType diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.diskSizeGb = 0; + + /** + * NodeType availableCustomCoreCounts. + * @member {Array.} availableCustomCoreCounts + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.availableCustomCoreCounts = $util.emptyArray; + + /** + * Creates a new NodeType instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType instance + */ + NodeType.create = function create(properties) { + return new NodeType(properties); + }; + + /** + * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.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.nodeTypeId != null && Object.hasOwnProperty.call(message, "nodeTypeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeTypeId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.virtualCpuCount != null && Object.hasOwnProperty.call(message, "virtualCpuCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.virtualCpuCount); + if (message.totalCoreCount != null && Object.hasOwnProperty.call(message, "totalCoreCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalCoreCount); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.memoryGb); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.diskSizeGb); + if (message.availableCustomCoreCounts != null && message.availableCustomCoreCounts.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) + writer.int32(message.availableCustomCoreCounts[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NodeType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.nodeTypeId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.virtualCpuCount = reader.int32(); + break; + } + case 5: { + message.totalCoreCount = reader.int32(); + break; + } + case 7: { + message.memoryGb = reader.int32(); + break; + } + case 8: { + message.diskSizeGb = reader.int32(); + break; + } + case 11: { + if (!(message.availableCustomCoreCounts && message.availableCustomCoreCounts.length)) + message.availableCustomCoreCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.availableCustomCoreCounts.push(reader.int32()); + } else + message.availableCustomCoreCounts.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return ManagementCluster; - })(); + /** + * Decodes a NodeType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeType message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeType.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.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) + if (!$util.isString(message.nodeTypeId)) + return "nodeTypeId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) + if (!$util.isInteger(message.virtualCpuCount)) + return "virtualCpuCount: integer expected"; + if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) + if (!$util.isInteger(message.totalCoreCount)) + return "totalCoreCount: integer expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (!$util.isInteger(message.memoryGb)) + return "memoryGb: integer expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.availableCustomCoreCounts != null && message.hasOwnProperty("availableCustomCoreCounts")) { + if (!Array.isArray(message.availableCustomCoreCounts)) + return "availableCustomCoreCounts: array expected"; + for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) + if (!$util.isInteger(message.availableCustomCoreCounts[i])) + return "availableCustomCoreCounts: integer[] expected"; + } + return null; + }; + + /** + * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + */ + NodeType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NodeType) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NodeType(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeTypeId != null) + message.nodeTypeId = String(object.nodeTypeId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.virtualCpuCount != null) + message.virtualCpuCount = object.virtualCpuCount | 0; + if (object.totalCoreCount != null) + message.totalCoreCount = object.totalCoreCount | 0; + if (object.memoryGb != null) + message.memoryGb = object.memoryGb | 0; + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.availableCustomCoreCounts) { + if (!Array.isArray(object.availableCustomCoreCounts)) + throw TypeError(".google.cloud.vmwareengine.v1.NodeType.availableCustomCoreCounts: array expected"); + message.availableCustomCoreCounts = []; + for (var i = 0; i < object.availableCustomCoreCounts.length; ++i) + message.availableCustomCoreCounts[i] = object.availableCustomCoreCounts[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.NodeType} message NodeType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableCustomCoreCounts = []; + if (options.defaults) { + object.name = ""; + object.nodeTypeId = ""; + object.displayName = ""; + object.virtualCpuCount = 0; + object.totalCoreCount = 0; + object.memoryGb = 0; + object.diskSizeGb = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) + object.nodeTypeId = message.nodeTypeId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) + object.virtualCpuCount = message.virtualCpuCount; + if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) + object.totalCoreCount = message.totalCoreCount; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = message.memoryGb; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.availableCustomCoreCounts && message.availableCustomCoreCounts.length) { + object.availableCustomCoreCounts = []; + for (var j = 0; j < message.availableCustomCoreCounts.length; ++j) + object.availableCustomCoreCounts[j] = message.availableCustomCoreCounts[j]; + } + return object; + }; + + /** + * Converts this NodeType to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + * @returns {Object.} JSON object + */ + NodeType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeType + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeType"; + }; - return PrivateCloud; + return NodeType; })(); - v1.Cluster = (function() { + v1.Credentials = (function() { /** - * Properties of a Cluster. + * Properties of a Credentials. * @memberof google.cloud.vmwareengine.v1 - * @interface ICluster - * @property {string|null} [name] Cluster name - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.cloud.vmwareengine.v1.Cluster.State|null} [state] Cluster state - * @property {boolean|null} [management] Cluster management - * @property {string|null} [uid] Cluster uid - * @property {Object.|null} [nodeTypeConfigs] Cluster nodeTypeConfigs + * @interface ICredentials + * @property {string|null} [username] Credentials username + * @property {string|null} [password] Credentials password */ /** - * Constructs a new Cluster. + * Constructs a new Credentials. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Cluster. - * @implements ICluster + * @classdesc Represents a Credentials. + * @implements ICredentials * @constructor - * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set */ - function Cluster(properties) { - this.nodeTypeConfigs = {}; + function Credentials(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12603,181 +16657,89 @@ } /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.Cluster - * @instance - */ - Cluster.prototype.name = ""; - - /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.Cluster - * @instance - */ - Cluster.prototype.createTime = null; - - /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.vmwareengine.v1.Cluster - * @instance - */ - Cluster.prototype.updateTime = null; - - /** - * Cluster state. - * @member {google.cloud.vmwareengine.v1.Cluster.State} state - * @memberof google.cloud.vmwareengine.v1.Cluster - * @instance - */ - Cluster.prototype.state = 0; - - /** - * Cluster management. - * @member {boolean} management - * @memberof google.cloud.vmwareengine.v1.Cluster - * @instance - */ - Cluster.prototype.management = false; - - /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.vmwareengine.v1.Cluster + * Credentials username. + * @member {string} username + * @memberof google.cloud.vmwareengine.v1.Credentials * @instance */ - Cluster.prototype.uid = ""; + Credentials.prototype.username = ""; /** - * Cluster nodeTypeConfigs. - * @member {Object.} nodeTypeConfigs - * @memberof google.cloud.vmwareengine.v1.Cluster + * Credentials password. + * @member {string} password + * @memberof google.cloud.vmwareengine.v1.Credentials * @instance */ - Cluster.prototype.nodeTypeConfigs = $util.emptyObject; + Credentials.prototype.password = ""; /** - * Creates a new Cluster instance using the specified properties. + * Creates a new Credentials instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static - * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster instance + * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials instance */ - Cluster.create = function create(properties) { - return new Cluster(properties); + Credentials.create = function create(properties) { + return new Credentials(properties); }; /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * Encodes the specified Credentials message. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static - * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encode = function encode(message, writer) { + Credentials.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 6, wireType 0 =*/48).int32(message.state); - if (message.management != null && Object.hasOwnProperty.call(message, "management")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.management); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.uid); - if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) - for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); return writer; }; /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * Encodes the specified Credentials message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static - * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { + Credentials.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Cluster message from the specified reader or buffer. + * Decodes a Credentials message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Cluster.decode = function decode(reader, length) { + Credentials.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Cluster(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Credentials(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.username = 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 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.management = reader.bool(); - break; - } - case 14: { - message.uid = reader.string(); - break; - } - case 16: { - if (message.nodeTypeConfigs === $util.emptyObject) - message.nodeTypeConfigs = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.nodeTypeConfigs[key] = value; + message.password = reader.string(); break; } default: @@ -12789,266 +16751,135 @@ }; /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. + * Decodes a Credentials message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cluster message. - * @function verify - * @memberof google.cloud.vmwareengine.v1.Cluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cluster.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: - break; - } - if (message.management != null && message.hasOwnProperty("management")) - if (typeof message.management !== "boolean") - return "management: boolean expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { - if (!$util.isObject(message.nodeTypeConfigs)) - return "nodeTypeConfigs: object expected"; - var key = Object.keys(message.nodeTypeConfigs); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); - if (error) - return "nodeTypeConfigs." + error; - } - } + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Credentials.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Credentials message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Credentials.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; return null; }; /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * Creates a Credentials message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Cluster) + Credentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Credentials) return object; - var message = new $root.google.cloud.vmwareengine.v1.Cluster(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.Cluster.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.vmwareengine.v1.Cluster.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 "ACTIVE": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "REPAIRING": - case 5: - message.state = 5; - break; - } - if (object.management != null) - message.management = Boolean(object.management); - if (object.uid != null) - message.uid = String(object.uid); - if (object.nodeTypeConfigs) { - if (typeof object.nodeTypeConfigs !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); - message.nodeTypeConfigs = {}; - for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { - if (typeof object.nodeTypeConfigs[keys[i]] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); - message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); - } - } + var message = new $root.google.cloud.vmwareengine.v1.Credentials(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); return message; }; /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * Creates a plain object from a Credentials message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static - * @param {google.cloud.vmwareengine.v1.Cluster} message Cluster + * @param {google.cloud.vmwareengine.v1.Credentials} message Credentials * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Cluster.toObject = function toObject(message, options) { + Credentials.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.nodeTypeConfigs = {}; if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.management = false; - object.uid = ""; - } - 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.vmwareengine.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Cluster.State[message.state] : message.state; - if (message.management != null && message.hasOwnProperty("management")) - object.management = message.management; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - var keys2; - if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { - object.nodeTypeConfigs = {}; - for (var j = 0; j < keys2.length; ++j) - object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); + object.username = ""; + object.password = ""; } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; return object; }; /** - * Converts this Cluster to JSON. + * Converts this Credentials to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @instance * @returns {Object.} JSON object */ - Cluster.prototype.toJSON = function toJSON() { + Credentials.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Cluster + * Gets the default type url for Credentials * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Cluster + * @memberof google.cloud.vmwareengine.v1.Credentials * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Credentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Cluster"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Credentials"; }; - /** - * State enum. - * @name google.cloud.vmwareengine.v1.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value - * @property {number} UPDATING=3 UPDATING value - * @property {number} DELETING=4 DELETING value - * @property {number} REPAIRING=5 REPAIRING value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "REPAIRING"] = 5; - return values; - })(); - - return Cluster; + return Credentials; })(); - v1.Subnet = (function() { + v1.HcxActivationKey = (function() { /** - * Properties of a Subnet. + * Properties of a HcxActivationKey. * @memberof google.cloud.vmwareengine.v1 - * @interface ISubnet - * @property {string|null} [name] Subnet name - * @property {string|null} [ipCidrRange] Subnet ipCidrRange - * @property {string|null} [gatewayIp] Subnet gatewayIp - * @property {string|null} [type] Subnet type - * @property {google.cloud.vmwareengine.v1.Subnet.State|null} [state] Subnet state + * @interface IHcxActivationKey + * @property {string|null} [name] HcxActivationKey name + * @property {google.protobuf.ITimestamp|null} [createTime] HcxActivationKey createTime + * @property {google.cloud.vmwareengine.v1.HcxActivationKey.State|null} [state] HcxActivationKey state + * @property {string|null} [activationKey] HcxActivationKey activationKey + * @property {string|null} [uid] HcxActivationKey uid */ /** - * Constructs a new Subnet. + * Constructs a new HcxActivationKey. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Subnet. - * @implements ISubnet + * @classdesc Represents a HcxActivationKey. + * @implements IHcxActivationKey * @constructor - * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set */ - function Subnet(properties) { + function HcxActivationKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13056,110 +16887,110 @@ } /** - * Subnet name. + * HcxActivationKey name. * @member {string} name - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance */ - Subnet.prototype.name = ""; + HcxActivationKey.prototype.name = ""; /** - * Subnet ipCidrRange. - * @member {string} ipCidrRange - * @memberof google.cloud.vmwareengine.v1.Subnet + * HcxActivationKey createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance */ - Subnet.prototype.ipCidrRange = ""; + HcxActivationKey.prototype.createTime = null; /** - * Subnet gatewayIp. - * @member {string} gatewayIp - * @memberof google.cloud.vmwareengine.v1.Subnet + * HcxActivationKey state. + * @member {google.cloud.vmwareengine.v1.HcxActivationKey.State} state + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance */ - Subnet.prototype.gatewayIp = ""; + HcxActivationKey.prototype.state = 0; /** - * Subnet type. - * @member {string} type - * @memberof google.cloud.vmwareengine.v1.Subnet + * HcxActivationKey activationKey. + * @member {string} activationKey + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance */ - Subnet.prototype.type = ""; + HcxActivationKey.prototype.activationKey = ""; /** - * Subnet state. - * @member {google.cloud.vmwareengine.v1.Subnet.State} state - * @memberof google.cloud.vmwareengine.v1.Subnet + * HcxActivationKey uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance */ - Subnet.prototype.state = 0; + HcxActivationKey.prototype.uid = ""; /** - * Creates a new Subnet instance using the specified properties. + * Creates a new HcxActivationKey instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static - * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet instance - */ - Subnet.create = function create(properties) { - return new Subnet(properties); + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey instance + */ + HcxActivationKey.create = function create(properties) { + return new HcxActivationKey(properties); }; /** - * Encodes the specified Subnet message. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * Encodes the specified HcxActivationKey message. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static - * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Subnet.encode = function encode(message, writer) { + HcxActivationKey.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.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.ipCidrRange); - if (message.gatewayIp != null && Object.hasOwnProperty.call(message, "gatewayIp")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.gatewayIp); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.type); + 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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.state); + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.activationKey != null && Object.hasOwnProperty.call(message, "activationKey")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.activationKey); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uid); return writer; }; /** - * Encodes the specified Subnet message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * Encodes the specified HcxActivationKey message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static - * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Subnet.encodeDelimited = function encodeDelimited(message, writer) { + HcxActivationKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Subnet message from the specified reader or buffer. + * Decodes a HcxActivationKey message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Subnet.decode = function decode(reader, length) { + HcxActivationKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Subnet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.HcxActivationKey(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13167,20 +16998,20 @@ message.name = reader.string(); break; } - case 7: { - message.ipCidrRange = reader.string(); + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 8: { - message.gatewayIp = reader.string(); + case 3: { + message.state = reader.int32(); break; } - case 11: { - message.type = reader.string(); + case 4: { + message.activationKey = reader.string(); break; } - case 13: { - message.state = reader.int32(); + case 5: { + message.uid = reader.string(); break; } default: @@ -13192,44 +17023,40 @@ }; /** - * Decodes a Subnet message from the specified reader or buffer, length delimited. + * Decodes a HcxActivationKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Subnet.decodeDelimited = function decodeDelimited(reader) { + HcxActivationKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Subnet message. + * Verifies a HcxActivationKey message. * @function verify - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Subnet.verify = function verify(message) { + HcxActivationKey.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.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) - if (!$util.isString(message.ipCidrRange)) - return "ipCidrRange: string expected"; - if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) - if (!$util.isString(message.gatewayIp)) - return "gatewayIp: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: 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.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -13238,32 +17065,36 @@ case 1: case 2: case 3: - case 4: break; } + if (message.activationKey != null && message.hasOwnProperty("activationKey")) + if (!$util.isString(message.activationKey)) + return "activationKey: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; return null; }; /** - * Creates a Subnet message from a plain object. Also converts values to their respective internal types. + * Creates a HcxActivationKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey */ - Subnet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Subnet) + HcxActivationKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.HcxActivationKey) return object; - var message = new $root.google.cloud.vmwareengine.v1.Subnet(); + var message = new $root.google.cloud.vmwareengine.v1.HcxActivationKey(); if (object.name != null) message.name = String(object.name); - if (object.ipCidrRange != null) - message.ipCidrRange = String(object.ipCidrRange); - if (object.gatewayIp != null) - message.gatewayIp = String(object.gatewayIp); - if (object.type != null) - message.type = String(object.type); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.HcxActivationKey.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } switch (object.state) { default: if (typeof object.state === "number") { @@ -13275,319 +17106,245 @@ case 0: message.state = 0; break; - case "ACTIVE": + case "AVAILABLE": case 1: message.state = 1; break; - case "CREATING": + case "CONSUMED": case 2: message.state = 2; break; - case "UPDATING": + case "CREATING": case 3: message.state = 3; break; - case "DELETING": - case 4: - message.state = 4; - break; } + if (object.activationKey != null) + message.activationKey = String(object.activationKey); + if (object.uid != null) + message.uid = String(object.uid); return message; }; /** - * Creates a plain object from a Subnet message. Also converts values to other types if specified. + * Creates a plain object from a HcxActivationKey message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static - * @param {google.cloud.vmwareengine.v1.Subnet} message Subnet + * @param {google.cloud.vmwareengine.v1.HcxActivationKey} message HcxActivationKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Subnet.toObject = function toObject(message, options) { + HcxActivationKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.ipCidrRange = ""; - object.gatewayIp = ""; - object.type = ""; + object.createTime = null; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.activationKey = ""; + object.uid = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) - object.ipCidrRange = message.ipCidrRange; - if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) - object.gatewayIp = message.gatewayIp; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] : message.state; + if (message.activationKey != null && message.hasOwnProperty("activationKey")) + object.activationKey = message.activationKey; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; return object; }; /** - * Converts this Subnet to JSON. + * Converts this HcxActivationKey to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @instance * @returns {Object.} JSON object */ - Subnet.prototype.toJSON = function toJSON() { + HcxActivationKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Subnet + * Gets the default type url for HcxActivationKey * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Subnet + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Subnet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HcxActivationKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Subnet"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.HcxActivationKey"; }; /** * State enum. - * @name google.cloud.vmwareengine.v1.Subnet.State + * @name google.cloud.vmwareengine.v1.HcxActivationKey.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value - * @property {number} UPDATING=3 UPDATING value - * @property {number} DELETING=4 DELETING value + * @property {number} AVAILABLE=1 AVAILABLE value + * @property {number} CONSUMED=2 CONSUMED value + * @property {number} CREATING=3 CREATING value */ - Subnet.State = (function() { + HcxActivationKey.State = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; + values[valuesById[1] = "AVAILABLE"] = 1; + values[valuesById[2] = "CONSUMED"] = 2; + values[valuesById[3] = "CREATING"] = 3; return values; })(); - return Subnet; + return HcxActivationKey; })(); - v1.NodeType = (function() { + v1.Hcx = (function() { /** - * Properties of a NodeType. + * Properties of a Hcx. * @memberof google.cloud.vmwareengine.v1 - * @interface INodeType - * @property {string|null} [name] NodeType name - * @property {string|null} [nodeTypeId] NodeType nodeTypeId - * @property {string|null} [displayName] NodeType displayName - * @property {number|null} [virtualCpuCount] NodeType virtualCpuCount - * @property {number|null} [totalCoreCount] NodeType totalCoreCount - * @property {number|null} [memoryGb] NodeType memoryGb - * @property {number|null} [diskSizeGb] NodeType diskSizeGb - * @property {Array.|null} [availableCustomCoreCounts] NodeType availableCustomCoreCounts + * @interface IHcx + * @property {string|null} [internalIp] Hcx internalIp + * @property {string|null} [version] Hcx version + * @property {google.cloud.vmwareengine.v1.Hcx.State|null} [state] Hcx state + * @property {string|null} [fqdn] Hcx fqdn */ /** - * Constructs a new NodeType. + * Constructs a new Hcx. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a NodeType. - * @implements INodeType + * @classdesc Represents a Hcx. + * @implements IHcx * @constructor - * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set */ - function NodeType(properties) { - this.availableCustomCoreCounts = []; + function Hcx(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeType name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.NodeType - * @instance - */ - NodeType.prototype.name = ""; - - /** - * NodeType nodeTypeId. - * @member {string} nodeTypeId - * @memberof google.cloud.vmwareengine.v1.NodeType - * @instance - */ - NodeType.prototype.nodeTypeId = ""; - - /** - * NodeType displayName. - * @member {string} displayName - * @memberof google.cloud.vmwareengine.v1.NodeType - * @instance - */ - NodeType.prototype.displayName = ""; - - /** - * NodeType virtualCpuCount. - * @member {number} virtualCpuCount - * @memberof google.cloud.vmwareengine.v1.NodeType - * @instance - */ - NodeType.prototype.virtualCpuCount = 0; + this[keys[i]] = properties[keys[i]]; + } /** - * NodeType totalCoreCount. - * @member {number} totalCoreCount - * @memberof google.cloud.vmwareengine.v1.NodeType + * Hcx internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Hcx * @instance */ - NodeType.prototype.totalCoreCount = 0; + Hcx.prototype.internalIp = ""; /** - * NodeType memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.vmwareengine.v1.NodeType + * Hcx version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Hcx * @instance */ - NodeType.prototype.memoryGb = 0; + Hcx.prototype.version = ""; /** - * NodeType diskSizeGb. - * @member {number} diskSizeGb - * @memberof google.cloud.vmwareengine.v1.NodeType + * Hcx state. + * @member {google.cloud.vmwareengine.v1.Hcx.State} state + * @memberof google.cloud.vmwareengine.v1.Hcx * @instance */ - NodeType.prototype.diskSizeGb = 0; + Hcx.prototype.state = 0; /** - * NodeType availableCustomCoreCounts. - * @member {Array.} availableCustomCoreCounts - * @memberof google.cloud.vmwareengine.v1.NodeType + * Hcx fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Hcx * @instance */ - NodeType.prototype.availableCustomCoreCounts = $util.emptyArray; + Hcx.prototype.fqdn = ""; /** - * Creates a new NodeType instance using the specified properties. + * Creates a new Hcx instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static - * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType instance + * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx instance */ - NodeType.create = function create(properties) { - return new NodeType(properties); + Hcx.create = function create(properties) { + return new Hcx(properties); }; /** - * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * Encodes the specified Hcx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static - * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeType.encode = function encode(message, writer) { + Hcx.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.nodeTypeId != null && Object.hasOwnProperty.call(message, "nodeTypeId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeTypeId); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.virtualCpuCount != null && Object.hasOwnProperty.call(message, "virtualCpuCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.virtualCpuCount); - if (message.totalCoreCount != null && Object.hasOwnProperty.call(message, "totalCoreCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalCoreCount); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.memoryGb); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.diskSizeGb); - if (message.availableCustomCoreCounts != null && message.availableCustomCoreCounts.length) { - writer.uint32(/* id 11, wireType 2 =*/90).fork(); - for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) - writer.int32(message.availableCustomCoreCounts[i]); - writer.ldelim(); - } + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); return writer; }; /** - * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * Encodes the specified Hcx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static - * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeType.encodeDelimited = function encodeDelimited(message, writer) { + Hcx.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NodeType message from the specified reader or buffer. + * Decodes a Hcx message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeType.decode = function decode(reader, length) { + Hcx.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NodeType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Hcx(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } case 2: { - message.nodeTypeId = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); + message.internalIp = reader.string(); break; } case 4: { - message.virtualCpuCount = reader.int32(); + message.version = reader.string(); break; } case 5: { - message.totalCoreCount = reader.int32(); - break; - } - case 7: { - message.memoryGb = reader.int32(); - break; - } - case 8: { - message.diskSizeGb = reader.int32(); + message.state = reader.int32(); break; } - case 11: { - if (!(message.availableCustomCoreCounts && message.availableCustomCoreCounts.length)) - message.availableCustomCoreCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.availableCustomCoreCounts.push(reader.int32()); - } else - message.availableCustomCoreCounts.push(reader.int32()); + case 6: { + message.fqdn = reader.string(); break; } default: @@ -13599,193 +17356,190 @@ }; /** - * Decodes a NodeType message from the specified reader or buffer, length delimited. + * Decodes a Hcx message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeType.decodeDelimited = function decodeDelimited(reader) { + Hcx.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeType message. + * Verifies a Hcx message. * @function verify - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeType.verify = function verify(message) { + Hcx.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.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) - if (!$util.isString(message.nodeTypeId)) - return "nodeTypeId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) - if (!$util.isInteger(message.virtualCpuCount)) - return "virtualCpuCount: integer expected"; - if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) - if (!$util.isInteger(message.totalCoreCount)) - return "totalCoreCount: integer expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (!$util.isInteger(message.memoryGb)) - return "memoryGb: integer expected"; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb)) - return "diskSizeGb: integer expected"; - if (message.availableCustomCoreCounts != null && message.hasOwnProperty("availableCustomCoreCounts")) { - if (!Array.isArray(message.availableCustomCoreCounts)) - return "availableCustomCoreCounts: array expected"; - for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) - if (!$util.isInteger(message.availableCustomCoreCounts[i])) - return "availableCustomCoreCounts: integer[] expected"; - } + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; return null; }; /** - * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * Creates a Hcx message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx */ - NodeType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.NodeType) + Hcx.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Hcx) return object; - var message = new $root.google.cloud.vmwareengine.v1.NodeType(); - if (object.name != null) - message.name = String(object.name); - if (object.nodeTypeId != null) - message.nodeTypeId = String(object.nodeTypeId); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.virtualCpuCount != null) - message.virtualCpuCount = object.virtualCpuCount | 0; - if (object.totalCoreCount != null) - message.totalCoreCount = object.totalCoreCount | 0; - if (object.memoryGb != null) - message.memoryGb = object.memoryGb | 0; - if (object.diskSizeGb != null) - message.diskSizeGb = object.diskSizeGb | 0; - if (object.availableCustomCoreCounts) { - if (!Array.isArray(object.availableCustomCoreCounts)) - throw TypeError(".google.cloud.vmwareengine.v1.NodeType.availableCustomCoreCounts: array expected"); - message.availableCustomCoreCounts = []; - for (var i = 0; i < object.availableCustomCoreCounts.length; ++i) - message.availableCustomCoreCounts[i] = object.availableCustomCoreCounts[i] | 0; + var message = new $root.google.cloud.vmwareengine.v1.Hcx(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + if (object.version != null) + message.version = String(object.version); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; } + if (object.fqdn != null) + message.fqdn = String(object.fqdn); return message; }; /** - * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * Creates a plain object from a Hcx message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static - * @param {google.cloud.vmwareengine.v1.NodeType} message NodeType + * @param {google.cloud.vmwareengine.v1.Hcx} message Hcx * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeType.toObject = function toObject(message, options) { + Hcx.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.availableCustomCoreCounts = []; if (options.defaults) { - object.name = ""; - object.nodeTypeId = ""; - object.displayName = ""; - object.virtualCpuCount = 0; - object.totalCoreCount = 0; - object.memoryGb = 0; - object.diskSizeGb = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) - object.nodeTypeId = message.nodeTypeId; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) - object.virtualCpuCount = message.virtualCpuCount; - if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) - object.totalCoreCount = message.totalCoreCount; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = message.memoryGb; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - object.diskSizeGb = message.diskSizeGb; - if (message.availableCustomCoreCounts && message.availableCustomCoreCounts.length) { - object.availableCustomCoreCounts = []; - for (var j = 0; j < message.availableCustomCoreCounts.length; ++j) - object.availableCustomCoreCounts[j] = message.availableCustomCoreCounts[j]; + object.internalIp = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.fqdn = ""; } + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Hcx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Hcx.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; return object; }; /** - * Converts this NodeType to JSON. + * Converts this Hcx to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @instance * @returns {Object.} JSON object */ - NodeType.prototype.toJSON = function toJSON() { + Hcx.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NodeType + * Gets the default type url for Hcx * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.NodeType + * @memberof google.cloud.vmwareengine.v1.Hcx * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Hcx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeType"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Hcx"; }; - return NodeType; + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Hcx.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + */ + Hcx.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Hcx; })(); - v1.Credentials = (function() { + v1.Nsx = (function() { /** - * Properties of a Credentials. + * Properties of a Nsx. * @memberof google.cloud.vmwareengine.v1 - * @interface ICredentials - * @property {string|null} [username] Credentials username - * @property {string|null} [password] Credentials password + * @interface INsx + * @property {string|null} [internalIp] Nsx internalIp + * @property {string|null} [version] Nsx version + * @property {google.cloud.vmwareengine.v1.Nsx.State|null} [state] Nsx state + * @property {string|null} [fqdn] Nsx fqdn */ /** - * Constructs a new Credentials. + * Constructs a new Nsx. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Credentials. - * @implements ICredentials + * @classdesc Represents a Nsx. + * @implements INsx * @constructor - * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set */ - function Credentials(properties) { + function Nsx(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13793,89 +17547,117 @@ } /** - * Credentials username. - * @member {string} username - * @memberof google.cloud.vmwareengine.v1.Credentials + * Nsx internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Nsx * @instance */ - Credentials.prototype.username = ""; + Nsx.prototype.internalIp = ""; /** - * Credentials password. - * @member {string} password - * @memberof google.cloud.vmwareengine.v1.Credentials + * Nsx version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Nsx * @instance */ - Credentials.prototype.password = ""; + Nsx.prototype.version = ""; /** - * Creates a new Credentials instance using the specified properties. + * Nsx state. + * @member {google.cloud.vmwareengine.v1.Nsx.State} state + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.state = 0; + + /** + * Nsx fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.fqdn = ""; + + /** + * Creates a new Nsx instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static - * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials instance + * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx instance */ - Credentials.create = function create(properties) { - return new Credentials(properties); + Nsx.create = function create(properties) { + return new Nsx(properties); }; /** - * Encodes the specified Credentials message. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * Encodes the specified Nsx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static - * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode + * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Credentials.encode = function encode(message, writer) { + Nsx.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); return writer; }; /** - * Encodes the specified Credentials message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * Encodes the specified Nsx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static - * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode + * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Credentials.encodeDelimited = function encodeDelimited(message, writer) { + Nsx.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Credentials message from the specified reader or buffer. + * Decodes a Nsx message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Credentials.decode = function decode(reader, length) { + Nsx.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Credentials(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Nsx(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.username = reader.string(); + case 2: { + message.internalIp = reader.string(); break; } - case 2: { - message.password = reader.string(); + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.fqdn = reader.string(); break; } default: @@ -13887,135 +17669,190 @@ }; /** - * Decodes a Credentials message from the specified reader or buffer, length delimited. + * Decodes a Nsx message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Credentials.decodeDelimited = function decodeDelimited(reader) { + Nsx.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Credentials message. + * Verifies a Nsx message. * @function verify - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Credentials.verify = function verify(message) { + Nsx.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; return null; }; /** - * Creates a Credentials message from a plain object. Also converts values to their respective internal types. + * Creates a Nsx message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx */ - Credentials.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Credentials) + Nsx.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Nsx) return object; - var message = new $root.google.cloud.vmwareengine.v1.Credentials(); - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); + var message = new $root.google.cloud.vmwareengine.v1.Nsx(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + if (object.version != null) + message.version = String(object.version); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.fqdn != null) + message.fqdn = String(object.fqdn); return message; }; /** - * Creates a plain object from a Credentials message. Also converts values to other types if specified. + * Creates a plain object from a Nsx message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static - * @param {google.cloud.vmwareengine.v1.Credentials} message Credentials + * @param {google.cloud.vmwareengine.v1.Nsx} message Nsx * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Credentials.toObject = function toObject(message, options) { + Nsx.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.username = ""; - object.password = ""; + object.internalIp = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.fqdn = ""; } - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Nsx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Nsx.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; return object; }; /** - * Converts this Credentials to JSON. + * Converts this Nsx to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @instance * @returns {Object.} JSON object */ - Credentials.prototype.toJSON = function toJSON() { + Nsx.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Credentials + * Gets the default type url for Nsx * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Credentials + * @memberof google.cloud.vmwareengine.v1.Nsx * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Credentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Nsx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Credentials"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Nsx"; }; - return Credentials; + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Nsx.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + */ + Nsx.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Nsx; })(); - v1.HcxActivationKey = (function() { + v1.Vcenter = (function() { /** - * Properties of a HcxActivationKey. + * Properties of a Vcenter. * @memberof google.cloud.vmwareengine.v1 - * @interface IHcxActivationKey - * @property {string|null} [name] HcxActivationKey name - * @property {google.protobuf.ITimestamp|null} [createTime] HcxActivationKey createTime - * @property {google.cloud.vmwareengine.v1.HcxActivationKey.State|null} [state] HcxActivationKey state - * @property {string|null} [activationKey] HcxActivationKey activationKey - * @property {string|null} [uid] HcxActivationKey uid + * @interface IVcenter + * @property {string|null} [internalIp] Vcenter internalIp + * @property {string|null} [version] Vcenter version + * @property {google.cloud.vmwareengine.v1.Vcenter.State|null} [state] Vcenter state + * @property {string|null} [fqdn] Vcenter fqdn */ /** - * Constructs a new HcxActivationKey. + * Constructs a new Vcenter. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a HcxActivationKey. - * @implements IHcxActivationKey + * @classdesc Represents a Vcenter. + * @implements IVcenter * @constructor - * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set */ - function HcxActivationKey(properties) { + function Vcenter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14023,131 +17860,117 @@ } /** - * HcxActivationKey name. - * @member {string} name - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey - * @instance - */ - HcxActivationKey.prototype.name = ""; - - /** - * HcxActivationKey createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * Vcenter internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Vcenter * @instance */ - HcxActivationKey.prototype.createTime = null; + Vcenter.prototype.internalIp = ""; /** - * HcxActivationKey state. - * @member {google.cloud.vmwareengine.v1.HcxActivationKey.State} state - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * Vcenter version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Vcenter * @instance */ - HcxActivationKey.prototype.state = 0; + Vcenter.prototype.version = ""; /** - * HcxActivationKey activationKey. - * @member {string} activationKey - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * Vcenter state. + * @member {google.cloud.vmwareengine.v1.Vcenter.State} state + * @memberof google.cloud.vmwareengine.v1.Vcenter * @instance */ - HcxActivationKey.prototype.activationKey = ""; + Vcenter.prototype.state = 0; /** - * HcxActivationKey uid. - * @member {string} uid - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * Vcenter fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Vcenter * @instance */ - HcxActivationKey.prototype.uid = ""; + Vcenter.prototype.fqdn = ""; /** - * Creates a new HcxActivationKey instance using the specified properties. + * Creates a new Vcenter instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static - * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey instance + * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter instance */ - HcxActivationKey.create = function create(properties) { - return new HcxActivationKey(properties); + Vcenter.create = function create(properties) { + return new Vcenter(properties); }; /** - * Encodes the specified HcxActivationKey message. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * Encodes the specified Vcenter message. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static - * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HcxActivationKey.encode = function encode(message, writer) { + Vcenter.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.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.activationKey != null && Object.hasOwnProperty.call(message, "activationKey")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.activationKey); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.uid); + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); return writer; }; /** - * Encodes the specified HcxActivationKey message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * Encodes the specified Vcenter message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static - * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HcxActivationKey.encodeDelimited = function encodeDelimited(message, writer) { + Vcenter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HcxActivationKey message from the specified reader or buffer. + * Decodes a Vcenter message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HcxActivationKey.decode = function decode(reader, length) { + Vcenter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.HcxActivationKey(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Vcenter(); 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.state = reader.int32(); + message.internalIp = reader.string(); break; } case 4: { - message.activationKey = reader.string(); + message.version = reader.string(); break; } case 5: { - message.uid = reader.string(); + message.state = reader.int32(); + break; + } + case 6: { + message.fqdn = reader.string(); break; } default: @@ -14159,40 +17982,38 @@ }; /** - * Decodes a HcxActivationKey message from the specified reader or buffer, length delimited. + * Decodes a Vcenter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HcxActivationKey.decodeDelimited = function decodeDelimited(reader) { + Vcenter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HcxActivationKey message. + * Verifies a Vcenter message. * @function verify - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HcxActivationKey.verify = function verify(message) { + Vcenter.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.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -14200,37 +18021,30 @@ case 0: case 1: case 2: - case 3: break; } - if (message.activationKey != null && message.hasOwnProperty("activationKey")) - if (!$util.isString(message.activationKey)) - return "activationKey: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; return null; }; /** - * Creates a HcxActivationKey message from a plain object. Also converts values to their respective internal types. + * Creates a Vcenter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter */ - HcxActivationKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.HcxActivationKey) + Vcenter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Vcenter) return object; - var message = new $root.google.cloud.vmwareengine.v1.HcxActivationKey(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.HcxActivationKey.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } + var message = new $root.google.cloud.vmwareengine.v1.Vcenter(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + if (object.version != null) + message.version = String(object.version); switch (object.state) { default: if (typeof object.state === "number") { @@ -14242,127 +18056,118 @@ case 0: message.state = 0; break; - case "AVAILABLE": + case "ACTIVE": case 1: message.state = 1; break; - case "CONSUMED": + case "CREATING": case 2: message.state = 2; break; - case "CREATING": - case 3: - message.state = 3; - break; } - if (object.activationKey != null) - message.activationKey = String(object.activationKey); - if (object.uid != null) - message.uid = String(object.uid); + if (object.fqdn != null) + message.fqdn = String(object.fqdn); return message; }; /** - * Creates a plain object from a HcxActivationKey message. Also converts values to other types if specified. + * Creates a plain object from a Vcenter message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static - * @param {google.cloud.vmwareengine.v1.HcxActivationKey} message HcxActivationKey + * @param {google.cloud.vmwareengine.v1.Vcenter} message Vcenter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HcxActivationKey.toObject = function toObject(message, options) { + Vcenter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.createTime = null; + object.internalIp = ""; + object.version = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.activationKey = ""; - object.uid = ""; + object.fqdn = ""; } - 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.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] : message.state; - if (message.activationKey != null && message.hasOwnProperty("activationKey")) - object.activationKey = message.activationKey; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Vcenter.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Vcenter.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; return object; }; /** - * Converts this HcxActivationKey to JSON. + * Converts this Vcenter to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @instance * @returns {Object.} JSON object */ - HcxActivationKey.prototype.toJSON = function toJSON() { + Vcenter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HcxActivationKey + * Gets the default type url for Vcenter * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @memberof google.cloud.vmwareengine.v1.Vcenter * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HcxActivationKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Vcenter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.HcxActivationKey"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Vcenter"; }; /** * State enum. - * @name google.cloud.vmwareengine.v1.HcxActivationKey.State + * @name google.cloud.vmwareengine.v1.Vcenter.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} AVAILABLE=1 AVAILABLE value - * @property {number} CONSUMED=2 CONSUMED value - * @property {number} CREATING=3 CREATING value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value */ - HcxActivationKey.State = (function() { + Vcenter.State = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AVAILABLE"] = 1; - values[valuesById[2] = "CONSUMED"] = 2; - values[valuesById[3] = "CREATING"] = 3; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; return values; })(); - return HcxActivationKey; + return Vcenter; })(); - v1.Hcx = (function() { + v1.PeeringRoute = (function() { /** - * Properties of a Hcx. + * Properties of a PeeringRoute. * @memberof google.cloud.vmwareengine.v1 - * @interface IHcx - * @property {string|null} [internalIp] Hcx internalIp - * @property {string|null} [version] Hcx version - * @property {google.cloud.vmwareengine.v1.Hcx.State|null} [state] Hcx state - * @property {string|null} [fqdn] Hcx fqdn + * @interface IPeeringRoute + * @property {string|null} [destRange] PeeringRoute destRange + * @property {google.cloud.vmwareengine.v1.PeeringRoute.Type|null} [type] PeeringRoute type + * @property {string|null} [nextHopRegion] PeeringRoute nextHopRegion + * @property {number|Long|null} [priority] PeeringRoute priority + * @property {boolean|null} [imported] PeeringRoute imported + * @property {google.cloud.vmwareengine.v1.PeeringRoute.Direction|null} [direction] PeeringRoute direction */ /** - * Constructs a new Hcx. + * Constructs a new PeeringRoute. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Hcx. - * @implements IHcx + * @classdesc Represents a PeeringRoute. + * @implements IPeeringRoute * @constructor - * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IPeeringRoute=} [properties] Properties to set */ - function Hcx(properties) { + function PeeringRoute(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14370,117 +18175,145 @@ } /** - * Hcx internalIp. - * @member {string} internalIp - * @memberof google.cloud.vmwareengine.v1.Hcx + * PeeringRoute destRange. + * @member {string} destRange + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @instance */ - Hcx.prototype.internalIp = ""; + PeeringRoute.prototype.destRange = ""; /** - * Hcx version. - * @member {string} version - * @memberof google.cloud.vmwareengine.v1.Hcx + * PeeringRoute type. + * @member {google.cloud.vmwareengine.v1.PeeringRoute.Type} type + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @instance */ - Hcx.prototype.version = ""; + PeeringRoute.prototype.type = 0; /** - * Hcx state. - * @member {google.cloud.vmwareengine.v1.Hcx.State} state - * @memberof google.cloud.vmwareengine.v1.Hcx + * PeeringRoute nextHopRegion. + * @member {string} nextHopRegion + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @instance */ - Hcx.prototype.state = 0; + PeeringRoute.prototype.nextHopRegion = ""; /** - * Hcx fqdn. - * @member {string} fqdn - * @memberof google.cloud.vmwareengine.v1.Hcx + * PeeringRoute priority. + * @member {number|Long} priority + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @instance */ - Hcx.prototype.fqdn = ""; + PeeringRoute.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new Hcx instance using the specified properties. + * PeeringRoute imported. + * @member {boolean} imported + * @memberof google.cloud.vmwareengine.v1.PeeringRoute + * @instance + */ + PeeringRoute.prototype.imported = false; + + /** + * PeeringRoute direction. + * @member {google.cloud.vmwareengine.v1.PeeringRoute.Direction} direction + * @memberof google.cloud.vmwareengine.v1.PeeringRoute + * @instance + */ + PeeringRoute.prototype.direction = 0; + + /** + * Creates a new PeeringRoute instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static - * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx instance + * @param {google.cloud.vmwareengine.v1.IPeeringRoute=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PeeringRoute} PeeringRoute instance */ - Hcx.create = function create(properties) { - return new Hcx(properties); + PeeringRoute.create = function create(properties) { + return new PeeringRoute(properties); }; /** - * Encodes the specified Hcx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * Encodes the specified PeeringRoute message. Does not implicitly {@link google.cloud.vmwareengine.v1.PeeringRoute.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static - * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IPeeringRoute} message PeeringRoute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Hcx.encode = function encode(message, writer) { + PeeringRoute.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); + if (message.destRange != null && Object.hasOwnProperty.call(message, "destRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destRange); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.nextHopRegion != null && Object.hasOwnProperty.call(message, "nextHopRegion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextHopRegion); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.priority); + if (message.imported != null && Object.hasOwnProperty.call(message, "imported")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.imported); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.direction); return writer; }; /** - * Encodes the specified Hcx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * Encodes the specified PeeringRoute message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PeeringRoute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static - * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IPeeringRoute} message PeeringRoute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Hcx.encodeDelimited = function encodeDelimited(message, writer) { + PeeringRoute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Hcx message from the specified reader or buffer. + * Decodes a PeeringRoute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + * @returns {google.cloud.vmwareengine.v1.PeeringRoute} PeeringRoute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Hcx.decode = function decode(reader, length) { + PeeringRoute.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Hcx(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PeeringRoute(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.destRange = reader.string(); + break; + } case 2: { - message.internalIp = reader.string(); + message.type = reader.int32(); + break; + } + case 3: { + message.nextHopRegion = reader.string(); break; } case 4: { - message.version = reader.string(); + message.priority = reader.int64(); break; } case 5: { - message.state = reader.int32(); + message.imported = reader.bool(); break; } case 6: { - message.fqdn = reader.string(); + message.direction = reader.int32(); break; } default: @@ -14492,190 +18325,273 @@ }; /** - * Decodes a Hcx message from the specified reader or buffer, length delimited. + * Decodes a PeeringRoute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + * @returns {google.cloud.vmwareengine.v1.PeeringRoute} PeeringRoute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Hcx.decodeDelimited = function decodeDelimited(reader) { + PeeringRoute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Hcx message. + * Verifies a PeeringRoute message. * @function verify - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Hcx.verify = function verify(message) { + PeeringRoute.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - if (!$util.isString(message.internalIp)) - return "internalIp: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { + if (message.destRange != null && message.hasOwnProperty("destRange")) + if (!$util.isString(message.destRange)) + return "destRange: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "state: enum value expected"; + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.nextHopRegion != null && message.hasOwnProperty("nextHopRegion")) + if (!$util.isString(message.nextHopRegion)) + return "nextHopRegion: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) + return "priority: integer|Long expected"; + if (message.imported != null && message.hasOwnProperty("imported")) + if (typeof message.imported !== "boolean") + return "imported: boolean expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; case 0: case 1: case 2: break; } - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - if (!$util.isString(message.fqdn)) - return "fqdn: string expected"; return null; }; /** - * Creates a Hcx message from a plain object. Also converts values to their respective internal types. + * Creates a PeeringRoute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + * @returns {google.cloud.vmwareengine.v1.PeeringRoute} PeeringRoute */ - Hcx.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Hcx) + PeeringRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PeeringRoute) return object; - var message = new $root.google.cloud.vmwareengine.v1.Hcx(); - if (object.internalIp != null) - message.internalIp = String(object.internalIp); - if (object.version != null) - message.version = String(object.version); - switch (object.state) { + var message = new $root.google.cloud.vmwareengine.v1.PeeringRoute(); + if (object.destRange != null) + message.destRange = String(object.destRange); + switch (object.type) { default: - if (typeof object.state === "number") { - message.state = object.state; + if (typeof object.type === "number") { + message.type = object.type; break; } break; - case "STATE_UNSPECIFIED": + case "TYPE_UNSPECIFIED": case 0: - message.state = 0; + message.type = 0; break; - case "ACTIVE": + case "DYNAMIC_PEERING_ROUTE": case 1: - message.state = 1; + message.type = 1; break; - case "CREATING": + case "STATIC_PEERING_ROUTE": case 2: - message.state = 2; + message.type = 2; + break; + case "SUBNET_PEERING_ROUTE": + case 3: + message.type = 3; + break; + } + if (object.nextHopRegion != null) + message.nextHopRegion = String(object.nextHopRegion); + if (object.priority != null) + if ($util.Long) + (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; + else if (typeof object.priority === "string") + message.priority = parseInt(object.priority, 10); + else if (typeof object.priority === "number") + message.priority = object.priority; + else if (typeof object.priority === "object") + message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); + if (object.imported != null) + message.imported = Boolean(object.imported); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "INCOMING": + case 1: + message.direction = 1; + break; + case "OUTGOING": + case 2: + message.direction = 2; break; } - if (object.fqdn != null) - message.fqdn = String(object.fqdn); return message; }; /** - * Creates a plain object from a Hcx message. Also converts values to other types if specified. + * Creates a plain object from a PeeringRoute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static - * @param {google.cloud.vmwareengine.v1.Hcx} message Hcx + * @param {google.cloud.vmwareengine.v1.PeeringRoute} message PeeringRoute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Hcx.toObject = function toObject(message, options) { + PeeringRoute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.internalIp = ""; - object.version = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.fqdn = ""; - } - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - object.internalIp = message.internalIp; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Hcx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Hcx.State[message.state] : message.state; - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - object.fqdn = message.fqdn; + object.destRange = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.nextHopRegion = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priority = options.longs === String ? "0" : 0; + object.imported = false; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.destRange != null && message.hasOwnProperty("destRange")) + object.destRange = message.destRange; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.PeeringRoute.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.PeeringRoute.Type[message.type] : message.type; + if (message.nextHopRegion != null && message.hasOwnProperty("nextHopRegion")) + object.nextHopRegion = message.nextHopRegion; + if (message.priority != null && message.hasOwnProperty("priority")) + if (typeof message.priority === "number") + object.priority = options.longs === String ? String(message.priority) : message.priority; + else + object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; + if (message.imported != null && message.hasOwnProperty("imported")) + object.imported = message.imported; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.cloud.vmwareengine.v1.PeeringRoute.Direction[message.direction] === undefined ? message.direction : $root.google.cloud.vmwareengine.v1.PeeringRoute.Direction[message.direction] : message.direction; return object; }; /** - * Converts this Hcx to JSON. + * Converts this PeeringRoute to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @instance * @returns {Object.} JSON object */ - Hcx.prototype.toJSON = function toJSON() { + PeeringRoute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Hcx + * Gets the default type url for PeeringRoute * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Hcx + * @memberof google.cloud.vmwareengine.v1.PeeringRoute * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Hcx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PeeringRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Hcx"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PeeringRoute"; }; /** - * State enum. - * @name google.cloud.vmwareengine.v1.Hcx.State + * Type enum. + * @name google.cloud.vmwareengine.v1.PeeringRoute.Type * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} DYNAMIC_PEERING_ROUTE=1 DYNAMIC_PEERING_ROUTE value + * @property {number} STATIC_PEERING_ROUTE=2 STATIC_PEERING_ROUTE value + * @property {number} SUBNET_PEERING_ROUTE=3 SUBNET_PEERING_ROUTE value */ - Hcx.State = (function() { + PeeringRoute.Type = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DYNAMIC_PEERING_ROUTE"] = 1; + values[valuesById[2] = "STATIC_PEERING_ROUTE"] = 2; + values[valuesById[3] = "SUBNET_PEERING_ROUTE"] = 3; return values; })(); - return Hcx; + /** + * Direction enum. + * @name google.cloud.vmwareengine.v1.PeeringRoute.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} INCOMING=1 INCOMING value + * @property {number} OUTGOING=2 OUTGOING value + */ + PeeringRoute.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCOMING"] = 1; + values[valuesById[2] = "OUTGOING"] = 2; + return values; + })(); + + return PeeringRoute; })(); - v1.Nsx = (function() { + v1.NetworkPolicy = (function() { /** - * Properties of a Nsx. + * Properties of a NetworkPolicy. * @memberof google.cloud.vmwareengine.v1 - * @interface INsx - * @property {string|null} [internalIp] Nsx internalIp - * @property {string|null} [version] Nsx version - * @property {google.cloud.vmwareengine.v1.Nsx.State|null} [state] Nsx state - * @property {string|null} [fqdn] Nsx fqdn + * @interface INetworkPolicy + * @property {string|null} [name] NetworkPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] NetworkPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] NetworkPolicy updateTime + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [internetAccess] NetworkPolicy internetAccess + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [externalIp] NetworkPolicy externalIp + * @property {string|null} [edgeServicesCidr] NetworkPolicy edgeServicesCidr + * @property {string|null} [uid] NetworkPolicy uid + * @property {string|null} [vmwareEngineNetwork] NetworkPolicy vmwareEngineNetwork + * @property {string|null} [description] NetworkPolicy description + * @property {string|null} [vmwareEngineNetworkCanonical] NetworkPolicy vmwareEngineNetworkCanonical */ /** - * Constructs a new Nsx. + * Constructs a new NetworkPolicy. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Nsx. - * @implements INsx + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy * @constructor - * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set */ - function Nsx(properties) { + function NetworkPolicy(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14683,117 +18599,201 @@ } /** - * Nsx internalIp. - * @member {string} internalIp - * @memberof google.cloud.vmwareengine.v1.Nsx + * NetworkPolicy name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @instance */ - Nsx.prototype.internalIp = ""; + NetworkPolicy.prototype.name = ""; /** - * Nsx version. - * @member {string} version - * @memberof google.cloud.vmwareengine.v1.Nsx + * NetworkPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @instance */ - Nsx.prototype.version = ""; + NetworkPolicy.prototype.createTime = null; /** - * Nsx state. - * @member {google.cloud.vmwareengine.v1.Nsx.State} state - * @memberof google.cloud.vmwareengine.v1.Nsx + * NetworkPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @instance */ - Nsx.prototype.state = 0; + NetworkPolicy.prototype.updateTime = null; /** - * Nsx fqdn. - * @member {string} fqdn - * @memberof google.cloud.vmwareengine.v1.Nsx + * NetworkPolicy internetAccess. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} internetAccess + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @instance */ - Nsx.prototype.fqdn = ""; + NetworkPolicy.prototype.internetAccess = null; /** - * Creates a new Nsx instance using the specified properties. + * NetworkPolicy externalIp. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} externalIp + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.externalIp = null; + + /** + * NetworkPolicy edgeServicesCidr. + * @member {string} edgeServicesCidr + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.edgeServicesCidr = ""; + + /** + * NetworkPolicy uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.uid = ""; + + /** + * NetworkPolicy vmwareEngineNetwork. + * @member {string} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.vmwareEngineNetwork = ""; + + /** + * NetworkPolicy description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.description = ""; + + /** + * NetworkPolicy vmwareEngineNetworkCanonical. + * @member {string} vmwareEngineNetworkCanonical + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.vmwareEngineNetworkCanonical = ""; + + /** + * Creates a new NetworkPolicy instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static - * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx instance + * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy instance */ - Nsx.create = function create(properties) { - return new Nsx(properties); + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); }; /** - * Encodes the specified Nsx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static - * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode + * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Nsx.encode = function encode(message, writer) { + NetworkPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); + 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.internetAccess != null && Object.hasOwnProperty.call(message, "internetAccess")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.internetAccess, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.externalIp, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.edgeServicesCidr != null && Object.hasOwnProperty.call(message, "edgeServicesCidr")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.edgeServicesCidr); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.uid); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.vmwareEngineNetwork); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.description); + if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.vmwareEngineNetworkCanonical); return writer; }; /** - * Encodes the specified Nsx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static - * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode + * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Nsx.encodeDelimited = function encodeDelimited(message, writer) { + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Nsx message from the specified reader or buffer. + * Decodes a NetworkPolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Nsx.decode = function decode(reader, length) { + NetworkPolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Nsx(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.internalIp = reader.string(); + case 1: { + message.name = reader.string(); break; } - case 4: { - message.version = reader.string(); + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 5: { - message.state = reader.int32(); + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 6: { - message.fqdn = reader.string(); + message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + break; + } + case 7: { + message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + break; + } + case 9: { + message.edgeServicesCidr = reader.string(); + break; + } + case 10: { + message.uid = reader.string(); + break; + } + case 12: { + message.vmwareEngineNetwork = reader.string(); + break; + } + case 13: { + message.description = reader.string(); + break; + } + case 14: { + message.vmwareEngineNetworkCanonical = reader.string(); break; } default: @@ -14805,509 +18805,498 @@ }; /** - * Decodes a Nsx message from the specified reader or buffer, length delimited. + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Nsx.decodeDelimited = function decodeDelimited(reader) { + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Nsx message. + * Verifies a NetworkPolicy message. * @function verify - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Nsx.verify = function verify(message) { + NetworkPolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - if (!$util.isString(message.internalIp)) - return "internalIp: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - if (!$util.isString(message.fqdn)) - return "fqdn: string 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.internetAccess != null && message.hasOwnProperty("internetAccess")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.internetAccess); + if (error) + return "internetAccess." + error; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.externalIp); + if (error) + return "externalIp." + error; + } + if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) + if (!$util.isString(message.edgeServicesCidr)) + return "edgeServicesCidr: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + if (!$util.isString(message.vmwareEngineNetwork)) + return "vmwareEngineNetwork: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + if (!$util.isString(message.vmwareEngineNetworkCanonical)) + return "vmwareEngineNetworkCanonical: string expected"; return null; }; /** - * Creates a Nsx message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy */ - Nsx.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Nsx) + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy) return object; - var message = new $root.google.cloud.vmwareengine.v1.Nsx(); - if (object.internalIp != null) - message.internalIp = String(object.internalIp); - if (object.version != null) - message.version = String(object.version); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; + var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.fqdn != null) - message.fqdn = String(object.fqdn); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.internetAccess != null) { + if (typeof object.internetAccess !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.internetAccess: object expected"); + message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.internetAccess); + } + if (object.externalIp != null) { + if (typeof object.externalIp !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.externalIp: object expected"); + message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.externalIp); + } + if (object.edgeServicesCidr != null) + message.edgeServicesCidr = String(object.edgeServicesCidr); + if (object.uid != null) + message.uid = String(object.uid); + if (object.vmwareEngineNetwork != null) + message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); + if (object.description != null) + message.description = String(object.description); + if (object.vmwareEngineNetworkCanonical != null) + message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); return message; }; /** - * Creates a plain object from a Nsx message. Also converts values to other types if specified. + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.Nsx + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static - * @param {google.cloud.vmwareengine.v1.Nsx} message Nsx + * @param {google.cloud.vmwareengine.v1.NetworkPolicy} message NetworkPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Nsx.toObject = function toObject(message, options) { + NetworkPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.internalIp = ""; - object.version = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.fqdn = ""; - } - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - object.internalIp = message.internalIp; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Nsx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Nsx.State[message.state] : message.state; - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - object.fqdn = message.fqdn; - return object; - }; - - /** - * Converts this Nsx to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Nsx - * @instance - * @returns {Object.} JSON object - */ - Nsx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Nsx - * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Nsx - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Nsx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.internetAccess = null; + object.externalIp = null; + object.edgeServicesCidr = ""; + object.uid = ""; + object.vmwareEngineNetwork = ""; + object.description = ""; + object.vmwareEngineNetworkCanonical = ""; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Nsx"; - }; - - /** - * State enum. - * @name google.cloud.vmwareengine.v1.Nsx.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value - */ - Nsx.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - return values; - })(); - - return Nsx; - })(); - - v1.Vcenter = (function() { - - /** - * Properties of a Vcenter. - * @memberof google.cloud.vmwareengine.v1 - * @interface IVcenter - * @property {string|null} [internalIp] Vcenter internalIp - * @property {string|null} [version] Vcenter version - * @property {google.cloud.vmwareengine.v1.Vcenter.State|null} [state] Vcenter state - * @property {string|null} [fqdn] Vcenter fqdn - */ - - /** - * Constructs a new Vcenter. - * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a Vcenter. - * @implements IVcenter - * @constructor - * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set - */ - function Vcenter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vcenter internalIp. - * @member {string} internalIp - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @instance - */ - Vcenter.prototype.internalIp = ""; - - /** - * Vcenter version. - * @member {string} version - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @instance - */ - Vcenter.prototype.version = ""; - - /** - * Vcenter state. - * @member {google.cloud.vmwareengine.v1.Vcenter.State} state - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @instance - */ - Vcenter.prototype.state = 0; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.internetAccess != null && message.hasOwnProperty("internetAccess")) + object.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.internetAccess, options); + if (message.externalIp != null && message.hasOwnProperty("externalIp")) + object.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.externalIp, options); + if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) + object.edgeServicesCidr = message.edgeServicesCidr; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = message.vmwareEngineNetwork; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + return object; + }; /** - * Vcenter fqdn. - * @member {string} fqdn - * @memberof google.cloud.vmwareengine.v1.Vcenter + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @instance + * @returns {Object.} JSON object */ - Vcenter.prototype.fqdn = ""; - - /** - * Creates a new Vcenter instance using the specified properties. - * @function create - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter instance - */ - Vcenter.create = function create(properties) { - return new Vcenter(properties); + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Encodes the specified Vcenter message. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. - * @function encode - * @memberof google.cloud.vmwareengine.v1.Vcenter + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy * @static - * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Vcenter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); - return writer; + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy"; }; - /** - * Encodes the specified Vcenter message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vcenter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + NetworkPolicy.NetworkService = (function() { - /** - * Decodes a Vcenter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vcenter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.Vcenter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.internalIp = reader.string(); - break; - } - case 4: { - message.version = reader.string(); + /** + * Properties of a NetworkService. + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @interface INetworkService + * @property {boolean|null} [enabled] NetworkService enabled + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|null} [state] NetworkService state + */ + + /** + * Constructs a new NetworkService. + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @classdesc Represents a NetworkService. + * @implements INetworkService + * @constructor + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set + */ + function NetworkService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkService enabled. + * @member {boolean} enabled + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + */ + NetworkService.prototype.enabled = false; + + /** + * NetworkService state. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State} state + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + */ + NetworkService.prototype.state = 0; + + /** + * Creates a new NetworkService instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService instance + */ + NetworkService.create = function create(properties) { + return new NetworkService(properties); + }; + + /** + * Encodes the specified NetworkService message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified NetworkService message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkService.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 5: { - message.state = reader.int32(); + } + return message; + }; + + /** + * Decodes a NetworkService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkService message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; } - case 6: { - message.fqdn = reader.string(); + return null; + }; + + /** + * Creates a NetworkService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + */ + NetworkService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; break; } - default: - reader.skipType(tag & 7); break; - } - } - return message; - }; - - /** - * Decodes a Vcenter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vcenter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vcenter message. - * @function verify - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vcenter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - if (!$util.isString(message.internalIp)) - return "internalIp: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; + case "STATE_UNSPECIFIED": case 0: + message.state = 0; + break; + case "UNPROVISIONED": case 1: + message.state = 1; + break; + case "RECONCILING": case 2: + message.state = 2; break; - } - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - if (!$util.isString(message.fqdn)) - return "fqdn: string expected"; - return null; - }; - - /** - * Creates a Vcenter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter - */ - Vcenter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.Vcenter) - return object; - var message = new $root.google.cloud.vmwareengine.v1.Vcenter(); - if (object.internalIp != null) - message.internalIp = String(object.internalIp); - if (object.version != null) - message.version = String(object.version); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; + case "ACTIVE": + case 3: + message.state = 3; break; } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - } - if (object.fqdn != null) - message.fqdn = String(object.fqdn); - return message; - }; + return message; + }; - /** - * Creates a plain object from a Vcenter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {google.cloud.vmwareengine.v1.Vcenter} message Vcenter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vcenter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.internalIp = ""; - object.version = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.fqdn = ""; - } - if (message.internalIp != null && message.hasOwnProperty("internalIp")) - object.internalIp = message.internalIp; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Vcenter.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Vcenter.State[message.state] : message.state; - if (message.fqdn != null && message.hasOwnProperty("fqdn")) - object.fqdn = message.fqdn; - return object; - }; + /** + * Creates a plain object from a NetworkService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} message NetworkService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] : message.state; + return object; + }; - /** - * Converts this Vcenter to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @instance - * @returns {Object.} JSON object - */ - Vcenter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this NetworkService to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + * @returns {Object.} JSON object + */ + NetworkService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for Vcenter - * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.Vcenter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Vcenter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Vcenter"; - }; + /** + * Gets the default type url for NetworkService + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"; + }; - /** - * State enum. - * @name google.cloud.vmwareengine.v1.Vcenter.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} CREATING=2 CREATING value - */ - Vcenter.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - return values; + /** + * State enum. + * @name google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNPROVISIONED=1 UNPROVISIONED value + * @property {number} RECONCILING=2 RECONCILING value + * @property {number} ACTIVE=3 ACTIVE value + */ + NetworkService.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNPROVISIONED"] = 1; + values[valuesById[2] = "RECONCILING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return NetworkService; })(); - return Vcenter; + return NetworkPolicy; })(); - v1.NetworkPolicy = (function() { + v1.VmwareEngineNetwork = (function() { /** - * Properties of a NetworkPolicy. + * Properties of a VmwareEngineNetwork. * @memberof google.cloud.vmwareengine.v1 - * @interface INetworkPolicy - * @property {string|null} [name] NetworkPolicy name - * @property {google.protobuf.ITimestamp|null} [createTime] NetworkPolicy createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] NetworkPolicy updateTime - * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [internetAccess] NetworkPolicy internetAccess - * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [externalIp] NetworkPolicy externalIp - * @property {string|null} [edgeServicesCidr] NetworkPolicy edgeServicesCidr - * @property {string|null} [uid] NetworkPolicy uid - * @property {string|null} [vmwareEngineNetwork] NetworkPolicy vmwareEngineNetwork - * @property {string|null} [description] NetworkPolicy description - * @property {string|null} [vmwareEngineNetworkCanonical] NetworkPolicy vmwareEngineNetworkCanonical + * @interface IVmwareEngineNetwork + * @property {string|null} [name] VmwareEngineNetwork name + * @property {google.protobuf.ITimestamp|null} [createTime] VmwareEngineNetwork createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VmwareEngineNetwork updateTime + * @property {string|null} [description] VmwareEngineNetwork description + * @property {Array.|null} [vpcNetworks] VmwareEngineNetwork vpcNetworks + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|null} [state] VmwareEngineNetwork state + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|null} [type] VmwareEngineNetwork type + * @property {string|null} [uid] VmwareEngineNetwork uid + * @property {string|null} [etag] VmwareEngineNetwork etag */ /** - * Constructs a new NetworkPolicy. + * Constructs a new VmwareEngineNetwork. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a NetworkPolicy. - * @implements INetworkPolicy + * @classdesc Represents a VmwareEngineNetwork. + * @implements IVmwareEngineNetwork * @constructor - * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set */ - function NetworkPolicy(properties) { + function VmwareEngineNetwork(properties) { + this.vpcNetworks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15315,107 +19304,99 @@ } /** - * NetworkPolicy name. + * VmwareEngineNetwork name. * @member {string} name - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.name = ""; + VmwareEngineNetwork.prototype.name = ""; /** - * NetworkPolicy createTime. + * VmwareEngineNetwork createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.createTime = null; + VmwareEngineNetwork.prototype.createTime = null; /** - * NetworkPolicy updateTime. + * VmwareEngineNetwork updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy - * @instance - */ - NetworkPolicy.prototype.updateTime = null; - - /** - * NetworkPolicy internetAccess. - * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} internetAccess - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.internetAccess = null; + VmwareEngineNetwork.prototype.updateTime = null; /** - * NetworkPolicy externalIp. - * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} externalIp - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.externalIp = null; + VmwareEngineNetwork.prototype.description = ""; /** - * NetworkPolicy edgeServicesCidr. - * @member {string} edgeServicesCidr - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork vpcNetworks. + * @member {Array.} vpcNetworks + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.edgeServicesCidr = ""; + VmwareEngineNetwork.prototype.vpcNetworks = $util.emptyArray; /** - * NetworkPolicy uid. - * @member {string} uid - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork state. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State} state + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.uid = ""; + VmwareEngineNetwork.prototype.state = 0; /** - * NetworkPolicy vmwareEngineNetwork. - * @member {string} vmwareEngineNetwork - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork type. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type} type + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.vmwareEngineNetwork = ""; + VmwareEngineNetwork.prototype.type = 0; /** - * NetworkPolicy description. - * @member {string} description - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.description = ""; + VmwareEngineNetwork.prototype.uid = ""; /** - * NetworkPolicy vmwareEngineNetworkCanonical. - * @member {string} vmwareEngineNetworkCanonical - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * VmwareEngineNetwork etag. + * @member {string} etag + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance */ - NetworkPolicy.prototype.vmwareEngineNetworkCanonical = ""; + VmwareEngineNetwork.prototype.etag = ""; /** - * Creates a new NetworkPolicy instance using the specified properties. + * Creates a new VmwareEngineNetwork instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static - * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy instance + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork instance */ - NetworkPolicy.create = function create(properties) { - return new NetworkPolicy(properties); + VmwareEngineNetwork.create = function create(properties) { + return new VmwareEngineNetwork(properties); }; /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * Encodes the specified VmwareEngineNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static - * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkPolicy.encode = function encode(message, writer) { + VmwareEngineNetwork.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -15424,51 +19405,50 @@ $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.internetAccess != null && Object.hasOwnProperty.call(message, "internetAccess")) - $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.internetAccess, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) - $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.externalIp, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.edgeServicesCidr != null && Object.hasOwnProperty.call(message, "edgeServicesCidr")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.edgeServicesCidr); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.uid); - if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.vmwareEngineNetwork); if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.description); - if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.vmwareEngineNetworkCanonical); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.vpcNetworks != null && message.vpcNetworks.length) + for (var i = 0; i < message.vpcNetworks.length; ++i) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.encode(message.vpcNetworks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uid); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); return writer; }; /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * Encodes the specified VmwareEngineNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static - * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + VmwareEngineNetwork.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NetworkPolicy message from the specified reader or buffer. + * Decodes a VmwareEngineNetwork message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkPolicy.decode = function decode(reader, length) { + VmwareEngineNetwork.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15484,32 +19464,30 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 5: { + message.description = reader.string(); + break; + } case 6: { - message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + if (!(message.vpcNetworks && message.vpcNetworks.length)) + message.vpcNetworks = []; + message.vpcNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.decode(reader, reader.uint32())); break; } case 7: { - message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + message.state = reader.int32(); break; } - case 9: { - message.edgeServicesCidr = reader.string(); + case 8: { + message.type = reader.int32(); break; } - case 10: { + case 9: { message.uid = reader.string(); break; } - case 12: { - message.vmwareEngineNetwork = reader.string(); - break; - } - case 13: { - message.description = reader.string(); - break; - } - case 14: { - message.vmwareEngineNetworkCanonical = reader.string(); + case 10: { + message.etag = reader.string(); break; } default: @@ -15521,30 +19499,30 @@ }; /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * Decodes a VmwareEngineNetwork message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + VmwareEngineNetwork.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NetworkPolicy message. + * Verifies a VmwareEngineNetwork message. * @function verify - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NetworkPolicy.verify = function verify(message) { + VmwareEngineNetwork.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -15560,105 +19538,157 @@ if (error) return "updateTime." + error; } - if (message.internetAccess != null && message.hasOwnProperty("internetAccess")) { - var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.internetAccess); - if (error) - return "internetAccess." + error; - } - if (message.externalIp != null && message.hasOwnProperty("externalIp")) { - var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.externalIp); - if (error) - return "externalIp." + error; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.vpcNetworks != null && message.hasOwnProperty("vpcNetworks")) { + if (!Array.isArray(message.vpcNetworks)) + return "vpcNetworks: array expected"; + for (var i = 0; i < message.vpcNetworks.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify(message.vpcNetworks[i]); + if (error) + return "vpcNetworks." + error; + } } - if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) - if (!$util.isString(message.edgeServicesCidr)) - return "edgeServicesCidr: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } if (message.uid != null && message.hasOwnProperty("uid")) if (!$util.isString(message.uid)) return "uid: string expected"; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - if (!$util.isString(message.vmwareEngineNetwork)) - return "vmwareEngineNetwork: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) - if (!$util.isString(message.vmwareEngineNetworkCanonical)) - return "vmwareEngineNetworkCanonical: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a VmwareEngineNetwork message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork */ - NetworkPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy) + VmwareEngineNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork) return object; - var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy(); + var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork(); if (object.name != null) message.name = String(object.name); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.createTime: object expected"); + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.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.vmwareengine.v1.NetworkPolicy.updateTime: object expected"); + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.internetAccess != null) { - if (typeof object.internetAccess !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.internetAccess: object expected"); - message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.internetAccess); + if (object.description != null) + message.description = String(object.description); + if (object.vpcNetworks) { + if (!Array.isArray(object.vpcNetworks)) + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: array expected"); + message.vpcNetworks = []; + for (var i = 0; i < object.vpcNetworks.length; ++i) { + if (typeof object.vpcNetworks[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: object expected"); + message.vpcNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.fromObject(object.vpcNetworks[i]); + } } - if (object.externalIp != null) { - if (typeof object.externalIp !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.externalIp: object expected"); - message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.externalIp); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "LEGACY": + case 1: + message.type = 1; + break; } - if (object.edgeServicesCidr != null) - message.edgeServicesCidr = String(object.edgeServicesCidr); if (object.uid != null) message.uid = String(object.uid); - if (object.vmwareEngineNetwork != null) - message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); - if (object.description != null) - message.description = String(object.description); - if (object.vmwareEngineNetworkCanonical != null) - message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * Creates a plain object from a VmwareEngineNetwork message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static - * @param {google.cloud.vmwareengine.v1.NetworkPolicy} message NetworkPolicy + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} message VmwareEngineNetwork * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NetworkPolicy.toObject = function toObject(message, options) { + VmwareEngineNetwork.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.vpcNetworks = []; if (options.defaults) { object.name = ""; object.createTime = null; object.updateTime = null; - object.internetAccess = null; - object.externalIp = null; - object.edgeServicesCidr = ""; - object.uid = ""; - object.vmwareEngineNetwork = ""; object.description = ""; - object.vmwareEngineNetworkCanonical = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.uid = ""; + object.etag = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -15666,68 +19696,69 @@ 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.internetAccess != null && message.hasOwnProperty("internetAccess")) - object.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.internetAccess, options); - if (message.externalIp != null && message.hasOwnProperty("externalIp")) - object.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.externalIp, options); - if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) - object.edgeServicesCidr = message.edgeServicesCidr; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) - object.vmwareEngineNetwork = message.vmwareEngineNetwork; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) - object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + if (message.vpcNetworks && message.vpcNetworks.length) { + object.vpcNetworks = []; + for (var j = 0; j < message.vpcNetworks.length; ++j) + object.vpcNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.toObject(message.vpcNetworks[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] : message.type; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this NetworkPolicy to JSON. + * Converts this VmwareEngineNetwork to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @instance * @returns {Object.} JSON object */ - NetworkPolicy.prototype.toJSON = function toJSON() { + VmwareEngineNetwork.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NetworkPolicy + * Gets the default type url for VmwareEngineNetwork * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VmwareEngineNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork"; }; - NetworkPolicy.NetworkService = (function() { + VmwareEngineNetwork.VpcNetwork = (function() { /** - * Properties of a NetworkService. - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy - * @interface INetworkService - * @property {boolean|null} [enabled] NetworkService enabled - * @property {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|null} [state] NetworkService state + * Properties of a VpcNetwork. + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @interface IVpcNetwork + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|null} [type] VpcNetwork type + * @property {string|null} [network] VpcNetwork network */ /** - * Constructs a new NetworkService. - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy - * @classdesc Represents a NetworkService. - * @implements INetworkService + * Constructs a new VpcNetwork. + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @classdesc Represents a VpcNetwork. + * @implements IVpcNetwork * @constructor - * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set */ - function NetworkService(properties) { + function VpcNetwork(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15735,89 +19766,89 @@ } /** - * NetworkService enabled. - * @member {boolean} enabled - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * VpcNetwork type. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type} type + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @instance */ - NetworkService.prototype.enabled = false; + VpcNetwork.prototype.type = 0; /** - * NetworkService state. - * @member {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State} state - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * VpcNetwork network. + * @member {string} network + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @instance */ - NetworkService.prototype.state = 0; + VpcNetwork.prototype.network = ""; /** - * Creates a new NetworkService instance using the specified properties. + * Creates a new VpcNetwork instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static - * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService instance + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork instance */ - NetworkService.create = function create(properties) { - return new NetworkService(properties); + VpcNetwork.create = function create(properties) { + return new VpcNetwork(properties); }; /** - * Encodes the specified NetworkService message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static - * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkService.encode = function encode(message, writer) { + VpcNetwork.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); return writer; }; /** - * Encodes the specified NetworkService message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static - * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkService.encodeDelimited = function encodeDelimited(message, writer) { + VpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NetworkService message from the specified reader or buffer. + * Decodes a VpcNetwork message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkService.decode = function decode(reader, length) { + VpcNetwork.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); + message.type = reader.int32(); break; } case 2: { - message.state = reader.int32(); + message.network = reader.string(); break; } default: @@ -15829,190 +19860,227 @@ }; /** - * Decodes a NetworkService message from the specified reader or buffer, length delimited. + * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkService.decodeDelimited = function decodeDelimited(reader) { + VpcNetwork.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NetworkService message. + * Verifies a VpcNetwork message. * @function verify - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NetworkService.verify = function verify(message) { + VpcNetwork.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "state: enum value expected"; + return "type: enum value expected"; case 0: case 1: case 2: case 3: break; } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; return null; }; /** - * Creates a NetworkService message from a plain object. Also converts values to their respective internal types. + * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork */ - NetworkService.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService) + VpcNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork) return object; - var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - switch (object.state) { + var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); + switch (object.type) { default: - if (typeof object.state === "number") { - message.state = object.state; + if (typeof object.type === "number") { + message.type = object.type; break; } break; - case "STATE_UNSPECIFIED": + case "TYPE_UNSPECIFIED": case 0: - message.state = 0; + message.type = 0; break; - case "UNPROVISIONED": + case "INTRANET": case 1: - message.state = 1; + message.type = 1; break; - case "RECONCILING": + case "INTERNET": case 2: - message.state = 2; + message.type = 2; break; - case "ACTIVE": + case "GOOGLE_CLOUD": case 3: - message.state = 3; + message.type = 3; break; } + if (object.network != null) + message.network = String(object.network); return message; }; /** - * Creates a plain object from a NetworkService message. Also converts values to other types if specified. + * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static - * @param {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} message NetworkService + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} message VpcNetwork * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NetworkService.toObject = function toObject(message, options) { + VpcNetwork.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.enabled = false; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.network = ""; } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] : message.type; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; return object; }; /** - * Converts this NetworkService to JSON. + * Converts this VpcNetwork to JSON. * @function toJSON - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @instance * @returns {Object.} JSON object */ - NetworkService.prototype.toJSON = function toJSON() { + VpcNetwork.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NetworkService + * Gets the default type url for VpcNetwork * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NetworkService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"; + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"; }; /** - * State enum. - * @name google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State + * Type enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} UNPROVISIONED=1 UNPROVISIONED value - * @property {number} RECONCILING=2 RECONCILING value - * @property {number} ACTIVE=3 ACTIVE value + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INTRANET=1 INTRANET value + * @property {number} INTERNET=2 INTERNET value + * @property {number} GOOGLE_CLOUD=3 GOOGLE_CLOUD value */ - NetworkService.State = (function() { + VpcNetwork.Type = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNPROVISIONED"] = 1; - values[valuesById[2] = "RECONCILING"] = 2; - values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTRANET"] = 1; + values[valuesById[2] = "INTERNET"] = 2; + values[valuesById[3] = "GOOGLE_CLOUD"] = 3; return values; })(); - return NetworkService; + return VpcNetwork; })(); - return NetworkPolicy; - })(); - - v1.VmwareEngineNetwork = (function() { + /** + * State enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + */ + VmwareEngineNetwork.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); /** - * Properties of a VmwareEngineNetwork. - * @memberof google.cloud.vmwareengine.v1 - * @interface IVmwareEngineNetwork - * @property {string|null} [name] VmwareEngineNetwork name - * @property {google.protobuf.ITimestamp|null} [createTime] VmwareEngineNetwork createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] VmwareEngineNetwork updateTime - * @property {string|null} [description] VmwareEngineNetwork description - * @property {Array.|null} [vpcNetworks] VmwareEngineNetwork vpcNetworks - * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|null} [state] VmwareEngineNetwork state - * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|null} [type] VmwareEngineNetwork type - * @property {string|null} [uid] VmwareEngineNetwork uid - * @property {string|null} [etag] VmwareEngineNetwork etag + * Type enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} LEGACY=1 LEGACY value */ + VmwareEngineNetwork.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGACY"] = 1; + return values; + })(); + + return VmwareEngineNetwork; + })(); + + v1.PrivateConnection = (function() { /** - * Constructs a new VmwareEngineNetwork. + * Properties of a PrivateConnection. * @memberof google.cloud.vmwareengine.v1 - * @classdesc Represents a VmwareEngineNetwork. - * @implements IVmwareEngineNetwork + * @interface IPrivateConnection + * @property {string|null} [name] PrivateConnection name + * @property {google.protobuf.ITimestamp|null} [createTime] PrivateConnection createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PrivateConnection updateTime + * @property {string|null} [description] PrivateConnection description + * @property {google.cloud.vmwareengine.v1.PrivateConnection.State|null} [state] PrivateConnection state + * @property {string|null} [vmwareEngineNetwork] PrivateConnection vmwareEngineNetwork + * @property {string|null} [vmwareEngineNetworkCanonical] PrivateConnection vmwareEngineNetworkCanonical + * @property {google.cloud.vmwareengine.v1.PrivateConnection.Type|null} [type] PrivateConnection type + * @property {string|null} [peeringId] PrivateConnection peeringId + * @property {google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode|null} [routingMode] PrivateConnection routingMode + * @property {string|null} [uid] PrivateConnection uid + * @property {string|null} [serviceNetwork] PrivateConnection serviceNetwork + * @property {google.cloud.vmwareengine.v1.PrivateConnection.PeeringState|null} [peeringState] PrivateConnection peeringState + */ + + /** + * Constructs a new PrivateConnection. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a PrivateConnection. + * @implements IPrivateConnection * @constructor - * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set + * @param {google.cloud.vmwareengine.v1.IPrivateConnection=} [properties] Properties to set */ - function VmwareEngineNetwork(properties) { - this.vpcNetworks = []; + function PrivateConnection(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16020,99 +20088,131 @@ } /** - * VmwareEngineNetwork name. + * PrivateConnection name. * @member {string} name - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.name = ""; + PrivateConnection.prototype.name = ""; /** - * VmwareEngineNetwork createTime. + * PrivateConnection createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.createTime = null; + PrivateConnection.prototype.createTime = null; /** - * VmwareEngineNetwork updateTime. + * PrivateConnection updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.updateTime = null; + PrivateConnection.prototype.updateTime = null; /** - * VmwareEngineNetwork description. + * PrivateConnection description. * @member {string} description - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.description = ""; + PrivateConnection.prototype.description = ""; /** - * VmwareEngineNetwork vpcNetworks. - * @member {Array.} vpcNetworks - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * PrivateConnection state. + * @member {google.cloud.vmwareengine.v1.PrivateConnection.State} state + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.vpcNetworks = $util.emptyArray; + PrivateConnection.prototype.state = 0; /** - * VmwareEngineNetwork state. - * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State} state - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * PrivateConnection vmwareEngineNetwork. + * @member {string} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.state = 0; + PrivateConnection.prototype.vmwareEngineNetwork = ""; /** - * VmwareEngineNetwork type. - * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type} type - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * PrivateConnection vmwareEngineNetworkCanonical. + * @member {string} vmwareEngineNetworkCanonical + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.type = 0; + PrivateConnection.prototype.vmwareEngineNetworkCanonical = ""; /** - * VmwareEngineNetwork uid. + * PrivateConnection type. + * @member {google.cloud.vmwareengine.v1.PrivateConnection.Type} type + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.type = 0; + + /** + * PrivateConnection peeringId. + * @member {string} peeringId + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.peeringId = ""; + + /** + * PrivateConnection routingMode. + * @member {google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode} routingMode + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.routingMode = 0; + + /** + * PrivateConnection uid. * @member {string} uid - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.uid = ""; + PrivateConnection.prototype.uid = ""; /** - * VmwareEngineNetwork etag. - * @member {string} etag - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * PrivateConnection serviceNetwork. + * @member {string} serviceNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @instance */ - VmwareEngineNetwork.prototype.etag = ""; + PrivateConnection.prototype.serviceNetwork = ""; /** - * Creates a new VmwareEngineNetwork instance using the specified properties. + * PrivateConnection peeringState. + * @member {google.cloud.vmwareengine.v1.PrivateConnection.PeeringState} peeringState + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.peeringState = 0; + + /** + * Creates a new PrivateConnection instance using the specified properties. * @function create - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static - * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork instance + * @param {google.cloud.vmwareengine.v1.IPrivateConnection=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PrivateConnection} PrivateConnection instance */ - VmwareEngineNetwork.create = function create(properties) { - return new VmwareEngineNetwork(properties); + PrivateConnection.create = function create(properties) { + return new PrivateConnection(properties); }; /** - * Encodes the specified VmwareEngineNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * Encodes the specified PrivateConnection message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateConnection.verify|verify} messages. * @function encode - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static - * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IPrivateConnection} message PrivateConnection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmwareEngineNetwork.encode = function encode(message, writer) { + PrivateConnection.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -16122,49 +20222,56 @@ 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.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.vpcNetworks != null && message.vpcNetworks.length) - for (var i = 0; i < message.vpcNetworks.length; ++i) - $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.encode(message.vpcNetworks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.vmwareEngineNetwork); + if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.vmwareEngineNetworkCanonical); if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.peeringId != null && Object.hasOwnProperty.call(message, "peeringId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.peeringId); + if (message.routingMode != null && Object.hasOwnProperty.call(message, "routingMode")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.routingMode); if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.uid); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + writer.uint32(/* id 14, wireType 2 =*/114).string(message.uid); + if (message.serviceNetwork != null && Object.hasOwnProperty.call(message, "serviceNetwork")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceNetwork); + if (message.peeringState != null && Object.hasOwnProperty.call(message, "peeringState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.peeringState); return writer; }; /** - * Encodes the specified VmwareEngineNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * Encodes the specified PrivateConnection message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateConnection.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static - * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode + * @param {google.cloud.vmwareengine.v1.IPrivateConnection} message PrivateConnection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmwareEngineNetwork.encodeDelimited = function encodeDelimited(message, writer) { + PrivateConnection.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VmwareEngineNetwork message from the specified reader or buffer. + * Decodes a PrivateConnection message from the specified reader or buffer. * @function decode - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork + * @returns {google.cloud.vmwareengine.v1.PrivateConnection} PrivateConnection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmwareEngineNetwork.decode = function decode(reader, length) { + PrivateConnection.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.PrivateConnection(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16180,30 +20287,44 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 5: { + case 4: { message.description = reader.string(); break; } - case 6: { - if (!(message.vpcNetworks && message.vpcNetworks.length)) - message.vpcNetworks = []; - message.vpcNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.decode(reader, reader.uint32())); - break; - } - case 7: { + case 5: { message.state = reader.int32(); break; } case 8: { - message.type = reader.int32(); + message.vmwareEngineNetwork = reader.string(); break; } case 9: { - message.uid = reader.string(); + message.vmwareEngineNetworkCanonical = reader.string(); break; } case 10: { - message.etag = reader.string(); + message.type = reader.int32(); + break; + } + case 12: { + message.peeringId = reader.string(); + break; + } + case 13: { + message.routingMode = reader.int32(); + break; + } + case 14: { + message.uid = reader.string(); + break; + } + case 16: { + message.serviceNetwork = reader.string(); + break; + } + case 17: { + message.peeringState = reader.int32(); break; } default: @@ -16215,556 +20336,411 @@ }; /** - * Decodes a VmwareEngineNetwork message from the specified reader or buffer, length delimited. + * Decodes a PrivateConnection message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VmwareEngineNetwork.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VmwareEngineNetwork message. - * @function verify - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VmwareEngineNetwork.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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.vpcNetworks != null && message.hasOwnProperty("vpcNetworks")) { - if (!Array.isArray(message.vpcNetworks)) - return "vpcNetworks: array expected"; - for (var i = 0; i < message.vpcNetworks.length; ++i) { - var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify(message.vpcNetworks[i]); - if (error) - return "vpcNetworks." + 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: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a VmwareEngineNetwork message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork - */ - VmwareEngineNetwork.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork) - return object; - var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.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.vmwareengine.v1.VmwareEngineNetwork.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.description != null) - message.description = String(object.description); - if (object.vpcNetworks) { - if (!Array.isArray(object.vpcNetworks)) - throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: array expected"); - message.vpcNetworks = []; - for (var i = 0; i < object.vpcNetworks.length; ++i) { - if (typeof object.vpcNetworks[i] !== "object") - throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: object expected"); - message.vpcNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.fromObject(object.vpcNetworks[i]); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "LEGACY": - case 1: - message.type = 1; - break; - } - if (object.uid != null) - message.uid = String(object.uid); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a VmwareEngineNetwork message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @static - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} message VmwareEngineNetwork - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VmwareEngineNetwork.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.vpcNetworks = []; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.description = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.uid = ""; - object.etag = ""; - } - 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.vpcNetworks && message.vpcNetworks.length) { - object.vpcNetworks = []; - for (var j = 0; j < message.vpcNetworks.length; ++j) - object.vpcNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.toObject(message.vpcNetworks[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] : message.type; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this VmwareEngineNetwork to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @instance - * @returns {Object.} JSON object + * @returns {google.cloud.vmwareengine.v1.PrivateConnection} PrivateConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmwareEngineNetwork.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + PrivateConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; /** - * Gets the default type url for VmwareEngineNetwork - * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * Verifies a PrivateConnection message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.PrivateConnection * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VmwareEngineNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + PrivateConnection.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; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork"; - }; - - VmwareEngineNetwork.VpcNetwork = (function() { - - /** - * Properties of a VpcNetwork. - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @interface IVpcNetwork - * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|null} [type] VpcNetwork type - * @property {string|null} [network] VpcNetwork network - */ - - /** - * Constructs a new VpcNetwork. - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork - * @classdesc Represents a VpcNetwork. - * @implements IVpcNetwork - * @constructor - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set - */ - function VpcNetwork(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } - - /** - * VpcNetwork type. - * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type} type - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @instance - */ - VpcNetwork.prototype.type = 0; - - /** - * VpcNetwork network. - * @member {string} network - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @instance - */ - VpcNetwork.prototype.network = ""; - - /** - * Creates a new VpcNetwork instance using the specified properties. - * @function create - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork instance - */ - VpcNetwork.create = function create(properties) { - return new VpcNetwork(properties); - }; - - /** - * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. - * @function encode - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcNetwork.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); - return writer; - }; - - /** - * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VpcNetwork message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcNetwork.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.network = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcNetwork.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VpcNetwork message. - * @function verify - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VpcNetwork.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - return null; - }; - - /** - * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork - */ - VpcNetwork.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork) - return object; - var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); - switch (object.type) { + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: break; - case "TYPE_UNSPECIFIED": + } + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + if (!$util.isString(message.vmwareEngineNetwork)) + return "vmwareEngineNetwork: string expected"; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + if (!$util.isString(message.vmwareEngineNetworkCanonical)) + return "vmwareEngineNetworkCanonical: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; case 0: - message.type = 0; + case 1: + case 2: + case 3: + case 4: break; - case "INTRANET": + } + if (message.peeringId != null && message.hasOwnProperty("peeringId")) + if (!$util.isString(message.peeringId)) + return "peeringId: string expected"; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + switch (message.routingMode) { + default: + return "routingMode: enum value expected"; + case 0: case 1: - message.type = 1; + case 2: break; - case "INTERNET": + } + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.serviceNetwork != null && message.hasOwnProperty("serviceNetwork")) + if (!$util.isString(message.serviceNetwork)) + return "serviceNetwork: string expected"; + if (message.peeringState != null && message.hasOwnProperty("peeringState")) + switch (message.peeringState) { + default: + return "peeringState: enum value expected"; + case 0: + case 1: case 2: - message.type = 2; - break; - case "GOOGLE_CLOUD": - case 3: - message.type = 3; break; } - if (object.network != null) - message.network = String(object.network); - return message; - }; + return null; + }; - /** - * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} message VpcNetwork - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VpcNetwork.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.network = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] : message.type; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; + /** + * Creates a PrivateConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.PrivateConnection} PrivateConnection + */ + PrivateConnection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateConnection) return object; - }; - - /** - * Converts this VpcNetwork to JSON. - * @function toJSON - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @instance - * @returns {Object.} JSON object - */ - VpcNetwork.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VpcNetwork - * @function getTypeUrl - * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + var message = new $root.google.cloud.vmwareengine.v1.PrivateConnection(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateConnection.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.vmwareengine.v1.PrivateConnection.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; } - return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"; - }; + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UNPROVISIONED": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.vmwareEngineNetwork != null) + message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); + if (object.vmwareEngineNetworkCanonical != null) + message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIVATE_SERVICE_ACCESS": + case 1: + message.type = 1; + break; + case "NETAPP_CLOUD_VOLUMES": + case 2: + message.type = 2; + break; + case "DELL_POWERSCALE": + case 3: + message.type = 3; + break; + case "THIRD_PARTY_SERVICE": + case 4: + message.type = 4; + break; + } + if (object.peeringId != null) + message.peeringId = String(object.peeringId); + switch (object.routingMode) { + default: + if (typeof object.routingMode === "number") { + message.routingMode = object.routingMode; + break; + } + break; + case "ROUTING_MODE_UNSPECIFIED": + case 0: + message.routingMode = 0; + break; + case "GLOBAL": + case 1: + message.routingMode = 1; + break; + case "REGIONAL": + case 2: + message.routingMode = 2; + break; + } + if (object.uid != null) + message.uid = String(object.uid); + if (object.serviceNetwork != null) + message.serviceNetwork = String(object.serviceNetwork); + switch (object.peeringState) { + default: + if (typeof object.peeringState === "number") { + message.peeringState = object.peeringState; + break; + } + break; + case "PEERING_STATE_UNSPECIFIED": + case 0: + message.peeringState = 0; + break; + case "PEERING_ACTIVE": + case 1: + message.peeringState = 1; + break; + case "PEERING_INACTIVE": + case 2: + message.peeringState = 2; + break; + } + return message; + }; - /** - * Type enum. - * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} INTRANET=1 INTRANET value - * @property {number} INTERNET=2 INTERNET value - * @property {number} GOOGLE_CLOUD=3 GOOGLE_CLOUD value - */ - VpcNetwork.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INTRANET"] = 1; - values[valuesById[2] = "INTERNET"] = 2; - values[valuesById[3] = "GOOGLE_CLOUD"] = 3; - return values; - })(); + /** + * Creates a plain object from a PrivateConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @static + * @param {google.cloud.vmwareengine.v1.PrivateConnection} message PrivateConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.vmwareEngineNetwork = ""; + object.vmwareEngineNetworkCanonical = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.peeringId = ""; + object.routingMode = options.enums === String ? "ROUTING_MODE_UNSPECIFIED" : 0; + object.uid = ""; + object.serviceNetwork = ""; + object.peeringState = options.enums === String ? "PEERING_STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateConnection.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.PrivateConnection.State[message.state] : message.state; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = message.vmwareEngineNetwork; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateConnection.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.PrivateConnection.Type[message.type] : message.type; + if (message.peeringId != null && message.hasOwnProperty("peeringId")) + object.peeringId = message.peeringId; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + object.routingMode = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode[message.routingMode] === undefined ? message.routingMode : $root.google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode[message.routingMode] : message.routingMode; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.serviceNetwork != null && message.hasOwnProperty("serviceNetwork")) + object.serviceNetwork = message.serviceNetwork; + if (message.peeringState != null && message.hasOwnProperty("peeringState")) + object.peeringState = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateConnection.PeeringState[message.peeringState] === undefined ? message.peeringState : $root.google.cloud.vmwareengine.v1.PrivateConnection.PeeringState[message.peeringState] : message.peeringState; + return object; + }; - return VpcNetwork; - })(); + /** + * Converts this PrivateConnection to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @instance + * @returns {Object.} JSON object + */ + PrivateConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateConnection + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.PrivateConnection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateConnection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateConnection"; + }; /** * State enum. - * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.State + * @name google.cloud.vmwareengine.v1.PrivateConnection.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} ACTIVE=2 ACTIVE value * @property {number} UPDATING=3 UPDATING value * @property {number} DELETING=4 DELETING value + * @property {number} UNPROVISIONED=5 UNPROVISIONED value + * @property {number} FAILED=6 FAILED value */ - VmwareEngineNetwork.State = (function() { + PrivateConnection.State = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "CREATING"] = 1; values[valuesById[2] = "ACTIVE"] = 2; values[valuesById[3] = "UPDATING"] = 3; values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UNPROVISIONED"] = 5; + values[valuesById[6] = "FAILED"] = 6; return values; })(); /** * Type enum. - * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type + * @name google.cloud.vmwareengine.v1.PrivateConnection.Type * @enum {number} * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} LEGACY=1 LEGACY value + * @property {number} PRIVATE_SERVICE_ACCESS=1 PRIVATE_SERVICE_ACCESS value + * @property {number} NETAPP_CLOUD_VOLUMES=2 NETAPP_CLOUD_VOLUMES value + * @property {number} DELL_POWERSCALE=3 DELL_POWERSCALE value + * @property {number} THIRD_PARTY_SERVICE=4 THIRD_PARTY_SERVICE value */ - VmwareEngineNetwork.Type = (function() { + PrivateConnection.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LEGACY"] = 1; + values[valuesById[1] = "PRIVATE_SERVICE_ACCESS"] = 1; + values[valuesById[2] = "NETAPP_CLOUD_VOLUMES"] = 2; + values[valuesById[3] = "DELL_POWERSCALE"] = 3; + values[valuesById[4] = "THIRD_PARTY_SERVICE"] = 4; return values; })(); - return VmwareEngineNetwork; + /** + * RoutingMode enum. + * @name google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode + * @enum {number} + * @property {number} ROUTING_MODE_UNSPECIFIED=0 ROUTING_MODE_UNSPECIFIED value + * @property {number} GLOBAL=1 GLOBAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + PrivateConnection.RoutingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GLOBAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + /** + * PeeringState enum. + * @name google.cloud.vmwareengine.v1.PrivateConnection.PeeringState + * @enum {number} + * @property {number} PEERING_STATE_UNSPECIFIED=0 PEERING_STATE_UNSPECIFIED value + * @property {number} PEERING_ACTIVE=1 PEERING_ACTIVE value + * @property {number} PEERING_INACTIVE=2 PEERING_INACTIVE value + */ + PrivateConnection.PeeringState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PEERING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEERING_ACTIVE"] = 1; + values[valuesById[2] = "PEERING_INACTIVE"] = 2; + return values; + })(); + + return PrivateConnection; })(); return v1; diff --git a/packages/google-cloud-vmwareengine/protos/protos.json b/packages/google-cloud-vmwareengine/protos/protos.json index 963d1dce0394..36a9c35a34dd 100644 --- a/packages/google-cloud-vmwareengine/protos/protos.json +++ b/packages/google-cloud-vmwareengine/protos/protos.json @@ -307,6 +307,52 @@ } ] }, + "GetSubnet": { + "requestType": "GetSubnetRequest", + "responseType": "Subnet", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateClouds/*/subnets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateClouds/*/subnets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSubnet": { + "requestType": "UpdateSubnetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{subnet.name=projects/*/locations/*/privateClouds/*/subnets/*}", + "(google.api.http).body": "subnet", + "(google.api.method_signature)": "subnet,update_mask", + "(google.longrunning.operation_info).response_type": "Subnet", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{subnet.name=projects/*/locations/*/privateClouds/*/subnets/*}", + "body": "subnet" + } + }, + { + "(google.api.method_signature)": "subnet,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Subnet", + "metadata_type": "OperationMetadata" + } + } + ] + }, "ListNodeTypes": { "requestType": "ListNodeTypesRequest", "responseType": "ListNodeTypesResponse", @@ -734,6 +780,142 @@ "(google.api.method_signature)": "parent" } ] + }, + "CreatePrivateConnection": { + "requestType": "CreatePrivateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/privateConnections", + "(google.api.http).body": "private_connection", + "(google.api.method_signature)": "parent,private_connection,private_connection_id", + "(google.longrunning.operation_info).response_type": "PrivateConnection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/privateConnections", + "body": "private_connection" + } + }, + { + "(google.api.method_signature)": "parent,private_connection,private_connection_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateConnection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetPrivateConnection": { + "requestType": "GetPrivateConnectionRequest", + "responseType": "PrivateConnection", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateConnections/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPrivateConnections": { + "requestType": "ListPrivateConnectionsRequest", + "responseType": "ListPrivateConnectionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/privateConnections", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/privateConnections" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePrivateConnection": { + "requestType": "UpdatePrivateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{private_connection.name=projects/*/locations/*/privateConnections/*}", + "(google.api.http).body": "private_connection", + "(google.api.method_signature)": "private_connection,update_mask", + "(google.longrunning.operation_info).response_type": "PrivateConnection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{private_connection.name=projects/*/locations/*/privateConnections/*}", + "body": "private_connection" + } + }, + { + "(google.api.method_signature)": "private_connection,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateConnection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeletePrivateConnection": { + "requestType": "DeletePrivateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/privateConnections/*}", + "(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/*/privateConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListPrivateConnectionPeeringRoutes": { + "requestType": "ListPrivateConnectionPeeringRoutesRequest", + "responseType": "ListPrivateConnectionPeeringRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/privateConnections/*}/peeringRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/privateConnections/*}/peeringRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -1099,6 +1281,41 @@ "nextPageToken": { "type": "string", "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetSubnetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/Subnet" + } + } + } + }, + "UpdateSubnetRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subnet": { + "type": "Subnet", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -1628,6 +1845,174 @@ } } }, + "CreatePrivateConnectionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmwareengine.googleapis.com/PrivateConnection" + } + }, + "privateConnectionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateConnection": { + "type": "PrivateConnection", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetPrivateConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateConnection" + } + } + } + }, + "ListPrivateConnectionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmwareengine.googleapis.com/PrivateConnection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListPrivateConnectionsResponse": { + "fields": { + "privateConnections": { + "rule": "repeated", + "type": "PrivateConnection", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdatePrivateConnectionRequest": { + "fields": { + "privateConnection": { + "type": "PrivateConnection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeletePrivateConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateConnection" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPrivateConnectionPeeringRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateConnection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPrivateConnectionPeeringRoutesResponse": { + "fields": { + "peeringRoutes": { + "rule": "repeated", + "type": "PeeringRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "NetworkConfig": { "fields": { "managementCidr": { @@ -1773,6 +2158,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "type": { + "type": "Type", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1805,6 +2197,12 @@ } } } + }, + "Type": { + "values": { + "STANDARD": 0, + "TIME_LIMITED": 1 + } } } }, @@ -1921,7 +2319,9 @@ "ACTIVE": 1, "CREATING": 2, "UPDATING": 3, - "DELETING": 4 + "DELETING": 4, + "RECONCILING": 5, + "FAILED": 6 } } } @@ -2152,6 +2552,69 @@ } } }, + "PeeringRoute": { + "fields": { + "destRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextHopRegion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "priority": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "imported": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "direction": { + "type": "Direction", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "DYNAMIC_PEERING_ROUTE": 1, + "STATIC_PEERING_ROUTE": 2, + "SUBNET_PEERING_ROUTE": 3 + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "INCOMING": 1, + "OUTGOING": 2 + } + } + } + }, "NetworkPolicy": { "options": { "(google.api.resource).type": "vmwareengine.googleapis.com/NetworkPolicy", @@ -2364,6 +2827,144 @@ } } } + }, + "PrivateConnection": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/PrivateConnection", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateConnections/{private_connection}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmwareEngineNetwork": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "vmwareEngineNetworkCanonical": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "type": { + "type": "Type", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "peeringId": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "routingMode": { + "type": "RoutingMode", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceNetwork": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "peeringState": { + "type": "PeeringState", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "UPDATING": 3, + "DELETING": 4, + "UNPROVISIONED": 5, + "FAILED": 6 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PRIVATE_SERVICE_ACCESS": 1, + "NETAPP_CLOUD_VOLUMES": 2, + "DELL_POWERSCALE": 3, + "THIRD_PARTY_SERVICE": 4 + } + }, + "RoutingMode": { + "values": { + "ROUTING_MODE_UNSPECIFIED": 0, + "GLOBAL": 1, + "REGIONAL": 2 + } + }, + "PeeringState": { + "values": { + "PEERING_STATE_UNSPECIFIED": 0, + "PEERING_ACTIVE": 1, + "PEERING_INACTIVE": 2 + } + } + } } } } diff --git a/packages/google-cloud-vmwareengine/samples/README.md b/packages/google-cloud-vmwareengine/samples/README.md index 81f8f31aa18d..a8741eab1e5f 100644 --- a/packages/google-cloud-vmwareengine/samples/README.md +++ b/packages/google-cloud-vmwareengine/samples/README.md @@ -16,22 +16,28 @@ * [Vmware_engine.create_hcx_activation_key](#vmware_engine.create_hcx_activation_key) * [Vmware_engine.create_network_policy](#vmware_engine.create_network_policy) * [Vmware_engine.create_private_cloud](#vmware_engine.create_private_cloud) + * [Vmware_engine.create_private_connection](#vmware_engine.create_private_connection) * [Vmware_engine.create_vmware_engine_network](#vmware_engine.create_vmware_engine_network) * [Vmware_engine.delete_cluster](#vmware_engine.delete_cluster) * [Vmware_engine.delete_network_policy](#vmware_engine.delete_network_policy) * [Vmware_engine.delete_private_cloud](#vmware_engine.delete_private_cloud) + * [Vmware_engine.delete_private_connection](#vmware_engine.delete_private_connection) * [Vmware_engine.delete_vmware_engine_network](#vmware_engine.delete_vmware_engine_network) * [Vmware_engine.get_cluster](#vmware_engine.get_cluster) * [Vmware_engine.get_hcx_activation_key](#vmware_engine.get_hcx_activation_key) * [Vmware_engine.get_network_policy](#vmware_engine.get_network_policy) * [Vmware_engine.get_node_type](#vmware_engine.get_node_type) * [Vmware_engine.get_private_cloud](#vmware_engine.get_private_cloud) + * [Vmware_engine.get_private_connection](#vmware_engine.get_private_connection) + * [Vmware_engine.get_subnet](#vmware_engine.get_subnet) * [Vmware_engine.get_vmware_engine_network](#vmware_engine.get_vmware_engine_network) * [Vmware_engine.list_clusters](#vmware_engine.list_clusters) * [Vmware_engine.list_hcx_activation_keys](#vmware_engine.list_hcx_activation_keys) * [Vmware_engine.list_network_policies](#vmware_engine.list_network_policies) * [Vmware_engine.list_node_types](#vmware_engine.list_node_types) * [Vmware_engine.list_private_clouds](#vmware_engine.list_private_clouds) + * [Vmware_engine.list_private_connection_peering_routes](#vmware_engine.list_private_connection_peering_routes) + * [Vmware_engine.list_private_connections](#vmware_engine.list_private_connections) * [Vmware_engine.list_subnets](#vmware_engine.list_subnets) * [Vmware_engine.list_vmware_engine_networks](#vmware_engine.list_vmware_engine_networks) * [Vmware_engine.reset_nsx_credentials](#vmware_engine.reset_nsx_credentials) @@ -42,9 +48,10 @@ * [Vmware_engine.update_cluster](#vmware_engine.update_cluster) * [Vmware_engine.update_network_policy](#vmware_engine.update_network_policy) * [Vmware_engine.update_private_cloud](#vmware_engine.update_private_cloud) + * [Vmware_engine.update_private_connection](#vmware_engine.update_private_connection) + * [Vmware_engine.update_subnet](#vmware_engine.update_subnet) * [Vmware_engine.update_vmware_engine_network](#vmware_engine.update_vmware_engine_network) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -129,6 +136,23 @@ __Usage:__ +### Vmware_engine.create_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js` + + +----- + + + + ### Vmware_engine.create_vmware_engine_network View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js). @@ -197,6 +221,23 @@ __Usage:__ +### Vmware_engine.delete_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js` + + +----- + + + + ### Vmware_engine.delete_vmware_engine_network View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js). @@ -299,6 +340,40 @@ __Usage:__ +### Vmware_engine.get_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js` + + +----- + + + + +### Vmware_engine.get_subnet + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js). + +[![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js` + + +----- + + + + ### Vmware_engine.get_vmware_engine_network View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js). @@ -401,6 +476,40 @@ __Usage:__ +### Vmware_engine.list_private_connection_peering_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js). + +[![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js` + + +----- + + + + +### Vmware_engine.list_private_connections + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js` + + +----- + + + + ### Vmware_engine.list_subnets View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js). @@ -571,16 +680,16 @@ __Usage:__ -### Vmware_engine.update_vmware_engine_network +### Vmware_engine.update_private_connection -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js,samples/README.md) __Usage:__ -`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js` +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js` ----- @@ -588,16 +697,33 @@ __Usage:__ -### Quickstart +### Vmware_engine.update_subnet -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js). -[![Open in Cloud 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-vmwareengine/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js,samples/README.md) __Usage:__ -`node packages/google-cloud-vmwareengine/samples/quickstart.js` +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js` + + +----- + + + + +### Vmware_engine.update_vmware_engine_network + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js). + +[![Open in Cloud 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-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js` ----- @@ -607,14 +733,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/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-vmwareengine/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/quickstart.js,samples/README.md) __Usage:__ -`node packages/google-cloud-vmwareengine/samples/test/quickstart.js` +`node packages/google-cloud-vmwareengine/samples/quickstart.js` diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json index bd328ff94f6e..aabdfea7b2e6 100644 --- a/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-vmwareengine", - "version": "0.1.1", + "version": "0.1.2", "language": "TYPESCRIPT", "apis": [ { @@ -603,6 +603,90 @@ } } }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetSubnet_async", + "title": "VmwareEngine getSubnet Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single subnet.", + "canonical": true, + "file": "vmware_engine.get_subnet.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSubnet", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.Subnet", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetSubnet", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_async", + "title": "VmwareEngine updateSubnet Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single subnet. Only fields specified in `update_mask` are applied. *Note*: This API is synchronous and always returns a successful `google.longrunning.Operation` (LRO). The returned LRO will only have `done` and `response` fields.", + "canonical": true, + "file": "vmware_engine.update_subnet.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSubnet", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "subnet", + "type": ".google.cloud.vmwareengine.v1.Subnet" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdateSubnet", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, { "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async", "title": "VmwareEngine listNodeTypes Sample", @@ -1486,6 +1570,294 @@ } } } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async", + "title": "VmwareEngine createPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new private connection that can be used for accessing private Clouds.", + "canonical": true, + "file": "vmware_engine.create_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "private_connection_id", + "type": "TYPE_STRING" + }, + { + "name": "private_connection", + "type": ".google.cloud.vmwareengine.v1.PrivateConnection" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_async", + "title": "VmwareEngine getPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `PrivateConnection` resource by its resource name. The resource contains details of the private connection, such as connected network, routing mode and state.", + "canonical": true, + "file": "vmware_engine.get_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.PrivateConnection", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_async", + "title": "VmwareEngine listPrivateConnections Sample", + "origin": "API_DEFINITION", + "description": " Lists `PrivateConnection` resources in a given project and location.", + "canonical": true, + "file": "vmware_engine.list_private_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 105, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_async", + "title": "VmwareEngine updatePrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Modifies a `PrivateConnection` resource. Only `description` and `routing_mode` fields can be updated. Only fields specified in `updateMask` are applied.", + "canonical": true, + "file": "vmware_engine.update_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection", + "async": true, + "parameters": [ + { + "name": "private_connection", + "type": ".google.cloud.vmwareengine.v1.PrivateConnection" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdatePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_async", + "title": "VmwareEngine deletePrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `PrivateConnection` resource. When a private connection is deleted for a VMware Engine network, the connected network becomes inaccessible to that VMware Engine network.", + "canonical": true, + "file": "vmware_engine.delete_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_async", + "title": "VmwareEngine listPrivateConnectionPeeringRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists the private connection routes exchanged over a peering connection.", + "canonical": true, + "file": "vmware_engine.list_private_connection_peering_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrivateConnectionPeeringRoutes", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListPrivateConnectionPeeringRoutes", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js new file mode 100644 index 000000000000..03084fd79cf0 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_connection.js @@ -0,0 +1,100 @@ +// 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, privateConnectionId, privateConnection) { + // [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to create the new private + * connection in. Private connection is a regional resource. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-central1` + */ + // const parent = 'abc123' + /** + * Required. The user-provided identifier of the new private connection. + * This identifier must be unique among private connection resources + * within the parent and becomes the final token in the name URI. The + * identifier must meet the following requirements: + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const privateConnectionId = 'abc123' + /** + * Required. The initial description of the new private connection. + */ + // const privateConnection = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreatePrivateConnection() { + // Construct request + const request = { + parent, + privateConnectionId, + privateConnection, + }; + + // Run request + const [operation] = await vmwareengineClient.createPrivateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreatePrivateConnection(); + // [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js new file mode 100644 index 000000000000..f382c3bb5a60 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_connection.js @@ -0,0 +1,81 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the private connection to be deleted. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateConnections/my-connection` + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callDeletePrivateConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.deletePrivateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeletePrivateConnection(); + // [END vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js new file mode 100644 index 000000000000..1b9a8f615d9d --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_connection.js @@ -0,0 +1,65 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the private connection to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateConnections/my-connection` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetPrivateConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getPrivateConnection(request); + console.log(response); + } + + callGetPrivateConnection(); + // [END vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js new file mode 100644 index 000000000000..31e78f125531 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_subnet.js @@ -0,0 +1,65 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_GetSubnet_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the subnet to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetSubnet() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getSubnet(request); + console.log(response); + } + + callGetSubnet(); + // [END vmwareengine_v1_generated_VmwareEngine_GetSubnet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js new file mode 100644 index 000000000000..a4b7bf2779cd --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js @@ -0,0 +1,80 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the private connection to retrieve peering + * routes from. Resource names are schemeless URIs that follow the conventions + * in https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-west1/privateConnections/my-connection` + */ + // const parent = 'abc123' + /** + * The maximum number of peering routes to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListPrivateConnectionPeeringRoutes` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListPrivateConnectionPeeringRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listPrivateConnectionPeeringRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPrivateConnectionPeeringRoutes(); + // [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js new file mode 100644 index 000000000000..75381fad0aac --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_connections.js @@ -0,0 +1,113 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the location to query for + * private connections. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` + */ + // const parent = 'abc123' + /** + * The maximum number of private connections to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of private connections, you can + * exclude the ones named `example-connection` by specifying + * `name != "example-connection"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-connection") + * (createTime > "2022-09-22T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-connection-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-connection-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListPrivateConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listPrivateConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPrivateConnections(); + // [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js new file mode 100644 index 000000000000..a77762077f98 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_connection.js @@ -0,0 +1,86 @@ +// 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(privateConnection, updateMask) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_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. Private connection description. + */ + // const privateConnection = {} + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `PrivateConnection` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdatePrivateConnection() { + // Construct request + const request = { + privateConnection, + updateMask, + }; + + // Run request + const [operation] = await vmwareengineClient.updatePrivateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdatePrivateConnection(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js new file mode 100644 index 000000000000..058161eb5335 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_subnet.js @@ -0,0 +1,71 @@ +// 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(updateMask, subnet) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_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. Field mask is used to specify the fields to be overwritten in the + * `Subnet` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Subnet description. + */ + // const subnet = {} + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdateSubnet() { + // Construct request + const request = { + updateMask, + subnet, + }; + + // Run request + const [operation] = await vmwareengineClient.updateSubnet(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSubnet(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json b/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json index 14267dd8a248..0e003e70da7e 100644 --- a/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json +++ b/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json @@ -20,6 +20,11 @@ "getCluster" ] }, + "GetSubnet": { + "methods": [ + "getSubnet" + ] + }, "GetNodeType": { "methods": [ "getNodeType" @@ -50,6 +55,11 @@ "getVmwareEngineNetwork" ] }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, "CreatePrivateCloud": { "methods": [ "createPrivateCloud" @@ -85,6 +95,11 @@ "deleteCluster" ] }, + "UpdateSubnet": { + "methods": [ + "updateSubnet" + ] + }, "ResetNsxCredentials": { "methods": [ "resetNsxCredentials" @@ -130,6 +145,21 @@ "deleteVmwareEngineNetwork" ] }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "UpdatePrivateConnection": { + "methods": [ + "updatePrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, "ListPrivateClouds": { "methods": [ "listPrivateClouds", @@ -178,6 +208,20 @@ "listVmwareEngineNetworksStream", "listVmwareEngineNetworksAsync" ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListPrivateConnectionPeeringRoutes": { + "methods": [ + "listPrivateConnectionPeeringRoutes", + "listPrivateConnectionPeeringRoutesStream", + "listPrivateConnectionPeeringRoutesAsync" + ] } } }, @@ -194,6 +238,11 @@ "getCluster" ] }, + "GetSubnet": { + "methods": [ + "getSubnet" + ] + }, "GetNodeType": { "methods": [ "getNodeType" @@ -224,6 +273,11 @@ "getVmwareEngineNetwork" ] }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, "CreatePrivateCloud": { "methods": [ "createPrivateCloud" @@ -259,6 +313,11 @@ "deleteCluster" ] }, + "UpdateSubnet": { + "methods": [ + "updateSubnet" + ] + }, "ResetNsxCredentials": { "methods": [ "resetNsxCredentials" @@ -304,6 +363,21 @@ "deleteVmwareEngineNetwork" ] }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "UpdatePrivateConnection": { + "methods": [ + "updatePrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, "ListPrivateClouds": { "methods": [ "listPrivateClouds", @@ -352,6 +426,20 @@ "listVmwareEngineNetworksStream", "listVmwareEngineNetworksAsync" ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListPrivateConnectionPeeringRoutes": { + "methods": [ + "listPrivateConnectionPeeringRoutes", + "listPrivateConnectionPeeringRoutesStream", + "listPrivateConnectionPeeringRoutesAsync" + ] } } } diff --git a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts index 49a6ba0045f2..14bdd486511b 100644 --- a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts +++ b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts @@ -211,6 +211,9 @@ export class VmwareEngineClient { privateCloudPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/privateClouds/{private_cloud}' ), + privateConnectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateConnections/{private_connection}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -261,6 +264,16 @@ export class VmwareEngineClient { 'nextPageToken', 'vmwareEngineNetworks' ), + listPrivateConnections: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'privateConnections' + ), + listPrivateConnectionPeeringRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'peeringRoutes' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -383,6 +396,12 @@ export class VmwareEngineClient { const deleteClusterMetadata = protoFilesRoot.lookup( '.google.cloud.vmwareengine.v1.OperationMetadata' ) as gax.protobuf.Type; + const updateSubnetResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.Subnet' + ) as gax.protobuf.Type; + const updateSubnetMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; const resetNsxCredentialsResponse = protoFilesRoot.lookup( '.google.cloud.vmwareengine.v1.PrivateCloud' ) as gax.protobuf.Type; @@ -437,6 +456,24 @@ export class VmwareEngineClient { const deleteVmwareEngineNetworkMetadata = protoFilesRoot.lookup( '.google.cloud.vmwareengine.v1.OperationMetadata' ) as gax.protobuf.Type; + const createPrivateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateConnection' + ) as gax.protobuf.Type; + const createPrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updatePrivateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateConnection' + ) as gax.protobuf.Type; + const updatePrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deletePrivateConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deletePrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createPrivateCloud: new this._gaxModule.LongrunningDescriptor( @@ -474,6 +511,11 @@ export class VmwareEngineClient { deleteClusterResponse.decode.bind(deleteClusterResponse), deleteClusterMetadata.decode.bind(deleteClusterMetadata) ), + updateSubnet: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSubnetResponse.decode.bind(updateSubnetResponse), + updateSubnetMetadata.decode.bind(updateSubnetMetadata) + ), resetNsxCredentials: new this._gaxModule.LongrunningDescriptor( this.operationsClient, resetNsxCredentialsResponse.decode.bind(resetNsxCredentialsResponse), @@ -539,6 +581,33 @@ export class VmwareEngineClient { deleteVmwareEngineNetworkMetadata ) ), + createPrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPrivateConnectionResponse.decode.bind( + createPrivateConnectionResponse + ), + createPrivateConnectionMetadata.decode.bind( + createPrivateConnectionMetadata + ) + ), + updatePrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updatePrivateConnectionResponse.decode.bind( + updatePrivateConnectionResponse + ), + updatePrivateConnectionMetadata.decode.bind( + updatePrivateConnectionMetadata + ) + ), + deletePrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePrivateConnectionResponse.decode.bind( + deletePrivateConnectionResponse + ), + deletePrivateConnectionMetadata.decode.bind( + deletePrivateConnectionMetadata + ) + ), }; // Put together the default options sent with requests. @@ -603,6 +672,8 @@ export class VmwareEngineClient { 'updateCluster', 'deleteCluster', 'listSubnets', + 'getSubnet', + 'updateSubnet', 'listNodeTypes', 'getNodeType', 'showNsxCredentials', @@ -622,6 +693,12 @@ export class VmwareEngineClient { 'deleteVmwareEngineNetwork', 'getVmwareEngineNetwork', 'listVmwareEngineNetworks', + 'createPrivateConnection', + 'getPrivateConnection', + 'listPrivateConnections', + 'updatePrivateConnection', + 'deletePrivateConnection', + 'listPrivateConnectionPeeringRoutes', ]; for (const methodName of vmwareEngineStubMethods) { const callPromise = this.vmwareEngineStub.then( @@ -892,6 +969,95 @@ export class VmwareEngineClient { this.initialize(); return this.innerApiCalls.getCluster(request, options, callback); } + /** + * Gets details of a single subnet. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the subnet to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.vmwareengine.v1.Subnet | Subnet}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.get_subnet.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetSubnet_async + */ + getSubnet( + request?: protos.google.cloud.vmwareengine.v1.IGetSubnetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ISubnet, + protos.google.cloud.vmwareengine.v1.IGetSubnetRequest | undefined, + {} | undefined + ] + >; + getSubnet( + request: protos.google.cloud.vmwareengine.v1.IGetSubnetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ISubnet, + protos.google.cloud.vmwareengine.v1.IGetSubnetRequest | null | undefined, + {} | null | undefined + > + ): void; + getSubnet( + request: protos.google.cloud.vmwareengine.v1.IGetSubnetRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ISubnet, + protos.google.cloud.vmwareengine.v1.IGetSubnetRequest | null | undefined, + {} | null | undefined + > + ): void; + getSubnet( + request?: protos.google.cloud.vmwareengine.v1.IGetSubnetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.ISubnet, + | protos.google.cloud.vmwareengine.v1.IGetSubnetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.ISubnet, + protos.google.cloud.vmwareengine.v1.IGetSubnetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ISubnet, + protos.google.cloud.vmwareengine.v1.IGetSubnetRequest | 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.getSubnet(request, options, callback); + } /** * Gets details of a single `NodeType`. * @@ -1499,6 +1665,109 @@ export class VmwareEngineClient { callback ); } + /** + * Retrieves a `PrivateConnection` resource by its resource name. The resource + * contains details of the private connection, such as connected + * network, routing mode and state. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the private connection to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateConnections/my-connection` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.vmwareengine.v1.PrivateConnection | PrivateConnection}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.get_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_async + */ + getPrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + ( + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | undefined + ), + {} | undefined + ] + >; + getPrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + ( + | protos.google.cloud.vmwareengine.v1.IGetPrivateConnectionRequest + | 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.getPrivateConnection(request, options, callback); + } /** * Creates a new `PrivateCloud` resource in a given project and location. @@ -2615,32 +2884,23 @@ export class VmwareEngineClient { >; } /** - * Resets credentials of the NSX appliance. + * Updates the parameters of a single subnet. Only fields specified in + * `update_mask` are applied. + * + * *Note*: This API is synchronous and always returns a successful + * `google.longrunning.Operation` (LRO). The returned LRO will only have + * `done` and `response` fields. * * @param {Object} request * The request object that will be sent. - * @param {string} request.privateCloud - * Required. The resource name of the private cloud - * to reset credentials for. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - * @param {string} [request.requestId] - * Optional. A request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server guarantees that a - * request doesn't result in creation of duplicate commitments for at least 60 - * minutes. - * - * For example, consider a situation where you make an initial request and the - * request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `Subnet` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.vmwareengine.v1.Subnet} request.subnet + * Required. Subnet description. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2650,52 +2910,52 @@ export class VmwareEngineClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.reset_nsx_credentials.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async + * @example include:samples/generated/v1/vmware_engine.update_subnet.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_async */ - resetNsxCredentials( - request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + updateSubnet( + request?: protos.google.cloud.vmwareengine.v1.IUpdateSubnetRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - resetNsxCredentials( - request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + updateSubnet( + request: protos.google.cloud.vmwareengine.v1.IUpdateSubnetRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - resetNsxCredentials( - request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + updateSubnet( + request: protos.google.cloud.vmwareengine.v1.IUpdateSubnetRequest, callback: Callback< LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - resetNsxCredentials( - request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + updateSubnet( + request?: protos.google.cloud.vmwareengine.v1.IUpdateSubnetRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2703,7 +2963,7 @@ export class VmwareEngineClient { >, callback?: Callback< LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2712,7 +2972,7 @@ export class VmwareEngineClient { ): Promise< [ LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2732,13 +2992,13 @@ export class VmwareEngineClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - private_cloud: request.privateCloud ?? '', + 'subnet.name': request.subnet!.name ?? '', }); this.initialize(); - return this.innerApiCalls.resetNsxCredentials(request, options, callback); + return this.innerApiCalls.updateSubnet(request, options, callback); } /** - * Check the status of the long running operation returned by `resetNsxCredentials()`. + * Check the status of the long running operation returned by `updateSubnet()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2746,14 +3006,14 @@ export class VmwareEngineClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.reset_nsx_credentials.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async + * @example include:samples/generated/v1/vmware_engine.update_subnet.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_async */ - async checkResetNsxCredentialsProgress( + async checkUpdateSubnetProgress( name: string ): Promise< LROperation< - protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.Subnet, protos.google.cloud.vmwareengine.v1.OperationMetadata > > { @@ -2764,16 +3024,16 @@ export class VmwareEngineClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.resetNsxCredentials, + this.descriptors.longrunning.updateSubnet, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.Subnet, protos.google.cloud.vmwareengine.v1.OperationMetadata >; } /** - * Resets credentials of the Vcenter appliance. + * Resets credentials of the NSX appliance. * * @param {Object} request * The request object that will be sent. @@ -2808,11 +3068,11 @@ export class VmwareEngineClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.reset_vcenter_credentials.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async + * @example include:samples/generated/v1/vmware_engine.reset_nsx_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async */ - resetVcenterCredentials( - request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + resetNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, options?: CallOptions ): Promise< [ @@ -2824,8 +3084,8 @@ export class VmwareEngineClient { {} | undefined ] >; - resetVcenterCredentials( - request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + resetNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, options: CallOptions, callback: Callback< LROperation< @@ -2836,8 +3096,8 @@ export class VmwareEngineClient { {} | null | undefined > ): void; - resetVcenterCredentials( - request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + resetNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, callback: Callback< LROperation< protos.google.cloud.vmwareengine.v1.IPrivateCloud, @@ -2847,8 +3107,8 @@ export class VmwareEngineClient { {} | null | undefined > ): void; - resetVcenterCredentials( - request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + resetNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2893,14 +3153,10 @@ export class VmwareEngineClient { private_cloud: request.privateCloud ?? '', }); this.initialize(); - return this.innerApiCalls.resetVcenterCredentials( - request, - options, - callback - ); + return this.innerApiCalls.resetNsxCredentials(request, options, callback); } /** - * Check the status of the long running operation returned by `resetVcenterCredentials()`. + * Check the status of the long running operation returned by `resetNsxCredentials()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2908,8 +3164,170 @@ export class VmwareEngineClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.reset_vcenter_credentials.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async + * @example include:samples/generated/v1/vmware_engine.reset_nsx_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async + */ + async checkResetNsxCredentialsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.resetNsxCredentials, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Resets credentials of the Vcenter appliance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.privateCloud + * Required. The resource name of the private cloud + * to reset credentials for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.reset_vcenter_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async + */ + resetVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resetVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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({ + private_cloud: request.privateCloud ?? '', + }); + this.initialize(); + return this.innerApiCalls.resetVcenterCredentials( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `resetVcenterCredentials()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.reset_vcenter_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async */ async checkResetVcenterCredentialsProgress( name: string @@ -4130,127 +4548,1205 @@ export class VmwareEngineClient { >; } /** - * Lists `PrivateCloud` resources in a given project and location. + * Creates a new private connection that can be used for accessing private + * Clouds. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud to be queried for - * clusters. Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1-a` - * @param {number} request.pageSize - * The maximum number of private clouds to return in one page. - * The service may return fewer than this value. - * The maximum value is coerced to 1000. - * The default value of this field is 500. - * @param {string} request.pageToken - * A page token, received from a previous `ListPrivateClouds` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListPrivateClouds` must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - * `<`. - * - * For example, if you are filtering a list of private clouds, you can exclude - * the ones named `example-pc` by specifying `name != "example-pc"`. + * Required. The resource name of the location to create the new private + * connection in. Private connection is a regional resource. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-central1` + * @param {string} request.privateConnectionId + * Required. The user-provided identifier of the new private connection. + * This identifier must be unique among private connection resources + * within the parent and becomes the final token in the name URI. The + * identifier must meet the following requirements: * - * You can also filter nested fields. For example, you could specify - * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - * only if they have a matching address in their network configuration. + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @param {google.cloud.vmwareengine.v1.PrivateConnection} request.privateConnection + * Required. The initial description of the new private connection. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-pc") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: - * ``` - * (name = "private-cloud-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "private-cloud-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud}. - * 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 `listPrivateCloudsAsync()` - * method described below for async iteration which you can stop as needed. + * 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.create_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async */ - listPrivateClouds( - request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + createPrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.IPrivateCloud[], - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined ] >; - listPrivateClouds( + createPrivateConnection( + request: protos.google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateConnection( + request: protos.google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.ICreatePrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.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.createPrivateConnection( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createPrivateConnection()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.create_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async + */ + async checkCreatePrivateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateConnection, + protos.google.cloud.vmwareengine.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.createPrivateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateConnection, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Modifies a `PrivateConnection` resource. Only `description` and + * `routing_mode` fields can be updated. Only fields specified in `updateMask` + * are applied. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.vmwareengine.v1.PrivateConnection} request.privateConnection + * Required. Private connection description. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `PrivateConnection` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.update_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_async + */ + updatePrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updatePrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IUpdatePrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.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({ + 'private_connection.name': request.privateConnection!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePrivateConnection( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updatePrivateConnection()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.update_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_async + */ + async checkUpdatePrivateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateConnection, + protos.google.cloud.vmwareengine.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.updatePrivateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateConnection, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Deletes a `PrivateConnection` resource. When a private connection is + * deleted for a VMware Engine network, the connected network becomes + * inaccessible to that VMware Engine network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the private connection to be deleted. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateConnections/my-connection` + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.delete_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_async + */ + deletePrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deletePrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateConnection( + request: protos.google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateConnection( + request?: protos.google.cloud.vmwareengine.v1.IDeletePrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.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.deletePrivateConnection( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deletePrivateConnection()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.delete_private_connection.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_async + */ + async checkDeletePrivateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.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.deletePrivateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Lists `PrivateCloud` resources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud}. + * 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 `listPrivateCloudsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPrivateClouds( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud[], + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + ] + >; + listPrivateClouds( + request: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): void; + listPrivateClouds( request: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): void; + listPrivateClouds( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud[], + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listPrivateClouds(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 resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud} 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 `listPrivateCloudsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPrivateCloudsStream( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + 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['listPrivateClouds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateClouds.createStream( + this.innerApiCalls.listPrivateClouds as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPrivateClouds`, 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 resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.list_private_clouds.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_async + */ + listPrivateCloudsAsync( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + 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['listPrivateClouds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateClouds.asyncIterate( + this.innerApiCalls['listPrivateClouds'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `Cluster` resources in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.Cluster | Cluster}. + * 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 `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listClusters( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster[], + protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, + protos.google.cloud.vmwareengine.v1.IListClustersResponse + ] + >; + listClusters( + request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): void; + listClusters( + request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): void; + listClusters( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster[], + protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, + protos.google.cloud.vmwareengine.v1.IListClustersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listClusters(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 resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 google.cloud.vmwareengine.v1.Cluster | Cluster} 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 `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listClustersStream( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listClusters`, 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 resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.vmwareengine.v1.Cluster | Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/vmware_engine.list_clusters.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists subnets in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to be queried for + * subnets. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of subnets to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListSubnetsRequest` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.Subnet | Subnet}. + * 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 `listSubnetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSubnets( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ISubnet[], + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, + protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + ] + >; + listSubnets( + request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, - | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IPrivateCloud + protos.google.cloud.vmwareengine.v1.ISubnet > ): void; - listPrivateClouds( - request: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + listSubnets( + request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, - | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IPrivateCloud + protos.google.cloud.vmwareengine.v1.ISubnet > ): void; - listPrivateClouds( - request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + listSubnets( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, - | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IPrivateCloud + protos.google.cloud.vmwareengine.v1.ISubnet >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, - | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IPrivateCloud + protos.google.cloud.vmwareengine.v1.ISubnet > ): Promise< [ - protos.google.cloud.vmwareengine.v1.IPrivateCloud[], - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, - protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + protos.google.cloud.vmwareengine.v1.ISubnet[], + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, + protos.google.cloud.vmwareengine.v1.IListSubnetsResponse ] > | void { request = request || {}; @@ -4269,7 +5765,7 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listPrivateClouds(request, options, callback); + return this.innerApiCalls.listSubnets(request, options, callback); } /** @@ -4278,68 +5774,36 @@ export class VmwareEngineClient { * The request object that will be sent. * @param {string} request.parent * Required. The resource name of the private cloud to be queried for - * clusters. Resource names are schemeless URIs that follow the conventions in + * subnets. + * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a` + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` * @param {number} request.pageSize - * The maximum number of private clouds to return in one page. + * The maximum number of subnets to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListPrivateClouds` call. + * A page token, received from a previous `ListSubnetsRequest` call. * Provide this to retrieve the subsequent page. * - * When paginating, all other parameters provided to `ListPrivateClouds` must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - * `<`. - * - * For example, if you are filtering a list of private clouds, you can exclude - * the ones named `example-pc` by specifying `name != "example-pc"`. - * - * You can also filter nested fields. For example, you could specify - * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - * only if they have a matching address in their network configuration. - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-pc") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` - * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: - * ``` - * (name = "private-cloud-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "private-cloud-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.Subnet | Subnet} 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 `listPrivateCloudsAsync()` + * We recommend using `listSubnetsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listPrivateCloudsStream( - request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + listSubnetsStream( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -4350,89 +5814,57 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listPrivateClouds']; + const defaultCallSettings = this._defaults['listSubnets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listPrivateClouds.createStream( - this.innerApiCalls.listPrivateClouds as GaxCall, + return this.descriptors.page.listSubnets.createStream( + this.innerApiCalls.listSubnets as GaxCall, request, callSettings ); } /** - * Equivalent to `listPrivateClouds`, but returns an iterable object. + * Equivalent to `listSubnets`, 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 resource name of the private cloud to be queried for - * clusters. Resource names are schemeless URIs that follow the conventions in + * subnets. + * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a` + * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` * @param {number} request.pageSize - * The maximum number of private clouds to return in one page. + * The maximum number of subnets to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListPrivateClouds` call. + * A page token, received from a previous `ListSubnetsRequest` call. * Provide this to retrieve the subsequent page. * - * When paginating, all other parameters provided to `ListPrivateClouds` must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - * `<`. - * - * For example, if you are filtering a list of private clouds, you can exclude - * the ones named `example-pc` by specifying `name != "example-pc"`. - * - * You can also filter nested fields. For example, you could specify - * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - * only if they have a matching address in their network configuration. - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-pc") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` - * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: - * ``` - * (name = "private-cloud-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "private-cloud-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.PrivateCloud | PrivateCloud}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.Subnet | Subnet}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_private_clouds.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_async + * @example include:samples/generated/v1/vmware_engine.list_subnets.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListSubnets_async */ - listPrivateCloudsAsync( - request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + listSubnetsAsync( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4441,125 +5873,130 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listPrivateClouds']; + const defaultCallSettings = this._defaults['listSubnets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listPrivateClouds.asyncIterate( - this.innerApiCalls['listPrivateClouds'] as GaxCall, + return this.descriptors.page.listSubnets.asyncIterate( + this.innerApiCalls['listSubnets'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists `Cluster` resources in a given private cloud. + * Lists node types * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud to query for clusters. + * Required. The resource name of the location to be queried for node types. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1-a` * @param {number} request.pageSize - * The maximum number of clusters to return in one page. + * The maximum number of node types to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListClusters` call. + * A page token, received from a previous `ListNodeTypes` call. * Provide this to retrieve the subsequent page. * - * When paginating, all other parameters provided to `ListClusters` - * must match the call that provided the page token. + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-cluster") - * (nodeCount = "3") + * (name = "standard-72") + * (virtual_cpu_count > 2) * ``` * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: * ``` - * (name = "example-cluster-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-cluster-2") + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.Cluster | Cluster}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.NodeType | NodeType}. * 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 `listClustersAsync()` + * We recommend using `listNodeTypesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listClusters( - request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypes( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.ICluster[], - protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, - protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.INodeType[], + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse ] >; - listClusters( - request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypes( + request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListClustersRequest, - | protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ICluster + protos.google.cloud.vmwareengine.v1.INodeType > ): void; - listClusters( - request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypes( + request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListClustersRequest, - | protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ICluster + protos.google.cloud.vmwareengine.v1.INodeType > ): void; - listClusters( - request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypes( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListClustersRequest, - | protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ICluster + protos.google.cloud.vmwareengine.v1.INodeType >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListClustersRequest, - | protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ICluster + protos.google.cloud.vmwareengine.v1.INodeType > ): Promise< [ - protos.google.cloud.vmwareengine.v1.ICluster[], - protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, - protos.google.cloud.vmwareengine.v1.IListClustersResponse + protos.google.cloud.vmwareengine.v1.INodeType[], + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse ] > | void { request = request || {}; @@ -4578,7 +6015,7 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); + return this.innerApiCalls.listNodeTypes(request, options, callback); } /** @@ -4586,57 +6023,62 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud to query for clusters. + * Required. The resource name of the location to be queried for node types. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1-a` * @param {number} request.pageSize - * The maximum number of clusters to return in one page. + * The maximum number of node types to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListClusters` call. + * A page token, received from a previous `ListNodeTypes` call. * Provide this to retrieve the subsequent page. * - * When paginating, all other parameters provided to `ListClusters` - * must match the call that provided the page token. + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-cluster") - * (nodeCount = "3") + * (name = "standard-72") + * (virtual_cpu_count > 2) * ``` * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: * ``` - * (name = "example-cluster-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-cluster-2") + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. * @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 google.cloud.vmwareengine.v1.Cluster | Cluster} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.NodeType | NodeType} 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 `listClustersAsync()` + * We recommend using `listNodeTypesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listClustersStream( - request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypesStream( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -4647,77 +6089,82 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listClusters']; + const defaultCallSettings = this._defaults['listNodeTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listClusters.createStream( - this.innerApiCalls.listClusters as GaxCall, + return this.descriptors.page.listNodeTypes.createStream( + this.innerApiCalls.listNodeTypes as GaxCall, request, callSettings ); } /** - * Equivalent to `listClusters`, but returns an iterable object. + * Equivalent to `listNodeTypes`, 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 resource name of the private cloud to query for clusters. + * Required. The resource name of the location to be queried for node types. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1-a` * @param {number} request.pageSize - * The maximum number of clusters to return in one page. + * The maximum number of node types to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListClusters` call. + * A page token, received from a previous `ListNodeTypes` call. * Provide this to retrieve the subsequent page. * - * When paginating, all other parameters provided to `ListClusters` - * must match the call that provided the page token. + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-cluster") - * (nodeCount = "3") + * (name = "standard-72") + * (virtual_cpu_count > 2) * ``` * - * By default, each expression is an `AND` expression. However, you can - * include `AND` and `OR` expressions explicitly. For example: + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: * ``` - * (name = "example-cluster-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-cluster-2") + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results are - * ordered by `name` in ascending order. You can also sort results in - * descending order based on the `name` value using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.Cluster | Cluster}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.NodeType | NodeType}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_clusters.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListClusters_async + * @example include:samples/generated/v1/vmware_engine.list_node_types.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async */ - listClustersAsync( - request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + listNodeTypesAsync( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4726,105 +6173,106 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listClusters']; + const defaultCallSettings = this._defaults['listNodeTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listClusters.asyncIterate( - this.innerApiCalls['listClusters'] as GaxCall, + return this.descriptors.page.listNodeTypes.asyncIterate( + this.innerApiCalls['listNodeTypes'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists subnets in a given private cloud. + * Lists `HcxActivationKey` resources in a given private cloud. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud to be queried for - * subnets. + * Required. The resource name of the private cloud + * to be queried for HCX activation keys. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` * @param {number} request.pageSize - * The maximum number of subnets to return in one page. + * The maximum number of HCX activation keys to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListSubnetsRequest` call. + * A page token, received from a previous `ListHcxActivationKeys` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListSubnetsRequest` must match the call that provided the page token. + * `ListHcxActivationKeys` must match the call that provided the page + * token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.Subnet | Subnet}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey}. * 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 `listSubnetsAsync()` + * We recommend using `listHcxActivationKeysAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listSubnets( - request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeys( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.ISubnet[], - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, - protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse ] >; - listSubnets( - request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeys( + request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, - | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ISubnet + protos.google.cloud.vmwareengine.v1.IHcxActivationKey > ): void; - listSubnets( - request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeys( + request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, - | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ISubnet + protos.google.cloud.vmwareengine.v1.IHcxActivationKey > ): void; - listSubnets( - request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeys( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, - | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ISubnet + protos.google.cloud.vmwareengine.v1.IHcxActivationKey >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, - | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.ISubnet + protos.google.cloud.vmwareengine.v1.IHcxActivationKey > ): Promise< [ - protos.google.cloud.vmwareengine.v1.ISubnet[], - protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, - protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse ] > | void { request = request || {}; @@ -4843,7 +6291,7 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSubnets(request, options, callback); + return this.innerApiCalls.listHcxActivationKeys(request, options, callback); } /** @@ -4851,37 +6299,38 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud to be queried for - * subnets. + * Required. The resource name of the private cloud + * to be queried for HCX activation keys. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` * @param {number} request.pageSize - * The maximum number of subnets to return in one page. + * The maximum number of HCX activation keys to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListSubnetsRequest` call. + * A page token, received from a previous `ListHcxActivationKeys` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListSubnetsRequest` must match the call that provided the page token. + * `ListHcxActivationKeys` must match the call that provided the page + * token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.Subnet | Subnet} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey} 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 `listSubnetsAsync()` + * We recommend using `listHcxActivationKeysAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listSubnetsStream( - request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeysStream( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, options?: CallOptions ): Transform { request = request || {}; @@ -4892,57 +6341,58 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listSubnets']; + const defaultCallSettings = this._defaults['listHcxActivationKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listSubnets.createStream( - this.innerApiCalls.listSubnets as GaxCall, + return this.descriptors.page.listHcxActivationKeys.createStream( + this.innerApiCalls.listHcxActivationKeys as GaxCall, request, callSettings ); } /** - * Equivalent to `listSubnets`, but returns an iterable object. + * Equivalent to `listHcxActivationKeys`, 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 resource name of the private cloud to be queried for - * subnets. + * Required. The resource name of the private cloud + * to be queried for HCX activation keys. * Resource names are schemeless URIs that follow the conventions in * https://cloud.google.com/apis/design/resource_names. * For example: - * `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` * @param {number} request.pageSize - * The maximum number of subnets to return in one page. + * The maximum number of HCX activation keys to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListSubnetsRequest` call. + * A page token, received from a previous `ListHcxActivationKeys` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListSubnetsRequest` must match the call that provided the page token. + * `ListHcxActivationKeys` must match the call that provided the page + * token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.Subnet | Subnet}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_subnets.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListSubnets_async + * @example include:samples/generated/v1/vmware_engine.list_hcx_activation_keys.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_async */ - listSubnetsAsync( - request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + listHcxActivationKeysAsync( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -4951,37 +6401,37 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listSubnets']; + const defaultCallSettings = this._defaults['listHcxActivationKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listSubnets.asyncIterate( - this.innerApiCalls['listSubnets'] as GaxCall, + return this.descriptors.page.listHcxActivationKeys.asyncIterate( + this.innerApiCalls['listHcxActivationKeys'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists node types + * Lists `NetworkPolicy` resources in a specified project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location to be queried for node types. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1-a` + * Required. The resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of node types to return in one page. + * The maximum number of network policies to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNodeTypes` call. + * A page token, received from a previous `ListNetworkPolicies` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNodeTypes` must match the call that provided the page token. + * `ListNetworkPolicies` must match the call that provided the page + * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. * The expression must specify the field name, a comparison @@ -4989,92 +6439,98 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of node types, you can - * exclude the ones named `standard-72` by specifying - * `name != "standard-72"`. + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "standard-72") - * (virtual_cpu_count > 2) + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "standard-96") AND - * (virtual_cpu_count > 2) OR - * (name = "standard-72") + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.NodeType | NodeType}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy}. * 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 `listNodeTypesAsync()` + * We recommend using `listNetworkPoliciesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listNodeTypes( - request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPolicies( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.INodeType[], - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, - protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.INetworkPolicy[], + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse ] >; - listNodeTypes( - request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPolicies( + request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, - | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INodeType + protos.google.cloud.vmwareengine.v1.INetworkPolicy > ): void; - listNodeTypes( - request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPolicies( + request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, - | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INodeType + protos.google.cloud.vmwareengine.v1.INetworkPolicy > ): void; - listNodeTypes( - request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPolicies( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, - | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INodeType + protos.google.cloud.vmwareengine.v1.INetworkPolicy >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, - | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INodeType + protos.google.cloud.vmwareengine.v1.INetworkPolicy > ): Promise< [ - protos.google.cloud.vmwareengine.v1.INodeType[], - protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, - protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + protos.google.cloud.vmwareengine.v1.INetworkPolicy[], + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse ] > | void { request = request || {}; @@ -5093,7 +6549,7 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listNodeTypes(request, options, callback); + return this.innerApiCalls.listNetworkPolicies(request, options, callback); } /** @@ -5101,22 +6557,22 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location to be queried for node types. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1-a` + * Required. The resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of node types to return in one page. + * The maximum number of network policies to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNodeTypes` call. + * A page token, received from a previous `ListNetworkPolicies` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNodeTypes` must match the call that provided the page token. + * `ListNetworkPolicies` must match the call that provided the page + * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. * The expression must specify the field name, a comparison @@ -5124,39 +6580,45 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of node types, you can - * exclude the ones named `standard-72` by specifying - * `name != "standard-72"`. + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "standard-72") - * (virtual_cpu_count > 2) + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "standard-96") AND - * (virtual_cpu_count > 2) OR - * (name = "standard-72") + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @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 google.cloud.vmwareengine.v1.NodeType | NodeType} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy} 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 `listNodeTypesAsync()` + * We recommend using `listNetworkPoliciesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listNodeTypesStream( - request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPoliciesStream( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -5167,39 +6629,39 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listNodeTypes']; + const defaultCallSettings = this._defaults['listNetworkPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listNodeTypes.createStream( - this.innerApiCalls.listNodeTypes as GaxCall, + return this.descriptors.page.listNetworkPolicies.createStream( + this.innerApiCalls.listNetworkPolicies as GaxCall, request, callSettings ); } /** - * Equivalent to `listNodeTypes`, but returns an iterable object. + * Equivalent to `listNetworkPolicies`, 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 resource name of the location to be queried for node types. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1-a` + * Required. The resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of node types to return in one page. + * The maximum number of network policies to return in one page. * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNodeTypes` call. + * A page token, received from a previous `ListNetworkPolicies` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNodeTypes` must match the call that provided the page token. + * `ListNetworkPolicies` must match the call that provided the page + * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. * The expression must specify the field name, a comparison @@ -5207,42 +6669,48 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of node types, you can - * exclude the ones named `standard-72` by specifying - * `name != "standard-72"`. + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "standard-72") - * (virtual_cpu_count > 2) + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "standard-96") AND - * (virtual_cpu_count > 2) OR - * (name = "standard-72") + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.NodeType | NodeType}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_node_types.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async + * @example include:samples/generated/v1/vmware_engine.list_network_policies.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_async */ - listNodeTypesAsync( - request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + listNetworkPoliciesAsync( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -5251,106 +6719,135 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listNodeTypes']; + const defaultCallSettings = this._defaults['listNetworkPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listNodeTypes.asyncIterate( - this.innerApiCalls['listNodeTypes'] as GaxCall, + return this.descriptors.page.listNetworkPolicies.asyncIterate( + this.innerApiCalls['listNetworkPolicies'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists `HcxActivationKey` resources in a given private cloud. + * Lists `VmwareEngineNetwork` resources in a given project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud - * to be queried for HCX activation keys. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * Required. The resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` * @param {number} request.pageSize - * The maximum number of HCX activation keys to return in one page. - * The service may return fewer than this value. + * The maximum number of results to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListHcxActivationKeys` call. + * A page token, received from a previous `ListVmwareEngineNetworks` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListHcxActivationKeys` must match the call that provided the page + * `ListVmwareEngineNetworks` must match the call that provided the page * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork}. * 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 `listHcxActivationKeysAsync()` + * We recommend using `listVmwareEngineNetworksAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listHcxActivationKeys( - request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworks( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse ] >; - listHcxActivationKeys( - request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworks( + request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, - | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IHcxActivationKey + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork > ): void; - listHcxActivationKeys( - request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworks( + request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, - | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IHcxActivationKey + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork > ): void; - listHcxActivationKeys( - request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworks( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, - | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IHcxActivationKey + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, - | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IHcxActivationKey + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork > ): Promise< [ - protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, - protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse ] > | void { request = request || {}; @@ -5369,7 +6866,11 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listHcxActivationKeys(request, options, callback); + return this.innerApiCalls.listVmwareEngineNetworks( + request, + options, + callback + ); } /** @@ -5377,38 +6878,67 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the private cloud - * to be queried for HCX activation keys. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * Required. The resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` * @param {number} request.pageSize - * The maximum number of HCX activation keys to return in one page. - * The service may return fewer than this value. + * The maximum number of results to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListHcxActivationKeys` call. + * A page token, received from a previous `ListVmwareEngineNetworks` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListHcxActivationKeys` must match the call that provided the page + * `ListVmwareEngineNetworks` must match the call that provided the page * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @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 google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork} 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 `listHcxActivationKeysAsync()` + * We recommend using `listVmwareEngineNetworksAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listHcxActivationKeysStream( - request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworksStream( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, options?: CallOptions ): Transform { request = request || {}; @@ -5419,58 +6949,87 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listHcxActivationKeys']; + const defaultCallSettings = this._defaults['listVmwareEngineNetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listHcxActivationKeys.createStream( - this.innerApiCalls.listHcxActivationKeys as GaxCall, + return this.descriptors.page.listVmwareEngineNetworks.createStream( + this.innerApiCalls.listVmwareEngineNetworks as GaxCall, request, callSettings ); } /** - * Equivalent to `listHcxActivationKeys`, but returns an iterable object. + * Equivalent to `listVmwareEngineNetworks`, 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 resource name of the private cloud - * to be queried for HCX activation keys. - * Resource names are schemeless URIs that follow the conventions in - * https://cloud.google.com/apis/design/resource_names. - * For example: - * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * Required. The resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` * @param {number} request.pageSize - * The maximum number of HCX activation keys to return in one page. - * The service may return fewer than this value. + * The maximum number of results to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListHcxActivationKeys` call. + * A page token, received from a previous `ListVmwareEngineNetworks` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListHcxActivationKeys` must match the call that provided the page + * `ListVmwareEngineNetworks` must match the call that provided the page * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.HcxActivationKey | HcxActivationKey}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_hcx_activation_keys.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_async + * @example include:samples/generated/v1/vmware_engine.list_vmware_engine_networks.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_async */ - listHcxActivationKeysAsync( - request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + listVmwareEngineNetworksAsync( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -5479,36 +7038,35 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listHcxActivationKeys']; + const defaultCallSettings = this._defaults['listVmwareEngineNetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listHcxActivationKeys.asyncIterate( - this.innerApiCalls['listHcxActivationKeys'] as GaxCall, + return this.descriptors.page.listVmwareEngineNetworks.asyncIterate( + this.innerApiCalls['listVmwareEngineNetworks'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists `NetworkPolicy` resources in a specified project and location. + * Lists `PrivateConnection` resources in a given project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location (region) to query for - * network policies. Resource names are schemeless URIs that follow the + * Required. The resource name of the location to query for + * private connections. Resource names are schemeless URIs that follow the * conventions in https://cloud.google.com/apis/design/resource_names. For * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of network policies to return in one page. - * The service may return fewer than this value. + * The maximum number of private connections to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNetworkPolicies` call. + * A page token, received from a previous `ListPrivateConnections` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNetworkPolicies` must match the call that provided the page + * `ListPrivateConnections` must match the call that provided the page * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. @@ -5517,24 +7075,24 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of network policies, you can - * exclude the ones named `example-policy` by specifying - * `name != "example-policy"`. + * For example, if you are filtering a list of private connections, you can + * exclude the ones named `example-connection` by specifying + * `name != "example-connection"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-policy") - * (createTime > "2021-04-12T08:15:10.40Z") + * (name = "example-connection") + * (createTime > "2022-09-22T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "example-policy-1") AND + * (name = "example-connection-1") AND * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-policy-2") + * (name = "example-connection-2") * ``` * @param {string} request.orderBy * Sorts list results by a certain order. By default, returned results @@ -5545,70 +7103,70 @@ export class VmwareEngineClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.PrivateConnection | PrivateConnection}. * 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 `listNetworkPoliciesAsync()` + * We recommend using `listPrivateConnectionsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listNetworkPolicies( - request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnections( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.INetworkPolicy[], - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IPrivateConnection[], + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse ] >; - listNetworkPolicies( - request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnections( + request: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, - | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INetworkPolicy + protos.google.cloud.vmwareengine.v1.IPrivateConnection > ): void; - listNetworkPolicies( - request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnections( + request: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, - | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INetworkPolicy + protos.google.cloud.vmwareengine.v1.IPrivateConnection > ): void; - listNetworkPolicies( - request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnections( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, - | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INetworkPolicy + protos.google.cloud.vmwareengine.v1.IPrivateConnection >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, - | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.INetworkPolicy + protos.google.cloud.vmwareengine.v1.IPrivateConnection > ): Promise< [ - protos.google.cloud.vmwareengine.v1.INetworkPolicy[], - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, - protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + protos.google.cloud.vmwareengine.v1.IPrivateConnection[], + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsResponse ] > | void { request = request || {}; @@ -5627,7 +7185,11 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listNetworkPolicies(request, options, callback); + return this.innerApiCalls.listPrivateConnections( + request, + options, + callback + ); } /** @@ -5635,21 +7197,20 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location (region) to query for - * network policies. Resource names are schemeless URIs that follow the + * Required. The resource name of the location to query for + * private connections. Resource names are schemeless URIs that follow the * conventions in https://cloud.google.com/apis/design/resource_names. For * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of network policies to return in one page. - * The service may return fewer than this value. + * The maximum number of private connections to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNetworkPolicies` call. + * A page token, received from a previous `ListPrivateConnections` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNetworkPolicies` must match the call that provided the page + * `ListPrivateConnections` must match the call that provided the page * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. @@ -5658,24 +7219,24 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of network policies, you can - * exclude the ones named `example-policy` by specifying - * `name != "example-policy"`. + * For example, if you are filtering a list of private connections, you can + * exclude the ones named `example-connection` by specifying + * `name != "example-connection"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-policy") - * (createTime > "2021-04-12T08:15:10.40Z") + * (name = "example-connection") + * (createTime > "2022-09-22T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "example-policy-1") AND + * (name = "example-connection-1") AND * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-policy-2") + * (name = "example-connection-2") * ``` * @param {string} request.orderBy * Sorts list results by a certain order. By default, returned results @@ -5686,17 +7247,17 @@ export class VmwareEngineClient { * @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 google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.PrivateConnection | PrivateConnection} 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 `listNetworkPoliciesAsync()` + * We recommend using `listPrivateConnectionsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listNetworkPoliciesStream( - request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnectionsStream( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -5707,38 +7268,37 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listNetworkPolicies']; + const defaultCallSettings = this._defaults['listPrivateConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listNetworkPolicies.createStream( - this.innerApiCalls.listNetworkPolicies as GaxCall, + return this.descriptors.page.listPrivateConnections.createStream( + this.innerApiCalls.listPrivateConnections as GaxCall, request, callSettings ); } /** - * Equivalent to `listNetworkPolicies`, but returns an iterable object. + * Equivalent to `listPrivateConnections`, 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 resource name of the location (region) to query for - * network policies. Resource names are schemeless URIs that follow the + * Required. The resource name of the location to query for + * private connections. Resource names are schemeless URIs that follow the * conventions in https://cloud.google.com/apis/design/resource_names. For * example: `projects/my-project/locations/us-central1` * @param {number} request.pageSize - * The maximum number of network policies to return in one page. - * The service may return fewer than this value. + * The maximum number of private connections to return in one page. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListNetworkPolicies` call. + * A page token, received from a previous `ListPrivateConnections` call. * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to - * `ListNetworkPolicies` must match the call that provided the page + * `ListPrivateConnections` must match the call that provided the page * token. * @param {string} request.filter * A filter expression that matches resources returned in the response. @@ -5747,24 +7307,24 @@ export class VmwareEngineClient { * must be a string, a number, or a boolean. The comparison operator * must be `=`, `!=`, `>`, or `<`. * - * For example, if you are filtering a list of network policies, you can - * exclude the ones named `example-policy` by specifying - * `name != "example-policy"`. + * For example, if you are filtering a list of private connections, you can + * exclude the ones named `example-connection` by specifying + * `name != "example-connection"`. * * To filter on multiple expressions, provide each separate expression within * parentheses. For example: * ``` - * (name = "example-policy") - * (createTime > "2021-04-12T08:15:10.40Z") + * (name = "example-connection") + * (createTime > "2022-09-22T08:15:10.40Z") * ``` * * By default, each expression is an `AND` expression. However, you * can include `AND` and `OR` expressions explicitly. * For example: * ``` - * (name = "example-policy-1") AND + * (name = "example-connection-1") AND * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-policy-2") + * (name = "example-connection-2") * ``` * @param {string} request.orderBy * Sorts list results by a certain order. By default, returned results @@ -5777,18 +7337,18 @@ export class VmwareEngineClient { * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.NetworkPolicy | NetworkPolicy}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.PrivateConnection | PrivateConnection}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_network_policies.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_async + * @example include:samples/generated/v1/vmware_engine.list_private_connections.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_async */ - listNetworkPoliciesAsync( - request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + listPrivateConnectionsAsync( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -5797,135 +7357,102 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listNetworkPolicies']; + const defaultCallSettings = this._defaults['listPrivateConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listNetworkPolicies.asyncIterate( - this.innerApiCalls['listNetworkPolicies'] as GaxCall, + return this.descriptors.page.listPrivateConnections.asyncIterate( + this.innerApiCalls['listPrivateConnections'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists `VmwareEngineNetwork` resources in a given project and location. + * Lists the private connection routes exchanged over a peering connection. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location to query for - * VMware Engine networks. Resource names are schemeless URIs that follow the - * conventions in https://cloud.google.com/apis/design/resource_names. For - * example: `projects/my-project/locations/global` + * Required. The resource name of the private connection to retrieve peering + * routes from. Resource names are schemeless URIs that follow the conventions + * in https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-west1/privateConnections/my-connection` * @param {number} request.pageSize - * The maximum number of results to return in one page. + * The maximum number of peering routes to return in one page. + * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListVmwareEngineNetworks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListVmwareEngineNetworks` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value - * must be a string, a number, or a boolean. The comparison operator - * must be `=`, `!=`, `>`, or `<`. - * - * For example, if you are filtering a list of network peerings, you can - * exclude the ones named `example-network` by specifying - * `name != "example-network"`. - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-network") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` - * - * By default, each expression is an `AND` expression. However, you - * can include `AND` and `OR` expressions explicitly. - * For example: - * ``` - * (name = "example-network-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-network-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results - * are ordered by `name` in ascending order. - * You can also sort results in descending order based on the `name` value - * using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListPrivateConnectionPeeringRoutes` must + * match the call that provided the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork}. + * The first element of the array is Array of {@link google.cloud.vmwareengine.v1.PeeringRoute | PeeringRoute}. * 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 `listVmwareEngineNetworksAsync()` + * We recommend using `listPrivateConnectionPeeringRoutesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listVmwareEngineNetworks( - request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutes( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IPeeringRoute[], + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse ] >; - listVmwareEngineNetworks( - request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutes( + request: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, - | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + protos.google.cloud.vmwareengine.v1.IPeeringRoute > ): void; - listVmwareEngineNetworks( - request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutes( + request: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, callback: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, - | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + protos.google.cloud.vmwareengine.v1.IPeeringRoute > ): void; - listVmwareEngineNetworks( - request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutes( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, - | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + protos.google.cloud.vmwareengine.v1.IPeeringRoute >, callback?: PaginationCallback< - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, - | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse | null | undefined, - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + protos.google.cloud.vmwareengine.v1.IPeeringRoute > ): Promise< [ - protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, - protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + protos.google.cloud.vmwareengine.v1.IPeeringRoute[], + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesResponse ] > | void { request = request || {}; @@ -5944,7 +7471,7 @@ export class VmwareEngineClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listVmwareEngineNetworks( + return this.innerApiCalls.listPrivateConnectionPeeringRoutes( request, options, callback @@ -5956,67 +7483,34 @@ export class VmwareEngineClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the location to query for - * VMware Engine networks. Resource names are schemeless URIs that follow the - * conventions in https://cloud.google.com/apis/design/resource_names. For - * example: `projects/my-project/locations/global` + * Required. The resource name of the private connection to retrieve peering + * routes from. Resource names are schemeless URIs that follow the conventions + * in https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-west1/privateConnections/my-connection` * @param {number} request.pageSize - * The maximum number of results to return in one page. + * The maximum number of peering routes to return in one page. + * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListVmwareEngineNetworks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListVmwareEngineNetworks` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value - * must be a string, a number, or a boolean. The comparison operator - * must be `=`, `!=`, `>`, or `<`. - * - * For example, if you are filtering a list of network peerings, you can - * exclude the ones named `example-network` by specifying - * `name != "example-network"`. - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-network") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` - * - * By default, each expression is an `AND` expression. However, you - * can include `AND` and `OR` expressions explicitly. - * For example: - * ``` - * (name = "example-network-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-network-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results - * are ordered by `name` in ascending order. - * You can also sort results in descending order based on the `name` value - * using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListPrivateConnectionPeeringRoutes` must + * match the call that provided the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.vmwareengine.v1.PeeringRoute | PeeringRoute} 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 `listVmwareEngineNetworksAsync()` + * We recommend using `listPrivateConnectionPeeringRoutesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ - listVmwareEngineNetworksStream( - request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutesStream( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -6027,87 +7521,55 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listVmwareEngineNetworks']; + const defaultCallSettings = + this._defaults['listPrivateConnectionPeeringRoutes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listVmwareEngineNetworks.createStream( - this.innerApiCalls.listVmwareEngineNetworks as GaxCall, + return this.descriptors.page.listPrivateConnectionPeeringRoutes.createStream( + this.innerApiCalls.listPrivateConnectionPeeringRoutes as GaxCall, request, callSettings ); } /** - * Equivalent to `listVmwareEngineNetworks`, but returns an iterable object. + * Equivalent to `listPrivateConnectionPeeringRoutes`, 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 resource name of the location to query for - * VMware Engine networks. Resource names are schemeless URIs that follow the - * conventions in https://cloud.google.com/apis/design/resource_names. For - * example: `projects/my-project/locations/global` + * Required. The resource name of the private connection to retrieve peering + * routes from. Resource names are schemeless URIs that follow the conventions + * in https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/us-west1/privateConnections/my-connection` * @param {number} request.pageSize - * The maximum number of results to return in one page. + * The maximum number of peering routes to return in one page. + * The service may return fewer than this value. * The maximum value is coerced to 1000. * The default value of this field is 500. * @param {string} request.pageToken - * A page token, received from a previous `ListVmwareEngineNetworks` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListVmwareEngineNetworks` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that matches resources returned in the response. - * The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value - * must be a string, a number, or a boolean. The comparison operator - * must be `=`, `!=`, `>`, or `<`. - * - * For example, if you are filtering a list of network peerings, you can - * exclude the ones named `example-network` by specifying - * `name != "example-network"`. - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. For example: - * ``` - * (name = "example-network") - * (createTime > "2021-04-12T08:15:10.40Z") - * ``` - * - * By default, each expression is an `AND` expression. However, you - * can include `AND` and `OR` expressions explicitly. - * For example: - * ``` - * (name = "example-network-1") AND - * (createTime > "2021-04-12T08:15:10.40Z") OR - * (name = "example-network-2") - * ``` - * @param {string} request.orderBy - * Sorts list results by a certain order. By default, returned results - * are ordered by `name` in ascending order. - * You can also sort results in descending order based on the `name` value - * using `orderBy="name desc"`. - * Currently, only ordering by `name` is supported. + * A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListPrivateConnectionPeeringRoutes` must + * match the call that provided the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork | VmwareEngineNetwork}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.vmwareengine.v1.PeeringRoute | PeeringRoute}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1/vmware_engine.list_vmware_engine_networks.js - * region_tag:vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_async + * @example include:samples/generated/v1/vmware_engine.list_private_connection_peering_routes.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_async */ - listVmwareEngineNetworksAsync( - request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + listPrivateConnectionPeeringRoutesAsync( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateConnectionPeeringRoutesRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -6116,14 +7578,15 @@ export class VmwareEngineClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listVmwareEngineNetworks']; + const defaultCallSettings = + this._defaults['listPrivateConnectionPeeringRoutes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listVmwareEngineNetworks.asyncIterate( - this.innerApiCalls['listVmwareEngineNetworks'] as GaxCall, + return this.descriptors.page.listPrivateConnectionPeeringRoutes.asyncIterate( + this.innerApiCalls['listPrivateConnectionPeeringRoutes'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** * Gets the access control policy for a resource. Returns an empty policy @@ -6857,6 +8320,67 @@ export class VmwareEngineClient { .private_cloud; } + /** + * Return a fully-qualified privateConnection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_connection + * @returns {string} Resource name string. + */ + privateConnectionPath( + project: string, + location: string, + privateConnection: string + ) { + return this.pathTemplates.privateConnectionPathTemplate.render({ + project: project, + location: location, + private_connection: privateConnection, + }); + } + + /** + * Parse the project from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).project; + } + + /** + * Parse the location from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).location; + } + + /** + * Parse the private_connection from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the private_connection. + */ + matchPrivateConnectionFromPrivateConnectionName( + privateConnectionName: string + ) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).private_connection; + } + /** * Return a fully-qualified project resource name string. * diff --git a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json index 3629213be22b..6dbb458e7b23 100644 --- a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json +++ b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json @@ -92,6 +92,16 @@ "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, + "GetSubnet": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSubnet": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListNodeTypes": { "timeout_millis": 120000, "retry_codes_name": "unavailable", @@ -186,6 +196,36 @@ "timeout_millis": 120000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreatePrivateConnection": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPrivateConnection": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPrivateConnections": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdatePrivateConnection": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePrivateConnection": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPrivateConnectionPeeringRoutes": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts b/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts index 171a4e20bde5..9367cc9204e3 100644 --- a/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts +++ b/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts @@ -523,6 +523,133 @@ describe('v1.VmwareEngineClient', () => { }); }); + describe('getSubnet', () => { + it('invokes getSubnet without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetSubnetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetSubnetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Subnet() + ); + client.innerApiCalls.getSubnet = stubSimpleCall(expectedResponse); + const [response] = await client.getSubnet(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubnet without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetSubnetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetSubnetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Subnet() + ); + client.innerApiCalls.getSubnet = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSubnet( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ISubnet | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubnet with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetSubnetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetSubnetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSubnet = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSubnet(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSubnet as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSubnet with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetSubnetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetSubnetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSubnet(request), expectedError); + }); + }); + describe('getNodeType', () => { it('invokes getNodeType without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ @@ -1319,6 +1446,137 @@ describe('v1.VmwareEngineClient', () => { }); }); + describe('getPrivateConnection', () => { + it('invokes getPrivateConnection without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateConnection() + ); + client.innerApiCalls.getPrivateConnection = + stubSimpleCall(expectedResponse); + const [response] = await client.getPrivateConnection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateConnection() + ); + client.innerApiCalls.getPrivateConnection = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPrivateConnection( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IPrivateConnection | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPrivateConnection = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPrivateConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPrivateConnection(request), expectedError); + }); + }); + describe('createPrivateCloud', () => { it('invokes createPrivateCloud without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ @@ -2685,67 +2943,68 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('resetNsxCredentials', () => { - it('invokes resetNsxCredentials without error', async () => { + describe('updateSubnet', () => { + it('invokes updateSubnet without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + new protos.google.cloud.vmwareengine.v1.UpdateSubnetRequest() ); + request.subnet ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', - ['privateCloud'] + '.google.cloud.vmwareengine.v1.UpdateSubnetRequest', + ['subnet', 'name'] ); - request.privateCloud = defaultValue1; - const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + request.subnet.name = defaultValue1; + const expectedHeaderRequestParams = `subnet.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.resetNsxCredentials = - stubLongRunningCall(expectedResponse); - const [operation] = await client.resetNsxCredentials(request); + client.innerApiCalls.updateSubnet = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSubnet(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resetNsxCredentials without error using callback', async () => { + it('invokes updateSubnet without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + new protos.google.cloud.vmwareengine.v1.UpdateSubnetRequest() ); + request.subnet ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', - ['privateCloud'] + '.google.cloud.vmwareengine.v1.UpdateSubnetRequest', + ['subnet', 'name'] ); - request.privateCloud = defaultValue1; - const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + request.subnet.name = defaultValue1; + const expectedHeaderRequestParams = `subnet.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.resetNsxCredentials = + client.innerApiCalls.updateSubnet = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.resetNsxCredentials( + client.updateSubnet( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata > | null ) => { @@ -2758,86 +3017,88 @@ describe('v1.VmwareEngineClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.ISubnet, protos.google.cloud.vmwareengine.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resetNsxCredentials with call error', async () => { + it('invokes updateSubnet with call error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + new protos.google.cloud.vmwareengine.v1.UpdateSubnetRequest() ); + request.subnet ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', - ['privateCloud'] + '.google.cloud.vmwareengine.v1.UpdateSubnetRequest', + ['subnet', 'name'] ); - request.privateCloud = defaultValue1; - const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + request.subnet.name = defaultValue1; + const expectedHeaderRequestParams = `subnet.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + client.innerApiCalls.updateSubnet = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.resetNsxCredentials(request), expectedError); + await assert.rejects(client.updateSubnet(request), expectedError); const actualRequest = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resetNsxCredentials with LRO error', async () => { + it('invokes updateSubnet with LRO error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + new protos.google.cloud.vmwareengine.v1.UpdateSubnetRequest() ); + request.subnet ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', - ['privateCloud'] + '.google.cloud.vmwareengine.v1.UpdateSubnetRequest', + ['subnet', 'name'] ); - request.privateCloud = defaultValue1; - const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + request.subnet.name = defaultValue1; + const expectedHeaderRequestParams = `subnet.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + client.innerApiCalls.updateSubnet = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.resetNsxCredentials(request); + const [operation] = await client.updateSubnet(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resetNsxCredentials as SinonStub + client.innerApiCalls.updateSubnet as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkResetNsxCredentialsProgress without error', async () => { + it('invokes checkUpdateSubnetProgress without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2851,7 +3112,7 @@ describe('v1.VmwareEngineClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkResetNsxCredentialsProgress( + const decodedOperation = await client.checkUpdateSubnetProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2859,7 +3120,7 @@ describe('v1.VmwareEngineClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkResetNsxCredentialsProgress with error', async () => { + it('invokes checkUpdateSubnetProgress with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2871,23 +3132,214 @@ describe('v1.VmwareEngineClient', () => { undefined, expectedError ); - await assert.rejects( - client.checkResetNsxCredentialsProgress(''), - expectedError - ); + await assert.rejects(client.checkUpdateSubnetProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('resetVcenterCredentials', () => { - it('invokes resetVcenterCredentials without error', async () => { + describe('resetNsxCredentials', () => { + it('invokes resetNsxCredentials without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetNsxCredentials = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resetNsxCredentials(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetNsxCredentials = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resetNsxCredentials( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.resetNsxCredentials(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resetNsxCredentials(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResetNsxCredentialsProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetNsxCredentialsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResetNsxCredentialsProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetNsxCredentialsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resetVcenterCredentials', () => { + it('invokes resetVcenterCredentials without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() ); const defaultValue1 = getTypeDefaultValue( '.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest', @@ -4458,80 +4910,69 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listPrivateClouds', () => { - it('invokes listPrivateClouds without error', async () => { + describe('createPrivateConnection', () => { + it('invokes createPrivateConnection without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - ]; - client.innerApiCalls.listPrivateClouds = stubSimpleCall(expectedResponse); - const [response] = await client.listPrivateClouds(request); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createPrivateConnection(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.createPrivateConnection as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.createPrivateConnection as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPrivateClouds without error using callback', async () => { + it('invokes createPrivateConnection without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - ]; - client.innerApiCalls.listPrivateClouds = - stubSimpleCallWithCallback(expectedResponse); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listPrivateClouds( + client.createPrivateConnection( request, ( err?: Error | null, - result?: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] | null + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -4541,84 +4982,1329 @@ describe('v1.VmwareEngineClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.createPrivateConnection as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.createPrivateConnection as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPrivateClouds with error', async () => { + it('invokes createPrivateConnection with call error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listPrivateClouds = stubSimpleCall( + client.innerApiCalls.createPrivateConnection = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.listPrivateClouds(request), expectedError); + await assert.rejects( + client.createPrivateConnection(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createPrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePrivateConnectionProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreatePrivateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePrivateConnectionProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreatePrivateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updatePrivateConnection', () => { + it('invokes updatePrivateConnection without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest() + ); + request.privateConnection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest', + ['privateConnection', 'name'] + ); + request.privateConnection.name = defaultValue1; + const expectedHeaderRequestParams = `private_connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePrivateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updatePrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateConnection without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest() + ); + request.privateConnection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest', + ['privateConnection', 'name'] + ); + request.privateConnection.name = defaultValue1; + const expectedHeaderRequestParams = `private_connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePrivateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePrivateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateConnection, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateConnection with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest() + ); + request.privateConnection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest', + ['privateConnection', 'name'] + ); + request.privateConnection.name = defaultValue1; + const expectedHeaderRequestParams = `private_connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePrivateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updatePrivateConnection(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateConnection with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest() + ); + request.privateConnection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest', + ['privateConnection', 'name'] + ); + request.privateConnection.name = defaultValue1; + const expectedHeaderRequestParams = `private_connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePrivateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updatePrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdatePrivateConnectionProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdatePrivateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdatePrivateConnectionProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdatePrivateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deletePrivateConnection', () => { + it('invokes deletePrivateConnection without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePrivateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePrivateConnection(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deletePrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePrivateConnectionProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeletePrivateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePrivateConnectionProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeletePrivateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPrivateClouds', () => { + it('invokes listPrivateClouds without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.innerApiCalls.listPrivateClouds = stubSimpleCall(expectedResponse); + const [response] = await client.listPrivateClouds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateClouds without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.innerApiCalls.listPrivateClouds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrivateClouds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateClouds with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrivateClouds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPrivateClouds(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateCloudsStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.descriptors.page.listPrivateClouds.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPrivateCloudsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + 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.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateClouds, request) + ); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPrivateCloudsStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateClouds.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPrivateCloudsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateClouds, request) + ); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateClouds without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.descriptors.page.listPrivateClouds.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = []; + const iterable = client.listPrivateCloudsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateClouds with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateClouds.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPrivateCloudsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSubnets', () => { + it('invokes listSubnets without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.innerApiCalls.listSubnets = stubSimpleCall(expectedResponse); + const [response] = await client.listSubnets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubnets without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.innerApiCalls.listSubnets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubnets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ISubnet[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubnets with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubnets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSubnets(request), expectedError); const actualRequest = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.listSubnets as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPrivateClouds as SinonStub + client.innerApiCalls.listSubnets as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPrivateCloudsStream without error', async () => { + it('invokes listSubnetsStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), ]; - client.descriptors.page.listPrivateClouds.createStream = + client.descriptors.page.listSubnets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPrivateCloudsStream(request); + const stream = client.listSubnetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = - []; + const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + (response: protos.google.cloud.vmwareengine.v1.Subnet) => { responses.push(response); } ); @@ -4632,12 +6318,12 @@ describe('v1.VmwareEngineClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + (client.descriptors.page.listSubnets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listPrivateClouds, request) + .calledWith(client.innerApiCalls.listSubnets, request) ); assert( - (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + (client.descriptors.page.listSubnets.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4645,31 +6331,32 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listPrivateCloudsStream with error', async () => { + it('invokes listSubnetsStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listPrivateClouds.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listPrivateCloudsStream(request); + client.descriptors.page.listSubnets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSubnetsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = - []; + const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + (response: protos.google.cloud.vmwareengine.v1.Subnet) => { responses.push(response); } ); @@ -4682,12 +6369,12 @@ describe('v1.VmwareEngineClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + (client.descriptors.page.listSubnets.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listPrivateClouds, request) + .calledWith(client.innerApiCalls.listSubnets, request) ); assert( - (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + (client.descriptors.page.listSubnets.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4695,48 +6382,42 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listPrivateClouds without error', async () => { + it('uses async iteration with listSubnets without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), - generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.PrivateCloud() - ), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), ]; - client.descriptors.page.listPrivateClouds.asyncIterate = + client.descriptors.page.listSubnets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = []; - const iterable = client.listPrivateCloudsAsync(request); + const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; + const iterable = client.listSubnetsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - ( - client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + (client.descriptors.page.listSubnets.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4744,40 +6425,41 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listPrivateClouds with error', async () => { + it('uses async iteration with listSubnets with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listPrivateClouds.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPrivateCloudsAsync(request); + client.descriptors.page.listSubnets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSubnetsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = - []; + const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - ( - client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub - ).getCall(0).args[1], + (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], request ); assert( - (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + (client.descriptors.page.listSubnets.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4786,80 +6468,80 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listClusters', () => { - it('invokes listClusters without error', async () => { + describe('listNodeTypes', () => { + it('invokes listNodeTypes without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); + client.innerApiCalls.listNodeTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listNodeTypes(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters without error using callback', async () => { + it('invokes listNodeTypes without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), ]; - client.innerApiCalls.listClusters = + client.innerApiCalls.listNodeTypes = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listClusters( + client.listNodeTypes( request, ( err?: Error | null, - result?: protos.google.cloud.vmwareengine.v1.ICluster[] | null + result?: protos.google.cloud.vmwareengine.v1.INodeType[] | null ) => { if (err) { reject(err); @@ -4872,80 +6554,80 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClusters with error', async () => { + it('invokes listNodeTypes with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall( + client.innerApiCalls.listNodeTypes = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listClusters(request), expectedError); + await assert.rejects(client.listNodeTypes(request), expectedError); const actualRequest = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listClusters as SinonStub + client.innerApiCalls.listNodeTypes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClustersStream without error', async () => { + it('invokes listNodeTypesStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), ]; - client.descriptors.page.listClusters.createStream = + client.descriptors.page.listNodeTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); + const stream = client.listNodeTypesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + (response: protos.google.cloud.vmwareengine.v1.NodeType) => { responses.push(response); } ); @@ -4959,12 +6641,12 @@ describe('v1.VmwareEngineClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listNodeTypes.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listNodeTypes, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listNodeTypes.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -4972,32 +6654,30 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listClustersStream with error', async () => { + it('invokes listNodeTypesStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listClustersStream(request); + client.descriptors.page.listNodeTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNodeTypesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + (response: protos.google.cloud.vmwareengine.v1.NodeType) => { responses.push(response); } ); @@ -5010,12 +6690,12 @@ describe('v1.VmwareEngineClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listNodeTypes.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listClusters, request) + .calledWith(client.innerApiCalls.listNodeTypes, request) ); assert( - (client.descriptors.page.listClusters.createStream as SinonStub) + (client.descriptors.page.listNodeTypes.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5023,48 +6703,48 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listClusters without error', async () => { + it('uses async iteration with listNodeTypes without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.Cluster() + new protos.google.cloud.vmwareengine.v1.NodeType() ), ]; - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listNodeTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; - const iterable = client.listClustersAsync(request); + const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; + const iterable = client.listNodeTypesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listNodeTypes.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5072,39 +6752,39 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listClusters with error', async () => { + it('uses async iteration with listNodeTypes with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListClustersRequest', + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = + client.descriptors.page.listNodeTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); + const iterable = client.listNodeTypesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; + const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listClusters.asyncIterate as SinonStub + client.descriptors.page.listNodeTypes.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) + (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5113,68 +6793,83 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listSubnets', () => { - it('invokes listSubnets without error', async () => { + describe('listHcxActivationKeys', () => { + it('invokes listHcxActivationKeys without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), ]; - client.innerApiCalls.listSubnets = stubSimpleCall(expectedResponse); - const [response] = await client.listSubnets(request); + client.innerApiCalls.listHcxActivationKeys = + stubSimpleCall(expectedResponse); + const [response] = await client.listHcxActivationKeys(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSubnets without error using callback', async () => { + it('invokes listHcxActivationKeys without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), ]; - client.innerApiCalls.listSubnets = + client.innerApiCalls.listHcxActivationKeys = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSubnets( + client.listHcxActivationKeys( request, ( err?: Error | null, - result?: protos.google.cloud.vmwareengine.v1.ISubnet[] | null + result?: + | protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] + | null ) => { if (err) { reject(err); @@ -5187,74 +6882,84 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSubnets with error', async () => { + it('invokes listHcxActivationKeys with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSubnets = stubSimpleCall( + client.innerApiCalls.listHcxActivationKeys = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listSubnets(request), expectedError); + await assert.rejects( + client.listHcxActivationKeys(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSubnets as SinonStub + client.innerApiCalls.listHcxActivationKeys as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSubnetsStream without error', async () => { + it('invokes listHcxActivationKeysStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), ]; - client.descriptors.page.listSubnets.createStream = + client.descriptors.page.listHcxActivationKeys.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSubnetsStream(request); + const stream = client.listHcxActivationKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; + const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.Subnet) => { + (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { responses.push(response); } ); @@ -5268,12 +6973,18 @@ describe('v1.VmwareEngineClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listSubnets.createStream as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listSubnets, request) + .calledWith(client.innerApiCalls.listHcxActivationKeys, request) ); assert( - (client.descriptors.page.listSubnets.createStream as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5281,32 +6992,31 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listSubnetsStream with error', async () => { + it('invokes listHcxActivationKeysStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSubnets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listSubnetsStream(request); + client.descriptors.page.listHcxActivationKeys.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHcxActivationKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; + const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.Subnet) => { + (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { responses.push(response); } ); @@ -5319,12 +7029,18 @@ describe('v1.VmwareEngineClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listSubnets.createStream as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listSubnets, request) + .calledWith(client.innerApiCalls.listHcxActivationKeys, request) ); assert( - (client.descriptors.page.listSubnets.createStream as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5332,42 +7048,53 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listSubnets without error', async () => { + it('uses async iteration with listHcxActivationKeys without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), - generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), ]; - client.descriptors.page.listSubnets.asyncIterate = + client.descriptors.page.listHcxActivationKeys.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; - const iterable = client.listSubnetsAsync(request); + const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + []; + const iterable = client.listHcxActivationKeysAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listSubnets.asyncIterate as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5375,41 +7102,44 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listSubnets with error', async () => { + it('uses async iteration with listHcxActivationKeys with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSubnets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listSubnetsAsync(request); + client.descriptors.page.listHcxActivationKeys.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHcxActivationKeysAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; + const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listSubnets.asyncIterate as SinonStub) + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5418,80 +7148,81 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listNodeTypes', () => { - it('invokes listNodeTypes without error', async () => { + describe('listNetworkPolicies', () => { + it('invokes listNetworkPolicies without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), ]; - client.innerApiCalls.listNodeTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listNodeTypes(request); + client.innerApiCalls.listNetworkPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listNetworkPolicies(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNodeTypes without error using callback', async () => { + it('invokes listNetworkPolicies without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), ]; - client.innerApiCalls.listNodeTypes = + client.innerApiCalls.listNetworkPolicies = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listNodeTypes( + client.listNetworkPolicies( request, ( err?: Error | null, - result?: protos.google.cloud.vmwareengine.v1.INodeType[] | null + result?: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] | null ) => { if (err) { reject(err); @@ -5504,80 +7235,81 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNodeTypes with error', async () => { + it('invokes listNetworkPolicies with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listNodeTypes = stubSimpleCall( + client.innerApiCalls.listNetworkPolicies = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listNodeTypes(request), expectedError); + await assert.rejects(client.listNetworkPolicies(request), expectedError); const actualRequest = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNodeTypes as SinonStub + client.innerApiCalls.listNetworkPolicies as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNodeTypesStream without error', async () => { + it('invokes listNetworkPoliciesStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), ]; - client.descriptors.page.listNodeTypes.createStream = + client.descriptors.page.listNetworkPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNodeTypesStream(request); + const stream = client.listNetworkPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; + const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.NodeType) => { + (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { responses.push(response); } ); @@ -5591,12 +7323,12 @@ describe('v1.VmwareEngineClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNodeTypes.createStream as SinonStub) + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listNodeTypes, request) + .calledWith(client.innerApiCalls.listNetworkPolicies, request) ); assert( - (client.descriptors.page.listNodeTypes.createStream as SinonStub) + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5604,30 +7336,31 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listNodeTypesStream with error', async () => { + it('invokes listNetworkPoliciesStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listNodeTypes.createStream = + client.descriptors.page.listNetworkPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNodeTypesStream(request); + const stream = client.listNetworkPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; + const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.NodeType) => { + (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { responses.push(response); } ); @@ -5640,12 +7373,12 @@ describe('v1.VmwareEngineClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNodeTypes.createStream as SinonStub) + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listNodeTypes, request) + .calledWith(client.innerApiCalls.listNetworkPolicies, request) ); assert( - (client.descriptors.page.listNodeTypes.createStream as SinonStub) + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5653,48 +7386,49 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listNodeTypes without error', async () => { + it('uses async iteration with listNetworkPolicies without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NodeType() + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() ), ]; - client.descriptors.page.listNodeTypes.asyncIterate = + client.descriptors.page.listNetworkPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; - const iterable = client.listNodeTypesAsync(request); + const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + []; + const iterable = client.listNetworkPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listNodeTypes.asyncIterate as SinonStub + client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) + (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5702,39 +7436,40 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listNodeTypes with error', async () => { + it('uses async iteration with listNetworkPolicies with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listNodeTypes.asyncIterate = + client.descriptors.page.listNetworkPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNodeTypesAsync(request); + const iterable = client.listNetworkPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; + const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listNodeTypes.asyncIterate as SinonStub + client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) + (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -5743,82 +7478,82 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listHcxActivationKeys', () => { - it('invokes listHcxActivationKeys without error', async () => { + describe('listVmwareEngineNetworks', () => { + it('invokes listVmwareEngineNetworks without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), ]; - client.innerApiCalls.listHcxActivationKeys = + client.innerApiCalls.listVmwareEngineNetworks = stubSimpleCall(expectedResponse); - const [response] = await client.listHcxActivationKeys(request); + const [response] = await client.listVmwareEngineNetworks(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHcxActivationKeys without error using callback', async () => { + it('invokes listVmwareEngineNetworks without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), ]; - client.innerApiCalls.listHcxActivationKeys = + client.innerApiCalls.listVmwareEngineNetworks = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listHcxActivationKeys( + client.listVmwareEngineNetworks( request, ( err?: Error | null, result?: - | protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] + | protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] | null ) => { if (err) { @@ -5832,84 +7567,86 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHcxActivationKeys with error', async () => { + it('invokes listVmwareEngineNetworks with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listHcxActivationKeys = stubSimpleCall( + client.innerApiCalls.listVmwareEngineNetworks = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.listHcxActivationKeys(request), + client.listVmwareEngineNetworks(request), expectedError ); const actualRequest = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHcxActivationKeys as SinonStub + client.innerApiCalls.listVmwareEngineNetworks as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHcxActivationKeysStream without error', async () => { + it('invokes listVmwareEngineNetworksStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), ]; - client.descriptors.page.listHcxActivationKeys.createStream = + client.descriptors.page.listVmwareEngineNetworks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHcxActivationKeysStream(request); + const stream = client.listVmwareEngineNetworksStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { + ( + response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork + ) => { responses.push(response); } ); @@ -5924,15 +7661,15 @@ describe('v1.VmwareEngineClient', () => { assert.deepStrictEqual(responses, expectedResponse); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listHcxActivationKeys, request) + .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) ); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .createStream as SinonStub ) .getCall(0) @@ -5942,31 +7679,33 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listHcxActivationKeysStream with error', async () => { + it('invokes listVmwareEngineNetworksStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listHcxActivationKeys.createStream = + client.descriptors.page.listVmwareEngineNetworks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHcxActivationKeysStream(request); + const stream = client.listVmwareEngineNetworksStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { + ( + response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork + ) => { responses.push(response); } ); @@ -5980,15 +7719,15 @@ describe('v1.VmwareEngineClient', () => { await assert.rejects(promise, expectedError); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listHcxActivationKeys, request) + .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) ); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .createStream as SinonStub ) .getCall(0) @@ -5998,51 +7737,51 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listHcxActivationKeys without error', async () => { + it('uses async iteration with listVmwareEngineNetworks without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() ), ]; - client.descriptors.page.listHcxActivationKeys.asyncIterate = + client.descriptors.page.listVmwareEngineNetworks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = []; - const iterable = client.listHcxActivationKeysAsync(request); + const iterable = client.listVmwareEngineNetworksAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .asyncIterate as SinonStub ) .getCall(0) @@ -6052,27 +7791,27 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listHcxActivationKeys with error', async () => { + it('uses async iteration with listVmwareEngineNetworks with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listHcxActivationKeys.asyncIterate = + client.descriptors.page.listVmwareEngineNetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHcxActivationKeysAsync(request); + const iterable = client.listVmwareEngineNetworksAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -6080,14 +7819,14 @@ describe('v1.VmwareEngineClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listHcxActivationKeys + client.descriptors.page.listVmwareEngineNetworks .asyncIterate as SinonStub ) .getCall(0) @@ -6098,81 +7837,83 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listNetworkPolicies', () => { - it('invokes listNetworkPolicies without error', async () => { + describe('listPrivateConnections', () => { + it('invokes listPrivateConnections without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), ]; - client.innerApiCalls.listNetworkPolicies = + client.innerApiCalls.listPrivateConnections = stubSimpleCall(expectedResponse); - const [response] = await client.listNetworkPolicies(request); + const [response] = await client.listPrivateConnections(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNetworkPolicies without error using callback', async () => { + it('invokes listPrivateConnections without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), ]; - client.innerApiCalls.listNetworkPolicies = + client.innerApiCalls.listPrivateConnections = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listNetworkPolicies( + client.listPrivateConnections( request, ( err?: Error | null, - result?: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] | null + result?: + | protos.google.cloud.vmwareengine.v1.IPrivateConnection[] + | null ) => { if (err) { reject(err); @@ -6185,81 +7926,84 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNetworkPolicies with error', async () => { + it('invokes listPrivateConnections with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listNetworkPolicies = stubSimpleCall( + client.innerApiCalls.listPrivateConnections = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listNetworkPolicies(request), expectedError); + await assert.rejects( + client.listPrivateConnections(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listNetworkPolicies as SinonStub + client.innerApiCalls.listPrivateConnections as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listNetworkPoliciesStream without error', async () => { + it('invokes listPrivateConnectionsStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), ]; - client.descriptors.page.listNetworkPolicies.createStream = + client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNetworkPoliciesStream(request); + const stream = client.listPrivateConnectionsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + const responses: protos.google.cloud.vmwareengine.v1.PrivateConnection[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { + (response: protos.google.cloud.vmwareengine.v1.PrivateConnection) => { responses.push(response); } ); @@ -6273,12 +8017,18 @@ describe('v1.VmwareEngineClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listNetworkPolicies, request) + .calledWith(client.innerApiCalls.listPrivateConnections, request) ); assert( - (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6286,31 +8036,31 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listNetworkPoliciesStream with error', async () => { + it('invokes listPrivateConnectionsStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listNetworkPolicies.createStream = + client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNetworkPoliciesStream(request); + const stream = client.listPrivateConnectionsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + const responses: protos.google.cloud.vmwareengine.v1.PrivateConnection[] = []; stream.on( 'data', - (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { + (response: protos.google.cloud.vmwareengine.v1.PrivateConnection) => { responses.push(response); } ); @@ -6323,12 +8073,18 @@ describe('v1.VmwareEngineClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) .getCall(0) - .calledWith(client.innerApiCalls.listNetworkPolicies, request) + .calledWith(client.innerApiCalls.listPrivateConnections, request) ); assert( - (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6336,49 +8092,53 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listNetworkPolicies without error', async () => { + it('uses async iteration with listPrivateConnections without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + new protos.google.cloud.vmwareengine.v1.PrivateConnection() ), ]; - client.descriptors.page.listNetworkPolicies.asyncIterate = + client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + const responses: protos.google.cloud.vmwareengine.v1.IPrivateConnection[] = []; - const iterable = client.listNetworkPoliciesAsync(request); + const iterable = client.listPrivateConnectionsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6386,27 +8146,27 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listNetworkPolicies with error', async () => { + it('uses async iteration with listPrivateConnections with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listNetworkPolicies.asyncIterate = + client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNetworkPoliciesAsync(request); + const iterable = client.listPrivateConnectionsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + const responses: protos.google.cloud.vmwareengine.v1.IPrivateConnection[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -6414,12 +8174,16 @@ describe('v1.VmwareEngineClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -6428,83 +8192,83 @@ describe('v1.VmwareEngineClient', () => { }); }); - describe('listVmwareEngineNetworks', () => { - it('invokes listVmwareEngineNetworks without error', async () => { + describe('listPrivateConnectionPeeringRoutes', () => { + it('invokes listPrivateConnectionPeeringRoutes without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), ]; - client.innerApiCalls.listVmwareEngineNetworks = + client.innerApiCalls.listPrivateConnectionPeeringRoutes = stubSimpleCall(expectedResponse); - const [response] = await client.listVmwareEngineNetworks(request); + const [response] = await client.listPrivateConnectionPeeringRoutes( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVmwareEngineNetworks without error using callback', async () => { + it('invokes listPrivateConnectionPeeringRoutes without error using callback', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), ]; - client.innerApiCalls.listVmwareEngineNetworks = + client.innerApiCalls.listPrivateConnectionPeeringRoutes = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listVmwareEngineNetworks( + client.listPrivateConnectionPeeringRoutes( request, ( err?: Error | null, - result?: - | protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] - | null + result?: protos.google.cloud.vmwareengine.v1.IPeeringRoute[] | null ) => { if (err) { reject(err); @@ -6517,86 +8281,84 @@ describe('v1.VmwareEngineClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVmwareEngineNetworks with error', async () => { + it('invokes listPrivateConnectionPeeringRoutes with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listVmwareEngineNetworks = stubSimpleCall( + client.innerApiCalls.listPrivateConnectionPeeringRoutes = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.listVmwareEngineNetworks(request), + client.listPrivateConnectionPeeringRoutes(request), expectedError ); const actualRequest = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listVmwareEngineNetworks as SinonStub + client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listVmwareEngineNetworksStream without error', async () => { + it('invokes listPrivateConnectionPeeringRoutesStream without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), ]; - client.descriptors.page.listVmwareEngineNetworks.createStream = + client.descriptors.page.listPrivateConnectionPeeringRoutes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listVmwareEngineNetworksStream(request); + const stream = client.listPrivateConnectionPeeringRoutesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = + const responses: protos.google.cloud.vmwareengine.v1.PeeringRoute[] = []; stream.on( 'data', - ( - response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork - ) => { + (response: protos.google.cloud.vmwareengine.v1.PeeringRoute) => { responses.push(response); } ); @@ -6611,15 +8373,18 @@ describe('v1.VmwareEngineClient', () => { assert.deepStrictEqual(responses, expectedResponse); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) + .calledWith( + client.innerApiCalls.listPrivateConnectionPeeringRoutes, + request + ) ); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .createStream as SinonStub ) .getCall(0) @@ -6629,33 +8394,31 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('invokes listVmwareEngineNetworksStream with error', async () => { + it('invokes listPrivateConnectionPeeringRoutesStream with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listVmwareEngineNetworks.createStream = + client.descriptors.page.listPrivateConnectionPeeringRoutes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listVmwareEngineNetworksStream(request); + const stream = client.listPrivateConnectionPeeringRoutesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = + const responses: protos.google.cloud.vmwareengine.v1.PeeringRoute[] = []; stream.on( 'data', - ( - response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork - ) => { + (response: protos.google.cloud.vmwareengine.v1.PeeringRoute) => { responses.push(response); } ); @@ -6669,15 +8432,18 @@ describe('v1.VmwareEngineClient', () => { await assert.rejects(promise, expectedError); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) + .calledWith( + client.innerApiCalls.listPrivateConnectionPeeringRoutes, + request + ) ); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .createStream as SinonStub ) .getCall(0) @@ -6687,51 +8453,50 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listVmwareEngineNetworks without error', async () => { + it('uses async iteration with listPrivateConnectionPeeringRoutes without error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + new protos.google.cloud.vmwareengine.v1.PeeringRoute() ), ]; - client.descriptors.page.listVmwareEngineNetworks.asyncIterate = + client.descriptors.page.listPrivateConnectionPeeringRoutes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = - []; - const iterable = client.listVmwareEngineNetworksAsync(request); + const responses: protos.google.cloud.vmwareengine.v1.IPeeringRoute[] = []; + const iterable = client.listPrivateConnectionPeeringRoutesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .asyncIterate as SinonStub ) .getCall(0) @@ -6741,27 +8506,27 @@ describe('v1.VmwareEngineClient', () => { ); }); - it('uses async iteration with listVmwareEngineNetworks with error', async () => { + it('uses async iteration with listPrivateConnectionPeeringRoutes with error', async () => { const client = new vmwareengineModule.v1.VmwareEngineClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + new protos.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + '.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listVmwareEngineNetworks.asyncIterate = + client.descriptors.page.listPrivateConnectionPeeringRoutes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listVmwareEngineNetworksAsync(request); + const iterable = client.listPrivateConnectionPeeringRoutesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = + const responses: protos.google.cloud.vmwareengine.v1.IPeeringRoute[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -6769,14 +8534,14 @@ describe('v1.VmwareEngineClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listVmwareEngineNetworks + client.descriptors.page.listPrivateConnectionPeeringRoutes .asyncIterate as SinonStub ) .getCall(0) @@ -8013,6 +9778,83 @@ describe('v1.VmwareEngineClient', () => { }); }); + describe('privateConnection', () => { + const fakePath = '/rendered/path/privateConnection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_connection: 'privateConnectionValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.privateConnectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.privateConnectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('privateConnectionPath', () => { + const result = client.privateConnectionPath( + 'projectValue', + 'locationValue', + 'privateConnectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPrivateConnectionName', () => { + const result = client.matchProjectFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPrivateConnectionName', () => { + const result = client.matchLocationFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateConnectionFromPrivateConnectionName', () => { + const result = + client.matchPrivateConnectionFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'privateConnectionValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { From ae1e46335525d7d93a31dcf7a801fcdd00d8eebe Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:30:12 -0700 Subject: [PATCH 41/46] docs: update the list of available APIs (#4337) Update the list of available APIs in the README. --- libraries.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries.json b/libraries.json index 1eac6f7a8100..14a2675a06a4 100644 --- a/libraries.json +++ b/libraries.json @@ -2551,7 +2551,7 @@ "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/discoveryengine", "api_id": "discoveryengine.googleapis.com", - "default_version": "v1beta", + "default_version": "v1", "requires_billing": true, "library_type": "GAPIC_AUTO", "api_shortname": "discoveryengine", From 98fcb21731e5457c26ee08a078905f994a64c058 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 14 Jun 2023 18:51:01 +0200 Subject: [PATCH 42/46] chore(deps): update dependency ts-loader to v9 (#4344) --- packages/google-cloud-accessapproval/package.json | 2 +- packages/google-cloud-bigquery-datatransfer/package.json | 2 +- packages/google-cloud-bigquery-reservation/package.json | 2 +- packages/google-cloud-kms-inventory/package.json | 2 +- packages/google-cloud-oslogin/package.json | 2 +- packages/google-cloud-securitycenter/package.json | 2 +- packages/google-cloud-speech/package.json | 2 +- packages/google-devtools-containeranalysis/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-accessapproval/package.json b/packages/google-cloud-accessapproval/package.json index 843383b6d7fa..90fc2544b931 100644 --- a/packages/google-cloud-accessapproval/package.json +++ b/packages/google-cloud-accessapproval/package.json @@ -62,7 +62,7 @@ "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.11", + "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.9.0", "webpack-cli": "^5.0.0" diff --git a/packages/google-cloud-bigquery-datatransfer/package.json b/packages/google-cloud-bigquery-datatransfer/package.json index d39923f4573c..4805c1611695 100644 --- a/packages/google-cloud-bigquery-datatransfer/package.json +++ b/packages/google-cloud-bigquery-datatransfer/package.json @@ -66,7 +66,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^5.0.0" diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index ea09dca5342f..fc72cb2f3ecf 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -63,7 +63,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^5.0.0" diff --git a/packages/google-cloud-kms-inventory/package.json b/packages/google-cloud-kms-inventory/package.json index a5a02ebf455f..73ba5b1e104e 100644 --- a/packages/google-cloud-kms-inventory/package.json +++ b/packages/google-cloud-kms-inventory/package.json @@ -63,7 +63,7 @@ "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.1", - "ts-loader": "^8.4.0", + "ts-loader": "^9.0.0", "typescript": "^4.8.4", "webpack": "^4.46.0", "webpack-cli": "^4.10.0" diff --git a/packages/google-cloud-oslogin/package.json b/packages/google-cloud-oslogin/package.json index 2e125718cc87..8ae16d8b550d 100644 --- a/packages/google-cloud-oslogin/package.json +++ b/packages/google-cloud-oslogin/package.json @@ -68,7 +68,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^5.0.0" diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index b1c6bf6cdf85..3b7e0946e607 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -65,7 +65,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^4.6.4" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-securitycenter" diff --git a/packages/google-cloud-speech/package.json b/packages/google-cloud-speech/package.json index 963a1dbad93e..abde9421cdf0 100644 --- a/packages/google-cloud-speech/package.json +++ b/packages/google-cloud-speech/package.json @@ -73,7 +73,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^5.0.0" diff --git a/packages/google-devtools-containeranalysis/package.json b/packages/google-devtools-containeranalysis/package.json index 510ba4c5212d..6d18754fed6a 100644 --- a/packages/google-devtools-containeranalysis/package.json +++ b/packages/google-devtools-containeranalysis/package.json @@ -60,7 +60,7 @@ "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^15.0.1", - "ts-loader": "^8.4.0", + "ts-loader": "^9.0.0", "typescript": "^4.8.4", "webpack": "^4.46.0", "webpack-cli": "^4.10.0" From e42176473d18e34f7f8cf14139c9e199a9b7bae3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 14 Jun 2023 22:54:15 +0200 Subject: [PATCH 43/46] chore(deps): update dependency sinon to v15 (#4343) Co-authored-by: Benjamin E. Coe --- packages/google-cloud-datacatalog-lineage/package.json | 2 +- packages/google-cloud-gsuiteaddons/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datacatalog-lineage/package.json b/packages/google-cloud-datacatalog-lineage/package.json index f71ae8052497..ac6d78d47aca 100644 --- a/packages/google-cloud-datacatalog-lineage/package.json +++ b/packages/google-cloud-datacatalog-lineage/package.json @@ -62,7 +62,7 @@ "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", + "sinon": "^15.0.0", "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.9.0", diff --git a/packages/google-cloud-gsuiteaddons/package.json b/packages/google-cloud-gsuiteaddons/package.json index 33e145779de4..89d0c54dfbaf 100644 --- a/packages/google-cloud-gsuiteaddons/package.json +++ b/packages/google-cloud-gsuiteaddons/package.json @@ -62,7 +62,7 @@ "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", + "sinon": "^15.0.0", "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.9.0", From d4d75c629a19649256072d29766e2e692c771ee9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 23:36:14 +0000 Subject: [PATCH 44/46] feat(v1): [batch] Add support for scheduling_policy (#4340) - [ ] Regenerate this pull request now. docs(v1): Minor clarifications for TaskGroup and min_cpu_platform PiperOrigin-RevId: 540265821 Source-Link: https://togithub.com/googleapis/googleapis/commit/71856b9fcb496e11bdbbe52d3d8030c7334519e1 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/f194a119b94d3b1b96043e74ea6fef7eb42eb798 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmMTk0YTExOWI5NGQzYjFiOTYwNDNlNzRlYTZmZWY3ZWI0MmViNzk4In0= BEGIN_NESTED_COMMIT feat: [batch] implement minCpuPlatform --- feat: Enable scheduling_policy in v1 --- feat: update TaskGroup doc PiperOrigin-RevId: 540043151 Source-Link: https://togithub.com/googleapis/googleapis/commit/50a39ef600abf842ce8a749894f674b301253091 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5bdc561934be9a4ad3244358288bae8ea65b8bd1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI1YmRjNTYxOTM0YmU5YTRhZDMyNDQzNTgyODhiYWU4ZWE2NWI4YmQxIn0= END_NESTED_COMMIT --- .../protos/google/cloud/batch/v1/job.proto | 25 ++++++-- .../google/cloud/batch/v1alpha/job.proto | 8 +-- .../google-cloud-batch/protos/protos.d.ts | 16 +++++ packages/google-cloud-batch/protos/protos.js | 63 +++++++++++++++++++ .../google-cloud-batch/protos/protos.json | 13 ++++ 5 files changed, 113 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto index 32e1fc416d21..3abb5c9f0ab3 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto @@ -332,7 +332,6 @@ message AllocationPolicy { // The minimum CPU platform. // See // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - // Not yet implemented. string min_cpu_platform = 3; // The provisioning model. @@ -471,14 +470,28 @@ message AllocationPolicy { PlacementPolicy placement = 10; } -// A TaskGroup contains one or multiple Tasks that share the same -// Runnable but with different runtime parameters. +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. message TaskGroup { option (google.api.resource) = { type: "batch.googleapis.com/TaskGroup" pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" }; + // How Tasks in the TaskGroup should be scheduled relative to each other. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. + AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + IN_ORDER = 2; + } + // Output only. TaskGroup name. // The system generates this field based on parent Job name. // For example: @@ -497,6 +510,10 @@ message TaskGroup { // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. int64 parallelism = 5; + // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. + SchedulingPolicy scheduling_policy = 6; + // An array of environment variable mappings, which are passed to Tasks with // matching indices. If task_environments is used then task_count should // not be specified in the request (and will be ignored). Task count will be @@ -506,8 +523,6 @@ message TaskGroup { // addition to any environment variables set in task_environments, specifying // the number of Tasks in the Task's parent TaskGroup, and the specific Task's // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - // - // task_environments supports up to 200 entries. repeated Environment task_environments = 9; // Max number of tasks that can be run on a VM at the same time. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto index c4a2201cfbcd..2feda464a54b 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto @@ -399,7 +399,6 @@ message AllocationPolicy { // The minimum CPU platform. // See // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - // Not yet implemented. string min_cpu_platform = 3; // The provisioning model. @@ -554,8 +553,7 @@ message AllocationPolicy { PlacementPolicy placement = 10; } -// A TaskGroup contains one or multiple Tasks that share the same -// Runnable but with different runtime parameters. +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. message TaskGroup { option (google.api.resource) = { type: "batch.googleapis.com/TaskGroup" @@ -574,8 +572,6 @@ message TaskGroup { AS_SOON_AS_POSSIBLE = 1; // Run Tasks sequentially with increased task index. - // - // Not yet implemented. IN_ORDER = 2; } @@ -622,8 +618,6 @@ message TaskGroup { // addition to any environment variables set in task_environments, specifying // the number of Tasks in the Task's parent TaskGroup, and the specific Task's // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - // - // task_environments supports up to 200 entries. repeated Environment task_environments = 9; // Max number of tasks that can be run on a VM at the same time. diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index 4c91ccc88985..2abda2f25bf1 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -3157,6 +3157,9 @@ export namespace google { /** TaskGroup parallelism */ parallelism?: (number|Long|string|null); + /** TaskGroup schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null); + /** TaskGroup taskEnvironments */ taskEnvironments?: (google.cloud.batch.v1.IEnvironment[]|null); @@ -3191,6 +3194,9 @@ export namespace google { /** TaskGroup parallelism. */ public parallelism: (number|Long|string); + /** TaskGroup schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy); + /** TaskGroup taskEnvironments. */ public taskEnvironments: google.cloud.batch.v1.IEnvironment[]; @@ -3281,6 +3287,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace TaskGroup { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 + } + } + /** Properties of a ServiceAccount. */ interface IServiceAccount { diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index 057cb5df6331..7a08a83a5231 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -8077,6 +8077,7 @@ * @property {google.cloud.batch.v1.ITaskSpec|null} [taskSpec] TaskGroup taskSpec * @property {number|Long|null} [taskCount] TaskGroup taskCount * @property {number|Long|null} [parallelism] TaskGroup parallelism + * @property {google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile @@ -8131,6 +8132,14 @@ */ TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * TaskGroup schedulingPolicy. + * @member {google.cloud.batch.v1.TaskGroup.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.schedulingPolicy = 0; + /** * TaskGroup taskEnvironments. * @member {Array.} taskEnvironments @@ -8195,6 +8204,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); if (message.taskEnvironments != null && message.taskEnvironments.length) for (var i = 0; i < message.taskEnvironments.length; ++i) $root.google.cloud.batch.v1.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); @@ -8254,6 +8265,10 @@ message.parallelism = reader.int64(); break; } + case 6: { + message.schedulingPolicy = reader.int32(); + break; + } case 9: { if (!(message.taskEnvironments && message.taskEnvironments.length)) message.taskEnvironments = []; @@ -8321,6 +8336,15 @@ if (message.parallelism != null && message.hasOwnProperty("parallelism")) if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) return "parallelism: integer|Long expected"; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { if (!Array.isArray(message.taskEnvironments)) return "taskEnvironments: array expected"; @@ -8379,6 +8403,26 @@ message.parallelism = object.parallelism; else if (typeof object.parallelism === "object") message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; + } if (object.taskEnvironments) { if (!Array.isArray(object.taskEnvironments)) throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: array expected"); @@ -8433,6 +8477,7 @@ object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.parallelism = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; @@ -8455,6 +8500,8 @@ object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; else object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; if (message.taskEnvironments && message.taskEnvironments.length) { object.taskEnvironments = []; for (var j = 0; j < message.taskEnvironments.length; ++j) @@ -8498,6 +8545,22 @@ return typeUrlPrefix + "/google.cloud.batch.v1.TaskGroup"; }; + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1.TaskGroup.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value + */ + TaskGroup.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; + return values; + })(); + return TaskGroup; })(); diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index 986b1da644aa..26af10caa15e 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -796,6 +796,10 @@ "type": "int64", "id": 5 }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 6 + }, "taskEnvironments": { "rule": "repeated", "type": "Environment", @@ -813,6 +817,15 @@ "type": "bool", "id": 12 } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 + } + } } }, "ServiceAccount": { From 33373fd503fd476ed5d5a6ced1e48d86dc0459e1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 23:52:37 +0000 Subject: [PATCH 45/46] feat: [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties (#4341) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 540052133 Source-Link: https://togithub.com/googleapis/googleapis/commit/386f722b6251585d42b1698ce433b1b55010eb11 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b8b5220bb0ca29e108194248def0dbb38b068769 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9yY2hlc3RyYXRpb24tYWlyZmxvdy1zZXJ2aWNlLy5Pd2xCb3QueWFtbCIsImgiOiJiOGI1MjIwYmIwY2EyOWUxMDgxOTQyNDhkZWYwZGJiMzhiMDY4NzY5In0= BEGIN_NESTED_COMMIT feat: [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties PiperOrigin-RevId: 540051332 Source-Link: https://togithub.com/googleapis/googleapis/commit/b84c697241488e5dd521b09b7eaf75b081648585 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/02564778c80b7b5dc2ddff413be253ef24b69165 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9yY2hlc3RyYXRpb24tYWlyZmxvdy1zZXJ2aWNlLy5Pd2xCb3QueWFtbCIsImgiOiIwMjU2NDc3OGM4MGI3YjVkYzJkZGZmNDEzYmUyNTNlZjI0YjY5MTY1In0= END_NESTED_COMMIT --- .../README.md | 53 +- .../airflow/service/v1/environments.proto | 214 + .../airflow/service/v1/operations.proto | 4 + .../service/v1beta1/environments.proto | 168 + .../airflow/service/v1beta1/operations.proto | 4 + .../protos/protos.d.ts | 7921 ++++-- .../protos/protos.js | 21122 ++++++++++------ .../protos/protos.json | 509 +- .../samples/README.md | 194 +- .../v1/environments.database_failover.js | 62 + .../environments.execute_airflow_command.js | 76 + .../environments.fetch_database_properties.js | 62 + .../v1/environments.poll_airflow_command.js | 77 + .../v1/environments.stop_airflow_command.js | 78 + ...loud.orchestration.airflow.service.v1.json | 244 + .../v1beta1/environments.database_failover.js | 62 + .../environments.execute_airflow_command.js | 76 + .../environments.fetch_database_properties.js | 62 + .../environments.poll_airflow_command.js | 77 + .../environments.stop_airflow_command.js | 78 + ...orchestration.airflow.service.v1beta1.json | 244 + .../src/v1/environments_client.ts | 577 + .../src/v1/environments_client_config.json | 20 + .../src/v1/gapic_metadata.json | 50 + .../src/v1beta1/environments_client.ts | 577 + .../v1beta1/environments_client_config.json | 20 + .../src/v1beta1/gapic_metadata.json | 50 + .../test/gapic_environments_v1.ts | 730 + .../test/gapic_environments_v1beta1.ts | 730 + 29 files changed, 23454 insertions(+), 10687 deletions(-) create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js create mode 100644 packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js diff --git a/packages/google-cloud-orchestration-airflow-service/README.md b/packages/google-cloud-orchestration-airflow-service/README.md index 499834f8a41e..585ff5c55526 100644 --- a/packages/google-cloud-orchestration-airflow-service/README.md +++ b/packages/google-cloud-orchestration-airflow-service/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Composer: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Cloud Composer: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-orchestration-airflow-service) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/orchestration-airflow.svg)](https://www.npmjs.org/package/@google-cloud/orchestration-airflow) @@ -84,30 +84,39 @@ listImageVersions(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-orchestration-airflow-service/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Environments.create_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.create_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.create_environment.js,samples/README.md) | -| Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js,samples/README.md) | -| Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js,samples/README.md) | -| Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.list_environments.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.list_environments.js,samples/README.md) | -| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js,samples/README.md) | -| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js,samples/README.md) | -| Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js,samples/README.md) | -| Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_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-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_versions.js,samples/README.md) | -| Environments.check_upgrade | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js,samples/README.md) | -| Environments.create_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.create_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.create_environment.js,samples/README.md) | -| Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js,samples/README.md) | -| Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js,samples/README.md) | -| Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.js,samples/README.md) | -| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js,samples/README.md) | -| Environments.restart_web_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js,samples/README.md) | -| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js,samples/README.md) | -| Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js,samples/README.md) | -| Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_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-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/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-orchestration-airflow-service/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/test/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-orchestration-airflow-service/samples/test/quickstart.js,samples/README.md) | +| Environments.create_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.create_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.create_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.database_failover | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.execute_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.fetch_database_properties | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.list_environments.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.list_environments.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.poll_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.stop_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_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-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_versions.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.check_upgrade | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.create_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.create_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.create_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.database_failover | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.execute_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.fetch_database_properties | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.poll_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.restart_web_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.stop_airflow_command | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js) | [![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_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-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/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-orchestration-airflow-service/samples/quickstart.js,packages/google-cloud-orchestration-airflow-service/samples/README.md) | diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto index 22d7af747115..e83af80a94ac 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto @@ -94,6 +94,33 @@ service Environments { }; } + // Executes Airflow CLI command. + rpc ExecuteAirflowCommand(ExecuteAirflowCommandRequest) + returns (ExecuteAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand" + body: "*" + }; + } + + // Stops Airflow CLI command execution. + rpc StopAirflowCommand(StopAirflowCommandRequest) + returns (StopAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand" + body: "*" + }; + } + + // Polls Airflow CLI command execution and fetches logs. + rpc PollAirflowCommand(PollAirflowCommandRequest) + returns (PollAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand" + body: "*" + }; + } + // Creates a snapshots of a Cloud Composer environment. // // As a result of this operation, snapshot of environment's state is stored @@ -123,6 +150,27 @@ service Environments { metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" }; } + + // Triggers database failover (only for highly resilient environments). + rpc DatabaseFailover(DatabaseFailoverRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:databaseFailover" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Fetches database properties. + rpc FetchDatabaseProperties(FetchDatabasePropertiesRequest) + returns (FetchDatabasePropertiesResponse) { + option (google.api.http) = { + get: "/v1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + }; + } } // Create a new environment. @@ -307,6 +355,119 @@ message UpdateEnvironmentRequest { google.protobuf.FieldMask update_mask = 3; } +// Execute Airflow Command request. +message ExecuteAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + string environment = 1; + + // Airflow command. + string command = 2; + + // Airflow subcommand. + string subcommand = 3; + + // Parameters for the Airflow command/subcommand as an array of arguments. + // It may contain positional arguments like `["my-dag-id"]`, key-value + // parameters like `["--foo=bar"]` or `["--foo","bar"]`, + // or other flags like `["-f"]`. + repeated string parameters = 4; +} + +// Response to ExecuteAirflowCommandRequest. +message ExecuteAirflowCommandResponse { + // The unique ID of the command execution for polling. + string execution_id = 1; + + // The name of the pod where the command is executed. + string pod = 2; + + // The namespace of the pod where the command is executed. + string pod_namespace = 3; + + // Error message. Empty if there was no error. + string error = 4; +} + +// Stop Airflow Command request. +message StopAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + string environment = 1; + + // The unique ID of the command execution. + string execution_id = 2; + + // The name of the pod where the command is executed. + string pod = 3; + + // The namespace of the pod where the command is executed. + string pod_namespace = 4; + + // If true, the execution is terminated forcefully (SIGKILL). If false, the + // execution is stopped gracefully, giving it time for cleanup. + bool force = 5; +} + +// Response to StopAirflowCommandRequest. +message StopAirflowCommandResponse { + // Whether the execution is still running. + bool is_done = 1; + + // Output message from stopping execution request. + repeated string output = 2; +} + +// Poll Airflow Command request. +message PollAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // The unique ID of the command execution. + string execution_id = 2; + + // The name of the pod where the command is executed. + string pod = 3; + + // The namespace of the pod where the command is executed. + string pod_namespace = 4; + + // Line number from which new logs should be fetched. + int32 next_line_number = 5; +} + +// Response to PollAirflowCommandRequest. +message PollAirflowCommandResponse { + // Contains information about a single line from logs. + message Line { + // Number of the line. + int32 line_number = 1; + + // Text content of the log line. + string content = 2; + } + + // Information about how a command ended. + message ExitInfo { + // The exit code from the command execution. + int32 exit_code = 1; + + // Error message. Empty if there was no error. + string error = 2; + } + + // Output from the command execution. It may not contain the full output + // and the caller may need to poll for more lines. + repeated Line output = 1; + + // Whether the command execution has finished and there is no more output. + bool output_end = 2; + + // The result exit status of the command. + ExitInfo exit_info = 3; +} + // Request to create a snapshot of a Cloud Composer environment. message SaveSnapshotRequest { // The resource name of the source environment in the form: @@ -357,6 +518,44 @@ message LoadSnapshotRequest { // Response to LoadSnapshotRequest. message LoadSnapshotResponse {} +// Request to trigger database failover (only for highly resilient +// environments). +message DatabaseFailoverRequest { + // Target environment: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; +} + +// Response for DatabaseFailoverRequest. +message DatabaseFailoverResponse {} + +// Request to fetch properties of environment's database. +message FetchDatabasePropertiesRequest { + // Required. The resource name of the environment, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "composer.googleapis.com/Environment" + } + ]; +} + +// Response for FetchDatabasePropertiesRequest. +message FetchDatabasePropertiesResponse { + // The Compute Engine zone that the instance is currently serving from. + string primary_gce_zone = 1; + + // The Compute Engine zone that the failover instance is currently serving + // from for a regional Cloud SQL instance. + string secondary_gce_zone = 2; + + // The availability status of the failover replica. A false status indicates + // that the failover replica is out of sync. The primary instance can only + // fail over to the failover replica when the status is true. + bool is_failover_replica_available = 3; +} + // Configuration information for an environment. message EnvironmentConfig { // The size of the Cloud Composer environment. @@ -374,6 +573,15 @@ message EnvironmentConfig { ENVIRONMENT_SIZE_LARGE = 3; } + // Resilience mode of the Cloud Composer Environment. + enum ResilienceMode { + // Default mode doesn't change environment parameters. + RESILIENCE_MODE_UNSPECIFIED = 0; + + // Enabled High Resilience mode, including Cloud SQL HA. + HIGH_RESILIENCE = 1; + } + // Output only. The Kubernetes Engine cluster used to run this environment. string gke_cluster = 1; @@ -478,6 +686,12 @@ message EnvironmentConfig { // This field is supported for Cloud Composer environments in versions // composer-2.*.*-airflow-*.*.* and newer. RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resilience mode of the Cloud Composer Environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.2.0-airflow-*.*.* and newer. + ResilienceMode resilience_mode = 19 [(google.api.field_behavior) = OPTIONAL]; } // Network-level access control policy for the Airflow web server. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto index d82fba818e3f..71672aa3c8e6 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto @@ -69,6 +69,10 @@ message OperationMetadata { // Loads snapshot of the resource operation. LOAD_SNAPSHOT = 6; + + // Triggers failover of environment's Cloud SQL instance (only for highly + // resilient environments). + DATABASE_FAILOVER = 7; } // Output only. The current operation state. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto index a47958ad8b01..51da9f3c152c 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto @@ -121,6 +121,33 @@ service Environments { }; } + // Executes Airflow CLI command. + rpc ExecuteAirflowCommand(ExecuteAirflowCommandRequest) + returns (ExecuteAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand" + body: "*" + }; + } + + // Stops Airflow CLI command execution. + rpc StopAirflowCommand(StopAirflowCommandRequest) + returns (StopAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand" + body: "*" + }; + } + + // Polls Airflow CLI command execution and fetches logs. + rpc PollAirflowCommand(PollAirflowCommandRequest) + returns (PollAirflowCommandResponse) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand" + body: "*" + }; + } + // Creates a snapshots of a Cloud Composer environment. // // As a result of this operation, snapshot of environment's state is stored @@ -150,6 +177,27 @@ service Environments { metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" }; } + + // Triggers database failover (only for highly resilient environments). + rpc DatabaseFailover(DatabaseFailoverRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:databaseFailover" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Fetches database properties. + rpc FetchDatabaseProperties(FetchDatabasePropertiesRequest) + returns (FetchDatabasePropertiesResponse) { + option (google.api.http) = { + get: "/v1beta1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + }; + } } // Create a new environment. @@ -364,6 +412,25 @@ message RestartWebServerRequest { string name = 1; } +// Execute Airflow Command request. +message ExecuteAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + string environment = 1; + + // Airflow command. + string command = 2; + + // Airflow subcommand. + string subcommand = 3; + + // Parameters for the Airflow command/subcommand as an array of arguments. + // It may contain positional arguments like `["my-dag-id"]`, key-value + // parameters like `["--foo=bar"]` or `["--foo","bar"]`, + // or other flags like `["-f"]`. + repeated string parameters = 4; +} + // Response to ExecuteAirflowCommandRequest. message ExecuteAirflowCommandResponse { // The unique ID of the command execution for polling. @@ -379,6 +446,54 @@ message ExecuteAirflowCommandResponse { string error = 4; } +// Stop Airflow Command request. +message StopAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + string environment = 1; + + // The unique ID of the command execution. + string execution_id = 2; + + // The name of the pod where the command is executed. + string pod = 3; + + // The namespace of the pod where the command is executed. + string pod_namespace = 4; + + // If true, the execution is terminated forcefully (SIGKILL). If false, the + // execution is stopped gracefully, giving it time for cleanup. + bool force = 5; +} + +// Response to StopAirflowCommandRequest. +message StopAirflowCommandResponse { + // Whether the execution is still running. + bool is_done = 1; + + // Output message from stopping execution request. + repeated string output = 2; +} + +// Poll Airflow Command request. +message PollAirflowCommandRequest { + // The resource name of the environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // The unique ID of the command execution. + string execution_id = 2; + + // The name of the pod where the command is executed. + string pod = 3; + + // The namespace of the pod where the command is executed. + string pod_namespace = 4; + + // Line number from which new logs should be fetched. + int32 next_line_number = 5; +} + // Response to PollAirflowCommandRequest. message PollAirflowCommandResponse { // Contains information about a single line from logs. @@ -460,6 +575,44 @@ message LoadSnapshotRequest { // Response to LoadSnapshotRequest. message LoadSnapshotResponse {} +// Request to trigger database failover (only for highly resilient +// environments). +message DatabaseFailoverRequest { + // Target environment: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; +} + +// Response for DatabaseFailoverRequest. +message DatabaseFailoverResponse {} + +// Request to fetch properties of environment's database. +message FetchDatabasePropertiesRequest { + // Required. The resource name of the environment, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "composer.googleapis.com/Environment" + } + ]; +} + +// Response for FetchDatabasePropertiesRequest. +message FetchDatabasePropertiesResponse { + // The Compute Engine zone that the instance is currently serving from. + string primary_gce_zone = 1; + + // The Compute Engine zone that the failover instance is currently serving + // from for a regional Cloud SQL instance. + string secondary_gce_zone = 2; + + // The availability status of the failover replica. A false status indicates + // that the failover replica is out of sync. The primary instance can only + // fail over to the failover replica when the status is true. + bool is_failover_replica_available = 3; +} + // Configuration information for an environment. message EnvironmentConfig { // The size of the Cloud Composer environment. @@ -477,6 +630,15 @@ message EnvironmentConfig { ENVIRONMENT_SIZE_LARGE = 3; } + // Resilience mode of the Cloud Composer Environment. + enum ResilienceMode { + // Default mode doesn't change environment parameters. + RESILIENCE_MODE_UNSPECIFIED = 0; + + // Enabled High Resilience mode, including Cloud SQL HA. + HIGH_RESILIENCE = 1; + } + // Output only. The Kubernetes Engine cluster used to run this environment. string gke_cluster = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -584,6 +746,12 @@ message EnvironmentConfig { // This field is supported for Cloud Composer environments in versions // composer-2.*.*-airflow-*.*.* and newer. RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resilience mode of the Cloud Composer Environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.2.0-airflow-*.*.* and newer. + ResilienceMode resilience_mode = 20 [(google.api.field_behavior) = OPTIONAL]; } // Network-level access control policy for the Airflow web server. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto index 75663268a4eb..6596658a0be3 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto @@ -65,6 +65,10 @@ message OperationMetadata { // Loads snapshot of the resource operation. LOAD_SNAPSHOT = 6; + + // Triggers failover of environment's Cloud SQL instance (only for highly + // resilient environments). + DATABASE_FAILOVER = 7; } // Output only. The current operation state. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts b/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts index de0726df8b4f..ed8fc54fbfe2 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts @@ -122,6 +122,48 @@ export namespace google { */ public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest): Promise; + /** + * Calls ExecuteAirflowCommand. + * @param request ExecuteAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteAirflowCommandResponse + */ + public executeAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.ExecuteAirflowCommandCallback): void; + + /** + * Calls ExecuteAirflowCommand. + * @param request ExecuteAirflowCommandRequest message or plain object + * @returns Promise + */ + public executeAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest): Promise; + + /** + * Calls StopAirflowCommand. + * @param request StopAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StopAirflowCommandResponse + */ + public stopAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.StopAirflowCommandCallback): void; + + /** + * Calls StopAirflowCommand. + * @param request StopAirflowCommandRequest message or plain object + * @returns Promise + */ + public stopAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest): Promise; + + /** + * Calls PollAirflowCommand. + * @param request PollAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PollAirflowCommandResponse + */ + public pollAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.PollAirflowCommandCallback): void; + + /** + * Calls PollAirflowCommand. + * @param request PollAirflowCommandRequest message or plain object + * @returns Promise + */ + public pollAirflowCommand(request: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest): Promise; + /** * Calls SaveSnapshot. * @param request SaveSnapshotRequest message or plain object @@ -149,6 +191,34 @@ export namespace google { * @returns Promise */ public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest): Promise; + + /** + * Calls DatabaseFailover. + * @param request DatabaseFailoverRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public databaseFailover(request: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.DatabaseFailoverCallback): void; + + /** + * Calls DatabaseFailover. + * @param request DatabaseFailoverRequest message or plain object + * @returns Promise + */ + public databaseFailover(request: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest): Promise; + + /** + * Calls FetchDatabaseProperties. + * @param request FetchDatabasePropertiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDatabasePropertiesResponse + */ + public fetchDatabaseProperties(request: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.FetchDatabasePropertiesCallback): void; + + /** + * Calls FetchDatabaseProperties. + * @param request FetchDatabasePropertiesRequest message or plain object + * @returns Promise + */ + public fetchDatabaseProperties(request: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest): Promise; } namespace Environments { @@ -188,6 +258,27 @@ export namespace google { */ type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|executeAirflowCommand}. + * @param error Error, if any + * @param [response] ExecuteAirflowCommandResponse + */ + type ExecuteAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|stopAirflowCommand}. + * @param error Error, if any + * @param [response] StopAirflowCommandResponse + */ + type StopAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|pollAirflowCommand}. + * @param error Error, if any + * @param [response] PollAirflowCommandResponse + */ + type PollAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse) => void; + /** * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|saveSnapshot}. * @param error Error, if any @@ -201,6 +292,20 @@ export namespace google { * @param [response] Operation */ type LoadSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|databaseFailover}. + * @param error Error, if any + * @param [response] Operation + */ + type DatabaseFailoverCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|fetchDatabaseProperties}. + * @param error Error, if any + * @param [response] FetchDatabasePropertiesResponse + */ + type FetchDatabasePropertiesCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse) => void; } /** Properties of a CreateEnvironmentRequest. */ @@ -821,824 +926,892 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SaveSnapshotRequest. */ - interface ISaveSnapshotRequest { + /** Properties of an ExecuteAirflowCommandRequest. */ + interface IExecuteAirflowCommandRequest { - /** SaveSnapshotRequest environment */ + /** ExecuteAirflowCommandRequest environment */ environment?: (string|null); - /** SaveSnapshotRequest snapshotLocation */ - snapshotLocation?: (string|null); + /** ExecuteAirflowCommandRequest command */ + command?: (string|null); + + /** ExecuteAirflowCommandRequest subcommand */ + subcommand?: (string|null); + + /** ExecuteAirflowCommandRequest parameters */ + parameters?: (string[]|null); } - /** Represents a SaveSnapshotRequest. */ - class SaveSnapshotRequest implements ISaveSnapshotRequest { + /** Represents an ExecuteAirflowCommandRequest. */ + class ExecuteAirflowCommandRequest implements IExecuteAirflowCommandRequest { /** - * Constructs a new SaveSnapshotRequest. + * Constructs a new ExecuteAirflowCommandRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest); - /** SaveSnapshotRequest environment. */ + /** ExecuteAirflowCommandRequest environment. */ public environment: string; - /** SaveSnapshotRequest snapshotLocation. */ - public snapshotLocation: string; + /** ExecuteAirflowCommandRequest command. */ + public command: string; + + /** ExecuteAirflowCommandRequest subcommand. */ + public subcommand: string; + + /** ExecuteAirflowCommandRequest parameters. */ + public parameters: string[]; /** - * Creates a new SaveSnapshotRequest instance using the specified properties. + * Creates a new ExecuteAirflowCommandRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SaveSnapshotRequest instance + * @returns ExecuteAirflowCommandRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest; /** - * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. - * @param message SaveSnapshotRequest message or plain object to encode + * Encodes the specified ExecuteAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest.verify|verify} messages. + * @param message ExecuteAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. - * @param message SaveSnapshotRequest message or plain object to encode + * Encodes the specified ExecuteAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest.verify|verify} messages. + * @param message ExecuteAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SaveSnapshotRequest + * @returns ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SaveSnapshotRequest + * @returns ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest; /** - * Verifies a SaveSnapshotRequest message. + * Verifies an ExecuteAirflowCommandRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SaveSnapshotRequest + * @returns ExecuteAirflowCommandRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest; /** - * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. - * @param message SaveSnapshotRequest + * Creates a plain object from an ExecuteAirflowCommandRequest message. Also converts values to other types if specified. + * @param message ExecuteAirflowCommandRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SaveSnapshotRequest to JSON. + * Converts this ExecuteAirflowCommandRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SaveSnapshotRequest + * Gets the default type url for ExecuteAirflowCommandRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SaveSnapshotResponse. */ - interface ISaveSnapshotResponse { + /** Properties of an ExecuteAirflowCommandResponse. */ + interface IExecuteAirflowCommandResponse { - /** SaveSnapshotResponse snapshotPath */ - snapshotPath?: (string|null); + /** ExecuteAirflowCommandResponse executionId */ + executionId?: (string|null); + + /** ExecuteAirflowCommandResponse pod */ + pod?: (string|null); + + /** ExecuteAirflowCommandResponse podNamespace */ + podNamespace?: (string|null); + + /** ExecuteAirflowCommandResponse error */ + error?: (string|null); } - /** Represents a SaveSnapshotResponse. */ - class SaveSnapshotResponse implements ISaveSnapshotResponse { + /** Represents an ExecuteAirflowCommandResponse. */ + class ExecuteAirflowCommandResponse implements IExecuteAirflowCommandResponse { /** - * Constructs a new SaveSnapshotResponse. + * Constructs a new ExecuteAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse); - /** SaveSnapshotResponse snapshotPath. */ - public snapshotPath: string; + /** ExecuteAirflowCommandResponse executionId. */ + public executionId: string; + + /** ExecuteAirflowCommandResponse pod. */ + public pod: string; + + /** ExecuteAirflowCommandResponse podNamespace. */ + public podNamespace: string; + + /** ExecuteAirflowCommandResponse error. */ + public error: string; /** - * Creates a new SaveSnapshotResponse instance using the specified properties. + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SaveSnapshotResponse instance + * @returns ExecuteAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse; /** - * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. - * @param message SaveSnapshotResponse message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. - * @param message SaveSnapshotResponse message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SaveSnapshotResponse + * @returns ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SaveSnapshotResponse + * @returns ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse; /** - * Verifies a SaveSnapshotResponse message. + * Verifies an ExecuteAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SaveSnapshotResponse + * @returns ExecuteAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse; /** - * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. - * @param message SaveSnapshotResponse + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. + * @param message ExecuteAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SaveSnapshotResponse to JSON. + * Converts this ExecuteAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SaveSnapshotResponse + * Gets the default type url for ExecuteAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LoadSnapshotRequest. */ - interface ILoadSnapshotRequest { + /** Properties of a StopAirflowCommandRequest. */ + interface IStopAirflowCommandRequest { - /** LoadSnapshotRequest environment */ + /** StopAirflowCommandRequest environment */ environment?: (string|null); - /** LoadSnapshotRequest snapshotPath */ - snapshotPath?: (string|null); - - /** LoadSnapshotRequest skipPypiPackagesInstallation */ - skipPypiPackagesInstallation?: (boolean|null); + /** StopAirflowCommandRequest executionId */ + executionId?: (string|null); - /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ - skipEnvironmentVariablesSetting?: (boolean|null); + /** StopAirflowCommandRequest pod */ + pod?: (string|null); - /** LoadSnapshotRequest skipAirflowOverridesSetting */ - skipAirflowOverridesSetting?: (boolean|null); + /** StopAirflowCommandRequest podNamespace */ + podNamespace?: (string|null); - /** LoadSnapshotRequest skipGcsDataCopying */ - skipGcsDataCopying?: (boolean|null); + /** StopAirflowCommandRequest force */ + force?: (boolean|null); } - /** Represents a LoadSnapshotRequest. */ - class LoadSnapshotRequest implements ILoadSnapshotRequest { + /** Represents a StopAirflowCommandRequest. */ + class StopAirflowCommandRequest implements IStopAirflowCommandRequest { /** - * Constructs a new LoadSnapshotRequest. + * Constructs a new StopAirflowCommandRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest); - /** LoadSnapshotRequest environment. */ + /** StopAirflowCommandRequest environment. */ public environment: string; - /** LoadSnapshotRequest snapshotPath. */ - public snapshotPath: string; - - /** LoadSnapshotRequest skipPypiPackagesInstallation. */ - public skipPypiPackagesInstallation: boolean; + /** StopAirflowCommandRequest executionId. */ + public executionId: string; - /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ - public skipEnvironmentVariablesSetting: boolean; + /** StopAirflowCommandRequest pod. */ + public pod: string; - /** LoadSnapshotRequest skipAirflowOverridesSetting. */ - public skipAirflowOverridesSetting: boolean; + /** StopAirflowCommandRequest podNamespace. */ + public podNamespace: string; - /** LoadSnapshotRequest skipGcsDataCopying. */ - public skipGcsDataCopying: boolean; + /** StopAirflowCommandRequest force. */ + public force: boolean; /** - * Creates a new LoadSnapshotRequest instance using the specified properties. + * Creates a new StopAirflowCommandRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LoadSnapshotRequest instance + * @returns StopAirflowCommandRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest; /** - * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. - * @param message LoadSnapshotRequest message or plain object to encode + * Encodes the specified StopAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest.verify|verify} messages. + * @param message StopAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. - * @param message LoadSnapshotRequest message or plain object to encode + * Encodes the specified StopAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest.verify|verify} messages. + * @param message StopAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LoadSnapshotRequest + * @returns StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LoadSnapshotRequest + * @returns StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest; /** - * Verifies a LoadSnapshotRequest message. + * Verifies a StopAirflowCommandRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LoadSnapshotRequest + * @returns StopAirflowCommandRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest; /** - * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. - * @param message LoadSnapshotRequest + * Creates a plain object from a StopAirflowCommandRequest message. Also converts values to other types if specified. + * @param message StopAirflowCommandRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LoadSnapshotRequest to JSON. + * Converts this StopAirflowCommandRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LoadSnapshotRequest + * Gets the default type url for StopAirflowCommandRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LoadSnapshotResponse. */ - interface ILoadSnapshotResponse { + /** Properties of a StopAirflowCommandResponse. */ + interface IStopAirflowCommandResponse { + + /** StopAirflowCommandResponse isDone */ + isDone?: (boolean|null); + + /** StopAirflowCommandResponse output */ + output?: (string[]|null); } - /** Represents a LoadSnapshotResponse. */ - class LoadSnapshotResponse implements ILoadSnapshotResponse { + /** Represents a StopAirflowCommandResponse. */ + class StopAirflowCommandResponse implements IStopAirflowCommandResponse { /** - * Constructs a new LoadSnapshotResponse. + * Constructs a new StopAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse); + + /** StopAirflowCommandResponse isDone. */ + public isDone: boolean; + + /** StopAirflowCommandResponse output. */ + public output: string[]; /** - * Creates a new LoadSnapshotResponse instance using the specified properties. + * Creates a new StopAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns LoadSnapshotResponse instance + * @returns StopAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse; /** - * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. - * @param message LoadSnapshotResponse message or plain object to encode + * Encodes the specified StopAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse.verify|verify} messages. + * @param message StopAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. - * @param message LoadSnapshotResponse message or plain object to encode + * Encodes the specified StopAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse.verify|verify} messages. + * @param message StopAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LoadSnapshotResponse + * @returns StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LoadSnapshotResponse + * @returns StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse; /** - * Verifies a LoadSnapshotResponse message. + * Verifies a StopAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LoadSnapshotResponse + * @returns StopAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse; /** - * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. - * @param message LoadSnapshotResponse + * Creates a plain object from a StopAirflowCommandResponse message. Also converts values to other types if specified. + * @param message StopAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LoadSnapshotResponse to JSON. + * Converts this StopAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LoadSnapshotResponse + * Gets the default type url for StopAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EnvironmentConfig. */ - interface IEnvironmentConfig { - - /** EnvironmentConfig gkeCluster */ - gkeCluster?: (string|null); - - /** EnvironmentConfig dagGcsPrefix */ - dagGcsPrefix?: (string|null); - - /** EnvironmentConfig nodeCount */ - nodeCount?: (number|null); - - /** EnvironmentConfig softwareConfig */ - softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); - - /** EnvironmentConfig nodeConfig */ - nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); - - /** EnvironmentConfig privateEnvironmentConfig */ - privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); - - /** EnvironmentConfig webServerNetworkAccessControl */ - webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); - - /** EnvironmentConfig databaseConfig */ - databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); - - /** EnvironmentConfig webServerConfig */ - webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); - - /** EnvironmentConfig encryptionConfig */ - encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); - - /** EnvironmentConfig maintenanceWindow */ - maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); - - /** EnvironmentConfig workloadsConfig */ - workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); + /** Properties of a PollAirflowCommandRequest. */ + interface IPollAirflowCommandRequest { - /** EnvironmentConfig environmentSize */ - environmentSize?: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null); + /** PollAirflowCommandRequest environment */ + environment?: (string|null); - /** EnvironmentConfig airflowUri */ - airflowUri?: (string|null); + /** PollAirflowCommandRequest executionId */ + executionId?: (string|null); - /** EnvironmentConfig airflowByoidUri */ - airflowByoidUri?: (string|null); + /** PollAirflowCommandRequest pod */ + pod?: (string|null); - /** EnvironmentConfig masterAuthorizedNetworksConfig */ - masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); + /** PollAirflowCommandRequest podNamespace */ + podNamespace?: (string|null); - /** EnvironmentConfig recoveryConfig */ - recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); + /** PollAirflowCommandRequest nextLineNumber */ + nextLineNumber?: (number|null); } - /** Represents an EnvironmentConfig. */ - class EnvironmentConfig implements IEnvironmentConfig { + /** Represents a PollAirflowCommandRequest. */ + class PollAirflowCommandRequest implements IPollAirflowCommandRequest { /** - * Constructs a new EnvironmentConfig. + * Constructs a new PollAirflowCommandRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig); - - /** EnvironmentConfig gkeCluster. */ - public gkeCluster: string; - - /** EnvironmentConfig dagGcsPrefix. */ - public dagGcsPrefix: string; - - /** EnvironmentConfig nodeCount. */ - public nodeCount: number; - - /** EnvironmentConfig softwareConfig. */ - public softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); - - /** EnvironmentConfig nodeConfig. */ - public nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); - - /** EnvironmentConfig privateEnvironmentConfig. */ - public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); - - /** EnvironmentConfig webServerNetworkAccessControl. */ - public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); - - /** EnvironmentConfig databaseConfig. */ - public databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); - - /** EnvironmentConfig webServerConfig. */ - public webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); - - /** EnvironmentConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); - - /** EnvironmentConfig maintenanceWindow. */ - public maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest); - /** EnvironmentConfig workloadsConfig. */ - public workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); - - /** EnvironmentConfig environmentSize. */ - public environmentSize: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize); + /** PollAirflowCommandRequest environment. */ + public environment: string; - /** EnvironmentConfig airflowUri. */ - public airflowUri: string; + /** PollAirflowCommandRequest executionId. */ + public executionId: string; - /** EnvironmentConfig airflowByoidUri. */ - public airflowByoidUri: string; + /** PollAirflowCommandRequest pod. */ + public pod: string; - /** EnvironmentConfig masterAuthorizedNetworksConfig. */ - public masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); + /** PollAirflowCommandRequest podNamespace. */ + public podNamespace: string; - /** EnvironmentConfig recoveryConfig. */ - public recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); + /** PollAirflowCommandRequest nextLineNumber. */ + public nextLineNumber: number; /** - * Creates a new EnvironmentConfig instance using the specified properties. + * Creates a new PollAirflowCommandRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EnvironmentConfig instance + * @returns PollAirflowCommandRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode + * Encodes the specified PollAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest.verify|verify} messages. + * @param message PollAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode + * Encodes the specified PollAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest.verify|verify} messages. + * @param message PollAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnvironmentConfig + * @returns PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnvironmentConfig + * @returns PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest; /** - * Verifies an EnvironmentConfig message. + * Verifies a PollAirflowCommandRequest message. * @param message Plain 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 EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnvironmentConfig + * @returns PollAirflowCommandRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest; /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. - * @param message EnvironmentConfig + * Creates a plain object from a PollAirflowCommandRequest message. Also converts values to other types if specified. + * @param message PollAirflowCommandRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnvironmentConfig to JSON. + * Converts this PollAirflowCommandRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnvironmentConfig + * Gets the default type url for PollAirflowCommandRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace EnvironmentConfig { + /** Properties of a PollAirflowCommandResponse. */ + interface IPollAirflowCommandResponse { - /** EnvironmentSize enum. */ - enum EnvironmentSize { - ENVIRONMENT_SIZE_UNSPECIFIED = 0, - ENVIRONMENT_SIZE_SMALL = 1, - ENVIRONMENT_SIZE_MEDIUM = 2, - ENVIRONMENT_SIZE_LARGE = 3 - } - } + /** PollAirflowCommandResponse output */ + output?: (google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine[]|null); - /** Properties of a WebServerNetworkAccessControl. */ - interface IWebServerNetworkAccessControl { + /** PollAirflowCommandResponse outputEnd */ + outputEnd?: (boolean|null); - /** WebServerNetworkAccessControl allowedIpRanges */ - allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); + /** PollAirflowCommandResponse exitInfo */ + exitInfo?: (google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo|null); } - /** Represents a WebServerNetworkAccessControl. */ - class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { + /** Represents a PollAirflowCommandResponse. */ + class PollAirflowCommandResponse implements IPollAirflowCommandResponse { /** - * Constructs a new WebServerNetworkAccessControl. + * Constructs a new PollAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse); - /** WebServerNetworkAccessControl allowedIpRanges. */ - public allowedIpRanges: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]; + /** PollAirflowCommandResponse output. */ + public output: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine[]; + + /** PollAirflowCommandResponse outputEnd. */ + public outputEnd: boolean; + + /** PollAirflowCommandResponse exitInfo. */ + public exitInfo?: (google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo|null); /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * Creates a new PollAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerNetworkAccessControl instance + * @returns PollAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse; /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerNetworkAccessControl + * @returns PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerNetworkAccessControl + * @returns PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse; /** - * Verifies a WebServerNetworkAccessControl message. + * Verifies a PollAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerNetworkAccessControl + * @returns PollAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse; /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. - * @param message WebServerNetworkAccessControl + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * @param message PollAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerNetworkAccessControl to JSON. + * Converts this PollAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerNetworkAccessControl + * Gets the default type url for PollAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace WebServerNetworkAccessControl { + namespace PollAirflowCommandResponse { - /** Properties of an AllowedIpRange. */ - interface IAllowedIpRange { + /** Properties of a Line. */ + interface ILine { - /** AllowedIpRange value */ - value?: (string|null); + /** Line lineNumber */ + lineNumber?: (number|null); - /** AllowedIpRange description */ - description?: (string|null); + /** Line content */ + content?: (string|null); } - /** Represents an AllowedIpRange. */ - class AllowedIpRange implements IAllowedIpRange { + /** Represents a Line. */ + class Line implements ILine { /** - * Constructs a new AllowedIpRange. + * Constructs a new Line. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine); - /** AllowedIpRange value. */ - public value: string; + /** Line lineNumber. */ + public lineNumber: number; - /** AllowedIpRange description. */ - public description: string; + /** Line content. */ + public content: string; /** - * Creates a new AllowedIpRange instance using the specified properties. + * Creates a new Line instance using the specified properties. * @param [properties] Properties to set - * @returns AllowedIpRange instance + * @returns Line instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line; /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AllowedIpRange message from the specified reader or buffer. + * Decodes a Line message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AllowedIpRange + * @returns Line * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line; /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * Decodes a Line message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AllowedIpRange + * @returns Line * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line; /** - * Verifies an AllowedIpRange message. + * Verifies a Line message. * @param message Plain 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 AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * Creates a Line message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AllowedIpRange + * @returns Line */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line; /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. - * @param message AllowedIpRange + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @param message Line * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AllowedIpRange to JSON. + * Converts this Line to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AllowedIpRange + * Gets the default type url for Line + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExitInfo. */ + interface IExitInfo { + + /** ExitInfo exitCode */ + exitCode?: (number|null); + + /** ExitInfo error */ + error?: (string|null); + } + + /** Represents an ExitInfo. */ + class ExitInfo implements IExitInfo { + + /** + * Constructs a new ExitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo); + + /** ExitInfo exitCode. */ + public exitCode: number; + + /** ExitInfo error. */ + public error: string; + + /** + * Creates a new ExitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExitInfo instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo; + + /** + * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo; + + /** + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo; + + /** + * Verifies an ExitInfo message. + * @param message Plain 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 ExitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExitInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo; + + /** + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. + * @param message ExitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExitInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -1646,4651 +1819,6842 @@ export namespace google { } } - /** Properties of a DatabaseConfig. */ - interface IDatabaseConfig { + /** Properties of a SaveSnapshotRequest. */ + interface ISaveSnapshotRequest { - /** DatabaseConfig machineType */ - machineType?: (string|null); + /** SaveSnapshotRequest environment */ + environment?: (string|null); + + /** SaveSnapshotRequest snapshotLocation */ + snapshotLocation?: (string|null); } - /** Represents a DatabaseConfig. */ - class DatabaseConfig implements IDatabaseConfig { + /** Represents a SaveSnapshotRequest. */ + class SaveSnapshotRequest implements ISaveSnapshotRequest { /** - * Constructs a new DatabaseConfig. + * Constructs a new SaveSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest); - /** DatabaseConfig machineType. */ - public machineType: string; + /** SaveSnapshotRequest environment. */ + public environment: string; + + /** SaveSnapshotRequest snapshotLocation. */ + public snapshotLocation: string; /** - * Creates a new DatabaseConfig instance using the specified properties. + * Creates a new SaveSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DatabaseConfig instance + * @returns SaveSnapshotRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DatabaseConfig + * @returns SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DatabaseConfig + * @returns SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; /** - * Verifies a DatabaseConfig message. + * Verifies a SaveSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DatabaseConfig + * @returns SaveSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. - * @param message DatabaseConfig + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * @param message SaveSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DatabaseConfig to JSON. + * Converts this SaveSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for SaveSnapshotRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WebServerConfig. */ - interface IWebServerConfig { + /** Properties of a SaveSnapshotResponse. */ + interface ISaveSnapshotResponse { - /** WebServerConfig machineType */ - machineType?: (string|null); + /** SaveSnapshotResponse snapshotPath */ + snapshotPath?: (string|null); } - /** Represents a WebServerConfig. */ - class WebServerConfig implements IWebServerConfig { + /** Represents a SaveSnapshotResponse. */ + class SaveSnapshotResponse implements ISaveSnapshotResponse { /** - * Constructs a new WebServerConfig. + * Constructs a new SaveSnapshotResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse); - /** WebServerConfig machineType. */ - public machineType: string; + /** SaveSnapshotResponse snapshotPath. */ + public snapshotPath: string; /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerConfig instance + * @returns SaveSnapshotResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerConfig + * @returns SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerConfig + * @returns SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Verifies a WebServerConfig message. + * Verifies a SaveSnapshotResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerConfig + * @returns SaveSnapshotResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. - * @param message WebServerConfig + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * @param message SaveSnapshotResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerConfig to JSON. + * Converts this SaveSnapshotResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerConfig + * Gets the default type url for SaveSnapshotResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { + /** Properties of a LoadSnapshotRequest. */ + interface ILoadSnapshotRequest { - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); + /** LoadSnapshotRequest environment */ + environment?: (string|null); + + /** LoadSnapshotRequest snapshotPath */ + snapshotPath?: (string|null); + + /** LoadSnapshotRequest skipPypiPackagesInstallation */ + skipPypiPackagesInstallation?: (boolean|null); + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ + skipEnvironmentVariablesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipAirflowOverridesSetting */ + skipAirflowOverridesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipGcsDataCopying */ + skipGcsDataCopying?: (boolean|null); } - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { + /** Represents a LoadSnapshotRequest. */ + class LoadSnapshotRequest implements ILoadSnapshotRequest { /** - * Constructs a new EncryptionConfig. + * Constructs a new LoadSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest); - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; + /** LoadSnapshotRequest environment. */ + public environment: string; + + /** LoadSnapshotRequest snapshotPath. */ + public snapshotPath: string; + + /** LoadSnapshotRequest skipPypiPackagesInstallation. */ + public skipPypiPackagesInstallation: boolean; + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ + public skipEnvironmentVariablesSetting: boolean; + + /** LoadSnapshotRequest skipAirflowOverridesSetting. */ + public skipAirflowOverridesSetting: boolean; + + /** LoadSnapshotRequest skipGcsDataCopying. */ + public skipGcsDataCopying: boolean; /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new LoadSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionConfig instance + * @returns LoadSnapshotRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionConfig + * @returns LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionConfig + * @returns LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Verifies an EncryptionConfig message. + * Verifies a LoadSnapshotRequest message. * @param message Plain 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionConfig + * @returns LoadSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @param message LoadSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionConfig to JSON. + * Converts this LoadSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for LoadSnapshotRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MaintenanceWindow. */ - interface IMaintenanceWindow { - - /** MaintenanceWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** MaintenanceWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** MaintenanceWindow recurrence */ - recurrence?: (string|null); + /** Properties of a LoadSnapshotResponse. */ + interface ILoadSnapshotResponse { } - /** Represents a MaintenanceWindow. */ - class MaintenanceWindow implements IMaintenanceWindow { + /** Represents a LoadSnapshotResponse. */ + class LoadSnapshotResponse implements ILoadSnapshotResponse { /** - * Constructs a new MaintenanceWindow. + * Constructs a new LoadSnapshotResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow); - - /** MaintenanceWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** MaintenanceWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** MaintenanceWindow recurrence. */ - public recurrence: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse); /** - * Creates a new MaintenanceWindow instance using the specified properties. + * Creates a new LoadSnapshotResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MaintenanceWindow instance + * @returns LoadSnapshotResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MaintenanceWindow + * @returns LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MaintenanceWindow + * @returns LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; /** - * Verifies a MaintenanceWindow message. + * Verifies a LoadSnapshotResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MaintenanceWindow + * @returns LoadSnapshotResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @param message MaintenanceWindow + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @param message LoadSnapshotResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MaintenanceWindow to JSON. + * Converts this LoadSnapshotResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MaintenanceWindow + * Gets the default type url for LoadSnapshotResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SoftwareConfig. */ - interface ISoftwareConfig { - - /** SoftwareConfig imageVersion */ - imageVersion?: (string|null); - - /** SoftwareConfig airflowConfigOverrides */ - airflowConfigOverrides?: ({ [k: string]: string }|null); - - /** SoftwareConfig pypiPackages */ - pypiPackages?: ({ [k: string]: string }|null); - - /** SoftwareConfig envVariables */ - envVariables?: ({ [k: string]: string }|null); - - /** SoftwareConfig pythonVersion */ - pythonVersion?: (string|null); + /** Properties of a DatabaseFailoverRequest. */ + interface IDatabaseFailoverRequest { - /** SoftwareConfig schedulerCount */ - schedulerCount?: (number|null); + /** DatabaseFailoverRequest environment */ + environment?: (string|null); } - /** Represents a SoftwareConfig. */ - class SoftwareConfig implements ISoftwareConfig { + /** Represents a DatabaseFailoverRequest. */ + class DatabaseFailoverRequest implements IDatabaseFailoverRequest { /** - * Constructs a new SoftwareConfig. + * Constructs a new DatabaseFailoverRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig); - - /** SoftwareConfig imageVersion. */ - public imageVersion: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest); - /** SoftwareConfig airflowConfigOverrides. */ - public airflowConfigOverrides: { [k: string]: string }; - - /** SoftwareConfig pypiPackages. */ - public pypiPackages: { [k: string]: string }; - - /** SoftwareConfig envVariables. */ - public envVariables: { [k: string]: string }; - - /** SoftwareConfig pythonVersion. */ - public pythonVersion: string; - - /** SoftwareConfig schedulerCount. */ - public schedulerCount: number; + /** DatabaseFailoverRequest environment. */ + public environment: string; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new DatabaseFailoverRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SoftwareConfig instance + * @returns DatabaseFailoverRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified DatabaseFailoverRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest.verify|verify} messages. + * @param message DatabaseFailoverRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified DatabaseFailoverRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest.verify|verify} messages. + * @param message DatabaseFailoverRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SoftwareConfig + * @returns DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SoftwareConfig + * @returns DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest; /** - * Verifies a SoftwareConfig message. + * Verifies a DatabaseFailoverRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SoftwareConfig + * @returns DatabaseFailoverRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. - * @param message SoftwareConfig + * Creates a plain object from a DatabaseFailoverRequest message. Also converts values to other types if specified. + * @param message DatabaseFailoverRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SoftwareConfig to JSON. + * Converts this DatabaseFailoverRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for DatabaseFailoverRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a IPAllocationPolicy. */ - interface IIPAllocationPolicy { - - /** IPAllocationPolicy useIpAliases */ - useIpAliases?: (boolean|null); + /** Properties of a DatabaseFailoverResponse. */ + interface IDatabaseFailoverResponse { + } - /** IPAllocationPolicy clusterSecondaryRangeName */ - clusterSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy clusterIpv4CidrBlock */ - clusterIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy servicesSecondaryRangeName */ - servicesSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy servicesIpv4CidrBlock */ - servicesIpv4CidrBlock?: (string|null); - } - - /** Represents a IPAllocationPolicy. */ - class IPAllocationPolicy implements IIPAllocationPolicy { + /** Represents a DatabaseFailoverResponse. */ + class DatabaseFailoverResponse implements IDatabaseFailoverResponse { /** - * Constructs a new IPAllocationPolicy. + * Constructs a new DatabaseFailoverResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy); - - /** IPAllocationPolicy useIpAliases. */ - public useIpAliases: boolean; - - /** IPAllocationPolicy clusterSecondaryRangeName. */ - public clusterSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy clusterIpv4CidrBlock. */ - public clusterIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy servicesSecondaryRangeName. */ - public servicesSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy servicesIpv4CidrBlock. */ - public servicesIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy clusterIpAllocation. */ - public clusterIpAllocation?: ("clusterSecondaryRangeName"|"clusterIpv4CidrBlock"); - - /** IPAllocationPolicy servicesIpAllocation. */ - public servicesIpAllocation?: ("servicesSecondaryRangeName"|"servicesIpv4CidrBlock"); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse); /** - * Creates a new IPAllocationPolicy instance using the specified properties. + * Creates a new DatabaseFailoverResponse instance using the specified properties. * @param [properties] Properties to set - * @returns IPAllocationPolicy instance + * @returns DatabaseFailoverResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse; /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified DatabaseFailoverResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse.verify|verify} messages. + * @param message DatabaseFailoverResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified DatabaseFailoverResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse.verify|verify} messages. + * @param message DatabaseFailoverResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IPAllocationPolicy + * @returns DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IPAllocationPolicy + * @returns DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse; /** - * Verifies a IPAllocationPolicy message. + * Verifies a DatabaseFailoverResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IPAllocationPolicy + * @returns DatabaseFailoverResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. - * @param message IPAllocationPolicy + * Creates a plain object from a DatabaseFailoverResponse message. Also converts values to other types if specified. + * @param message DatabaseFailoverResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this DatabaseFailoverResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for DatabaseFailoverResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NodeConfig. */ - interface INodeConfig { - - /** NodeConfig location */ - location?: (string|null); - - /** NodeConfig machineType */ - machineType?: (string|null); - - /** NodeConfig network */ - network?: (string|null); - - /** NodeConfig subnetwork */ - subnetwork?: (string|null); - - /** NodeConfig diskSizeGb */ - diskSizeGb?: (number|null); - - /** NodeConfig oauthScopes */ - oauthScopes?: (string[]|null); - - /** NodeConfig serviceAccount */ - serviceAccount?: (string|null); - - /** NodeConfig tags */ - tags?: (string[]|null); - - /** NodeConfig ipAllocationPolicy */ - ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + /** Properties of a FetchDatabasePropertiesRequest. */ + interface IFetchDatabasePropertiesRequest { - /** NodeConfig enableIpMasqAgent */ - enableIpMasqAgent?: (boolean|null); + /** FetchDatabasePropertiesRequest environment */ + environment?: (string|null); } - /** Represents a NodeConfig. */ - class NodeConfig implements INodeConfig { + /** Represents a FetchDatabasePropertiesRequest. */ + class FetchDatabasePropertiesRequest implements IFetchDatabasePropertiesRequest { /** - * Constructs a new NodeConfig. + * Constructs a new FetchDatabasePropertiesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig); - - /** NodeConfig location. */ - public location: string; - - /** NodeConfig machineType. */ - public machineType: string; - - /** NodeConfig network. */ - public network: string; - - /** NodeConfig subnetwork. */ - public subnetwork: string; - - /** NodeConfig diskSizeGb. */ - public diskSizeGb: number; - - /** NodeConfig oauthScopes. */ - public oauthScopes: string[]; - - /** NodeConfig serviceAccount. */ - public serviceAccount: string; - - /** NodeConfig tags. */ - public tags: string[]; - - /** NodeConfig ipAllocationPolicy. */ - public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest); - /** NodeConfig enableIpMasqAgent. */ - public enableIpMasqAgent: boolean; + /** FetchDatabasePropertiesRequest environment. */ + public environment: string; /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new FetchDatabasePropertiesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NodeConfig instance + * @returns FetchDatabasePropertiesRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified FetchDatabasePropertiesRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest.verify|verify} messages. + * @param message FetchDatabasePropertiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified FetchDatabasePropertiesRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest.verify|verify} messages. + * @param message FetchDatabasePropertiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NodeConfig + * @returns FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NodeConfig + * @returns FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest; /** - * Verifies a NodeConfig message. + * Verifies a FetchDatabasePropertiesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NodeConfig + * @returns FetchDatabasePropertiesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. - * @param message NodeConfig + * Creates a plain object from a FetchDatabasePropertiesRequest message. Also converts values to other types if specified. + * @param message FetchDatabasePropertiesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NodeConfig to JSON. + * Converts this FetchDatabasePropertiesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for FetchDatabasePropertiesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrivateClusterConfig. */ - interface IPrivateClusterConfig { + /** Properties of a FetchDatabasePropertiesResponse. */ + interface IFetchDatabasePropertiesResponse { - /** PrivateClusterConfig enablePrivateEndpoint */ - enablePrivateEndpoint?: (boolean|null); + /** FetchDatabasePropertiesResponse primaryGceZone */ + primaryGceZone?: (string|null); - /** PrivateClusterConfig masterIpv4CidrBlock */ - masterIpv4CidrBlock?: (string|null); + /** FetchDatabasePropertiesResponse secondaryGceZone */ + secondaryGceZone?: (string|null); - /** PrivateClusterConfig masterIpv4ReservedRange */ - masterIpv4ReservedRange?: (string|null); + /** FetchDatabasePropertiesResponse isFailoverReplicaAvailable */ + isFailoverReplicaAvailable?: (boolean|null); } - /** Represents a PrivateClusterConfig. */ - class PrivateClusterConfig implements IPrivateClusterConfig { + /** Represents a FetchDatabasePropertiesResponse. */ + class FetchDatabasePropertiesResponse implements IFetchDatabasePropertiesResponse { /** - * Constructs a new PrivateClusterConfig. + * Constructs a new FetchDatabasePropertiesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse); - /** PrivateClusterConfig enablePrivateEndpoint. */ - public enablePrivateEndpoint: boolean; + /** FetchDatabasePropertiesResponse primaryGceZone. */ + public primaryGceZone: string; - /** PrivateClusterConfig masterIpv4CidrBlock. */ - public masterIpv4CidrBlock: string; + /** FetchDatabasePropertiesResponse secondaryGceZone. */ + public secondaryGceZone: string; - /** PrivateClusterConfig masterIpv4ReservedRange. */ - public masterIpv4ReservedRange: string; + /** FetchDatabasePropertiesResponse isFailoverReplicaAvailable. */ + public isFailoverReplicaAvailable: boolean; /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * Creates a new FetchDatabasePropertiesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateClusterConfig instance + * @returns FetchDatabasePropertiesResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified FetchDatabasePropertiesResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse.verify|verify} messages. + * @param message FetchDatabasePropertiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified FetchDatabasePropertiesResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse.verify|verify} messages. + * @param message FetchDatabasePropertiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateClusterConfig + * @returns FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateClusterConfig + * @returns FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse; /** - * Verifies a PrivateClusterConfig message. + * Verifies a FetchDatabasePropertiesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateClusterConfig + * @returns FetchDatabasePropertiesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse; /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. - * @param message PrivateClusterConfig + * Creates a plain object from a FetchDatabasePropertiesResponse message. Also converts values to other types if specified. + * @param message FetchDatabasePropertiesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this FetchDatabasePropertiesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for FetchDatabasePropertiesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NetworkingConfig. */ - interface INetworkingConfig { + /** Properties of an EnvironmentConfig. */ + interface IEnvironmentConfig { - /** NetworkingConfig connectionType */ - connectionType?: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null); - } + /** EnvironmentConfig gkeCluster */ + gkeCluster?: (string|null); - /** Represents a NetworkingConfig. */ - class NetworkingConfig implements INetworkingConfig { + /** EnvironmentConfig dagGcsPrefix */ + dagGcsPrefix?: (string|null); - /** - * Constructs a new NetworkingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig); + /** EnvironmentConfig nodeCount */ + nodeCount?: (number|null); - /** NetworkingConfig connectionType. */ - public connectionType: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType); + /** EnvironmentConfig softwareConfig */ + softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); - /** - * Creates a new NetworkingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkingConfig instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; + /** EnvironmentConfig nodeConfig */ + nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); - /** - * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. - * @param message NetworkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnvironmentConfig privateEnvironmentConfig */ + privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); - /** - * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. - * @param message NetworkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnvironmentConfig webServerNetworkAccessControl */ + webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); - /** - * Decodes a NetworkingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; + /** EnvironmentConfig databaseConfig */ + databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); - /** - * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; - - /** - * Verifies a NetworkingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnvironmentConfig webServerConfig */ + webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); - /** - * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; + /** EnvironmentConfig encryptionConfig */ + encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); - /** - * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. - * @param message NetworkingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.NetworkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnvironmentConfig maintenanceWindow */ + maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); - /** - * Converts this NetworkingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** EnvironmentConfig workloadsConfig */ + workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); - /** - * Gets the default type url for NetworkingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** EnvironmentConfig environmentSize */ + environmentSize?: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null); - namespace NetworkingConfig { + /** EnvironmentConfig airflowUri */ + airflowUri?: (string|null); - /** ConnectionType enum. */ - enum ConnectionType { - CONNECTION_TYPE_UNSPECIFIED = 0, - VPC_PEERING = 1, - PRIVATE_SERVICE_CONNECT = 2 - } - } + /** EnvironmentConfig airflowByoidUri */ + airflowByoidUri?: (string|null); - /** Properties of a PrivateEnvironmentConfig. */ - interface IPrivateEnvironmentConfig { + /** EnvironmentConfig masterAuthorizedNetworksConfig */ + masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); - /** PrivateEnvironmentConfig enablePrivateEnvironment */ - enablePrivateEnvironment?: (boolean|null); + /** EnvironmentConfig recoveryConfig */ + recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); - /** PrivateEnvironmentConfig privateClusterConfig */ - privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); + /** EnvironmentConfig resilienceMode */ + resilienceMode?: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode|null); + } - /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ - webServerIpv4CidrBlock?: (string|null); + /** Represents an EnvironmentConfig. */ + class EnvironmentConfig implements IEnvironmentConfig { - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ - cloudSqlIpv4CidrBlock?: (string|null); + /** + * Constructs a new EnvironmentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig); - /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ - webServerIpv4ReservedRange?: (string|null); + /** EnvironmentConfig gkeCluster. */ + public gkeCluster: string; - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock */ - cloudComposerNetworkIpv4CidrBlock?: (string|null); + /** EnvironmentConfig dagGcsPrefix. */ + public dagGcsPrefix: string; - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange */ - cloudComposerNetworkIpv4ReservedRange?: (string|null); + /** EnvironmentConfig nodeCount. */ + public nodeCount: number; - /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps */ - enablePrivatelyUsedPublicIps?: (boolean|null); + /** EnvironmentConfig softwareConfig. */ + public softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); - /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork */ - cloudComposerConnectionSubnetwork?: (string|null); + /** EnvironmentConfig nodeConfig. */ + public nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); - /** PrivateEnvironmentConfig networkingConfig */ - networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); - } + /** EnvironmentConfig privateEnvironmentConfig. */ + public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); - /** Represents a PrivateEnvironmentConfig. */ - class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { + /** EnvironmentConfig webServerNetworkAccessControl. */ + public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); - /** - * Constructs a new PrivateEnvironmentConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig); + /** EnvironmentConfig databaseConfig. */ + public databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); - /** PrivateEnvironmentConfig enablePrivateEnvironment. */ - public enablePrivateEnvironment: boolean; + /** EnvironmentConfig webServerConfig. */ + public webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); - /** PrivateEnvironmentConfig privateClusterConfig. */ - public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); + /** EnvironmentConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); - /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ - public webServerIpv4CidrBlock: string; + /** EnvironmentConfig maintenanceWindow. */ + public maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ - public cloudSqlIpv4CidrBlock: string; + /** EnvironmentConfig workloadsConfig. */ + public workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); - /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ - public webServerIpv4ReservedRange: string; + /** EnvironmentConfig environmentSize. */ + public environmentSize: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize); - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. */ - public cloudComposerNetworkIpv4CidrBlock: string; + /** EnvironmentConfig airflowUri. */ + public airflowUri: string; - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. */ - public cloudComposerNetworkIpv4ReservedRange: string; + /** EnvironmentConfig airflowByoidUri. */ + public airflowByoidUri: string; - /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. */ - public enablePrivatelyUsedPublicIps: boolean; + /** EnvironmentConfig masterAuthorizedNetworksConfig. */ + public masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); - /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. */ - public cloudComposerConnectionSubnetwork: string; + /** EnvironmentConfig recoveryConfig. */ + public recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); - /** PrivateEnvironmentConfig networkingConfig. */ - public networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); + /** EnvironmentConfig resilienceMode. */ + public resilienceMode: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode); /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * Creates a new EnvironmentConfig instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateEnvironmentConfig instance + * @returns EnvironmentConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * Decodes an EnvironmentConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateEnvironmentConfig + * @returns EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateEnvironmentConfig + * @returns EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Verifies a PrivateEnvironmentConfig message. + * Verifies an EnvironmentConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateEnvironmentConfig + * @returns EnvironmentConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. - * @param message PrivateEnvironmentConfig + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @param message EnvironmentConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateEnvironmentConfig to JSON. + * Converts this EnvironmentConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateEnvironmentConfig + * Gets the default type url for EnvironmentConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkloadsConfig. */ - interface IWorkloadsConfig { + namespace EnvironmentConfig { - /** WorkloadsConfig scheduler */ - scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); + /** EnvironmentSize enum. */ + enum EnvironmentSize { + ENVIRONMENT_SIZE_UNSPECIFIED = 0, + ENVIRONMENT_SIZE_SMALL = 1, + ENVIRONMENT_SIZE_MEDIUM = 2, + ENVIRONMENT_SIZE_LARGE = 3 + } - /** WorkloadsConfig webServer */ - webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + /** ResilienceMode enum. */ + enum ResilienceMode { + RESILIENCE_MODE_UNSPECIFIED = 0, + HIGH_RESILIENCE = 1 + } + } - /** WorkloadsConfig worker */ - worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); + /** Properties of a WebServerNetworkAccessControl. */ + interface IWebServerNetworkAccessControl { + + /** WebServerNetworkAccessControl allowedIpRanges */ + allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); } - /** Represents a WorkloadsConfig. */ - class WorkloadsConfig implements IWorkloadsConfig { + /** Represents a WebServerNetworkAccessControl. */ + class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { /** - * Constructs a new WorkloadsConfig. + * Constructs a new WebServerNetworkAccessControl. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig); - - /** WorkloadsConfig scheduler. */ - public scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); - - /** WorkloadsConfig webServer. */ - public webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl); - /** WorkloadsConfig worker. */ - public worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); + /** WebServerNetworkAccessControl allowedIpRanges. */ + public allowedIpRanges: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]; /** - * Creates a new WorkloadsConfig instance using the specified properties. + * Creates a new WebServerNetworkAccessControl instance using the specified properties. * @param [properties] Properties to set - * @returns WorkloadsConfig instance + * @returns WebServerNetworkAccessControl instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. - * @param message WorkloadsConfig message or plain object to encode + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. - * @param message WorkloadsConfig message or plain object to encode + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkloadsConfig message from the specified reader or buffer. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkloadsConfig + * @returns WebServerNetworkAccessControl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkloadsConfig + * @returns WebServerNetworkAccessControl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Verifies a WorkloadsConfig message. + * Verifies a WebServerNetworkAccessControl message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkloadsConfig + * @returns WebServerNetworkAccessControl */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. - * @param message WorkloadsConfig + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * @param message WebServerNetworkAccessControl * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkloadsConfig to JSON. + * Converts this WebServerNetworkAccessControl to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WorkloadsConfig + * Gets the default type url for WebServerNetworkAccessControl * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace WorkloadsConfig { - - /** Properties of a SchedulerResource. */ - interface ISchedulerResource { - - /** SchedulerResource cpu */ - cpu?: (number|null); + namespace WebServerNetworkAccessControl { - /** SchedulerResource memoryGb */ - memoryGb?: (number|null); + /** Properties of an AllowedIpRange. */ + interface IAllowedIpRange { - /** SchedulerResource storageGb */ - storageGb?: (number|null); + /** AllowedIpRange value */ + value?: (string|null); - /** SchedulerResource count */ - count?: (number|null); + /** AllowedIpRange description */ + description?: (string|null); } - /** Represents a SchedulerResource. */ - class SchedulerResource implements ISchedulerResource { + /** Represents an AllowedIpRange. */ + class AllowedIpRange implements IAllowedIpRange { /** - * Constructs a new SchedulerResource. + * Constructs a new AllowedIpRange. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource); - - /** SchedulerResource cpu. */ - public cpu: number; - - /** SchedulerResource memoryGb. */ - public memoryGb: number; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange); - /** SchedulerResource storageGb. */ - public storageGb: number; + /** AllowedIpRange value. */ + public value: string; - /** SchedulerResource count. */ - public count: number; + /** AllowedIpRange description. */ + public description: string; /** - * Creates a new SchedulerResource instance using the specified properties. + * Creates a new AllowedIpRange instance using the specified properties. * @param [properties] Properties to set - * @returns SchedulerResource instance + * @returns AllowedIpRange instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; /** - * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @param message SchedulerResource message or plain object to encode + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @param message SchedulerResource message or plain object to encode + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SchedulerResource message from the specified reader or buffer. + * Decodes an AllowedIpRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SchedulerResource + * @returns AllowedIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; /** - * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SchedulerResource + * @returns AllowedIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; /** - * Verifies a SchedulerResource message. + * Verifies an AllowedIpRange message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SchedulerResource + * @returns AllowedIpRange */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; /** - * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. - * @param message SchedulerResource + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @param message AllowedIpRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SchedulerResource to JSON. + * Converts this AllowedIpRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SchedulerResource + * Gets the default type url for AllowedIpRange * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of a WebServerResource. */ - interface IWebServerResource { - - /** WebServerResource cpu */ - cpu?: (number|null); + /** Properties of a DatabaseConfig. */ + interface IDatabaseConfig { - /** WebServerResource memoryGb */ - memoryGb?: (number|null); + /** DatabaseConfig machineType */ + machineType?: (string|null); + } - /** WebServerResource storageGb */ - storageGb?: (number|null); - } + /** Represents a DatabaseConfig. */ + class DatabaseConfig implements IDatabaseConfig { - /** Represents a WebServerResource. */ - class WebServerResource implements IWebServerResource { + /** + * Constructs a new DatabaseConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig); - /** - * Constructs a new WebServerResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource); + /** DatabaseConfig machineType. */ + public machineType: string; - /** WebServerResource cpu. */ - public cpu: number; + /** + * Creates a new DatabaseConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; - /** WebServerResource memoryGb. */ - public memoryGb: number; + /** + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebServerResource storageGb. */ - public storageGb: number; + /** + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new WebServerResource instance using the specified properties. - * @param [properties] Properties to set - * @returns WebServerResource instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + /** + * Decodes a DatabaseConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; - /** - * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @param message WebServerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; - /** - * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @param message WebServerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a DatabaseConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a WebServerResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + /** + * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; - /** - * Decodes a WebServerResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + /** + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * @param message DatabaseConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a WebServerResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebServerResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; - - /** - * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. - * @param message WebServerResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebServerResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WebServerResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkerResource. */ - interface IWorkerResource { - - /** WorkerResource cpu */ - cpu?: (number|null); - - /** WorkerResource memoryGb */ - memoryGb?: (number|null); - - /** WorkerResource storageGb */ - storageGb?: (number|null); - - /** WorkerResource minCount */ - minCount?: (number|null); - - /** WorkerResource maxCount */ - maxCount?: (number|null); - } - - /** Represents a WorkerResource. */ - class WorkerResource implements IWorkerResource { - - /** - * Constructs a new WorkerResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource); - - /** WorkerResource cpu. */ - public cpu: number; - - /** WorkerResource memoryGb. */ - public memoryGb: number; - - /** WorkerResource storageGb. */ - public storageGb: number; - - /** WorkerResource minCount. */ - public minCount: number; - - /** WorkerResource maxCount. */ - public maxCount: number; - - /** - * Creates a new WorkerResource instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerResource instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; - - /** - * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @param message WorkerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @param message WorkerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; - - /** - * Decodes a WorkerResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; - - /** - * Verifies a WorkerResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; - - /** - * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. - * @param message WorkerResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this DatabaseConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for WorkerResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for DatabaseConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RecoveryConfig. */ - interface IRecoveryConfig { + /** Properties of a WebServerConfig. */ + interface IWebServerConfig { - /** RecoveryConfig scheduledSnapshotsConfig */ - scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + /** WebServerConfig machineType */ + machineType?: (string|null); } - /** Represents a RecoveryConfig. */ - class RecoveryConfig implements IRecoveryConfig { + /** Represents a WebServerConfig. */ + class WebServerConfig implements IWebServerConfig { /** - * Constructs a new RecoveryConfig. + * Constructs a new WebServerConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig); - /** RecoveryConfig scheduledSnapshotsConfig. */ - public scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + /** WebServerConfig machineType. */ + public machineType: string; /** - * Creates a new RecoveryConfig instance using the specified properties. + * Creates a new WebServerConfig instance using the specified properties. * @param [properties] Properties to set - * @returns RecoveryConfig instance + * @returns WebServerConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. - * @param message RecoveryConfig message or plain object to encode + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. - * @param message RecoveryConfig message or plain object to encode + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecoveryConfig message from the specified reader or buffer. + * Decodes a WebServerConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecoveryConfig + * @returns WebServerConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecoveryConfig + * @returns WebServerConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Verifies a RecoveryConfig message. + * Verifies a WebServerConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecoveryConfig + * @returns WebServerConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. - * @param message RecoveryConfig + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * @param message WebServerConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.RecoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecoveryConfig to JSON. + * Converts this WebServerConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RecoveryConfig + * Gets the default type url for WebServerConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ScheduledSnapshotsConfig. */ - interface IScheduledSnapshotsConfig { - - /** ScheduledSnapshotsConfig enabled */ - enabled?: (boolean|null); - - /** ScheduledSnapshotsConfig snapshotLocation */ - snapshotLocation?: (string|null); - - /** ScheduledSnapshotsConfig snapshotCreationSchedule */ - snapshotCreationSchedule?: (string|null); + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { - /** ScheduledSnapshotsConfig timeZone */ - timeZone?: (string|null); + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); } - /** Represents a ScheduledSnapshotsConfig. */ - class ScheduledSnapshotsConfig implements IScheduledSnapshotsConfig { + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { /** - * Constructs a new ScheduledSnapshotsConfig. + * Constructs a new EncryptionConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig); - - /** ScheduledSnapshotsConfig enabled. */ - public enabled: boolean; - - /** ScheduledSnapshotsConfig snapshotLocation. */ - public snapshotLocation: string; - - /** ScheduledSnapshotsConfig snapshotCreationSchedule. */ - public snapshotCreationSchedule: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig); - /** ScheduledSnapshotsConfig timeZone. */ - public timeZone: string; + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; /** - * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * Creates a new EncryptionConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ScheduledSnapshotsConfig instance + * @returns EncryptionConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. - * @param message ScheduledSnapshotsConfig message or plain object to encode + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. - * @param message ScheduledSnapshotsConfig message or plain object to encode + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * Decodes an EncryptionConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ScheduledSnapshotsConfig + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ScheduledSnapshotsConfig + * @returns EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Verifies a ScheduledSnapshotsConfig message. + * Verifies an EncryptionConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ScheduledSnapshotsConfig + * @returns EncryptionConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. - * @param message ScheduledSnapshotsConfig + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ScheduledSnapshotsConfig to JSON. + * Converts this EncryptionConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ScheduledSnapshotsConfig + * Gets the default type url for EncryptionConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MasterAuthorizedNetworksConfig. */ - interface IMasterAuthorizedNetworksConfig { + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { - /** MasterAuthorizedNetworksConfig enabled */ - enabled?: (boolean|null); + /** MaintenanceWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** MasterAuthorizedNetworksConfig cidrBlocks */ - cidrBlocks?: (google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]|null); + /** MaintenanceWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow recurrence */ + recurrence?: (string|null); } - /** Represents a MasterAuthorizedNetworksConfig. */ - class MasterAuthorizedNetworksConfig implements IMasterAuthorizedNetworksConfig { + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { /** - * Constructs a new MasterAuthorizedNetworksConfig. + * Constructs a new MaintenanceWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow); - /** MasterAuthorizedNetworksConfig enabled. */ - public enabled: boolean; + /** MaintenanceWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** MasterAuthorizedNetworksConfig cidrBlocks. */ - public cidrBlocks: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]; + /** MaintenanceWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow recurrence. */ + public recurrence: string; /** - * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. + * Creates a new MaintenanceWindow instance using the specified properties. * @param [properties] Properties to set - * @returns MasterAuthorizedNetworksConfig instance + * @returns MaintenanceWindow instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. - * @param message MasterAuthorizedNetworksConfig message or plain object to encode + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. - * @param message MasterAuthorizedNetworksConfig message or plain object to encode + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. + * Decodes a MaintenanceWindow message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MasterAuthorizedNetworksConfig + * @returns MaintenanceWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MasterAuthorizedNetworksConfig + * @returns MaintenanceWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Verifies a MasterAuthorizedNetworksConfig message. + * Verifies a MaintenanceWindow message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MasterAuthorizedNetworksConfig + * @returns MaintenanceWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. - * @param message MasterAuthorizedNetworksConfig + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MasterAuthorizedNetworksConfig to JSON. + * Converts this MaintenanceWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MasterAuthorizedNetworksConfig + * Gets the default type url for MaintenanceWindow * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MasterAuthorizedNetworksConfig { - - /** Properties of a CidrBlock. */ - interface ICidrBlock { + /** Properties of a SoftwareConfig. */ + interface ISoftwareConfig { - /** CidrBlock displayName */ - displayName?: (string|null); + /** SoftwareConfig imageVersion */ + imageVersion?: (string|null); - /** CidrBlock cidrBlock */ - cidrBlock?: (string|null); - } + /** SoftwareConfig airflowConfigOverrides */ + airflowConfigOverrides?: ({ [k: string]: string }|null); - /** Represents a CidrBlock. */ - class CidrBlock implements ICidrBlock { + /** SoftwareConfig pypiPackages */ + pypiPackages?: ({ [k: string]: string }|null); - /** - * Constructs a new CidrBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock); + /** SoftwareConfig envVariables */ + envVariables?: ({ [k: string]: string }|null); - /** CidrBlock displayName. */ - public displayName: string; + /** SoftwareConfig pythonVersion */ + pythonVersion?: (string|null); - /** CidrBlock cidrBlock. */ - public cidrBlock: string; + /** SoftwareConfig schedulerCount */ + schedulerCount?: (number|null); + } - /** - * Creates a new CidrBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns CidrBlock instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + /** Represents a SoftwareConfig. */ + class SoftwareConfig implements ISoftwareConfig { - /** - * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. - * @param message CidrBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new SoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig); - /** - * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. - * @param message CidrBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + /** SoftwareConfig imageVersion. */ + public imageVersion: string; - /** - * Decodes a CidrBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CidrBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + /** SoftwareConfig airflowConfigOverrides. */ + public airflowConfigOverrides: { [k: string]: string }; - /** - * Decodes a CidrBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CidrBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + /** SoftwareConfig pypiPackages. */ + public pypiPackages: { [k: string]: string }; - /** - * Verifies a CidrBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SoftwareConfig envVariables. */ + public envVariables: { [k: string]: string }; - /** - * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CidrBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + /** SoftwareConfig pythonVersion. */ + public pythonVersion: string; - /** - * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. - * @param message CidrBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CidrBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CidrBlock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment name */ - name?: (string|null); - - /** Environment config */ - config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); - - /** Environment uuid */ - uuid?: (string|null); - - /** Environment state */ - state?: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State|null); - - /** Environment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Environment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Environment labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an Environment. */ - class Environment implements IEnvironment { - - /** - * Constructs a new Environment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment); - - /** Environment name. */ - public name: string; - - /** Environment config. */ - public config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); - - /** Environment uuid. */ - public uuid: string; - - /** Environment state. */ - public state: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State); - - /** Environment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Environment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Environment labels. */ - public labels: { [k: string]: string }; + /** SoftwareConfig schedulerCount. */ + public schedulerCount: number; /** - * Creates a new Environment instance using the specified properties. + * Creates a new SoftwareConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Environment instance + * @returns SoftwareConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment): google.cloud.orchestration.airflow.service.v1.Environment; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a SoftwareConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Environment + * @returns SoftwareConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.Environment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Environment + * @returns SoftwareConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.Environment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Verifies an Environment message. + * Verifies a SoftwareConfig message. * @param message Plain 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 Environment message from a plain object. Also converts values to their respective internal types. + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Environment + * @returns SoftwareConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.Environment; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @param message SoftwareConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Environment to JSON. + * Converts this SoftwareConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Environment + * Gets the default type url for SoftwareConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Environment { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - RUNNING = 2, - UPDATING = 3, - DELETING = 4, - ERROR = 5 - } - } - - /** Properties of a CheckUpgradeResponse. */ - interface ICheckUpgradeResponse { + /** Properties of a IPAllocationPolicy. */ + interface IIPAllocationPolicy { - /** CheckUpgradeResponse buildLogUri */ - buildLogUri?: (string|null); + /** IPAllocationPolicy useIpAliases */ + useIpAliases?: (boolean|null); - /** CheckUpgradeResponse containsPypiModulesConflict */ - containsPypiModulesConflict?: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null); + /** IPAllocationPolicy clusterSecondaryRangeName */ + clusterSecondaryRangeName?: (string|null); - /** CheckUpgradeResponse pypiConflictBuildLogExtract */ - pypiConflictBuildLogExtract?: (string|null); + /** IPAllocationPolicy clusterIpv4CidrBlock */ + clusterIpv4CidrBlock?: (string|null); - /** CheckUpgradeResponse imageVersion */ - imageVersion?: (string|null); + /** IPAllocationPolicy servicesSecondaryRangeName */ + servicesSecondaryRangeName?: (string|null); - /** CheckUpgradeResponse pypiDependencies */ - pypiDependencies?: ({ [k: string]: string }|null); + /** IPAllocationPolicy servicesIpv4CidrBlock */ + servicesIpv4CidrBlock?: (string|null); } - /** Represents a CheckUpgradeResponse. */ - class CheckUpgradeResponse implements ICheckUpgradeResponse { + /** Represents a IPAllocationPolicy. */ + class IPAllocationPolicy implements IIPAllocationPolicy { /** - * Constructs a new CheckUpgradeResponse. + * Constructs a new IPAllocationPolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy); - /** CheckUpgradeResponse buildLogUri. */ - public buildLogUri: string; + /** IPAllocationPolicy useIpAliases. */ + public useIpAliases: boolean; - /** CheckUpgradeResponse containsPypiModulesConflict. */ - public containsPypiModulesConflict: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult); + /** IPAllocationPolicy clusterSecondaryRangeName. */ + public clusterSecondaryRangeName?: (string|null); - /** CheckUpgradeResponse pypiConflictBuildLogExtract. */ - public pypiConflictBuildLogExtract: string; + /** IPAllocationPolicy clusterIpv4CidrBlock. */ + public clusterIpv4CidrBlock?: (string|null); - /** CheckUpgradeResponse imageVersion. */ - public imageVersion: string; + /** IPAllocationPolicy servicesSecondaryRangeName. */ + public servicesSecondaryRangeName?: (string|null); - /** CheckUpgradeResponse pypiDependencies. */ - public pypiDependencies: { [k: string]: string }; + /** IPAllocationPolicy servicesIpv4CidrBlock. */ + public servicesIpv4CidrBlock?: (string|null); + + /** IPAllocationPolicy clusterIpAllocation. */ + public clusterIpAllocation?: ("clusterSecondaryRangeName"|"clusterIpv4CidrBlock"); + + /** IPAllocationPolicy servicesIpAllocation. */ + public servicesIpAllocation?: ("servicesSecondaryRangeName"|"servicesIpv4CidrBlock"); /** - * Creates a new CheckUpgradeResponse instance using the specified properties. + * Creates a new IPAllocationPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns CheckUpgradeResponse instance + * @returns IPAllocationPolicy instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @param message CheckUpgradeResponse message or plain object to encode + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @param message CheckUpgradeResponse message or plain object to encode + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer. + * Decodes a IPAllocationPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CheckUpgradeResponse + * @returns IPAllocationPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CheckUpgradeResponse + * @returns IPAllocationPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Verifies a CheckUpgradeResponse message. + * Verifies a IPAllocationPolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CheckUpgradeResponse + * @returns IPAllocationPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. - * @param message CheckUpgradeResponse + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * @param message IPAllocationPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CheckUpgradeResponse to JSON. + * Converts this IPAllocationPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CheckUpgradeResponse + * Gets the default type url for IPAllocationPolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CheckUpgradeResponse { - - /** ConflictResult enum. */ - enum ConflictResult { - CONFLICT_RESULT_UNSPECIFIED = 0, - CONFLICT = 1, - NO_CONFLICT = 2 - } - } + /** Properties of a NodeConfig. */ + interface INodeConfig { - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { + /** NodeConfig location */ + location?: (string|null); - /** OperationMetadata state */ - state?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null); + /** NodeConfig machineType */ + machineType?: (string|null); - /** OperationMetadata operationType */ - operationType?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null); + /** NodeConfig network */ + network?: (string|null); - /** OperationMetadata resource */ - resource?: (string|null); + /** NodeConfig subnetwork */ + subnetwork?: (string|null); - /** OperationMetadata resourceUuid */ - resourceUuid?: (string|null); + /** NodeConfig diskSizeGb */ + diskSizeGb?: (number|null); - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig oauthScopes */ + oauthScopes?: (string[]|null); - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NodeConfig tags */ + tags?: (string[]|null); + + /** NodeConfig ipAllocationPolicy */ + ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + + /** NodeConfig enableIpMasqAgent */ + enableIpMasqAgent?: (boolean|null); } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { /** - * Constructs a new OperationMetadata. + * Constructs a new NodeConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig); - /** OperationMetadata state. */ - public state: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State); + /** NodeConfig location. */ + public location: string; - /** OperationMetadata operationType. */ - public operationType: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type); + /** NodeConfig machineType. */ + public machineType: string; - /** OperationMetadata resource. */ - public resource: string; + /** NodeConfig network. */ + public network: string; - /** OperationMetadata resourceUuid. */ - public resourceUuid: string; + /** NodeConfig subnetwork. */ + public subnetwork: string; - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig diskSizeGb. */ + public diskSizeGb: number; - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig oauthScopes. */ + public oauthScopes: string[]; + + /** NodeConfig serviceAccount. */ + public serviceAccount: string; + + /** NodeConfig tags. */ + public tags: string[]; + + /** NodeConfig ipAllocationPolicy. */ + public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + + /** NodeConfig enableIpMasqAgent. */ + public enableIpMasqAgent: boolean; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new NodeConfig instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns NodeConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a NodeConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns NodeConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns NodeConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Verifies an OperationMetadata message. + * Verifies a NodeConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns NodeConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this NodeConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for NodeConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace OperationMetadata { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - RUNNING = 2, - SUCCEEDED = 3, - SUCCESSFUL = 3, - FAILED = 4 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - CREATE = 1, - DELETE = 2, - UPDATE = 3, - CHECK = 4, - SAVE_SNAPSHOT = 5, - LOAD_SNAPSHOT = 6 - } - } - - /** Represents an ImageVersions */ - class ImageVersions extends $protobuf.rpc.Service { - - /** - * Constructs a new ImageVersions 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 ImageVersions 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): ImageVersions; - - /** - * Calls ListImageVersions. - * @param request ListImageVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListImageVersionsResponse - */ - public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, callback: google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback): void; - - /** - * Calls ListImageVersions. - * @param request ListImageVersionsRequest message or plain object - * @returns Promise - */ - public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): Promise; - } - - namespace ImageVersions { - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. - * @param error Error, if any - * @param [response] ListImageVersionsResponse - */ - type ListImageVersionsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) => void; - } - - /** Properties of a ListImageVersionsRequest. */ - interface IListImageVersionsRequest { - - /** ListImageVersionsRequest parent */ - parent?: (string|null); + /** Properties of a PrivateClusterConfig. */ + interface IPrivateClusterConfig { - /** ListImageVersionsRequest pageSize */ - pageSize?: (number|null); + /** PrivateClusterConfig enablePrivateEndpoint */ + enablePrivateEndpoint?: (boolean|null); - /** ListImageVersionsRequest pageToken */ - pageToken?: (string|null); + /** PrivateClusterConfig masterIpv4CidrBlock */ + masterIpv4CidrBlock?: (string|null); - /** ListImageVersionsRequest includePastReleases */ - includePastReleases?: (boolean|null); + /** PrivateClusterConfig masterIpv4ReservedRange */ + masterIpv4ReservedRange?: (string|null); } - /** Represents a ListImageVersionsRequest. */ - class ListImageVersionsRequest implements IListImageVersionsRequest { + /** Represents a PrivateClusterConfig. */ + class PrivateClusterConfig implements IPrivateClusterConfig { /** - * Constructs a new ListImageVersionsRequest. + * Constructs a new PrivateClusterConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest); - - /** ListImageVersionsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig); - /** ListImageVersionsRequest pageSize. */ - public pageSize: number; + /** PrivateClusterConfig enablePrivateEndpoint. */ + public enablePrivateEndpoint: boolean; - /** ListImageVersionsRequest pageToken. */ - public pageToken: string; + /** PrivateClusterConfig masterIpv4CidrBlock. */ + public masterIpv4CidrBlock: string; - /** ListImageVersionsRequest includePastReleases. */ - public includePastReleases: boolean; + /** PrivateClusterConfig masterIpv4ReservedRange. */ + public masterIpv4ReservedRange: string; /** - * Creates a new ListImageVersionsRequest instance using the specified properties. + * Creates a new PrivateClusterConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListImageVersionsRequest instance + * @returns PrivateClusterConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. - * @param message ListImageVersionsRequest message or plain object to encode + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. - * @param message ListImageVersionsRequest message or plain object to encode + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer. + * Decodes a PrivateClusterConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListImageVersionsRequest + * @returns PrivateClusterConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListImageVersionsRequest + * @returns PrivateClusterConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Verifies a ListImageVersionsRequest message. + * Verifies a PrivateClusterConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListImageVersionsRequest + * @returns PrivateClusterConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. - * @param message ListImageVersionsRequest + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @param message PrivateClusterConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListImageVersionsRequest to JSON. + * Converts this PrivateClusterConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListImageVersionsRequest + * Gets the default type url for PrivateClusterConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListImageVersionsResponse. */ - interface IListImageVersionsResponse { - - /** ListImageVersionsResponse imageVersions */ - imageVersions?: (google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null); + /** Properties of a NetworkingConfig. */ + interface INetworkingConfig { - /** ListImageVersionsResponse nextPageToken */ - nextPageToken?: (string|null); + /** NetworkingConfig connectionType */ + connectionType?: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null); } - /** Represents a ListImageVersionsResponse. */ - class ListImageVersionsResponse implements IListImageVersionsResponse { + /** Represents a NetworkingConfig. */ + class NetworkingConfig implements INetworkingConfig { /** - * Constructs a new ListImageVersionsResponse. + * Constructs a new NetworkingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse); - - /** ListImageVersionsResponse imageVersions. */ - public imageVersions: google.cloud.orchestration.airflow.service.v1.IImageVersion[]; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig); - /** ListImageVersionsResponse nextPageToken. */ - public nextPageToken: string; + /** NetworkingConfig connectionType. */ + public connectionType: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType); /** - * Creates a new ListImageVersionsResponse instance using the specified properties. + * Creates a new NetworkingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListImageVersionsResponse instance + * @returns NetworkingConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; /** - * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. - * @param message ListImageVersionsResponse message or plain object to encode + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. - * @param message ListImageVersionsResponse message or plain object to encode + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer. + * Decodes a NetworkingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListImageVersionsResponse + * @returns NetworkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListImageVersionsResponse + * @returns NetworkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; /** - * Verifies a ListImageVersionsResponse message. + * Verifies a NetworkingConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListImageVersionsResponse + * @returns NetworkingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; /** - * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. - * @param message ListImageVersionsResponse + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * @param message NetworkingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.NetworkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListImageVersionsResponse to JSON. + * Converts this NetworkingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListImageVersionsResponse + * Gets the default type url for NetworkingConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImageVersion. */ - interface IImageVersion { + namespace NetworkingConfig { - /** ImageVersion imageVersionId */ - imageVersionId?: (string|null); + /** ConnectionType enum. */ + enum ConnectionType { + CONNECTION_TYPE_UNSPECIFIED = 0, + VPC_PEERING = 1, + PRIVATE_SERVICE_CONNECT = 2 + } + } - /** ImageVersion isDefault */ - isDefault?: (boolean|null); + /** Properties of a PrivateEnvironmentConfig. */ + interface IPrivateEnvironmentConfig { - /** ImageVersion supportedPythonVersions */ - supportedPythonVersions?: (string[]|null); + /** PrivateEnvironmentConfig enablePrivateEnvironment */ + enablePrivateEnvironment?: (boolean|null); - /** ImageVersion releaseDate */ - releaseDate?: (google.type.IDate|null); + /** PrivateEnvironmentConfig privateClusterConfig */ + privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); - /** ImageVersion creationDisabled */ - creationDisabled?: (boolean|null); + /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ + webServerIpv4CidrBlock?: (string|null); - /** ImageVersion upgradeDisabled */ - upgradeDisabled?: (boolean|null); + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ + cloudSqlIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ + webServerIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock */ + cloudComposerNetworkIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange */ + cloudComposerNetworkIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps */ + enablePrivatelyUsedPublicIps?: (boolean|null); + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork */ + cloudComposerConnectionSubnetwork?: (string|null); + + /** PrivateEnvironmentConfig networkingConfig */ + networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); } - /** Represents an ImageVersion. */ - class ImageVersion implements IImageVersion { + /** Represents a PrivateEnvironmentConfig. */ + class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { /** - * Constructs a new ImageVersion. + * Constructs a new PrivateEnvironmentConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig); - /** ImageVersion imageVersionId. */ - public imageVersionId: string; + /** PrivateEnvironmentConfig enablePrivateEnvironment. */ + public enablePrivateEnvironment: boolean; - /** ImageVersion isDefault. */ - public isDefault: boolean; + /** PrivateEnvironmentConfig privateClusterConfig. */ + public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); - /** ImageVersion supportedPythonVersions. */ - public supportedPythonVersions: string[]; + /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ + public webServerIpv4CidrBlock: string; - /** ImageVersion releaseDate. */ - public releaseDate?: (google.type.IDate|null); + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ + public cloudSqlIpv4CidrBlock: string; - /** ImageVersion creationDisabled. */ - public creationDisabled: boolean; + /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ + public webServerIpv4ReservedRange: string; - /** ImageVersion upgradeDisabled. */ - public upgradeDisabled: boolean; + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. */ + public cloudComposerNetworkIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. */ + public cloudComposerNetworkIpv4ReservedRange: string; + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. */ + public enablePrivatelyUsedPublicIps: boolean; + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. */ + public cloudComposerConnectionSubnetwork: string; + + /** PrivateEnvironmentConfig networkingConfig. */ + public networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); /** - * Creates a new ImageVersion instance using the specified properties. + * Creates a new PrivateEnvironmentConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ImageVersion instance + * @returns PrivateEnvironmentConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion): google.cloud.orchestration.airflow.service.v1.ImageVersion; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. - * @param message ImageVersion message or plain object to encode + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. - * @param message ImageVersion message or plain object to encode + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageVersion message from the specified reader or buffer. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageVersion + * @returns PrivateEnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ImageVersion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Decodes an ImageVersion message from the specified reader or buffer, length delimited. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageVersion + * @returns PrivateEnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ImageVersion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Verifies an ImageVersion message. + * Verifies a PrivateEnvironmentConfig message. * @param message Plain 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 ImageVersion message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageVersion + * @returns PrivateEnvironmentConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ImageVersion; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. - * @param message ImageVersion + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * @param message PrivateEnvironmentConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ImageVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageVersion to JSON. + * Converts this PrivateEnvironmentConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageVersion + * Gets the default type url for PrivateEnvironmentConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Represents an Environments */ - class Environments extends $protobuf.rpc.Service { + /** Properties of a WorkloadsConfig. */ + interface IWorkloadsConfig { - /** - * Constructs a new Environments 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); + /** WorkloadsConfig scheduler */ + scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); + + /** WorkloadsConfig webServer */ + webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker */ + worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); + } + + /** Represents a WorkloadsConfig. */ + class WorkloadsConfig implements IWorkloadsConfig { + + /** + * Constructs a new WorkloadsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig); + + /** WorkloadsConfig scheduler. */ + public scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); + + /** WorkloadsConfig webServer. */ + public webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker. */ + public worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); + + /** + * Creates a new WorkloadsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkloadsConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + + /** + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + + /** + * Verifies a WorkloadsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkloadsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; + + /** + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * @param message WorkloadsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkloadsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkloadsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkloadsConfig { + + /** Properties of a SchedulerResource. */ + interface ISchedulerResource { + + /** SchedulerResource cpu */ + cpu?: (number|null); + + /** SchedulerResource memoryGb */ + memoryGb?: (number|null); + + /** SchedulerResource storageGb */ + storageGb?: (number|null); + + /** SchedulerResource count */ + count?: (number|null); + } + + /** Represents a SchedulerResource. */ + class SchedulerResource implements ISchedulerResource { + + /** + * Constructs a new SchedulerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource); + + /** SchedulerResource cpu. */ + public cpu: number; + + /** SchedulerResource memoryGb. */ + public memoryGb: number; + + /** SchedulerResource storageGb. */ + public storageGb: number; + + /** SchedulerResource count. */ + public count: number; + + /** + * Creates a new SchedulerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + + /** + * Verifies a SchedulerResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; + + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @param message SchedulerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebServerResource. */ + interface IWebServerResource { + + /** WebServerResource cpu */ + cpu?: (number|null); + + /** WebServerResource memoryGb */ + memoryGb?: (number|null); + + /** WebServerResource storageGb */ + storageGb?: (number|null); + } + + /** Represents a WebServerResource. */ + class WebServerResource implements IWebServerResource { + + /** + * Constructs a new WebServerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource); + + /** WebServerResource cpu. */ + public cpu: number; + + /** WebServerResource memoryGb. */ + public memoryGb: number; + + /** WebServerResource storageGb. */ + public storageGb: number; + + /** + * Creates a new WebServerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WebServerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + + /** + * Verifies a WebServerResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebServerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; + + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @param message WebServerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebServerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebServerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerResource. */ + interface IWorkerResource { + + /** WorkerResource cpu */ + cpu?: (number|null); + + /** WorkerResource memoryGb */ + memoryGb?: (number|null); + + /** WorkerResource storageGb */ + storageGb?: (number|null); + + /** WorkerResource minCount */ + minCount?: (number|null); + + /** WorkerResource maxCount */ + maxCount?: (number|null); + } + + /** Represents a WorkerResource. */ + class WorkerResource implements IWorkerResource { + + /** + * Constructs a new WorkerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource); + + /** WorkerResource cpu. */ + public cpu: number; + + /** WorkerResource memoryGb. */ + public memoryGb: number; + + /** WorkerResource storageGb. */ + public storageGb: number; + + /** WorkerResource minCount. */ + public minCount: number; + + /** WorkerResource maxCount. */ + public maxCount: number; + + /** + * Creates a new WorkerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Verifies a WorkerResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @param message WorkerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecoveryConfig. */ + interface IRecoveryConfig { + + /** RecoveryConfig scheduledSnapshotsConfig */ + scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + } + + /** Represents a RecoveryConfig. */ + class RecoveryConfig implements IRecoveryConfig { + + /** + * Constructs a new RecoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig); + + /** RecoveryConfig scheduledSnapshotsConfig. */ + public scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + + /** + * Creates a new RecoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecoveryConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + + /** + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + + /** + * Verifies a RecoveryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecoveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + + /** + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. + * @param message RecoveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.RecoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecoveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecoveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduledSnapshotsConfig. */ + interface IScheduledSnapshotsConfig { + + /** ScheduledSnapshotsConfig enabled */ + enabled?: (boolean|null); + + /** ScheduledSnapshotsConfig snapshotLocation */ + snapshotLocation?: (string|null); + + /** ScheduledSnapshotsConfig snapshotCreationSchedule */ + snapshotCreationSchedule?: (string|null); + + /** ScheduledSnapshotsConfig timeZone */ + timeZone?: (string|null); + } + + /** Represents a ScheduledSnapshotsConfig. */ + class ScheduledSnapshotsConfig implements IScheduledSnapshotsConfig { + + /** + * Constructs a new ScheduledSnapshotsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig); + + /** ScheduledSnapshotsConfig enabled. */ + public enabled: boolean; + + /** ScheduledSnapshotsConfig snapshotLocation. */ + public snapshotLocation: string; + + /** ScheduledSnapshotsConfig snapshotCreationSchedule. */ + public snapshotCreationSchedule: string; + + /** ScheduledSnapshotsConfig timeZone. */ + public timeZone: string; + + /** + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledSnapshotsConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + + /** + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + + /** + * Verifies a ScheduledSnapshotsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledSnapshotsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; + + /** + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * @param message ScheduledSnapshotsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduledSnapshotsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduledSnapshotsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MasterAuthorizedNetworksConfig. */ + interface IMasterAuthorizedNetworksConfig { + + /** MasterAuthorizedNetworksConfig enabled */ + enabled?: (boolean|null); + + /** MasterAuthorizedNetworksConfig cidrBlocks */ + cidrBlocks?: (google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]|null); + } + + /** Represents a MasterAuthorizedNetworksConfig. */ + class MasterAuthorizedNetworksConfig implements IMasterAuthorizedNetworksConfig { + + /** + * Constructs a new MasterAuthorizedNetworksConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig); + + /** MasterAuthorizedNetworksConfig enabled. */ + public enabled: boolean; + + /** MasterAuthorizedNetworksConfig cidrBlocks. */ + public cidrBlocks: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]; + + /** + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MasterAuthorizedNetworksConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + + /** + * Verifies a MasterAuthorizedNetworksConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MasterAuthorizedNetworksConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; + + /** + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. + * @param message MasterAuthorizedNetworksConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MasterAuthorizedNetworksConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MasterAuthorizedNetworksConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MasterAuthorizedNetworksConfig { + + /** Properties of a CidrBlock. */ + interface ICidrBlock { + + /** CidrBlock displayName */ + displayName?: (string|null); + + /** CidrBlock cidrBlock */ + cidrBlock?: (string|null); + } + + /** Represents a CidrBlock. */ + class CidrBlock implements ICidrBlock { + + /** + * Constructs a new CidrBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock); + + /** CidrBlock displayName. */ + public displayName: string; + + /** CidrBlock cidrBlock. */ + public cidrBlock: string; + + /** + * Creates a new CidrBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CidrBlock instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CidrBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Verifies a CidrBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CidrBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. + * @param message CidrBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CidrBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CidrBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment config */ + config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + + /** Environment uuid */ + uuid?: (string|null); + + /** Environment state */ + state?: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State|null); + + /** Environment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment config. */ + public config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + + /** Environment uuid. */ + public uuid: string; + + /** Environment state. */ + public state: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State); + + /** Environment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment): google.cloud.orchestration.airflow.service.v1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + RUNNING = 2, + UPDATING = 3, + DELETING = 4, + ERROR = 5 + } + } + + /** Properties of a CheckUpgradeResponse. */ + interface ICheckUpgradeResponse { + + /** CheckUpgradeResponse buildLogUri */ + buildLogUri?: (string|null); + + /** CheckUpgradeResponse containsPypiModulesConflict */ + containsPypiModulesConflict?: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null); + + /** CheckUpgradeResponse pypiConflictBuildLogExtract */ + pypiConflictBuildLogExtract?: (string|null); + + /** CheckUpgradeResponse imageVersion */ + imageVersion?: (string|null); + + /** CheckUpgradeResponse pypiDependencies */ + pypiDependencies?: ({ [k: string]: string }|null); + } + + /** Represents a CheckUpgradeResponse. */ + class CheckUpgradeResponse implements ICheckUpgradeResponse { + + /** + * Constructs a new CheckUpgradeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse); + + /** CheckUpgradeResponse buildLogUri. */ + public buildLogUri: string; + + /** CheckUpgradeResponse containsPypiModulesConflict. */ + public containsPypiModulesConflict: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult); + + /** CheckUpgradeResponse pypiConflictBuildLogExtract. */ + public pypiConflictBuildLogExtract: string; + + /** CheckUpgradeResponse imageVersion. */ + public imageVersion: string; + + /** CheckUpgradeResponse pypiDependencies. */ + public pypiDependencies: { [k: string]: string }; + + /** + * Creates a new CheckUpgradeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckUpgradeResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + + /** + * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @param message CheckUpgradeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @param message CheckUpgradeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckUpgradeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckUpgradeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + + /** + * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckUpgradeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + + /** + * Verifies a CheckUpgradeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckUpgradeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + + /** + * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. + * @param message CheckUpgradeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckUpgradeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckUpgradeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CheckUpgradeResponse { + + /** ConflictResult enum. */ + enum ConflictResult { + CONFLICT_RESULT_UNSPECIFIED = 0, + CONFLICT = 1, + NO_CONFLICT = 2 + } + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata state */ + state?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null); + + /** OperationMetadata operationType */ + operationType?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null); + + /** OperationMetadata resource */ + resource?: (string|null); + + /** OperationMetadata resourceUuid */ + resourceUuid?: (string|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata); + + /** OperationMetadata state. */ + public state: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State); + + /** OperationMetadata operationType. */ + public operationType: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type); + + /** OperationMetadata resource. */ + public resource: string; + + /** OperationMetadata resourceUuid. */ + public resourceUuid: string; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.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.orchestration.airflow.service.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.orchestration.airflow.service.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.orchestration.airflow.service.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.orchestration.airflow.service.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; + } + + namespace OperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + SUCCEEDED = 3, + SUCCESSFUL = 3, + FAILED = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CREATE = 1, + DELETE = 2, + UPDATE = 3, + CHECK = 4, + SAVE_SNAPSHOT = 5, + LOAD_SNAPSHOT = 6, + DATABASE_FAILOVER = 7 + } + } + + /** Represents an ImageVersions */ + class ImageVersions extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageVersions 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 ImageVersions 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): ImageVersions; + + /** + * Calls ListImageVersions. + * @param request ListImageVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListImageVersionsResponse + */ + public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, callback: google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback): void; + + /** + * Calls ListImageVersions. + * @param request ListImageVersionsRequest message or plain object + * @returns Promise + */ + public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): Promise; + } + + namespace ImageVersions { + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. + * @param error Error, if any + * @param [response] ListImageVersionsResponse + */ + type ListImageVersionsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) => void; + } + + /** Properties of a ListImageVersionsRequest. */ + interface IListImageVersionsRequest { + + /** ListImageVersionsRequest parent */ + parent?: (string|null); + + /** ListImageVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListImageVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListImageVersionsRequest includePastReleases */ + includePastReleases?: (boolean|null); + } + + /** Represents a ListImageVersionsRequest. */ + class ListImageVersionsRequest implements IListImageVersionsRequest { + + /** + * Constructs a new ListImageVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest); + + /** ListImageVersionsRequest parent. */ + public parent: string; + + /** ListImageVersionsRequest pageSize. */ + public pageSize: number; + + /** ListImageVersionsRequest pageToken. */ + public pageToken: string; + + /** ListImageVersionsRequest includePastReleases. */ + public includePastReleases: boolean; + + /** + * Creates a new ListImageVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListImageVersionsRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + + /** + * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * @param message ListImageVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * @param message ListImageVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListImageVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListImageVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + + /** + * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListImageVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + + /** + * Verifies a ListImageVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListImageVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + + /** + * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. + * @param message ListImageVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListImageVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListImageVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListImageVersionsResponse. */ + interface IListImageVersionsResponse { + + /** ListImageVersionsResponse imageVersions */ + imageVersions?: (google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null); + + /** ListImageVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListImageVersionsResponse. */ + class ListImageVersionsResponse implements IListImageVersionsResponse { + + /** + * Constructs a new ListImageVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse); + + /** ListImageVersionsResponse imageVersions. */ + public imageVersions: google.cloud.orchestration.airflow.service.v1.IImageVersion[]; + + /** ListImageVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListImageVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListImageVersionsResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + + /** + * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * @param message ListImageVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * @param message ListImageVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListImageVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListImageVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + + /** + * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListImageVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + + /** + * Verifies a ListImageVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListImageVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + + /** + * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. + * @param message ListImageVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListImageVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListImageVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageVersion. */ + interface IImageVersion { + + /** ImageVersion imageVersionId */ + imageVersionId?: (string|null); + + /** ImageVersion isDefault */ + isDefault?: (boolean|null); + + /** ImageVersion supportedPythonVersions */ + supportedPythonVersions?: (string[]|null); + + /** ImageVersion releaseDate */ + releaseDate?: (google.type.IDate|null); + + /** ImageVersion creationDisabled */ + creationDisabled?: (boolean|null); + + /** ImageVersion upgradeDisabled */ + upgradeDisabled?: (boolean|null); + } + + /** Represents an ImageVersion. */ + class ImageVersion implements IImageVersion { + + /** + * Constructs a new ImageVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion); + + /** ImageVersion imageVersionId. */ + public imageVersionId: string; + + /** ImageVersion isDefault. */ + public isDefault: boolean; + + /** ImageVersion supportedPythonVersions. */ + public supportedPythonVersions: string[]; + + /** ImageVersion releaseDate. */ + public releaseDate?: (google.type.IDate|null); + + /** ImageVersion creationDisabled. */ + public creationDisabled: boolean; + + /** ImageVersion upgradeDisabled. */ + public upgradeDisabled: boolean; + + /** + * Creates a new ImageVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageVersion instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion): google.cloud.orchestration.airflow.service.v1.ImageVersion; + + /** + * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * @param message ImageVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * @param message ImageVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ImageVersion; + + /** + * Decodes an ImageVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ImageVersion; + + /** + * Verifies an ImageVersion message. + * @param message Plain 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 ImageVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ImageVersion; + + /** + * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. + * @param message ImageVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ImageVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { + + /** + * Constructs a new Environments 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 Environments 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): Environments; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback): void; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @returns Promise + */ + public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): Promise; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment + */ + public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback): void; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise + */ + public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): Promise; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): Promise; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback): void; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @returns Promise + */ + public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): Promise; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback): void; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @returns Promise + */ + public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): Promise; + + /** + * Calls RestartWebServer. + * @param request RestartWebServerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback): void; + + /** + * Calls RestartWebServer. + * @param request RestartWebServerRequest message or plain object + * @returns Promise + */ + public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): Promise; + + /** + * Calls CheckUpgrade. + * @param request CheckUpgradeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback): void; + + /** + * Calls CheckUpgrade. + * @param request CheckUpgradeRequest message or plain object + * @returns Promise + */ + public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest): Promise; + + /** + * Calls ExecuteAirflowCommand. + * @param request ExecuteAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteAirflowCommandResponse + */ + public executeAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.ExecuteAirflowCommandCallback): void; + + /** + * Calls ExecuteAirflowCommand. + * @param request ExecuteAirflowCommandRequest message or plain object + * @returns Promise + */ + public executeAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest): Promise; + + /** + * Calls StopAirflowCommand. + * @param request StopAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StopAirflowCommandResponse + */ + public stopAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.StopAirflowCommandCallback): void; + + /** + * Calls StopAirflowCommand. + * @param request StopAirflowCommandRequest message or plain object + * @returns Promise + */ + public stopAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest): Promise; + + /** + * Calls PollAirflowCommand. + * @param request PollAirflowCommandRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PollAirflowCommandResponse + */ + public pollAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.PollAirflowCommandCallback): void; + + /** + * Calls PollAirflowCommand. + * @param request PollAirflowCommandRequest message or plain object + * @returns Promise + */ + public pollAirflowCommand(request: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest): Promise; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback): void; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @returns Promise + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): Promise; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback): void; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @returns Promise + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): Promise; + + /** + * Calls DatabaseFailover. + * @param request DatabaseFailoverRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public databaseFailover(request: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.DatabaseFailoverCallback): void; + + /** + * Calls DatabaseFailover. + * @param request DatabaseFailoverRequest message or plain object + * @returns Promise + */ + public databaseFailover(request: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest): Promise; + + /** + * Calls FetchDatabaseProperties. + * @param request FetchDatabasePropertiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDatabasePropertiesResponse + */ + public fetchDatabaseProperties(request: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.FetchDatabasePropertiesCallback): void; + + /** + * Calls FetchDatabaseProperties. + * @param request FetchDatabasePropertiesRequest message or plain object + * @returns Promise + */ + public fetchDatabaseProperties(request: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest): Promise; + } + + namespace Environments { + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.Environment) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartWebServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. + * @param error Error, if any + * @param [response] Operation + */ + type CheckUpgradeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|executeAirflowCommand}. + * @param error Error, if any + * @param [response] ExecuteAirflowCommandResponse + */ + type ExecuteAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|stopAirflowCommand}. + * @param error Error, if any + * @param [response] StopAirflowCommandResponse + */ + type StopAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|pollAirflowCommand}. + * @param error Error, if any + * @param [response] PollAirflowCommandResponse + */ + type PollAirflowCommandCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type SaveSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type LoadSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|databaseFailover}. + * @param error Error, if any + * @param [response] Operation + */ + type DatabaseFailoverCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|fetchDatabaseProperties}. + * @param error Error, if any + * @param [response] FetchDatabasePropertiesResponse + */ + type FetchDatabasePropertiesCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse) => void; + } + + /** Properties of a CreateEnvironmentRequest. */ + interface ICreateEnvironmentRequest { + + /** CreateEnvironmentRequest parent */ + parent?: (string|null); + + /** CreateEnvironmentRequest environment */ + environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + } + + /** Represents a CreateEnvironmentRequest. */ + class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + + /** + * Constructs a new CreateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest); + + /** CreateEnvironmentRequest parent. */ + public parent: string; + + /** CreateEnvironmentRequest environment. */ + public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + + /** + * Verifies a CreateEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @param message CreateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { + + /** GetEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { + + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest); + + /** GetEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + + /** + * Verifies a GetEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates new Environments 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. + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEnvironmentRequest. */ + interface IDeleteEnvironmentRequest { + + /** DeleteEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEnvironmentRequest. */ + class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + + /** + * Constructs a new DeleteEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest); + + /** DeleteEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEnvironmentRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @param message DeleteEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEnvironmentRequest. */ + interface IUpdateEnvironmentRequest { + + /** UpdateEnvironmentRequest name */ + name?: (string|null); + + /** UpdateEnvironmentRequest environment */ + environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEnvironmentRequest. */ + class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + + /** + * Constructs a new UpdateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest); + + /** UpdateEnvironmentRequest name. */ + public name: string; + + /** UpdateEnvironmentRequest environment. */ + public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + + /** UpdateEnvironmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Calls CreateEnvironment. - * @param request CreateEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies an UpdateEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateEnvironment. - * @param request CreateEnvironmentRequest message or plain object - * @returns Promise + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEnvironmentRequest */ - public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Calls GetEnvironment. - * @param request GetEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Environment + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @param message UpdateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object */ - public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback): void; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetEnvironment. - * @param request GetEnvironmentRequest message or plain object - * @returns Promise + * Converts this UpdateEnvironmentRequest to JSON. + * @returns JSON object */ - public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * Gets the default type url for UpdateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestartWebServerRequest. */ + interface IRestartWebServerRequest { + + /** RestartWebServerRequest name */ + name?: (string|null); + } + + /** Represents a RestartWebServerRequest. */ + class RestartWebServerRequest implements IRestartWebServerRequest { /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @returns Promise + * Constructs a new RestartWebServerRequest. + * @param [properties] Properties to set */ - public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): Promise; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest); + + /** RestartWebServerRequest name. */ + public name: string; /** - * Calls UpdateEnvironment. - * @param request UpdateEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new RestartWebServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartWebServerRequest instance */ - public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback): void; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Calls UpdateEnvironment. - * @param request UpdateEnvironmentRequest message or plain object - * @returns Promise + * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @param message RestartWebServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): Promise; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteEnvironment. - * @param request DeleteEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @param message RestartWebServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback): void; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteEnvironment. - * @param request DeleteEnvironmentRequest message or plain object - * @returns Promise + * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Calls RestartWebServer. - * @param request RestartWebServerRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Calls RestartWebServer. - * @param request RestartWebServerRequest message or plain object - * @returns Promise + * Verifies a RestartWebServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CheckUpgrade. - * @param request CheckUpgradeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartWebServerRequest */ - public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Calls CheckUpgrade. - * @param request CheckUpgradeRequest message or plain object - * @returns Promise + * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. + * @param message RestartWebServerRequest + * @param [options] Conversion options + * @returns Plain object */ - public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest): Promise; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls SaveSnapshot. - * @param request SaveSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this RestartWebServerRequest to JSON. + * @returns JSON object */ - public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls SaveSnapshot. - * @param request SaveSnapshotRequest message or plain object - * @returns Promise + * Gets the default type url for RestartWebServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteAirflowCommandRequest. */ + interface IExecuteAirflowCommandRequest { + + /** ExecuteAirflowCommandRequest environment */ + environment?: (string|null); + + /** ExecuteAirflowCommandRequest command */ + command?: (string|null); + + /** ExecuteAirflowCommandRequest subcommand */ + subcommand?: (string|null); + + /** ExecuteAirflowCommandRequest parameters */ + parameters?: (string[]|null); + } + + /** Represents an ExecuteAirflowCommandRequest. */ + class ExecuteAirflowCommandRequest implements IExecuteAirflowCommandRequest { /** - * Calls LoadSnapshot. - * @param request LoadSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new ExecuteAirflowCommandRequest. + * @param [properties] Properties to set */ - public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback): void; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest); + + /** ExecuteAirflowCommandRequest environment. */ + public environment: string; + + /** ExecuteAirflowCommandRequest command. */ + public command: string; + + /** ExecuteAirflowCommandRequest subcommand. */ + public subcommand: string; + + /** ExecuteAirflowCommandRequest parameters. */ + public parameters: string[]; /** - * Calls LoadSnapshot. - * @param request LoadSnapshotRequest message or plain object - * @returns Promise + * Creates a new ExecuteAirflowCommandRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteAirflowCommandRequest instance */ - public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): Promise; - } - - namespace Environments { + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified ExecuteAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest.verify|verify} messages. + * @param message ExecuteAirflowCommandRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. - * @param error Error, if any - * @param [response] Environment + * Encodes the specified ExecuteAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest.verify|verify} messages. + * @param message ExecuteAirflowCommandRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.Environment) => void; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. - * @param error Error, if any - * @param [response] ListEnvironmentsResponse + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteAirflowCommandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. - * @param error Error, if any - * @param [response] Operation + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteAirflowCommandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. - * @param error Error, if any - * @param [response] Operation + * Verifies an ExecuteAirflowCommandRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. - * @param error Error, if any - * @param [response] Operation + * Creates an ExecuteAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteAirflowCommandRequest */ - type RestartWebServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from an ExecuteAirflowCommandRequest message. Also converts values to other types if specified. + * @param message ExecuteAirflowCommandRequest + * @param [options] Conversion options + * @returns Plain object */ - type CheckUpgradeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. - * @param error Error, if any - * @param [response] Operation + * Converts this ExecuteAirflowCommandRequest to JSON. + * @returns JSON object */ - type SaveSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for ExecuteAirflowCommandRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type LoadSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateEnvironmentRequest. */ - interface ICreateEnvironmentRequest { + /** Properties of an ExecuteAirflowCommandResponse. */ + interface IExecuteAirflowCommandResponse { - /** CreateEnvironmentRequest parent */ - parent?: (string|null); + /** ExecuteAirflowCommandResponse executionId */ + executionId?: (string|null); - /** CreateEnvironmentRequest environment */ - environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** ExecuteAirflowCommandResponse pod */ + pod?: (string|null); + + /** ExecuteAirflowCommandResponse podNamespace */ + podNamespace?: (string|null); + + /** ExecuteAirflowCommandResponse error */ + error?: (string|null); } - /** Represents a CreateEnvironmentRequest. */ - class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + /** Represents an ExecuteAirflowCommandResponse. */ + class ExecuteAirflowCommandResponse implements IExecuteAirflowCommandResponse { /** - * Constructs a new CreateEnvironmentRequest. + * Constructs a new ExecuteAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse); - /** CreateEnvironmentRequest parent. */ - public parent: string; + /** ExecuteAirflowCommandResponse executionId. */ + public executionId: string; - /** CreateEnvironmentRequest environment. */ - public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** ExecuteAirflowCommandResponse pod. */ + public pod: string; + + /** ExecuteAirflowCommandResponse podNamespace. */ + public podNamespace: string; + + /** ExecuteAirflowCommandResponse error. */ + public error: string; /** - * Creates a new CreateEnvironmentRequest instance using the specified properties. + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateEnvironmentRequest instance + * @returns ExecuteAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. - * @param message CreateEnvironmentRequest message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. - * @param message CreateEnvironmentRequest message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateEnvironmentRequest + * @returns ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateEnvironmentRequest + * @returns ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Verifies a CreateEnvironmentRequest message. + * Verifies an ExecuteAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateEnvironmentRequest + * @returns ExecuteAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. - * @param message CreateEnvironmentRequest + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. + * @param message ExecuteAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateEnvironmentRequest to JSON. + * Converts this ExecuteAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateEnvironmentRequest + * Gets the default type url for ExecuteAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetEnvironmentRequest. */ - interface IGetEnvironmentRequest { + /** Properties of a StopAirflowCommandRequest. */ + interface IStopAirflowCommandRequest { - /** GetEnvironmentRequest name */ - name?: (string|null); + /** StopAirflowCommandRequest environment */ + environment?: (string|null); + + /** StopAirflowCommandRequest executionId */ + executionId?: (string|null); + + /** StopAirflowCommandRequest pod */ + pod?: (string|null); + + /** StopAirflowCommandRequest podNamespace */ + podNamespace?: (string|null); + + /** StopAirflowCommandRequest force */ + force?: (boolean|null); } - /** Represents a GetEnvironmentRequest. */ - class GetEnvironmentRequest implements IGetEnvironmentRequest { + /** Represents a StopAirflowCommandRequest. */ + class StopAirflowCommandRequest implements IStopAirflowCommandRequest { /** - * Constructs a new GetEnvironmentRequest. + * Constructs a new StopAirflowCommandRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest); - /** GetEnvironmentRequest name. */ - public name: string; + /** StopAirflowCommandRequest environment. */ + public environment: string; + + /** StopAirflowCommandRequest executionId. */ + public executionId: string; + + /** StopAirflowCommandRequest pod. */ + public pod: string; + + /** StopAirflowCommandRequest podNamespace. */ + public podNamespace: string; + + /** StopAirflowCommandRequest force. */ + public force: boolean; /** - * Creates a new GetEnvironmentRequest instance using the specified properties. + * Creates a new StopAirflowCommandRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetEnvironmentRequest instance + * @returns StopAirflowCommandRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest; /** - * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. - * @param message GetEnvironmentRequest message or plain object to encode + * Encodes the specified StopAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest.verify|verify} messages. + * @param message StopAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. - * @param message GetEnvironmentRequest message or plain object to encode + * Encodes the specified StopAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest.verify|verify} messages. + * @param message StopAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetEnvironmentRequest + * @returns StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetEnvironmentRequest + * @returns StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest; /** - * Verifies a GetEnvironmentRequest message. + * Verifies a StopAirflowCommandRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetEnvironmentRequest + * @returns StopAirflowCommandRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest; /** - * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. - * @param message GetEnvironmentRequest + * Creates a plain object from a StopAirflowCommandRequest message. Also converts values to other types if specified. + * @param message StopAirflowCommandRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetEnvironmentRequest to JSON. + * Converts this StopAirflowCommandRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetEnvironmentRequest + * Gets the default type url for StopAirflowCommandRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListEnvironmentsRequest. */ - interface IListEnvironmentsRequest { - - /** ListEnvironmentsRequest parent */ - parent?: (string|null); + /** Properties of a StopAirflowCommandResponse. */ + interface IStopAirflowCommandResponse { - /** ListEnvironmentsRequest pageSize */ - pageSize?: (number|null); + /** StopAirflowCommandResponse isDone */ + isDone?: (boolean|null); - /** ListEnvironmentsRequest pageToken */ - pageToken?: (string|null); + /** StopAirflowCommandResponse output */ + output?: (string[]|null); } - /** Represents a ListEnvironmentsRequest. */ - class ListEnvironmentsRequest implements IListEnvironmentsRequest { + /** Represents a StopAirflowCommandResponse. */ + class StopAirflowCommandResponse implements IStopAirflowCommandResponse { /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new StopAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest); - - /** ListEnvironmentsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse); - /** ListEnvironmentsRequest pageSize. */ - public pageSize: number; + /** StopAirflowCommandResponse isDone. */ + public isDone: boolean; - /** ListEnvironmentsRequest pageToken. */ - public pageToken: string; + /** StopAirflowCommandResponse output. */ + public output: string[]; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * Creates a new StopAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsRequest instance + * @returns StopAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified StopAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse.verify|verify} messages. + * @param message StopAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified StopAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse.verify|verify} messages. + * @param message StopAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsRequest + * @returns StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsRequest + * @returns StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a StopAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsRequest + * @returns StopAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @param message ListEnvironmentsRequest + * Creates a plain object from a StopAirflowCommandResponse message. Also converts values to other types if specified. + * @param message StopAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this StopAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListEnvironmentsRequest + * Gets the default type url for StopAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListEnvironmentsResponse. */ - interface IListEnvironmentsResponse { + /** Properties of a PollAirflowCommandRequest. */ + interface IPollAirflowCommandRequest { - /** ListEnvironmentsResponse environments */ - environments?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null); + /** PollAirflowCommandRequest environment */ + environment?: (string|null); - /** ListEnvironmentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** PollAirflowCommandRequest executionId */ + executionId?: (string|null); + + /** PollAirflowCommandRequest pod */ + pod?: (string|null); + + /** PollAirflowCommandRequest podNamespace */ + podNamespace?: (string|null); + + /** PollAirflowCommandRequest nextLineNumber */ + nextLineNumber?: (number|null); } - /** Represents a ListEnvironmentsResponse. */ - class ListEnvironmentsResponse implements IListEnvironmentsResponse { + /** Represents a PollAirflowCommandRequest. */ + class PollAirflowCommandRequest implements IPollAirflowCommandRequest { /** - * Constructs a new ListEnvironmentsResponse. + * Constructs a new PollAirflowCommandRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest); - /** ListEnvironmentsResponse environments. */ - public environments: google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]; + /** PollAirflowCommandRequest environment. */ + public environment: string; - /** ListEnvironmentsResponse nextPageToken. */ - public nextPageToken: string; + /** PollAirflowCommandRequest executionId. */ + public executionId: string; + + /** PollAirflowCommandRequest pod. */ + public pod: string; + + /** PollAirflowCommandRequest podNamespace. */ + public podNamespace: string; + + /** PollAirflowCommandRequest nextLineNumber. */ + public nextLineNumber: number; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * Creates a new PollAirflowCommandRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsResponse instance + * @returns PollAirflowCommandRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified PollAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest.verify|verify} messages. + * @param message PollAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified PollAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest.verify|verify} messages. + * @param message PollAirflowCommandRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsResponse + * @returns PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsResponse + * @returns PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies a PollAirflowCommandRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsResponse + * @returns PollAirflowCommandRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @param message ListEnvironmentsResponse + * Creates a plain object from a PollAirflowCommandRequest message. Also converts values to other types if specified. + * @param message PollAirflowCommandRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this PollAirflowCommandRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListEnvironmentsResponse + * Gets the default type url for PollAirflowCommandRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteEnvironmentRequest. */ - interface IDeleteEnvironmentRequest { + /** Properties of a PollAirflowCommandResponse. */ + interface IPollAirflowCommandResponse { - /** DeleteEnvironmentRequest name */ - name?: (string|null); + /** PollAirflowCommandResponse output */ + output?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]|null); + + /** PollAirflowCommandResponse outputEnd */ + outputEnd?: (boolean|null); + + /** PollAirflowCommandResponse exitInfo */ + exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); } - /** Represents a DeleteEnvironmentRequest. */ - class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + /** Represents a PollAirflowCommandResponse. */ + class PollAirflowCommandResponse implements IPollAirflowCommandResponse { /** - * Constructs a new DeleteEnvironmentRequest. + * Constructs a new PollAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse); - /** DeleteEnvironmentRequest name. */ - public name: string; + /** PollAirflowCommandResponse output. */ + public output: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]; + + /** PollAirflowCommandResponse outputEnd. */ + public outputEnd: boolean; + + /** PollAirflowCommandResponse exitInfo. */ + public exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); /** - * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * Creates a new PollAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteEnvironmentRequest instance + * @returns PollAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @param message DeleteEnvironmentRequest message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @param message DeleteEnvironmentRequest message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteEnvironmentRequest + * @returns PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteEnvironmentRequest + * @returns PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Verifies a DeleteEnvironmentRequest message. + * Verifies a PollAirflowCommandResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteEnvironmentRequest + * @returns PollAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. - * @param message DeleteEnvironmentRequest + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * @param message PollAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteEnvironmentRequest to JSON. + * Converts this PollAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteEnvironmentRequest + * Gets the default type url for PollAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateEnvironmentRequest. */ - interface IUpdateEnvironmentRequest { + namespace PollAirflowCommandResponse { - /** UpdateEnvironmentRequest name */ - name?: (string|null); + /** Properties of a Line. */ + interface ILine { - /** UpdateEnvironmentRequest environment */ - environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** Line lineNumber */ + lineNumber?: (number|null); - /** UpdateEnvironmentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** Line content */ + content?: (string|null); + } - /** Represents an UpdateEnvironmentRequest. */ - class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + /** Represents a Line. */ + class Line implements ILine { - /** - * Constructs a new UpdateEnvironmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest); + /** + * Constructs a new Line. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine); - /** UpdateEnvironmentRequest name. */ - public name: string; + /** Line lineNumber. */ + public lineNumber: number; - /** UpdateEnvironmentRequest environment. */ - public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** Line content. */ + public content: string; - /** UpdateEnvironmentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Creates a new Line instance using the specified properties. + * @param [properties] Properties to set + * @returns Line instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - /** - * Creates a new UpdateEnvironmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEnvironmentRequest instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. - * @param message UpdateEnvironmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. - * @param message UpdateEnvironmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a Line message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEnvironmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEnvironmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + /** + * Verifies a Line message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies an UpdateEnvironmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a Line message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Line + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @param message Line + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Line to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Line + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExitInfo. */ + interface IExitInfo { + + /** ExitInfo exitCode */ + exitCode?: (number|null); + + /** ExitInfo error */ + error?: (string|null); + } + + /** Represents an ExitInfo. */ + class ExitInfo implements IExitInfo { + + /** + * Constructs a new ExitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo); + + /** ExitInfo exitCode. */ + public exitCode: number; + + /** ExitInfo error. */ + public error: string; + + /** + * Creates a new ExitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExitInfo instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; - /** - * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEnvironmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + /** + * Verifies an ExitInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. - * @param message UpdateEnvironmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an ExitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExitInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; - /** - * Converts this UpdateEnvironmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. + * @param message ExitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for UpdateEnvironmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Converts this ExitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExitInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Properties of a RestartWebServerRequest. */ - interface IRestartWebServerRequest { + /** Properties of a SaveSnapshotRequest. */ + interface ISaveSnapshotRequest { - /** RestartWebServerRequest name */ - name?: (string|null); + /** SaveSnapshotRequest environment */ + environment?: (string|null); + + /** SaveSnapshotRequest snapshotLocation */ + snapshotLocation?: (string|null); } - /** Represents a RestartWebServerRequest. */ - class RestartWebServerRequest implements IRestartWebServerRequest { + /** Represents a SaveSnapshotRequest. */ + class SaveSnapshotRequest implements ISaveSnapshotRequest { /** - * Constructs a new RestartWebServerRequest. + * Constructs a new SaveSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest); - /** RestartWebServerRequest name. */ - public name: string; + /** SaveSnapshotRequest environment. */ + public environment: string; + + /** SaveSnapshotRequest snapshotLocation. */ + public snapshotLocation: string; /** - * Creates a new RestartWebServerRequest instance using the specified properties. + * Creates a new SaveSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestartWebServerRequest instance + * @returns SaveSnapshotRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; /** - * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @param message RestartWebServerRequest message or plain object to encode + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @param message RestartWebServerRequest message or plain object to encode + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestartWebServerRequest + * @returns SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestartWebServerRequest + * @returns SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; /** - * Verifies a RestartWebServerRequest message. + * Verifies a SaveSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestartWebServerRequest + * @returns SaveSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; /** - * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. - * @param message RestartWebServerRequest + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * @param message SaveSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestartWebServerRequest to JSON. + * Converts this SaveSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestartWebServerRequest + * Gets the default type url for SaveSnapshotRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExecuteAirflowCommandResponse. */ - interface IExecuteAirflowCommandResponse { - - /** ExecuteAirflowCommandResponse executionId */ - executionId?: (string|null); - - /** ExecuteAirflowCommandResponse pod */ - pod?: (string|null); - - /** ExecuteAirflowCommandResponse podNamespace */ - podNamespace?: (string|null); + /** Properties of a SaveSnapshotResponse. */ + interface ISaveSnapshotResponse { - /** ExecuteAirflowCommandResponse error */ - error?: (string|null); + /** SaveSnapshotResponse snapshotPath */ + snapshotPath?: (string|null); } - /** Represents an ExecuteAirflowCommandResponse. */ - class ExecuteAirflowCommandResponse implements IExecuteAirflowCommandResponse { + /** Represents a SaveSnapshotResponse. */ + class SaveSnapshotResponse implements ISaveSnapshotResponse { /** - * Constructs a new ExecuteAirflowCommandResponse. + * Constructs a new SaveSnapshotResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse); - - /** ExecuteAirflowCommandResponse executionId. */ - public executionId: string; - - /** ExecuteAirflowCommandResponse pod. */ - public pod: string; - - /** ExecuteAirflowCommandResponse podNamespace. */ - public podNamespace: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse); - /** ExecuteAirflowCommandResponse error. */ - public error: string; + /** SaveSnapshotResponse snapshotPath. */ + public snapshotPath: string; /** - * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExecuteAirflowCommandResponse instance + * @returns SaveSnapshotResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; /** - * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. - * @param message ExecuteAirflowCommandResponse message or plain object to encode + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. - * @param message ExecuteAirflowCommandResponse message or plain object to encode + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExecuteAirflowCommandResponse + * @returns SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; /** - * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExecuteAirflowCommandResponse + * @returns SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; /** - * Verifies an ExecuteAirflowCommandResponse message. + * Verifies a SaveSnapshotResponse message. * @param message Plain 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 ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExecuteAirflowCommandResponse + * @returns SaveSnapshotResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; /** - * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. - * @param message ExecuteAirflowCommandResponse + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * @param message SaveSnapshotResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExecuteAirflowCommandResponse to JSON. + * Converts this SaveSnapshotResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExecuteAirflowCommandResponse + * Gets the default type url for SaveSnapshotResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PollAirflowCommandResponse. */ - interface IPollAirflowCommandResponse { + /** Properties of a LoadSnapshotRequest. */ + interface ILoadSnapshotRequest { - /** PollAirflowCommandResponse output */ - output?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]|null); + /** LoadSnapshotRequest environment */ + environment?: (string|null); - /** PollAirflowCommandResponse outputEnd */ - outputEnd?: (boolean|null); + /** LoadSnapshotRequest snapshotPath */ + snapshotPath?: (string|null); - /** PollAirflowCommandResponse exitInfo */ - exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); + /** LoadSnapshotRequest skipPypiPackagesInstallation */ + skipPypiPackagesInstallation?: (boolean|null); + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ + skipEnvironmentVariablesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipAirflowOverridesSetting */ + skipAirflowOverridesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipGcsDataCopying */ + skipGcsDataCopying?: (boolean|null); } - /** Represents a PollAirflowCommandResponse. */ - class PollAirflowCommandResponse implements IPollAirflowCommandResponse { + /** Represents a LoadSnapshotRequest. */ + class LoadSnapshotRequest implements ILoadSnapshotRequest { /** - * Constructs a new PollAirflowCommandResponse. + * Constructs a new LoadSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest); + + /** LoadSnapshotRequest environment. */ + public environment: string; + + /** LoadSnapshotRequest snapshotPath. */ + public snapshotPath: string; - /** PollAirflowCommandResponse output. */ - public output: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]; + /** LoadSnapshotRequest skipPypiPackagesInstallation. */ + public skipPypiPackagesInstallation: boolean; - /** PollAirflowCommandResponse outputEnd. */ - public outputEnd: boolean; + /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ + public skipEnvironmentVariablesSetting: boolean; - /** PollAirflowCommandResponse exitInfo. */ - public exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); + /** LoadSnapshotRequest skipAirflowOverridesSetting. */ + public skipAirflowOverridesSetting: boolean; + + /** LoadSnapshotRequest skipGcsDataCopying. */ + public skipGcsDataCopying: boolean; /** - * Creates a new PollAirflowCommandResponse instance using the specified properties. + * Creates a new LoadSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PollAirflowCommandResponse instance + * @returns LoadSnapshotRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; /** - * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. - * @param message PollAirflowCommandResponse message or plain object to encode + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. - * @param message PollAirflowCommandResponse message or plain object to encode + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PollAirflowCommandResponse + * @returns LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; /** - * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PollAirflowCommandResponse + * @returns LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; /** - * Verifies a PollAirflowCommandResponse message. + * Verifies a LoadSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PollAirflowCommandResponse + * @returns LoadSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; /** - * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. - * @param message PollAirflowCommandResponse + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @param message LoadSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PollAirflowCommandResponse to JSON. + * Converts this LoadSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PollAirflowCommandResponse + * Gets the default type url for LoadSnapshotRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace PollAirflowCommandResponse { - - /** Properties of a Line. */ - interface ILine { - - /** Line lineNumber */ - lineNumber?: (number|null); - - /** Line content */ - content?: (string|null); - } - - /** Represents a Line. */ - class Line implements ILine { - - /** - * Constructs a new Line. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine); - - /** Line lineNumber. */ - public lineNumber: number; - - /** Line content. */ - public content: string; - - /** - * Creates a new Line instance using the specified properties. - * @param [properties] Properties to set - * @returns Line instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - - /** - * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. - * @param message Line message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. - * @param message Line message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Line message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - - /** - * Decodes a Line message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - - /** - * Verifies a Line message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Line message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Line - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; - - /** - * Creates a plain object from a Line message. Also converts values to other types if specified. - * @param message Line - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Line to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Line - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExitInfo. */ - interface IExitInfo { - - /** ExitInfo exitCode */ - exitCode?: (number|null); - - /** ExitInfo error */ - error?: (string|null); - } - - /** Represents an ExitInfo. */ - class ExitInfo implements IExitInfo { - - /** - * Constructs a new ExitInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo); + /** Properties of a LoadSnapshotResponse. */ + interface ILoadSnapshotResponse { + } - /** ExitInfo exitCode. */ - public exitCode: number; + /** Represents a LoadSnapshotResponse. */ + class LoadSnapshotResponse implements ILoadSnapshotResponse { - /** ExitInfo error. */ - public error: string; + /** + * Constructs a new LoadSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse); - /** - * Creates a new ExitInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ExitInfo instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + /** + * Creates a new LoadSnapshotResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadSnapshotResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; - /** - * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. - * @param message ExitInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. - * @param message ExitInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ExitInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; - /** - * Decodes an ExitInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; - /** - * Verifies an ExitInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a LoadSnapshotResponse message. + * @param message Plain 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 ExitInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExitInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + /** + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadSnapshotResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; - /** - * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. - * @param message ExitInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @param message LoadSnapshotResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ExitInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this LoadSnapshotResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for ExitInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for LoadSnapshotResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SaveSnapshotRequest. */ - interface ISaveSnapshotRequest { + /** Properties of a DatabaseFailoverRequest. */ + interface IDatabaseFailoverRequest { - /** SaveSnapshotRequest environment */ + /** DatabaseFailoverRequest environment */ environment?: (string|null); - - /** SaveSnapshotRequest snapshotLocation */ - snapshotLocation?: (string|null); } - /** Represents a SaveSnapshotRequest. */ - class SaveSnapshotRequest implements ISaveSnapshotRequest { + /** Represents a DatabaseFailoverRequest. */ + class DatabaseFailoverRequest implements IDatabaseFailoverRequest { /** - * Constructs a new SaveSnapshotRequest. + * Constructs a new DatabaseFailoverRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest); - /** SaveSnapshotRequest environment. */ + /** DatabaseFailoverRequest environment. */ public environment: string; - /** SaveSnapshotRequest snapshotLocation. */ - public snapshotLocation: string; - /** - * Creates a new SaveSnapshotRequest instance using the specified properties. + * Creates a new DatabaseFailoverRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SaveSnapshotRequest instance + * @returns DatabaseFailoverRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest; /** - * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. - * @param message SaveSnapshotRequest message or plain object to encode + * Encodes the specified DatabaseFailoverRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest.verify|verify} messages. + * @param message DatabaseFailoverRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. - * @param message SaveSnapshotRequest message or plain object to encode + * Encodes the specified DatabaseFailoverRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest.verify|verify} messages. + * @param message DatabaseFailoverRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SaveSnapshotRequest + * @returns DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SaveSnapshotRequest + * @returns DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest; /** - * Verifies a SaveSnapshotRequest message. + * Verifies a DatabaseFailoverRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SaveSnapshotRequest + * @returns DatabaseFailoverRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest; /** - * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. - * @param message SaveSnapshotRequest + * Creates a plain object from a DatabaseFailoverRequest message. Also converts values to other types if specified. + * @param message DatabaseFailoverRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SaveSnapshotRequest to JSON. + * Converts this DatabaseFailoverRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SaveSnapshotRequest + * Gets the default type url for DatabaseFailoverRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SaveSnapshotResponse. */ - interface ISaveSnapshotResponse { - - /** SaveSnapshotResponse snapshotPath */ - snapshotPath?: (string|null); + /** Properties of a DatabaseFailoverResponse. */ + interface IDatabaseFailoverResponse { } - /** Represents a SaveSnapshotResponse. */ - class SaveSnapshotResponse implements ISaveSnapshotResponse { + /** Represents a DatabaseFailoverResponse. */ + class DatabaseFailoverResponse implements IDatabaseFailoverResponse { /** - * Constructs a new SaveSnapshotResponse. + * Constructs a new DatabaseFailoverResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse); - - /** SaveSnapshotResponse snapshotPath. */ - public snapshotPath: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse); /** - * Creates a new SaveSnapshotResponse instance using the specified properties. + * Creates a new DatabaseFailoverResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SaveSnapshotResponse instance + * @returns DatabaseFailoverResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse; /** - * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. - * @param message SaveSnapshotResponse message or plain object to encode + * Encodes the specified DatabaseFailoverResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse.verify|verify} messages. + * @param message DatabaseFailoverResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. - * @param message SaveSnapshotResponse message or plain object to encode + * Encodes the specified DatabaseFailoverResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse.verify|verify} messages. + * @param message DatabaseFailoverResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SaveSnapshotResponse + * @returns DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SaveSnapshotResponse + * @returns DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse; /** - * Verifies a SaveSnapshotResponse message. + * Verifies a DatabaseFailoverResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SaveSnapshotResponse + * @returns DatabaseFailoverResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse; /** - * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. - * @param message SaveSnapshotResponse + * Creates a plain object from a DatabaseFailoverResponse message. Also converts values to other types if specified. + * @param message DatabaseFailoverResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SaveSnapshotResponse to JSON. + * Converts this DatabaseFailoverResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SaveSnapshotResponse + * Gets the default type url for DatabaseFailoverResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LoadSnapshotRequest. */ - interface ILoadSnapshotRequest { + /** Properties of a FetchDatabasePropertiesRequest. */ + interface IFetchDatabasePropertiesRequest { - /** LoadSnapshotRequest environment */ + /** FetchDatabasePropertiesRequest environment */ environment?: (string|null); - - /** LoadSnapshotRequest snapshotPath */ - snapshotPath?: (string|null); - - /** LoadSnapshotRequest skipPypiPackagesInstallation */ - skipPypiPackagesInstallation?: (boolean|null); - - /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ - skipEnvironmentVariablesSetting?: (boolean|null); - - /** LoadSnapshotRequest skipAirflowOverridesSetting */ - skipAirflowOverridesSetting?: (boolean|null); - - /** LoadSnapshotRequest skipGcsDataCopying */ - skipGcsDataCopying?: (boolean|null); } - /** Represents a LoadSnapshotRequest. */ - class LoadSnapshotRequest implements ILoadSnapshotRequest { + /** Represents a FetchDatabasePropertiesRequest. */ + class FetchDatabasePropertiesRequest implements IFetchDatabasePropertiesRequest { /** - * Constructs a new LoadSnapshotRequest. + * Constructs a new FetchDatabasePropertiesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest); - /** LoadSnapshotRequest environment. */ + /** FetchDatabasePropertiesRequest environment. */ public environment: string; - /** LoadSnapshotRequest snapshotPath. */ - public snapshotPath: string; - - /** LoadSnapshotRequest skipPypiPackagesInstallation. */ - public skipPypiPackagesInstallation: boolean; - - /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ - public skipEnvironmentVariablesSetting: boolean; - - /** LoadSnapshotRequest skipAirflowOverridesSetting. */ - public skipAirflowOverridesSetting: boolean; - - /** LoadSnapshotRequest skipGcsDataCopying. */ - public skipGcsDataCopying: boolean; - /** - * Creates a new LoadSnapshotRequest instance using the specified properties. + * Creates a new FetchDatabasePropertiesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LoadSnapshotRequest instance + * @returns FetchDatabasePropertiesRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest; /** - * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. - * @param message LoadSnapshotRequest message or plain object to encode + * Encodes the specified FetchDatabasePropertiesRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest.verify|verify} messages. + * @param message FetchDatabasePropertiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. - * @param message LoadSnapshotRequest message or plain object to encode + * Encodes the specified FetchDatabasePropertiesRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest.verify|verify} messages. + * @param message FetchDatabasePropertiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LoadSnapshotRequest + * @returns FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LoadSnapshotRequest + * @returns FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest; /** - * Verifies a LoadSnapshotRequest message. + * Verifies a FetchDatabasePropertiesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LoadSnapshotRequest + * @returns FetchDatabasePropertiesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest; /** - * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. - * @param message LoadSnapshotRequest + * Creates a plain object from a FetchDatabasePropertiesRequest message. Also converts values to other types if specified. + * @param message FetchDatabasePropertiesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LoadSnapshotRequest to JSON. + * Converts this FetchDatabasePropertiesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LoadSnapshotRequest + * Gets the default type url for FetchDatabasePropertiesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LoadSnapshotResponse. */ - interface ILoadSnapshotResponse { + /** Properties of a FetchDatabasePropertiesResponse. */ + interface IFetchDatabasePropertiesResponse { + + /** FetchDatabasePropertiesResponse primaryGceZone */ + primaryGceZone?: (string|null); + + /** FetchDatabasePropertiesResponse secondaryGceZone */ + secondaryGceZone?: (string|null); + + /** FetchDatabasePropertiesResponse isFailoverReplicaAvailable */ + isFailoverReplicaAvailable?: (boolean|null); } - /** Represents a LoadSnapshotResponse. */ - class LoadSnapshotResponse implements ILoadSnapshotResponse { + /** Represents a FetchDatabasePropertiesResponse. */ + class FetchDatabasePropertiesResponse implements IFetchDatabasePropertiesResponse { /** - * Constructs a new LoadSnapshotResponse. + * Constructs a new FetchDatabasePropertiesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse); + + /** FetchDatabasePropertiesResponse primaryGceZone. */ + public primaryGceZone: string; + + /** FetchDatabasePropertiesResponse secondaryGceZone. */ + public secondaryGceZone: string; + + /** FetchDatabasePropertiesResponse isFailoverReplicaAvailable. */ + public isFailoverReplicaAvailable: boolean; /** - * Creates a new LoadSnapshotResponse instance using the specified properties. + * Creates a new FetchDatabasePropertiesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns LoadSnapshotResponse instance + * @returns FetchDatabasePropertiesResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse; /** - * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. - * @param message LoadSnapshotResponse message or plain object to encode + * Encodes the specified FetchDatabasePropertiesResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse.verify|verify} messages. + * @param message FetchDatabasePropertiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. - * @param message LoadSnapshotResponse message or plain object to encode + * Encodes the specified FetchDatabasePropertiesResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse.verify|verify} messages. + * @param message FetchDatabasePropertiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LoadSnapshotResponse + * @returns FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LoadSnapshotResponse + * @returns FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse; /** - * Verifies a LoadSnapshotResponse message. + * Verifies a FetchDatabasePropertiesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LoadSnapshotResponse + * @returns FetchDatabasePropertiesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse; /** - * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. - * @param message LoadSnapshotResponse + * Creates a plain object from a FetchDatabasePropertiesResponse message. Also converts values to other types if specified. + * @param message FetchDatabasePropertiesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LoadSnapshotResponse to JSON. + * Converts this FetchDatabasePropertiesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LoadSnapshotResponse + * Gets the default type url for FetchDatabasePropertiesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -6350,6 +8714,9 @@ export namespace google { /** EnvironmentConfig recoveryConfig */ recoveryConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null); + + /** EnvironmentConfig resilienceMode */ + resilienceMode?: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode|null); } /** Represents an EnvironmentConfig. */ @@ -6412,6 +8779,9 @@ export namespace google { /** EnvironmentConfig recoveryConfig. */ public recoveryConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null); + /** EnvironmentConfig resilienceMode. */ + public resilienceMode: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode); + /** * Creates a new EnvironmentConfig instance using the specified properties. * @param [properties] Properties to set @@ -6499,6 +8869,12 @@ export namespace google { ENVIRONMENT_SIZE_MEDIUM = 2, ENVIRONMENT_SIZE_LARGE = 3 } + + /** ResilienceMode enum. */ + enum ResilienceMode { + RESILIENCE_MODE_UNSPECIFIED = 0, + HIGH_RESILIENCE = 1 + } } /** Properties of a WebServerNetworkAccessControl. */ @@ -9498,7 +11874,8 @@ export namespace google { UPDATE = 3, CHECK = 4, SAVE_SNAPSHOT = 5, - LOAD_SNAPSHOT = 6 + LOAD_SNAPSHOT = 6, + DATABASE_FAILOVER = 7 } } diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.js b/packages/google-cloud-orchestration-airflow-service/protos/protos.js index 12ba35d2b5c9..9907b173665e 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.js +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.js @@ -281,6 +281,105 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|executeAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef ExecuteAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} [response] ExecuteAirflowCommandResponse + */ + + /** + * Calls ExecuteAirflowCommand. + * @function executeAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest} request ExecuteAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.ExecuteAirflowCommandCallback} callback Node-style callback called with the error, if any, and ExecuteAirflowCommandResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.executeAirflowCommand = function executeAirflowCommand(request, callback) { + return this.rpcCall(executeAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse, request, callback); + }, "name", { value: "ExecuteAirflowCommand" }); + + /** + * Calls ExecuteAirflowCommand. + * @function executeAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest} request ExecuteAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|stopAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef StopAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} [response] StopAirflowCommandResponse + */ + + /** + * Calls StopAirflowCommand. + * @function stopAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest} request StopAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.StopAirflowCommandCallback} callback Node-style callback called with the error, if any, and StopAirflowCommandResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.stopAirflowCommand = function stopAirflowCommand(request, callback) { + return this.rpcCall(stopAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse, request, callback); + }, "name", { value: "StopAirflowCommand" }); + + /** + * Calls StopAirflowCommand. + * @function stopAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest} request StopAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|pollAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef PollAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} [response] PollAirflowCommandResponse + */ + + /** + * Calls PollAirflowCommand. + * @function pollAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest} request PollAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.PollAirflowCommandCallback} callback Node-style callback called with the error, if any, and PollAirflowCommandResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.pollAirflowCommand = function pollAirflowCommand(request, callback) { + return this.rpcCall(pollAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse, request, callback); + }, "name", { value: "PollAirflowCommand" }); + + /** + * Calls PollAirflowCommand. + * @function pollAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest} request PollAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|saveSnapshot}. * @memberof google.cloud.orchestration.airflow.service.v1.Environments @@ -347,6 +446,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|databaseFailover}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef DatabaseFailoverCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DatabaseFailover. + * @function databaseFailover + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest} request DatabaseFailoverRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.DatabaseFailoverCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.databaseFailover = function databaseFailover(request, callback) { + return this.rpcCall(databaseFailover, $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DatabaseFailover" }); + + /** + * Calls DatabaseFailover. + * @function databaseFailover + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest} request DatabaseFailoverRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|fetchDatabaseProperties}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef FetchDatabasePropertiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} [response] FetchDatabasePropertiesResponse + */ + + /** + * Calls FetchDatabaseProperties. + * @function fetchDatabaseProperties + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest} request FetchDatabasePropertiesRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.FetchDatabasePropertiesCallback} callback Node-style callback called with the error, if any, and FetchDatabasePropertiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.fetchDatabaseProperties = function fetchDatabaseProperties(request, callback) { + return this.rpcCall(fetchDatabaseProperties, $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest, $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse, request, callback); + }, "name", { value: "FetchDatabaseProperties" }); + + /** + * Calls FetchDatabaseProperties. + * @function fetchDatabaseProperties + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest} request FetchDatabasePropertiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Environments; })(); @@ -1746,25 +1911,28 @@ return UpdateEnvironmentRequest; })(); - v1.SaveSnapshotRequest = (function() { + v1.ExecuteAirflowCommandRequest = (function() { /** - * Properties of a SaveSnapshotRequest. + * Properties of an ExecuteAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ISaveSnapshotRequest - * @property {string|null} [environment] SaveSnapshotRequest environment - * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation + * @interface IExecuteAirflowCommandRequest + * @property {string|null} [environment] ExecuteAirflowCommandRequest environment + * @property {string|null} [command] ExecuteAirflowCommandRequest command + * @property {string|null} [subcommand] ExecuteAirflowCommandRequest subcommand + * @property {Array.|null} [parameters] ExecuteAirflowCommandRequest parameters */ /** - * Constructs a new SaveSnapshotRequest. + * Constructs a new ExecuteAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a SaveSnapshotRequest. - * @implements ISaveSnapshotRequest + * @classdesc Represents an ExecuteAirflowCommandRequest. + * @implements IExecuteAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest=} [properties] Properties to set */ - function SaveSnapshotRequest(properties) { + function ExecuteAirflowCommandRequest(properties) { + this.parameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1772,80 +1940,101 @@ } /** - * SaveSnapshotRequest environment. + * ExecuteAirflowCommandRequest environment. * @member {string} environment - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @instance */ - SaveSnapshotRequest.prototype.environment = ""; + ExecuteAirflowCommandRequest.prototype.environment = ""; /** - * SaveSnapshotRequest snapshotLocation. - * @member {string} snapshotLocation - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * ExecuteAirflowCommandRequest command. + * @member {string} command + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @instance */ - SaveSnapshotRequest.prototype.snapshotLocation = ""; + ExecuteAirflowCommandRequest.prototype.command = ""; /** - * Creates a new SaveSnapshotRequest instance using the specified properties. + * ExecuteAirflowCommandRequest subcommand. + * @member {string} subcommand + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest + * @instance + */ + ExecuteAirflowCommandRequest.prototype.subcommand = ""; + + /** + * ExecuteAirflowCommandRequest parameters. + * @member {Array.} parameters + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest + * @instance + */ + ExecuteAirflowCommandRequest.prototype.parameters = $util.emptyArray; + + /** + * Creates a new ExecuteAirflowCommandRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest instance */ - SaveSnapshotRequest.create = function create(properties) { - return new SaveSnapshotRequest(properties); + ExecuteAirflowCommandRequest.create = function create(properties) { + return new ExecuteAirflowCommandRequest(properties); }; /** - * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotRequest.encode = function encode(message, writer) { + ExecuteAirflowCommandRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); - if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); + if (message.command != null && Object.hasOwnProperty.call(message, "command")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.command); + if (message.subcommand != null && Object.hasOwnProperty.call(message, "subcommand")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subcommand); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parameters[i]); return writer; }; /** - * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotRequest.decode = function decode(reader, length) { + ExecuteAirflowCommandRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1854,7 +2043,17 @@ break; } case 2: { - message.snapshotLocation = reader.string(); + message.command = reader.string(); + break; + } + case 3: { + message.subcommand = reader.string(); + break; + } + case 4: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push(reader.string()); break; } default: @@ -1866,131 +2065,163 @@ }; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SaveSnapshotRequest message. + * Verifies an ExecuteAirflowCommandRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SaveSnapshotRequest.verify = function verify(message) { + ExecuteAirflowCommandRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.environment != null && message.hasOwnProperty("environment")) if (!$util.isString(message.environment)) return "environment: string expected"; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - if (!$util.isString(message.snapshotLocation)) - return "snapshotLocation: string expected"; + if (message.command != null && message.hasOwnProperty("command")) + if (!$util.isString(message.command)) + return "command: string expected"; + if (message.subcommand != null && message.hasOwnProperty("subcommand")) + if (!$util.isString(message.subcommand)) + return "subcommand: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) + if (!$util.isString(message.parameters[i])) + return "parameters: string[] expected"; + } return null; }; /** - * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest */ - SaveSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest) + ExecuteAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest(); if (object.environment != null) message.environment = String(object.environment); - if (object.snapshotLocation != null) - message.snapshotLocation = String(object.snapshotLocation); + if (object.command != null) + message.command = String(object.command); + if (object.subcommand != null) + message.subcommand = String(object.subcommand); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) + message.parameters[i] = String(object.parameters[i]); + } return message; }; /** - * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteAirflowCommandRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} message SaveSnapshotRequest + * @param {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SaveSnapshotRequest.toObject = function toObject(message, options) { + ExecuteAirflowCommandRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; if (options.defaults) { object.environment = ""; - object.snapshotLocation = ""; + object.command = ""; + object.subcommand = ""; } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = message.environment; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - object.snapshotLocation = message.snapshotLocation; + if (message.command != null && message.hasOwnProperty("command")) + object.command = message.command; + if (message.subcommand != null && message.hasOwnProperty("subcommand")) + object.subcommand = message.subcommand; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = message.parameters[j]; + } return object; }; /** - * Converts this SaveSnapshotRequest to JSON. + * Converts this ExecuteAirflowCommandRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @instance * @returns {Object.} JSON object */ - SaveSnapshotRequest.prototype.toJSON = function toJSON() { + ExecuteAirflowCommandRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SaveSnapshotRequest + * Gets the default type url for ExecuteAirflowCommandRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest"; }; - return SaveSnapshotRequest; + return ExecuteAirflowCommandRequest; })(); - v1.SaveSnapshotResponse = (function() { + v1.ExecuteAirflowCommandResponse = (function() { /** - * Properties of a SaveSnapshotResponse. + * Properties of an ExecuteAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ISaveSnapshotResponse - * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath + * @interface IExecuteAirflowCommandResponse + * @property {string|null} [executionId] ExecuteAirflowCommandResponse executionId + * @property {string|null} [pod] ExecuteAirflowCommandResponse pod + * @property {string|null} [podNamespace] ExecuteAirflowCommandResponse podNamespace + * @property {string|null} [error] ExecuteAirflowCommandResponse error */ /** - * Constructs a new SaveSnapshotResponse. + * Constructs a new ExecuteAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a SaveSnapshotResponse. - * @implements ISaveSnapshotResponse + * @classdesc Represents an ExecuteAirflowCommandResponse. + * @implements IExecuteAirflowCommandResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse=} [properties] Properties to set */ - function SaveSnapshotResponse(properties) { + function ExecuteAirflowCommandResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1998,75 +2229,117 @@ } /** - * SaveSnapshotResponse snapshotPath. - * @member {string} snapshotPath - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * ExecuteAirflowCommandResponse executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @instance */ - SaveSnapshotResponse.prototype.snapshotPath = ""; + ExecuteAirflowCommandResponse.prototype.executionId = ""; /** - * Creates a new SaveSnapshotResponse instance using the specified properties. + * ExecuteAirflowCommandResponse pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.pod = ""; + + /** + * ExecuteAirflowCommandResponse podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.podNamespace = ""; + + /** + * ExecuteAirflowCommandResponse error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.error = ""; + + /** + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse instance + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse instance */ - SaveSnapshotResponse.create = function create(properties) { - return new SaveSnapshotResponse(properties); + ExecuteAirflowCommandResponse.create = function create(properties) { + return new ExecuteAirflowCommandResponse(properties); }; /** - * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotResponse.encode = function encode(message, writer) { + ExecuteAirflowCommandResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); - return writer; - }; - - /** - * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.podNamespace); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.error); + return writer; + }; + + /** + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotResponse.decode = function decode(reader, length) { + ExecuteAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.snapshotPath = reader.string(); + message.executionId = reader.string(); + break; + } + case 2: { + message.pod = reader.string(); + break; + } + case 3: { + message.podNamespace = reader.string(); + break; + } + case 4: { + message.error = reader.string(); break; } default: @@ -2078,127 +2351,151 @@ }; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + ExecuteAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SaveSnapshotResponse message. + * Verifies an ExecuteAirflowCommandResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SaveSnapshotResponse.verify = function verify(message) { + ExecuteAirflowCommandResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - if (!$util.isString(message.snapshotPath)) - return "snapshotPath: string expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; return null; }; /** - * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse */ - SaveSnapshotResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse) + ExecuteAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); - if (object.snapshotPath != null) - message.snapshotPath = String(object.snapshotPath); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse(); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.error != null) + message.error = String(object.error); return message; }; /** - * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} message SaveSnapshotResponse + * @param {google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SaveSnapshotResponse.toObject = function toObject(message, options) { + ExecuteAirflowCommandResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.snapshotPath = ""; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - object.snapshotPath = message.snapshotPath; + if (options.defaults) { + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.error = ""; + } + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; return object; }; /** - * Converts this SaveSnapshotResponse to JSON. + * Converts this ExecuteAirflowCommandResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @instance * @returns {Object.} JSON object */ - SaveSnapshotResponse.prototype.toJSON = function toJSON() { + ExecuteAirflowCommandResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SaveSnapshotResponse + * Gets the default type url for ExecuteAirflowCommandResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse"; }; - return SaveSnapshotResponse; + return ExecuteAirflowCommandResponse; })(); - v1.LoadSnapshotRequest = (function() { + v1.StopAirflowCommandRequest = (function() { /** - * Properties of a LoadSnapshotRequest. + * Properties of a StopAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ILoadSnapshotRequest - * @property {string|null} [environment] LoadSnapshotRequest environment - * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath - * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation - * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting - * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting - * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying + * @interface IStopAirflowCommandRequest + * @property {string|null} [environment] StopAirflowCommandRequest environment + * @property {string|null} [executionId] StopAirflowCommandRequest executionId + * @property {string|null} [pod] StopAirflowCommandRequest pod + * @property {string|null} [podNamespace] StopAirflowCommandRequest podNamespace + * @property {boolean|null} [force] StopAirflowCommandRequest force */ /** - * Constructs a new LoadSnapshotRequest. + * Constructs a new StopAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a LoadSnapshotRequest. - * @implements ILoadSnapshotRequest + * @classdesc Represents a StopAirflowCommandRequest. + * @implements IStopAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest=} [properties] Properties to set */ - function LoadSnapshotRequest(properties) { + function StopAirflowCommandRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2206,120 +2503,110 @@ } /** - * LoadSnapshotRequest environment. + * StopAirflowCommandRequest environment. * @member {string} environment - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest - * @instance - */ - LoadSnapshotRequest.prototype.environment = ""; - - /** - * LoadSnapshotRequest snapshotPath. - * @member {string} snapshotPath - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance */ - LoadSnapshotRequest.prototype.snapshotPath = ""; + StopAirflowCommandRequest.prototype.environment = ""; /** - * LoadSnapshotRequest skipPypiPackagesInstallation. - * @member {boolean} skipPypiPackagesInstallation - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * StopAirflowCommandRequest executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance */ - LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; + StopAirflowCommandRequest.prototype.executionId = ""; /** - * LoadSnapshotRequest skipEnvironmentVariablesSetting. - * @member {boolean} skipEnvironmentVariablesSetting - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * StopAirflowCommandRequest pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance */ - LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; + StopAirflowCommandRequest.prototype.pod = ""; /** - * LoadSnapshotRequest skipAirflowOverridesSetting. - * @member {boolean} skipAirflowOverridesSetting - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * StopAirflowCommandRequest podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance */ - LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; + StopAirflowCommandRequest.prototype.podNamespace = ""; /** - * LoadSnapshotRequest skipGcsDataCopying. - * @member {boolean} skipGcsDataCopying - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * StopAirflowCommandRequest force. + * @member {boolean} force + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance */ - LoadSnapshotRequest.prototype.skipGcsDataCopying = false; + StopAirflowCommandRequest.prototype.force = false; /** - * Creates a new LoadSnapshotRequest instance using the specified properties. + * Creates a new StopAirflowCommandRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest} StopAirflowCommandRequest instance */ - LoadSnapshotRequest.create = function create(properties) { - return new LoadSnapshotRequest(properties); + StopAirflowCommandRequest.create = function create(properties) { + return new StopAirflowCommandRequest(properties); }; /** - * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * Encodes the specified StopAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest} message StopAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotRequest.encode = function encode(message, writer) { + StopAirflowCommandRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); - if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); - if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); - if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); - if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); - if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.podNamespace); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); return writer; }; /** - * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * Encodes the specified StopAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest} message StopAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + StopAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest} StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotRequest.decode = function decode(reader, length) { + StopAirflowCommandRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2328,23 +2615,19 @@ break; } case 2: { - message.snapshotPath = reader.string(); + message.executionId = reader.string(); break; } case 3: { - message.skipPypiPackagesInstallation = reader.bool(); + message.pod = reader.string(); break; } case 4: { - message.skipEnvironmentVariablesSetting = reader.bool(); + message.podNamespace = reader.string(); break; } case 5: { - message.skipAirflowOverridesSetting = reader.bool(); - break; - } - case 6: { - message.skipGcsDataCopying = reader.bool(); + message.force = reader.bool(); break; } default: @@ -2356,162 +2639,157 @@ }; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest} StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + StopAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LoadSnapshotRequest message. + * Verifies a StopAirflowCommandRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LoadSnapshotRequest.verify = function verify(message) { + StopAirflowCommandRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.environment != null && message.hasOwnProperty("environment")) if (!$util.isString(message.environment)) return "environment: string expected"; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - if (!$util.isString(message.snapshotPath)) - return "snapshotPath: string expected"; - if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) - if (typeof message.skipPypiPackagesInstallation !== "boolean") - return "skipPypiPackagesInstallation: boolean expected"; - if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) - if (typeof message.skipEnvironmentVariablesSetting !== "boolean") - return "skipEnvironmentVariablesSetting: boolean expected"; - if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) - if (typeof message.skipAirflowOverridesSetting !== "boolean") - return "skipAirflowOverridesSetting: boolean expected"; - if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) - if (typeof message.skipGcsDataCopying !== "boolean") - return "skipGcsDataCopying: boolean expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest} StopAirflowCommandRequest */ - LoadSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest) + StopAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); + var message = new $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest(); if (object.environment != null) message.environment = String(object.environment); - if (object.snapshotPath != null) - message.snapshotPath = String(object.snapshotPath); - if (object.skipPypiPackagesInstallation != null) - message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); - if (object.skipEnvironmentVariablesSetting != null) - message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); - if (object.skipAirflowOverridesSetting != null) - message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); - if (object.skipGcsDataCopying != null) - message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); - return message; - }; - + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + /** - * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a StopAirflowCommandRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} message LoadSnapshotRequest + * @param {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest} message StopAirflowCommandRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LoadSnapshotRequest.toObject = function toObject(message, options) { + StopAirflowCommandRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.environment = ""; - object.snapshotPath = ""; - object.skipPypiPackagesInstallation = false; - object.skipEnvironmentVariablesSetting = false; - object.skipAirflowOverridesSetting = false; - object.skipGcsDataCopying = false; + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.force = false; } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = message.environment; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - object.snapshotPath = message.snapshotPath; - if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) - object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; - if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) - object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; - if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) - object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; - if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) - object.skipGcsDataCopying = message.skipGcsDataCopying; + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this LoadSnapshotRequest to JSON. + * Converts this StopAirflowCommandRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @instance * @returns {Object.} JSON object */ - LoadSnapshotRequest.prototype.toJSON = function toJSON() { + StopAirflowCommandRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LoadSnapshotRequest + * Gets the default type url for StopAirflowCommandRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest"; }; - return LoadSnapshotRequest; + return StopAirflowCommandRequest; })(); - v1.LoadSnapshotResponse = (function() { + v1.StopAirflowCommandResponse = (function() { /** - * Properties of a LoadSnapshotResponse. + * Properties of a StopAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ILoadSnapshotResponse + * @interface IStopAirflowCommandResponse + * @property {boolean|null} [isDone] StopAirflowCommandResponse isDone + * @property {Array.|null} [output] StopAirflowCommandResponse output */ /** - * Constructs a new LoadSnapshotResponse. + * Constructs a new StopAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a LoadSnapshotResponse. - * @implements ILoadSnapshotResponse + * @classdesc Represents a StopAirflowCommandResponse. + * @implements IStopAirflowCommandResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse=} [properties] Properties to set */ - function LoadSnapshotResponse(properties) { + function StopAirflowCommandResponse(properties) { + this.output = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2519,63 +2797,94 @@ } /** - * Creates a new LoadSnapshotResponse instance using the specified properties. + * StopAirflowCommandResponse isDone. + * @member {boolean} isDone + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse + * @instance + */ + StopAirflowCommandResponse.prototype.isDone = false; + + /** + * StopAirflowCommandResponse output. + * @member {Array.} output + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse + * @instance + */ + StopAirflowCommandResponse.prototype.output = $util.emptyArray; + + /** + * Creates a new StopAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse instance + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} StopAirflowCommandResponse instance */ - LoadSnapshotResponse.create = function create(properties) { - return new LoadSnapshotResponse(properties); + StopAirflowCommandResponse.create = function create(properties) { + return new StopAirflowCommandResponse(properties); }; /** - * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * Encodes the specified StopAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse} message StopAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotResponse.encode = function encode(message, writer) { + StopAirflowCommandResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.isDone != null && Object.hasOwnProperty.call(message, "isDone")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isDone); + if (message.output != null && message.output.length) + for (var i = 0; i < message.output.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.output[i]); return writer; }; /** - * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * Encodes the specified StopAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse} message StopAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + StopAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotResponse.decode = function decode(reader, length) { + StopAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.isDone = reader.bool(); + break; + } + case 2: { + if (!(message.output && message.output.length)) + message.output = []; + message.output.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -2585,125 +2894,147 @@ }; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + StopAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LoadSnapshotResponse message. + * Verifies a StopAirflowCommandResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LoadSnapshotResponse.verify = function verify(message) { + StopAirflowCommandResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.isDone != null && message.hasOwnProperty("isDone")) + if (typeof message.isDone !== "boolean") + return "isDone: boolean expected"; + if (message.output != null && message.hasOwnProperty("output")) { + if (!Array.isArray(message.output)) + return "output: array expected"; + for (var i = 0; i < message.output.length; ++i) + if (!$util.isString(message.output[i])) + return "output: string[] expected"; + } return null; }; /** - * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} StopAirflowCommandResponse */ - LoadSnapshotResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse) + StopAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse) return object; - return new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); + var message = new $root.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse(); + if (object.isDone != null) + message.isDone = Boolean(object.isDone); + if (object.output) { + if (!Array.isArray(object.output)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse.output: array expected"); + message.output = []; + for (var i = 0; i < object.output.length; ++i) + message.output[i] = String(object.output[i]); + } + return message; }; /** - * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * Creates a plain object from a StopAirflowCommandResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} message LoadSnapshotResponse + * @param {google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse} message StopAirflowCommandResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LoadSnapshotResponse.toObject = function toObject() { - return {}; + StopAirflowCommandResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.output = []; + if (options.defaults) + object.isDone = false; + if (message.isDone != null && message.hasOwnProperty("isDone")) + object.isDone = message.isDone; + if (message.output && message.output.length) { + object.output = []; + for (var j = 0; j < message.output.length; ++j) + object.output[j] = message.output[j]; + } + return object; }; /** - * Converts this LoadSnapshotResponse to JSON. + * Converts this StopAirflowCommandResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @instance * @returns {Object.} JSON object */ - LoadSnapshotResponse.prototype.toJSON = function toJSON() { + StopAirflowCommandResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LoadSnapshotResponse + * Gets the default type url for StopAirflowCommandResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse"; }; - return LoadSnapshotResponse; + return StopAirflowCommandResponse; })(); - v1.EnvironmentConfig = (function() { + v1.PollAirflowCommandRequest = (function() { /** - * Properties of an EnvironmentConfig. + * Properties of a PollAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEnvironmentConfig - * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster - * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix - * @property {number|null} [nodeCount] EnvironmentConfig nodeCount - * @property {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig - * @property {google.cloud.orchestration.airflow.service.v1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig - * @property {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig - * @property {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl - * @property {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig - * @property {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig - * @property {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig - * @property {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null} [maintenanceWindow] EnvironmentConfig maintenanceWindow - * @property {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null} [workloadsConfig] EnvironmentConfig workloadsConfig - * @property {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize - * @property {string|null} [airflowUri] EnvironmentConfig airflowUri - * @property {string|null} [airflowByoidUri] EnvironmentConfig airflowByoidUri - * @property {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null} [masterAuthorizedNetworksConfig] EnvironmentConfig masterAuthorizedNetworksConfig - * @property {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null} [recoveryConfig] EnvironmentConfig recoveryConfig + * @interface IPollAirflowCommandRequest + * @property {string|null} [environment] PollAirflowCommandRequest environment + * @property {string|null} [executionId] PollAirflowCommandRequest executionId + * @property {string|null} [pod] PollAirflowCommandRequest pod + * @property {string|null} [podNamespace] PollAirflowCommandRequest podNamespace + * @property {number|null} [nextLineNumber] PollAirflowCommandRequest nextLineNumber */ /** - * Constructs a new EnvironmentConfig. + * Constructs a new PollAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an EnvironmentConfig. - * @implements IEnvironmentConfig + * @classdesc Represents a PollAirflowCommandRequest. + * @implements IPollAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest=} [properties] Properties to set */ - function EnvironmentConfig(properties) { + function PollAirflowCommandRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2711,299 +3042,401 @@ } /** - * EnvironmentConfig gkeCluster. - * @member {string} gkeCluster - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.gkeCluster = ""; - - /** - * EnvironmentConfig dagGcsPrefix. - * @member {string} dagGcsPrefix - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.dagGcsPrefix = ""; - - /** - * EnvironmentConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance */ - EnvironmentConfig.prototype.nodeCount = 0; + PollAirflowCommandRequest.prototype.environment = ""; /** - * EnvironmentConfig softwareConfig. - * @member {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null|undefined} softwareConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandRequest executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance */ - EnvironmentConfig.prototype.softwareConfig = null; + PollAirflowCommandRequest.prototype.executionId = ""; /** - * EnvironmentConfig nodeConfig. - * @member {google.cloud.orchestration.airflow.service.v1.INodeConfig|null|undefined} nodeConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandRequest pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance */ - EnvironmentConfig.prototype.nodeConfig = null; + PollAirflowCommandRequest.prototype.pod = ""; /** - * EnvironmentConfig privateEnvironmentConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandRequest podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance */ - EnvironmentConfig.prototype.privateEnvironmentConfig = null; + PollAirflowCommandRequest.prototype.podNamespace = ""; /** - * EnvironmentConfig webServerNetworkAccessControl. - * @member {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandRequest nextLineNumber. + * @member {number} nextLineNumber + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance */ - EnvironmentConfig.prototype.webServerNetworkAccessControl = null; + PollAirflowCommandRequest.prototype.nextLineNumber = 0; /** - * EnvironmentConfig databaseConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null|undefined} databaseConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + * Creates a new PollAirflowCommandRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest} PollAirflowCommandRequest instance */ - EnvironmentConfig.prototype.databaseConfig = null; + PollAirflowCommandRequest.create = function create(properties) { + return new PollAirflowCommandRequest(properties); + }; /** - * EnvironmentConfig webServerConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null|undefined} webServerConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + * Encodes the specified PollAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest} message PollAirflowCommandRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.prototype.webServerConfig = null; + PollAirflowCommandRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.podNamespace); + if (message.nextLineNumber != null && Object.hasOwnProperty.call(message, "nextLineNumber")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nextLineNumber); + return writer; + }; /** - * EnvironmentConfig encryptionConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + * Encodes the specified PollAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest} message PollAirflowCommandRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.prototype.encryptionConfig = null; + PollAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * EnvironmentConfig maintenanceWindow. - * @member {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null|undefined} maintenanceWindow - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest} PollAirflowCommandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.prototype.maintenanceWindow = null; - - /** - * EnvironmentConfig workloadsConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null|undefined} workloadsConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + PollAirflowCommandRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.executionId = reader.string(); + break; + } + case 3: { + message.pod = reader.string(); + break; + } + case 4: { + message.podNamespace = reader.string(); + break; + } + case 5: { + message.nextLineNumber = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest} PollAirflowCommandRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.prototype.workloadsConfig = null; + PollAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * EnvironmentConfig environmentSize. - * @member {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize} environmentSize - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance + * Verifies a PollAirflowCommandRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnvironmentConfig.prototype.environmentSize = 0; + PollAirflowCommandRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.nextLineNumber != null && message.hasOwnProperty("nextLineNumber")) + if (!$util.isInteger(message.nextLineNumber)) + return "nextLineNumber: integer expected"; + return null; + }; /** - * EnvironmentConfig airflowUri. - * @member {string} airflowUri - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * Creates a PollAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest} PollAirflowCommandRequest + */ + PollAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.nextLineNumber != null) + message.nextLineNumber = object.nextLineNumber | 0; + return message; + }; + + /** + * Creates a plain object from a PollAirflowCommandRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest} message PollAirflowCommandRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PollAirflowCommandRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.nextLineNumber = 0; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.nextLineNumber != null && message.hasOwnProperty("nextLineNumber")) + object.nextLineNumber = message.nextLineNumber; + return object; + }; + + /** + * Converts this PollAirflowCommandRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest * @instance + * @returns {Object.} JSON object */ - EnvironmentConfig.prototype.airflowUri = ""; + PollAirflowCommandRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * EnvironmentConfig airflowByoidUri. - * @member {string} airflowByoidUri - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * Gets the default type url for PollAirflowCommandRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PollAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest"; + }; + + return PollAirflowCommandRequest; + })(); + + v1.PollAirflowCommandResponse = (function() { + + /** + * Properties of a PollAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IPollAirflowCommandResponse + * @property {Array.|null} [output] PollAirflowCommandResponse output + * @property {boolean|null} [outputEnd] PollAirflowCommandResponse outputEnd + * @property {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo|null} [exitInfo] PollAirflowCommandResponse exitInfo + */ + + /** + * Constructs a new PollAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a PollAirflowCommandResponse. + * @implements IPollAirflowCommandResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse=} [properties] Properties to set + */ + function PollAirflowCommandResponse(properties) { + this.output = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PollAirflowCommandResponse output. + * @member {Array.} output + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @instance */ - EnvironmentConfig.prototype.airflowByoidUri = ""; + PollAirflowCommandResponse.prototype.output = $util.emptyArray; /** - * EnvironmentConfig masterAuthorizedNetworksConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null|undefined} masterAuthorizedNetworksConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandResponse outputEnd. + * @member {boolean} outputEnd + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @instance */ - EnvironmentConfig.prototype.masterAuthorizedNetworksConfig = null; + PollAirflowCommandResponse.prototype.outputEnd = false; /** - * EnvironmentConfig recoveryConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null|undefined} recoveryConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * PollAirflowCommandResponse exitInfo. + * @member {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo|null|undefined} exitInfo + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @instance */ - EnvironmentConfig.prototype.recoveryConfig = null; + PollAirflowCommandResponse.prototype.exitInfo = null; /** - * Creates a new EnvironmentConfig instance using the specified properties. + * Creates a new PollAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} PollAirflowCommandResponse instance */ - EnvironmentConfig.create = function create(properties) { - return new EnvironmentConfig(properties); + PollAirflowCommandResponse.create = function create(properties) { + return new PollAirflowCommandResponse(properties); }; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encode = function encode(message, writer) { + PollAirflowCommandResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); - if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); - if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) - $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) - $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); - if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) - $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) - $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) - $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) - $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) - $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.workloadsConfig != null && Object.hasOwnProperty.call(message, "workloadsConfig")) - $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.encode(message.workloadsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.environmentSize != null && Object.hasOwnProperty.call(message, "environmentSize")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.environmentSize); - if (message.masterAuthorizedNetworksConfig != null && Object.hasOwnProperty.call(message, "masterAuthorizedNetworksConfig")) - $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.encode(message.masterAuthorizedNetworksConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.recoveryConfig != null && Object.hasOwnProperty.call(message, "recoveryConfig")) - $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.encode(message.recoveryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.airflowByoidUri != null && Object.hasOwnProperty.call(message, "airflowByoidUri")) - writer.uint32(/* id 20, wireType 2 =*/162).string(message.airflowByoidUri); + if (message.output != null && message.output.length) + for (var i = 0; i < message.output.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.encode(message.output[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputEnd != null && Object.hasOwnProperty.call(message, "outputEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.outputEnd); + if (message.exitInfo != null && Object.hasOwnProperty.call(message, "exitInfo")) + $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.encode(message.exitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + PollAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decode = function decode(reader, length) { + PollAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.gkeCluster = reader.string(); + if (!(message.output && message.output.length)) + message.output = []; + message.output.push($root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.decode(reader, reader.uint32())); break; } case 2: { - message.dagGcsPrefix = reader.string(); + message.outputEnd = reader.bool(); break; } case 3: { - message.nodeCount = reader.int32(); - break; - } - case 4: { - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); - break; - } - case 9: { - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 12: { - message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.decode(reader, reader.uint32()); - break; - } - case 15: { - message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.decode(reader, reader.uint32()); - break; - } - case 16: { - message.environmentSize = reader.int32(); - break; - } - case 6: { - message.airflowUri = reader.string(); - break; - } - case 20: { - message.airflowByoidUri = reader.string(); - break; - } - case 17: { - message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.decode(reader, reader.uint32()); - break; - } - case 18: { - message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.decode(reader, reader.uint32()); + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.decode(reader, reader.uint32()); break; } default: @@ -3015,575 +3448,387 @@ }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + PollAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnvironmentConfig message. + * Verifies a PollAirflowCommandResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnvironmentConfig.verify = function verify(message) { + PollAirflowCommandResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - if (!$util.isString(message.gkeCluster)) - return "gkeCluster: string expected"; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - if (!$util.isString(message.dagGcsPrefix)) - return "dagGcsPrefix: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify(message.softwareConfig); - if (error) - return "softwareConfig." + error; - } - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.verify(message.nodeConfig); - if (error) - return "nodeConfig." + error; - } - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); - if (error) - return "privateEnvironmentConfig." + error; - } - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); - if (error) - return "webServerNetworkAccessControl." + error; - } - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify(message.databaseConfig); - if (error) - return "databaseConfig." + error; - } - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify(message.webServerConfig); - if (error) - return "webServerConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify(message.maintenanceWindow); - if (error) - return "maintenanceWindow." + error; - } - if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify(message.workloadsConfig); - if (error) - return "workloadsConfig." + error; - } - if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) - switch (message.environmentSize) { - default: - return "environmentSize: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.output != null && message.hasOwnProperty("output")) { + if (!Array.isArray(message.output)) + return "output: array expected"; + for (var i = 0; i < message.output.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.verify(message.output[i]); + if (error) + return "output." + error; } - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - if (!$util.isString(message.airflowUri)) - return "airflowUri: string expected"; - if (message.airflowByoidUri != null && message.hasOwnProperty("airflowByoidUri")) - if (!$util.isString(message.airflowByoidUri)) - return "airflowByoidUri: string expected"; - if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify(message.masterAuthorizedNetworksConfig); - if (error) - return "masterAuthorizedNetworksConfig." + error; } - if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify(message.recoveryConfig); + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + if (typeof message.outputEnd !== "boolean") + return "outputEnd: boolean expected"; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.verify(message.exitInfo); if (error) - return "recoveryConfig." + error; + return "exitInfo." + error; } return null; }; /** - * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} PollAirflowCommandResponse */ - EnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig) + PollAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); - if (object.gkeCluster != null) - message.gkeCluster = String(object.gkeCluster); - if (object.dagGcsPrefix != null) - message.dagGcsPrefix = String(object.dagGcsPrefix); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.softwareConfig != null) { - if (typeof object.softwareConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.softwareConfig: object expected"); - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.fromObject(object.softwareConfig); - } - if (object.nodeConfig != null) { - if (typeof object.nodeConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.nodeConfig: object expected"); - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.fromObject(object.nodeConfig); - } - if (object.privateEnvironmentConfig != null) { - if (typeof object.privateEnvironmentConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.privateEnvironmentConfig: object expected"); - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); - } - if (object.webServerNetworkAccessControl != null) { - if (typeof object.webServerNetworkAccessControl !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); - } - if (object.databaseConfig != null) { - if (typeof object.databaseConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.databaseConfig: object expected"); - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.fromObject(object.databaseConfig); - } - if (object.webServerConfig != null) { - if (typeof object.webServerConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerConfig: object expected"); - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.fromObject(object.webServerConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.maintenanceWindow != null) { - if (typeof object.maintenanceWindow !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.maintenanceWindow: object expected"); - message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.fromObject(object.maintenanceWindow); - } - if (object.workloadsConfig != null) { - if (typeof object.workloadsConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.workloadsConfig: object expected"); - message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.fromObject(object.workloadsConfig); - } - switch (object.environmentSize) { - default: - if (typeof object.environmentSize === "number") { - message.environmentSize = object.environmentSize; - break; + var message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse(); + if (object.output) { + if (!Array.isArray(object.output)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.output: array expected"); + message.output = []; + for (var i = 0; i < object.output.length; ++i) { + if (typeof object.output[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.output: object expected"); + message.output[i] = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.fromObject(object.output[i]); } - break; - case "ENVIRONMENT_SIZE_UNSPECIFIED": - case 0: - message.environmentSize = 0; - break; - case "ENVIRONMENT_SIZE_SMALL": - case 1: - message.environmentSize = 1; - break; - case "ENVIRONMENT_SIZE_MEDIUM": - case 2: - message.environmentSize = 2; - break; - case "ENVIRONMENT_SIZE_LARGE": - case 3: - message.environmentSize = 3; - break; - } - if (object.airflowUri != null) - message.airflowUri = String(object.airflowUri); - if (object.airflowByoidUri != null) - message.airflowByoidUri = String(object.airflowByoidUri); - if (object.masterAuthorizedNetworksConfig != null) { - if (typeof object.masterAuthorizedNetworksConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.masterAuthorizedNetworksConfig: object expected"); - message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.fromObject(object.masterAuthorizedNetworksConfig); } - if (object.recoveryConfig != null) { - if (typeof object.recoveryConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.recoveryConfig: object expected"); - message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.fromObject(object.recoveryConfig); + if (object.outputEnd != null) + message.outputEnd = Boolean(object.outputEnd); + if (object.exitInfo != null) { + if (typeof object.exitInfo !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.exitInfo: object expected"); + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.fromObject(object.exitInfo); } return message; }; /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} message EnvironmentConfig + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse} message PollAirflowCommandResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnvironmentConfig.toObject = function toObject(message, options) { + PollAirflowCommandResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.output = []; if (options.defaults) { - object.gkeCluster = ""; - object.dagGcsPrefix = ""; - object.nodeCount = 0; - object.softwareConfig = null; - object.nodeConfig = null; - object.airflowUri = ""; - object.privateEnvironmentConfig = null; - object.webServerNetworkAccessControl = null; - object.databaseConfig = null; - object.webServerConfig = null; - object.encryptionConfig = null; - object.maintenanceWindow = null; - object.workloadsConfig = null; - object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; - object.masterAuthorizedNetworksConfig = null; - object.recoveryConfig = null; - object.airflowByoidUri = ""; + object.outputEnd = false; + object.exitInfo = null; } - if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - object.gkeCluster = message.gkeCluster; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - object.dagGcsPrefix = message.dagGcsPrefix; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) - object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.toObject(message.softwareConfig, options); - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) - object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.toObject(message.nodeConfig, options); - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - object.airflowUri = message.airflowUri; - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) - object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) - object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) - object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.toObject(message.databaseConfig, options); - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) - object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.toObject(message.webServerConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) - object.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.toObject(message.maintenanceWindow, options); - if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) - object.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.toObject(message.workloadsConfig, options); - if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) - object.environmentSize = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] === undefined ? message.environmentSize : $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] : message.environmentSize; - if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) - object.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.toObject(message.masterAuthorizedNetworksConfig, options); - if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) - object.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.toObject(message.recoveryConfig, options); - if (message.airflowByoidUri != null && message.hasOwnProperty("airflowByoidUri")) - object.airflowByoidUri = message.airflowByoidUri; + if (message.output && message.output.length) { + object.output = []; + for (var j = 0; j < message.output.length; ++j) + object.output[j] = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.toObject(message.output[j], options); + } + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + object.outputEnd = message.outputEnd; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) + object.exitInfo = $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.toObject(message.exitInfo, options); return object; }; /** - * Converts this EnvironmentConfig to JSON. + * Converts this PollAirflowCommandResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @instance * @returns {Object.} JSON object */ - EnvironmentConfig.prototype.toJSON = function toJSON() { + PollAirflowCommandResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnvironmentConfig + * Gets the default type url for PollAirflowCommandResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PollAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EnvironmentConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse"; }; - /** - * EnvironmentSize enum. - * @name google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize - * @enum {number} - * @property {number} ENVIRONMENT_SIZE_UNSPECIFIED=0 ENVIRONMENT_SIZE_UNSPECIFIED value - * @property {number} ENVIRONMENT_SIZE_SMALL=1 ENVIRONMENT_SIZE_SMALL value - * @property {number} ENVIRONMENT_SIZE_MEDIUM=2 ENVIRONMENT_SIZE_MEDIUM value - * @property {number} ENVIRONMENT_SIZE_LARGE=3 ENVIRONMENT_SIZE_LARGE value - */ - EnvironmentConfig.EnvironmentSize = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENVIRONMENT_SIZE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENVIRONMENT_SIZE_SMALL"] = 1; - values[valuesById[2] = "ENVIRONMENT_SIZE_MEDIUM"] = 2; - values[valuesById[3] = "ENVIRONMENT_SIZE_LARGE"] = 3; - return values; - })(); + PollAirflowCommandResponse.Line = (function() { - return EnvironmentConfig; - })(); + /** + * Properties of a Line. + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse + * @interface ILine + * @property {number|null} [lineNumber] Line lineNumber + * @property {string|null} [content] Line content + */ - v1.WebServerNetworkAccessControl = (function() { + /** + * Constructs a new Line. + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse + * @classdesc Represents a Line. + * @implements ILine + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + */ + function Line(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a WebServerNetworkAccessControl. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IWebServerNetworkAccessControl - * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges - */ + /** + * Line lineNumber. + * @member {number} lineNumber + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.lineNumber = 0; - /** - * Constructs a new WebServerNetworkAccessControl. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a WebServerNetworkAccessControl. - * @implements IWebServerNetworkAccessControl - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set - */ - function WebServerNetworkAccessControl(properties) { - this.allowedIpRanges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Line content. + * @member {string} content + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.content = ""; - /** - * WebServerNetworkAccessControl allowedIpRanges. - * @member {Array.} allowedIpRanges - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @instance - */ - WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; + /** + * Creates a new Line instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line} Line instance + */ + Line.create = function create(properties) { + return new Line(properties); + }; - /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance - */ - WebServerNetworkAccessControl.create = function create(properties) { - return new WebServerNetworkAccessControl(properties); - }; + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + return writer; + }; - /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerNetworkAccessControl.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedIpRanges != null && message.allowedIpRanges.length) - for (var i = 0; i < message.allowedIpRanges.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Line message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lineNumber = reader.int32(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerNetworkAccessControl.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedIpRanges && message.allowedIpRanges.length)) - message.allowedIpRanges = []; - message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a Line message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Line.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + if (!$util.isInteger(message.lineNumber)) + return "lineNumber: integer expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; - /** - * Verifies a WebServerNetworkAccessControl message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebServerNetworkAccessControl.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { - if (!Array.isArray(message.allowedIpRanges)) - return "allowedIpRanges: array expected"; - for (var i = 0; i < message.allowedIpRanges.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); - if (error) - return "allowedIpRanges." + error; - } - } - return null; - }; + /** + * Creates a Line message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line} Line + */ + Line.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line(); + if (object.lineNumber != null) + message.lineNumber = object.lineNumber | 0; + if (object.content != null) + message.content = String(object.content); + return message; + }; - /** - * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl - */ - WebServerNetworkAccessControl.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); - if (object.allowedIpRanges) { - if (!Array.isArray(object.allowedIpRanges)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); - message.allowedIpRanges = []; - for (var i = 0; i < object.allowedIpRanges.length; ++i) { - if (typeof object.allowedIpRanges[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); - message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line} message Line + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Line.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lineNumber = 0; + object.content = ""; } - } - return message; - }; + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + object.lineNumber = message.lineNumber; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; - /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebServerNetworkAccessControl.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedIpRanges = []; - if (message.allowedIpRanges && message.allowedIpRanges.length) { - object.allowedIpRanges = []; - for (var j = 0; j < message.allowedIpRanges.length; ++j) - object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); - } - return object; - }; + /** + * Converts this Line to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @instance + * @returns {Object.} JSON object + */ + Line.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this WebServerNetworkAccessControl to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @instance - * @returns {Object.} JSON object - */ - WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Line + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.Line"; + }; - /** - * Gets the default type url for WebServerNetworkAccessControl - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl"; - }; + return Line; + })(); - WebServerNetworkAccessControl.AllowedIpRange = (function() { + PollAirflowCommandResponse.ExitInfo = (function() { /** - * Properties of an AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @interface IAllowedIpRange - * @property {string|null} [value] AllowedIpRange value - * @property {string|null} [description] AllowedIpRange description + * Properties of an ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse + * @interface IExitInfo + * @property {number|null} [exitCode] ExitInfo exitCode + * @property {string|null} [error] ExitInfo error */ /** - * Constructs a new AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @classdesc Represents an AllowedIpRange. - * @implements IAllowedIpRange + * Constructs a new ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse + * @classdesc Represents an ExitInfo. + * @implements IExitInfo * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set */ - function AllowedIpRange(properties) { + function ExitInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3591,89 +3836,89 @@ } /** - * AllowedIpRange value. - * @member {string} value - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * ExitInfo exitCode. + * @member {number} exitCode + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @instance */ - AllowedIpRange.prototype.value = ""; + ExitInfo.prototype.exitCode = 0; /** - * AllowedIpRange description. - * @member {string} description - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * ExitInfo error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @instance */ - AllowedIpRange.prototype.description = ""; + ExitInfo.prototype.error = ""; /** - * Creates a new AllowedIpRange instance using the specified properties. + * Creates a new ExitInfo instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo} ExitInfo instance */ - AllowedIpRange.create = function create(properties) { - return new AllowedIpRange(properties); + ExitInfo.create = function create(properties) { + return new ExitInfo(properties); }; /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AllowedIpRange.encode = function encode(message, writer) { + ExitInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); return writer; }; /** - * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { + ExitInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AllowedIpRange message from the specified reader or buffer. + * Decodes an ExitInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo} ExitInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AllowedIpRange.decode = function decode(reader, length) { + ExitInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.string(); + message.exitCode = reader.int32(); break; } case 2: { - message.description = reader.string(); + message.error = reader.string(); break; } default: @@ -3685,134 +3930,135 @@ }; /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo} ExitInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { + ExitInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AllowedIpRange message. + * Verifies an ExitInfo message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AllowedIpRange.verify = function verify(message) { + ExitInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; return null; }; /** - * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * Creates an ExitInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @returns {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo} ExitInfo */ - AllowedIpRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange) + ExitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); - if (object.value != null) - message.value = String(object.value); - if (object.description != null) - message.description = String(object.description); + var message = new $root.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.error != null) + message.error = String(object.error); return message; }; /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange + * @param {google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo} message ExitInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AllowedIpRange.toObject = function toObject(message, options) { + ExitInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.value = ""; - object.description = ""; + object.exitCode = 0; + object.error = ""; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; return object; }; /** - * Converts this AllowedIpRange to JSON. + * Converts this ExitInfo to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @instance * @returns {Object.} JSON object */ - AllowedIpRange.prototype.toJSON = function toJSON() { + ExitInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AllowedIpRange + * Gets the default type url for ExitInfo * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @memberof google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse.ExitInfo"; }; - return AllowedIpRange; + return ExitInfo; })(); - return WebServerNetworkAccessControl; + return PollAirflowCommandResponse; })(); - v1.DatabaseConfig = (function() { + v1.SaveSnapshotRequest = (function() { /** - * Properties of a DatabaseConfig. + * Properties of a SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IDatabaseConfig - * @property {string|null} [machineType] DatabaseConfig machineType + * @interface ISaveSnapshotRequest + * @property {string|null} [environment] SaveSnapshotRequest environment + * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation */ /** - * Constructs a new DatabaseConfig. + * Constructs a new SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a DatabaseConfig. - * @implements IDatabaseConfig + * @classdesc Represents a SaveSnapshotRequest. + * @implements ISaveSnapshotRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set */ - function DatabaseConfig(properties) { + function SaveSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3820,75 +4066,89 @@ } /** - * DatabaseConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * SaveSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @instance */ - DatabaseConfig.prototype.machineType = ""; + SaveSnapshotRequest.prototype.environment = ""; /** - * Creates a new DatabaseConfig instance using the specified properties. + * SaveSnapshotRequest snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest + * @instance + */ + SaveSnapshotRequest.prototype.snapshotLocation = ""; + + /** + * Creates a new SaveSnapshotRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest instance */ - DatabaseConfig.create = function create(properties) { - return new DatabaseConfig(properties); + SaveSnapshotRequest.create = function create(properties) { + return new SaveSnapshotRequest(properties); }; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encode = function encode(message, writer) { + SaveSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); return writer; }; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decode = function decode(reader, length) { + SaveSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); + message.environment = reader.string(); + break; + } + case 2: { + message.snapshotLocation = reader.string(); break; } default: @@ -3900,122 +4160,131 @@ }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DatabaseConfig message. + * Verifies a SaveSnapshotRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DatabaseConfig.verify = function verify(message) { + SaveSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; return null; }; /** - * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest */ - DatabaseConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig) + SaveSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); + var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); return message; }; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} message DatabaseConfig + * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} message SaveSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseConfig.toObject = function toObject(message, options) { + SaveSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; + if (options.defaults) { + object.environment = ""; + object.snapshotLocation = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; return object; }; /** - * Converts this DatabaseConfig to JSON. + * Converts this SaveSnapshotRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @instance * @returns {Object.} JSON object */ - DatabaseConfig.prototype.toJSON = function toJSON() { + SaveSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for SaveSnapshotRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest"; }; - return DatabaseConfig; + return SaveSnapshotRequest; })(); - v1.WebServerConfig = (function() { + v1.SaveSnapshotResponse = (function() { /** - * Properties of a WebServerConfig. + * Properties of a SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IWebServerConfig - * @property {string|null} [machineType] WebServerConfig machineType + * @interface ISaveSnapshotResponse + * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath */ /** - * Constructs a new WebServerConfig. + * Constructs a new SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a WebServerConfig. - * @implements IWebServerConfig + * @classdesc Represents a SaveSnapshotResponse. + * @implements ISaveSnapshotResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set */ - function WebServerConfig(properties) { + function SaveSnapshotResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4023,75 +4292,75 @@ } /** - * WebServerConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * SaveSnapshotResponse snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @instance */ - WebServerConfig.prototype.machineType = ""; + SaveSnapshotResponse.prototype.snapshotPath = ""; /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse instance */ - WebServerConfig.create = function create(properties) { - return new WebServerConfig(properties); + SaveSnapshotResponse.create = function create(properties) { + return new SaveSnapshotResponse(properties); }; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encode = function encode(message, writer) { + SaveSnapshotResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); return writer; }; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decode = function decode(reader, length) { + SaveSnapshotResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); + message.snapshotPath = reader.string(); break; } default: @@ -4103,122 +4372,127 @@ }; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebServerConfig message. + * Verifies a SaveSnapshotResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebServerConfig.verify = function verify(message) { + SaveSnapshotResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; return null; }; /** - * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse */ - WebServerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig) + SaveSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); + var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); return message; }; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerConfig} message WebServerConfig + * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} message SaveSnapshotResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebServerConfig.toObject = function toObject(message, options) { + SaveSnapshotResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; + object.snapshotPath = ""; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; return object; }; /** - * Converts this WebServerConfig to JSON. + * Converts this SaveSnapshotResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @instance * @returns {Object.} JSON object */ - WebServerConfig.prototype.toJSON = function toJSON() { + SaveSnapshotResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WebServerConfig + * Gets the default type url for SaveSnapshotResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse"; }; - return WebServerConfig; + return SaveSnapshotResponse; })(); - v1.EncryptionConfig = (function() { + v1.LoadSnapshotRequest = (function() { /** - * Properties of an EncryptionConfig. + * Properties of a LoadSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @interface ILoadSnapshotRequest + * @property {string|null} [environment] LoadSnapshotRequest environment + * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath + * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation + * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting + * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting + * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying */ /** - * Constructs a new EncryptionConfig. + * Constructs a new LoadSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * @classdesc Represents a LoadSnapshotRequest. + * @implements ILoadSnapshotRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function LoadSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4226,75 +4500,145 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * LoadSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + LoadSnapshotRequest.prototype.environment = ""; /** - * Creates a new EncryptionConfig instance using the specified properties. + * LoadSnapshotRequest snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.snapshotPath = ""; + + /** + * LoadSnapshotRequest skipPypiPackagesInstallation. + * @member {boolean} skipPypiPackagesInstallation + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; + + /** + * LoadSnapshotRequest skipEnvironmentVariablesSetting. + * @member {boolean} skipEnvironmentVariablesSetting + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; + + /** + * LoadSnapshotRequest skipAirflowOverridesSetting. + * @member {boolean} skipAirflowOverridesSetting + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; + + /** + * LoadSnapshotRequest skipGcsDataCopying. + * @member {boolean} skipGcsDataCopying + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipGcsDataCopying = false; + + /** + * Creates a new LoadSnapshotRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); + LoadSnapshotRequest.create = function create(properties) { + return new LoadSnapshotRequest(properties); }; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encode = function encode(message, writer) { + LoadSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); + if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); + if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); + if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); + if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); return writer; }; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decode = function decode(reader, length) { + LoadSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.kmsKeyName = reader.string(); + message.environment = reader.string(); + break; + } + case 2: { + message.snapshotPath = reader.string(); + break; + } + case 3: { + message.skipPypiPackagesInstallation = reader.bool(); + break; + } + case 4: { + message.skipEnvironmentVariablesSetting = reader.bool(); + break; + } + case 5: { + message.skipAirflowOverridesSetting = reader.bool(); + break; + } + case 6: { + message.skipGcsDataCopying = reader.bool(); break; } default: @@ -4306,124 +4650,162 @@ }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionConfig message. + * Verifies a LoadSnapshotRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionConfig.verify = function verify(message) { + LoadSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + if (typeof message.skipPypiPackagesInstallation !== "boolean") + return "skipPypiPackagesInstallation: boolean expected"; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + if (typeof message.skipEnvironmentVariablesSetting !== "boolean") + return "skipEnvironmentVariablesSetting: boolean expected"; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + if (typeof message.skipAirflowOverridesSetting !== "boolean") + return "skipAirflowOverridesSetting: boolean expected"; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + if (typeof message.skipGcsDataCopying !== "boolean") + return "skipGcsDataCopying: boolean expected"; return null; }; /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig) + LoadSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + var message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); + if (object.skipPypiPackagesInstallation != null) + message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); + if (object.skipEnvironmentVariablesSetting != null) + message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); + if (object.skipAirflowOverridesSetting != null) + message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); + if (object.skipGcsDataCopying != null) + message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); return message; }; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} message EncryptionConfig + * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} message LoadSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + LoadSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; + if (options.defaults) { + object.environment = ""; + object.snapshotPath = ""; + object.skipPypiPackagesInstallation = false; + object.skipEnvironmentVariablesSetting = false; + object.skipAirflowOverridesSetting = false; + object.skipGcsDataCopying = false; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + object.skipGcsDataCopying = message.skipGcsDataCopying; return object; }; /** - * Converts this EncryptionConfig to JSON. + * Converts this LoadSnapshotRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @instance * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { + LoadSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for LoadSnapshotRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EncryptionConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest"; }; - return EncryptionConfig; + return LoadSnapshotRequest; })(); - v1.MaintenanceWindow = (function() { + v1.LoadSnapshotResponse = (function() { /** - * Properties of a MaintenanceWindow. + * Properties of a LoadSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IMaintenanceWindow - * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceWindow endTime - * @property {string|null} [recurrence] MaintenanceWindow recurrence + * @interface ILoadSnapshotResponse */ /** - * Constructs a new MaintenanceWindow. + * Constructs a new LoadSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a MaintenanceWindow. - * @implements IMaintenanceWindow + * @classdesc Represents a LoadSnapshotResponse. + * @implements ILoadSnapshotResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set */ - function MaintenanceWindow(properties) { + function LoadSnapshotResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4431,105 +4813,63 @@ } /** - * MaintenanceWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.startTime = null; - - /** - * MaintenanceWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.endTime = null; - - /** - * MaintenanceWindow recurrence. - * @member {string} recurrence - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.recurrence = ""; - - /** - * Creates a new MaintenanceWindow instance using the specified properties. + * Creates a new LoadSnapshotResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse instance */ - MaintenanceWindow.create = function create(properties) { - return new MaintenanceWindow(properties); + LoadSnapshotResponse.create = function create(properties) { + return new LoadSnapshotResponse(properties); }; /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encode = function encode(message, writer) { + LoadSnapshotResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, 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.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.recurrence); return writer; }; /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MaintenanceWindow.decode = function decode(reader, length) { + LoadSnapshotResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.startTime = $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.recurrence = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -4539,157 +4879,109 @@ }; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MaintenanceWindow message. + * Verifies a LoadSnapshotResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MaintenanceWindow.verify = function verify(message) { + LoadSnapshotResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.recurrence != null && message.hasOwnProperty("recurrence")) - if (!$util.isString(message.recurrence)) - return "recurrence: string expected"; return null; }; /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse */ - MaintenanceWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow) + LoadSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.recurrence != null) - message.recurrence = String(object.recurrence); - return message; + return new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); }; /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} message MaintenanceWindow + * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} message LoadSnapshotResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MaintenanceWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.recurrence = ""; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.recurrence != null && message.hasOwnProperty("recurrence")) - object.recurrence = message.recurrence; - return object; + LoadSnapshotResponse.toObject = function toObject() { + return {}; }; /** - * Converts this MaintenanceWindow to JSON. + * Converts this LoadSnapshotResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @instance * @returns {Object.} JSON object */ - MaintenanceWindow.prototype.toJSON = function toJSON() { + LoadSnapshotResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MaintenanceWindow + * Gets the default type url for LoadSnapshotResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MaintenanceWindow"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse"; }; - return MaintenanceWindow; + return LoadSnapshotResponse; })(); - v1.SoftwareConfig = (function() { + v1.DatabaseFailoverRequest = (function() { /** - * Properties of a SoftwareConfig. + * Properties of a DatabaseFailoverRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ISoftwareConfig - * @property {string|null} [imageVersion] SoftwareConfig imageVersion - * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides - * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages - * @property {Object.|null} [envVariables] SoftwareConfig envVariables - * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion - * @property {number|null} [schedulerCount] SoftwareConfig schedulerCount + * @interface IDatabaseFailoverRequest + * @property {string|null} [environment] DatabaseFailoverRequest environment */ /** - * Constructs a new SoftwareConfig. + * Constructs a new DatabaseFailoverRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a SoftwareConfig. - * @implements ISoftwareConfig + * @classdesc Represents a DatabaseFailoverRequest. + * @implements IDatabaseFailoverRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest=} [properties] Properties to set */ - function SoftwareConfig(properties) { - this.airflowConfigOverrides = {}; - this.pypiPackages = {}; - this.envVariables = {}; + function DatabaseFailoverRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4697,205 +4989,75 @@ } /** - * SoftwareConfig imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.imageVersion = ""; - - /** - * SoftwareConfig airflowConfigOverrides. - * @member {Object.} airflowConfigOverrides - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; - - /** - * SoftwareConfig pypiPackages. - * @member {Object.} pypiPackages - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.pypiPackages = $util.emptyObject; - - /** - * SoftwareConfig envVariables. - * @member {Object.} envVariables - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.envVariables = $util.emptyObject; - - /** - * SoftwareConfig pythonVersion. - * @member {string} pythonVersion - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.pythonVersion = ""; - - /** - * SoftwareConfig schedulerCount. - * @member {number} schedulerCount - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * DatabaseFailoverRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @instance */ - SoftwareConfig.prototype.schedulerCount = 0; + DatabaseFailoverRequest.prototype.environment = ""; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new DatabaseFailoverRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest} DatabaseFailoverRequest instance */ - SoftwareConfig.create = function create(properties) { - return new SoftwareConfig(properties); + DatabaseFailoverRequest.create = function create(properties) { + return new DatabaseFailoverRequest(properties); }; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * Encodes the specified DatabaseFailoverRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest} message DatabaseFailoverRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encode = function encode(message, writer) { + DatabaseFailoverRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); - if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) - for (var keys = Object.keys(message.airflowConfigOverrides), 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.airflowConfigOverrides[keys[i]]).ldelim(); - if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) - for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); - if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) - for (var keys = Object.keys(message.envVariables), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.envVariables[keys[i]]).ldelim(); - if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); - if (message.schedulerCount != null && Object.hasOwnProperty.call(message, "schedulerCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.schedulerCount); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); return writer; }; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * Encodes the specified DatabaseFailoverRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest} message DatabaseFailoverRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest} DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decode = function decode(reader, length) { + DatabaseFailoverRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.imageVersion = reader.string(); - break; - } - case 2: { - if (message.airflowConfigOverrides === $util.emptyObject) - message.airflowConfigOverrides = {}; - 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.airflowConfigOverrides[key] = value; - break; - } - case 3: { - if (message.pypiPackages === $util.emptyObject) - message.pypiPackages = {}; - 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.pypiPackages[key] = value; - break; - } - case 4: { - if (message.envVariables === $util.emptyObject) - message.envVariables = {}; - 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.envVariables[key] = value; - break; - } - case 6: { - message.pythonVersion = reader.string(); - break; - } - case 7: { - message.schedulerCount = reader.int32(); + message.environment = reader.string(); break; } default: @@ -4907,209 +5069,121 @@ }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest} DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + DatabaseFailoverRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SoftwareConfig message. + * Verifies a DatabaseFailoverRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SoftwareConfig.verify = function verify(message) { + DatabaseFailoverRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - if (!$util.isString(message.imageVersion)) - return "imageVersion: string expected"; - if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { - if (!$util.isObject(message.airflowConfigOverrides)) - return "airflowConfigOverrides: object expected"; - var key = Object.keys(message.airflowConfigOverrides); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.airflowConfigOverrides[key[i]])) - return "airflowConfigOverrides: string{k:string} expected"; - } - if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { - if (!$util.isObject(message.pypiPackages)) - return "pypiPackages: object expected"; - var key = Object.keys(message.pypiPackages); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.pypiPackages[key[i]])) - return "pypiPackages: string{k:string} expected"; - } - if (message.envVariables != null && message.hasOwnProperty("envVariables")) { - if (!$util.isObject(message.envVariables)) - return "envVariables: object expected"; - var key = Object.keys(message.envVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.envVariables[key[i]])) - return "envVariables: string{k:string} expected"; - } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - if (!$util.isString(message.pythonVersion)) - return "pythonVersion: string expected"; - if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) - if (!$util.isInteger(message.schedulerCount)) - return "schedulerCount: integer expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; return null; }; /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest} DatabaseFailoverRequest */ - SoftwareConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig) + DatabaseFailoverRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(); - if (object.imageVersion != null) - message.imageVersion = String(object.imageVersion); - if (object.airflowConfigOverrides) { - if (typeof object.airflowConfigOverrides !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.airflowConfigOverrides: object expected"); - message.airflowConfigOverrides = {}; - for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) - message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); - } - if (object.pypiPackages) { - if (typeof object.pypiPackages !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.pypiPackages: object expected"); - message.pypiPackages = {}; - for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) - message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); - } - if (object.envVariables) { - if (typeof object.envVariables !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.envVariables: object expected"); - message.envVariables = {}; - for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) - message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); - } - if (object.pythonVersion != null) - message.pythonVersion = String(object.pythonVersion); - if (object.schedulerCount != null) - message.schedulerCount = object.schedulerCount | 0; + var message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest(); + if (object.environment != null) + message.environment = String(object.environment); return message; }; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseFailoverRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} message SoftwareConfig + * @param {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest} message DatabaseFailoverRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SoftwareConfig.toObject = function toObject(message, options) { + DatabaseFailoverRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.airflowConfigOverrides = {}; - object.pypiPackages = {}; - object.envVariables = {}; - } - if (options.defaults) { - object.imageVersion = ""; - object.pythonVersion = ""; - object.schedulerCount = 0; - } - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - object.imageVersion = message.imageVersion; - var keys2; - if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { - object.airflowConfigOverrides = {}; - for (var j = 0; j < keys2.length; ++j) - object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; - } - if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { - object.pypiPackages = {}; - for (var j = 0; j < keys2.length; ++j) - object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; - } - if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { - object.envVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; - } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - object.pythonVersion = message.pythonVersion; - if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) - object.schedulerCount = message.schedulerCount; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; return object; }; /** - * Converts this SoftwareConfig to JSON. + * Converts this DatabaseFailoverRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @instance * @returns {Object.} JSON object */ - SoftwareConfig.prototype.toJSON = function toJSON() { + DatabaseFailoverRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for DatabaseFailoverRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseFailoverRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SoftwareConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest"; }; - return SoftwareConfig; + return DatabaseFailoverRequest; })(); - v1.IPAllocationPolicy = (function() { + v1.DatabaseFailoverResponse = (function() { /** - * Properties of a IPAllocationPolicy. + * Properties of a DatabaseFailoverResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IIPAllocationPolicy - * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases - * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName - * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock - * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName - * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock + * @interface IDatabaseFailoverResponse */ /** - * Constructs a new IPAllocationPolicy. + * Constructs a new DatabaseFailoverResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a IPAllocationPolicy. - * @implements IIPAllocationPolicy + * @classdesc Represents a DatabaseFailoverResponse. + * @implements IDatabaseFailoverResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse=} [properties] Properties to set */ - function IPAllocationPolicy(properties) { + function DatabaseFailoverResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5117,158 +5191,63 @@ } /** - * IPAllocationPolicy useIpAliases. - * @member {boolean} useIpAliases - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.useIpAliases = false; - - /** - * IPAllocationPolicy clusterSecondaryRangeName. - * @member {string|null|undefined} clusterSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.clusterSecondaryRangeName = null; - - /** - * IPAllocationPolicy clusterIpv4CidrBlock. - * @member {string|null|undefined} clusterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.clusterIpv4CidrBlock = null; - - /** - * IPAllocationPolicy servicesSecondaryRangeName. - * @member {string|null|undefined} servicesSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.servicesSecondaryRangeName = null; - - /** - * IPAllocationPolicy servicesIpv4CidrBlock. - * @member {string|null|undefined} servicesIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.servicesIpv4CidrBlock = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * IPAllocationPolicy clusterIpAllocation. - * @member {"clusterSecondaryRangeName"|"clusterIpv4CidrBlock"|undefined} clusterIpAllocation - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - Object.defineProperty(IPAllocationPolicy.prototype, "clusterIpAllocation", { - get: $util.oneOfGetter($oneOfFields = ["clusterSecondaryRangeName", "clusterIpv4CidrBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * IPAllocationPolicy servicesIpAllocation. - * @member {"servicesSecondaryRangeName"|"servicesIpv4CidrBlock"|undefined} servicesIpAllocation - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - Object.defineProperty(IPAllocationPolicy.prototype, "servicesIpAllocation", { - get: $util.oneOfGetter($oneOfFields = ["servicesSecondaryRangeName", "servicesIpv4CidrBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new IPAllocationPolicy instance using the specified properties. + * Creates a new DatabaseFailoverResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy instance + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse} DatabaseFailoverResponse instance */ - IPAllocationPolicy.create = function create(properties) { - return new IPAllocationPolicy(properties); + DatabaseFailoverResponse.create = function create(properties) { + return new DatabaseFailoverResponse(properties); }; /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * Encodes the specified DatabaseFailoverResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse} message DatabaseFailoverResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.encode = function encode(message, writer) { + DatabaseFailoverResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); - if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); - if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); - if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); - if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); return writer; }; /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * Encodes the specified DatabaseFailoverResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse} message DatabaseFailoverResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseFailoverResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse} DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decode = function decode(reader, length) { + DatabaseFailoverResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.useIpAliases = reader.bool(); - break; - } - case 2: { - message.clusterSecondaryRangeName = reader.string(); - break; - } - case 4: { - message.clusterIpv4CidrBlock = reader.string(); - break; - } - case 3: { - message.servicesSecondaryRangeName = reader.string(); - break; - } - case 5: { - message.servicesIpv4CidrBlock = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -5278,186 +5257,109 @@ }; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse} DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + DatabaseFailoverResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a IPAllocationPolicy message. + * Verifies a DatabaseFailoverResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IPAllocationPolicy.verify = function verify(message) { + DatabaseFailoverResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - if (typeof message.useIpAliases !== "boolean") - return "useIpAliases: boolean expected"; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { - properties.clusterIpAllocation = 1; - if (!$util.isString(message.clusterSecondaryRangeName)) - return "clusterSecondaryRangeName: string expected"; - } - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { - if (properties.clusterIpAllocation === 1) - return "clusterIpAllocation: multiple values"; - properties.clusterIpAllocation = 1; - if (!$util.isString(message.clusterIpv4CidrBlock)) - return "clusterIpv4CidrBlock: string expected"; - } - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { - properties.servicesIpAllocation = 1; - if (!$util.isString(message.servicesSecondaryRangeName)) - return "servicesSecondaryRangeName: string expected"; - } - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { - if (properties.servicesIpAllocation === 1) - return "servicesIpAllocation: multiple values"; - properties.servicesIpAllocation = 1; - if (!$util.isString(message.servicesIpv4CidrBlock)) - return "servicesIpv4CidrBlock: string expected"; - } return null; }; /** - * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse} DatabaseFailoverResponse */ - IPAllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy) + DatabaseFailoverResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); - if (object.useIpAliases != null) - message.useIpAliases = Boolean(object.useIpAliases); - if (object.clusterSecondaryRangeName != null) - message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); - if (object.clusterIpv4CidrBlock != null) - message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); - if (object.servicesSecondaryRangeName != null) - message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); - if (object.servicesIpv4CidrBlock != null) - message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); - return message; + return new $root.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse(); }; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseFailoverResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} message IPAllocationPolicy + * @param {google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse} message DatabaseFailoverResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IPAllocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useIpAliases = false; - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - object.useIpAliases = message.useIpAliases; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { - object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; - if (options.oneofs) - object.clusterIpAllocation = "clusterSecondaryRangeName"; - } - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { - object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; - if (options.oneofs) - object.servicesIpAllocation = "servicesSecondaryRangeName"; - } - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { - object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; - if (options.oneofs) - object.clusterIpAllocation = "clusterIpv4CidrBlock"; - } - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { - object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; - if (options.oneofs) - object.servicesIpAllocation = "servicesIpv4CidrBlock"; - } - return object; + DatabaseFailoverResponse.toObject = function toObject() { + return {}; }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this DatabaseFailoverResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @instance * @returns {Object.} JSON object */ - IPAllocationPolicy.prototype.toJSON = function toJSON() { + DatabaseFailoverResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for DatabaseFailoverResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseFailoverResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse"; }; - return IPAllocationPolicy; + return DatabaseFailoverResponse; })(); - v1.NodeConfig = (function() { + v1.FetchDatabasePropertiesRequest = (function() { /** - * Properties of a NodeConfig. + * Properties of a FetchDatabasePropertiesRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface INodeConfig - * @property {string|null} [location] NodeConfig location - * @property {string|null} [machineType] NodeConfig machineType - * @property {string|null} [network] NodeConfig network - * @property {string|null} [subnetwork] NodeConfig subnetwork - * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb - * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes - * @property {string|null} [serviceAccount] NodeConfig serviceAccount - * @property {Array.|null} [tags] NodeConfig tags - * @property {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy - * @property {boolean|null} [enableIpMasqAgent] NodeConfig enableIpMasqAgent + * @interface IFetchDatabasePropertiesRequest + * @property {string|null} [environment] FetchDatabasePropertiesRequest environment */ /** - * Constructs a new NodeConfig. + * Constructs a new FetchDatabasePropertiesRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a NodeConfig. - * @implements INodeConfig + * @classdesc Represents a FetchDatabasePropertiesRequest. + * @implements IFetchDatabasePropertiesRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest=} [properties] Properties to set */ - function NodeConfig(properties) { - this.oauthScopes = []; - this.tags = []; + function FetchDatabasePropertiesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5465,207 +5367,75 @@ } /** - * NodeConfig location. - * @member {string} location - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.location = ""; - - /** - * NodeConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.machineType = ""; - - /** - * NodeConfig network. - * @member {string} network - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.network = ""; - - /** - * NodeConfig subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.subnetwork = ""; - - /** - * NodeConfig diskSizeGb. - * @member {number} diskSizeGb - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.diskSizeGb = 0; - - /** - * NodeConfig oauthScopes. - * @member {Array.} oauthScopes - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.oauthScopes = $util.emptyArray; - - /** - * NodeConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.serviceAccount = ""; - - /** - * NodeConfig tags. - * @member {Array.} tags - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.tags = $util.emptyArray; - - /** - * NodeConfig ipAllocationPolicy. - * @member {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.ipAllocationPolicy = null; - - /** - * NodeConfig enableIpMasqAgent. - * @member {boolean} enableIpMasqAgent - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * FetchDatabasePropertiesRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @instance */ - NodeConfig.prototype.enableIpMasqAgent = false; + FetchDatabasePropertiesRequest.prototype.environment = ""; /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new FetchDatabasePropertiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest instance */ - NodeConfig.create = function create(properties) { - return new NodeConfig(properties); + FetchDatabasePropertiesRequest.create = function create(properties) { + return new FetchDatabasePropertiesRequest(properties); }; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encode = function encode(message, writer) { + FetchDatabasePropertiesRequest.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.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); - if (message.oauthScopes != null && message.oauthScopes.length) - for (var i = 0; i < message.oauthScopes.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) - $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.enableIpMasqAgent != null && Object.hasOwnProperty.call(message, "enableIpMasqAgent")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableIpMasqAgent); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); return writer; }; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + FetchDatabasePropertiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decode = function decode(reader, length) { + FetchDatabasePropertiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.machineType = reader.string(); - break; - } - case 3: { - message.network = reader.string(); - break; - } - case 4: { - message.subnetwork = reader.string(); - break; - } - case 5: { - message.diskSizeGb = reader.int32(); - break; - } - case 6: { - if (!(message.oauthScopes && message.oauthScopes.length)) - message.oauthScopes = []; - message.oauthScopes.push(reader.string()); - break; - } - case 7: { - message.serviceAccount = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 9: { - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 11: { - message.enableIpMasqAgent = reader.bool(); + message.environment = reader.string(); break; } default: @@ -5677,228 +5447,124 @@ }; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decodeDelimited = function decodeDelimited(reader) { + FetchDatabasePropertiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeConfig message. + * Verifies a FetchDatabasePropertiesRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeConfig.verify = function verify(message) { + FetchDatabasePropertiesRequest.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.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb)) - return "diskSizeGb: integer expected"; - if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { - if (!Array.isArray(message.oauthScopes)) - return "oauthScopes: array expected"; - for (var i = 0; i < message.oauthScopes.length; ++i) - if (!$util.isString(message.oauthScopes[i])) - return "oauthScopes: string[] expected"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify(message.ipAllocationPolicy); - if (error) - return "ipAllocationPolicy." + error; - } - if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) - if (typeof message.enableIpMasqAgent !== "boolean") - return "enableIpMasqAgent: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; return null; }; /** - * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest */ - NodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NodeConfig) + FetchDatabasePropertiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); - if (object.location != null) - message.location = String(object.location); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.diskSizeGb != null) - message.diskSizeGb = object.diskSizeGb | 0; - if (object.oauthScopes) { - if (!Array.isArray(object.oauthScopes)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.oauthScopes: array expected"); - message.oauthScopes = []; - for (var i = 0; i < object.oauthScopes.length; ++i) - message.oauthScopes[i] = String(object.oauthScopes[i]); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.ipAllocationPolicy != null) { - if (typeof object.ipAllocationPolicy !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.ipAllocationPolicy: object expected"); - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); - } - if (object.enableIpMasqAgent != null) - message.enableIpMasqAgent = Boolean(object.enableIpMasqAgent); + var message = new $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest(); + if (object.environment != null) + message.environment = String(object.environment); return message; }; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * Creates a plain object from a FetchDatabasePropertiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.NodeConfig} message NodeConfig + * @param {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeConfig.toObject = function toObject(message, options) { + FetchDatabasePropertiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.oauthScopes = []; - object.tags = []; - } - if (options.defaults) { - object.location = ""; - object.machineType = ""; - object.network = ""; - object.subnetwork = ""; - object.diskSizeGb = 0; - object.serviceAccount = ""; - object.ipAllocationPolicy = null; - object.enableIpMasqAgent = false; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - object.diskSizeGb = message.diskSizeGb; - if (message.oauthScopes && message.oauthScopes.length) { - object.oauthScopes = []; - for (var j = 0; j < message.oauthScopes.length; ++j) - object.oauthScopes[j] = message.oauthScopes[j]; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) - object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); - if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) - object.enableIpMasqAgent = message.enableIpMasqAgent; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; return object; }; /** - * Converts this NodeConfig to JSON. + * Converts this FetchDatabasePropertiesRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @instance * @returns {Object.} JSON object */ - NodeConfig.prototype.toJSON = function toJSON() { + FetchDatabasePropertiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for FetchDatabasePropertiesRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FetchDatabasePropertiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NodeConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest"; }; - return NodeConfig; + return FetchDatabasePropertiesRequest; })(); - v1.PrivateClusterConfig = (function() { + v1.FetchDatabasePropertiesResponse = (function() { /** - * Properties of a PrivateClusterConfig. + * Properties of a FetchDatabasePropertiesResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IPrivateClusterConfig - * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint - * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock - * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange + * @interface IFetchDatabasePropertiesResponse + * @property {string|null} [primaryGceZone] FetchDatabasePropertiesResponse primaryGceZone + * @property {string|null} [secondaryGceZone] FetchDatabasePropertiesResponse secondaryGceZone + * @property {boolean|null} [isFailoverReplicaAvailable] FetchDatabasePropertiesResponse isFailoverReplicaAvailable */ /** - * Constructs a new PrivateClusterConfig. + * Constructs a new FetchDatabasePropertiesResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a PrivateClusterConfig. - * @implements IPrivateClusterConfig + * @classdesc Represents a FetchDatabasePropertiesResponse. + * @implements IFetchDatabasePropertiesResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse=} [properties] Properties to set */ - function PrivateClusterConfig(properties) { + function FetchDatabasePropertiesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5906,103 +5572,103 @@ } /** - * PrivateClusterConfig enablePrivateEndpoint. - * @member {boolean} enablePrivateEndpoint - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * FetchDatabasePropertiesResponse primaryGceZone. + * @member {string} primaryGceZone + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @instance */ - PrivateClusterConfig.prototype.enablePrivateEndpoint = false; + FetchDatabasePropertiesResponse.prototype.primaryGceZone = ""; /** - * PrivateClusterConfig masterIpv4CidrBlock. - * @member {string} masterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * FetchDatabasePropertiesResponse secondaryGceZone. + * @member {string} secondaryGceZone + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @instance */ - PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; + FetchDatabasePropertiesResponse.prototype.secondaryGceZone = ""; /** - * PrivateClusterConfig masterIpv4ReservedRange. - * @member {string} masterIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * FetchDatabasePropertiesResponse isFailoverReplicaAvailable. + * @member {boolean} isFailoverReplicaAvailable + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @instance */ - PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; + FetchDatabasePropertiesResponse.prototype.isFailoverReplicaAvailable = false; /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * Creates a new FetchDatabasePropertiesResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse instance */ - PrivateClusterConfig.create = function create(properties) { - return new PrivateClusterConfig(properties); + FetchDatabasePropertiesResponse.create = function create(properties) { + return new FetchDatabasePropertiesResponse(properties); }; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encode = function encode(message, writer) { + FetchDatabasePropertiesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); - if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); - if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); + if (message.primaryGceZone != null && Object.hasOwnProperty.call(message, "primaryGceZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryGceZone); + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secondaryGceZone); + if (message.isFailoverReplicaAvailable != null && Object.hasOwnProperty.call(message, "isFailoverReplicaAvailable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFailoverReplicaAvailable); return writer; }; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + FetchDatabasePropertiesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decode = function decode(reader, length) { + FetchDatabasePropertiesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enablePrivateEndpoint = reader.bool(); + message.primaryGceZone = reader.string(); break; } case 2: { - message.masterIpv4CidrBlock = reader.string(); + message.secondaryGceZone = reader.string(); break; } case 3: { - message.masterIpv4ReservedRange = reader.string(); + message.isFailoverReplicaAvailable = reader.bool(); break; } default: @@ -6014,139 +5680,156 @@ }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + FetchDatabasePropertiesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateClusterConfig message. + * Verifies a FetchDatabasePropertiesResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateClusterConfig.verify = function verify(message) { + FetchDatabasePropertiesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - if (typeof message.enablePrivateEndpoint !== "boolean") - return "enablePrivateEndpoint: boolean expected"; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - if (!$util.isString(message.masterIpv4CidrBlock)) - return "masterIpv4CidrBlock: string expected"; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - if (!$util.isString(message.masterIpv4ReservedRange)) - return "masterIpv4ReservedRange: string expected"; + if (message.primaryGceZone != null && message.hasOwnProperty("primaryGceZone")) + if (!$util.isString(message.primaryGceZone)) + return "primaryGceZone: string expected"; + if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (!$util.isString(message.secondaryGceZone)) + return "secondaryGceZone: string expected"; + if (message.isFailoverReplicaAvailable != null && message.hasOwnProperty("isFailoverReplicaAvailable")) + if (typeof message.isFailoverReplicaAvailable !== "boolean") + return "isFailoverReplicaAvailable: boolean expected"; return null; }; /** - * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse */ - PrivateClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig) + FetchDatabasePropertiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); - if (object.enablePrivateEndpoint != null) - message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); - if (object.masterIpv4CidrBlock != null) - message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); - if (object.masterIpv4ReservedRange != null) - message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); + var message = new $root.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse(); + if (object.primaryGceZone != null) + message.primaryGceZone = String(object.primaryGceZone); + if (object.secondaryGceZone != null) + message.secondaryGceZone = String(object.secondaryGceZone); + if (object.isFailoverReplicaAvailable != null) + message.isFailoverReplicaAvailable = Boolean(object.isFailoverReplicaAvailable); return message; }; /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * Creates a plain object from a FetchDatabasePropertiesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} message PrivateClusterConfig + * @param {google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivateClusterConfig.toObject = function toObject(message, options) { + FetchDatabasePropertiesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.enablePrivateEndpoint = false; - object.masterIpv4CidrBlock = ""; - object.masterIpv4ReservedRange = ""; - } - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - object.enablePrivateEndpoint = message.enablePrivateEndpoint; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; + object.primaryGceZone = ""; + object.secondaryGceZone = ""; + object.isFailoverReplicaAvailable = false; + } + if (message.primaryGceZone != null && message.hasOwnProperty("primaryGceZone")) + object.primaryGceZone = message.primaryGceZone; + if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + object.secondaryGceZone = message.secondaryGceZone; + if (message.isFailoverReplicaAvailable != null && message.hasOwnProperty("isFailoverReplicaAvailable")) + object.isFailoverReplicaAvailable = message.isFailoverReplicaAvailable; return object; }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this FetchDatabasePropertiesResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @instance * @returns {Object.} JSON object */ - PrivateClusterConfig.prototype.toJSON = function toJSON() { + FetchDatabasePropertiesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for FetchDatabasePropertiesResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FetchDatabasePropertiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse"; }; - return PrivateClusterConfig; + return FetchDatabasePropertiesResponse; })(); - v1.NetworkingConfig = (function() { + v1.EnvironmentConfig = (function() { /** - * Properties of a NetworkingConfig. + * Properties of an EnvironmentConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface INetworkingConfig - * @property {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null} [connectionType] NetworkingConfig connectionType + * @interface IEnvironmentConfig + * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster + * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix + * @property {number|null} [nodeCount] EnvironmentConfig nodeCount + * @property {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig + * @property {google.cloud.orchestration.airflow.service.v1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig + * @property {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig + * @property {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl + * @property {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig + * @property {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig + * @property {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig + * @property {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null} [maintenanceWindow] EnvironmentConfig maintenanceWindow + * @property {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null} [workloadsConfig] EnvironmentConfig workloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize + * @property {string|null} [airflowUri] EnvironmentConfig airflowUri + * @property {string|null} [airflowByoidUri] EnvironmentConfig airflowByoidUri + * @property {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null} [masterAuthorizedNetworksConfig] EnvironmentConfig masterAuthorizedNetworksConfig + * @property {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null} [recoveryConfig] EnvironmentConfig recoveryConfig + * @property {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode|null} [resilienceMode] EnvironmentConfig resilienceMode */ /** - * Constructs a new NetworkingConfig. + * Constructs a new EnvironmentConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a NetworkingConfig. - * @implements INetworkingConfig + * @classdesc Represents an EnvironmentConfig. + * @implements IEnvironmentConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set */ - function NetworkingConfig(properties) { + function EnvironmentConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6154,75 +5837,313 @@ } /** - * NetworkingConfig connectionType. - * @member {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType} connectionType - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * EnvironmentConfig gkeCluster. + * @member {string} gkeCluster + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - NetworkingConfig.prototype.connectionType = 0; + EnvironmentConfig.prototype.gkeCluster = ""; /** - * Creates a new NetworkingConfig instance using the specified properties. + * EnvironmentConfig dagGcsPrefix. + * @member {string} dagGcsPrefix + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.dagGcsPrefix = ""; + + /** + * EnvironmentConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.nodeCount = 0; + + /** + * EnvironmentConfig softwareConfig. + * @member {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.softwareConfig = null; + + /** + * EnvironmentConfig nodeConfig. + * @member {google.cloud.orchestration.airflow.service.v1.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.nodeConfig = null; + + /** + * EnvironmentConfig privateEnvironmentConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.privateEnvironmentConfig = null; + + /** + * EnvironmentConfig webServerNetworkAccessControl. + * @member {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.webServerNetworkAccessControl = null; + + /** + * EnvironmentConfig databaseConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null|undefined} databaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.databaseConfig = null; + + /** + * EnvironmentConfig webServerConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null|undefined} webServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.webServerConfig = null; + + /** + * EnvironmentConfig encryptionConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.encryptionConfig = null; + + /** + * EnvironmentConfig maintenanceWindow. + * @member {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null|undefined} maintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.maintenanceWindow = null; + + /** + * EnvironmentConfig workloadsConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null|undefined} workloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.workloadsConfig = null; + + /** + * EnvironmentConfig environmentSize. + * @member {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize} environmentSize + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.environmentSize = 0; + + /** + * EnvironmentConfig airflowUri. + * @member {string} airflowUri + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.airflowUri = ""; + + /** + * EnvironmentConfig airflowByoidUri. + * @member {string} airflowByoidUri + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.airflowByoidUri = ""; + + /** + * EnvironmentConfig masterAuthorizedNetworksConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null|undefined} masterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.masterAuthorizedNetworksConfig = null; + + /** + * EnvironmentConfig recoveryConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null|undefined} recoveryConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.recoveryConfig = null; + + /** + * EnvironmentConfig resilienceMode. + * @member {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode} resilienceMode + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.resilienceMode = 0; + + /** + * Creates a new EnvironmentConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig instance */ - NetworkingConfig.create = function create(properties) { - return new NetworkingConfig(properties); + EnvironmentConfig.create = function create(properties) { + return new EnvironmentConfig(properties); }; /** - * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkingConfig.encode = function encode(message, writer) { + EnvironmentConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.connectionType); + if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); + if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); + if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) + $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) + $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) + $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) + $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.workloadsConfig != null && Object.hasOwnProperty.call(message, "workloadsConfig")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.encode(message.workloadsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.environmentSize != null && Object.hasOwnProperty.call(message, "environmentSize")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.environmentSize); + if (message.masterAuthorizedNetworksConfig != null && Object.hasOwnProperty.call(message, "masterAuthorizedNetworksConfig")) + $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.encode(message.masterAuthorizedNetworksConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.recoveryConfig != null && Object.hasOwnProperty.call(message, "recoveryConfig")) + $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.encode(message.recoveryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.resilienceMode != null && Object.hasOwnProperty.call(message, "resilienceMode")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.resilienceMode); + if (message.airflowByoidUri != null && Object.hasOwnProperty.call(message, "airflowByoidUri")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.airflowByoidUri); return writer; }; /** - * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NetworkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NetworkingConfig message from the specified reader or buffer. + * Decodes an EnvironmentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkingConfig.decode = function decode(reader, length) { + EnvironmentConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.connectionType = reader.int32(); + message.gkeCluster = reader.string(); + break; + } + case 2: { + message.dagGcsPrefix = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int32(); + break; + } + case 4: { + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); + break; + } + case 9: { + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.decode(reader, reader.uint32()); + break; + } + case 15: { + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.environmentSize = reader.int32(); + break; + } + case 6: { + message.airflowUri = reader.string(); + break; + } + case 20: { + message.airflowByoidUri = reader.string(); + break; + } + case 17: { + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.resilienceMode = reader.int32(); break; } default: @@ -6234,171 +6155,395 @@ }; /** - * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NetworkingConfig.decodeDelimited = function decodeDelimited(reader) { + EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NetworkingConfig message. + * Verifies an EnvironmentConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NetworkingConfig.verify = function verify(message) { + EnvironmentConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.connectionType != null && message.hasOwnProperty("connectionType")) - switch (message.connectionType) { + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + if (!$util.isString(message.gkeCluster)) + return "gkeCluster: string expected"; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + if (!$util.isString(message.dagGcsPrefix)) + return "dagGcsPrefix: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); + if (error) + return "privateEnvironmentConfig." + error; + } + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); + if (error) + return "webServerNetworkAccessControl." + error; + } + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify(message.databaseConfig); + if (error) + return "databaseConfig." + error; + } + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify(message.webServerConfig); + if (error) + return "webServerConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify(message.maintenanceWindow); + if (error) + return "maintenanceWindow." + error; + } + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify(message.workloadsConfig); + if (error) + return "workloadsConfig." + error; + } + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + switch (message.environmentSize) { default: - return "connectionType: enum value expected"; + return "environmentSize: enum value expected"; case 0: case 1: case 2: + case 3: + break; + } + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + if (!$util.isString(message.airflowUri)) + return "airflowUri: string expected"; + if (message.airflowByoidUri != null && message.hasOwnProperty("airflowByoidUri")) + if (!$util.isString(message.airflowByoidUri)) + return "airflowByoidUri: string expected"; + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify(message.masterAuthorizedNetworksConfig); + if (error) + return "masterAuthorizedNetworksConfig." + error; + } + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify(message.recoveryConfig); + if (error) + return "recoveryConfig." + error; + } + if (message.resilienceMode != null && message.hasOwnProperty("resilienceMode")) + switch (message.resilienceMode) { + default: + return "resilienceMode: enum value expected"; + case 0: + case 1: break; } return null; }; /** - * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig */ - NetworkingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig) + EnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); - switch (object.connectionType) { + var message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); + if (object.gkeCluster != null) + message.gkeCluster = String(object.gkeCluster); + if (object.dagGcsPrefix != null) + message.dagGcsPrefix = String(object.dagGcsPrefix); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.fromObject(object.softwareConfig); + } + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.fromObject(object.nodeConfig); + } + if (object.privateEnvironmentConfig != null) { + if (typeof object.privateEnvironmentConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.privateEnvironmentConfig: object expected"); + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); + } + if (object.webServerNetworkAccessControl != null) { + if (typeof object.webServerNetworkAccessControl !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); + } + if (object.databaseConfig != null) { + if (typeof object.databaseConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.databaseConfig: object expected"); + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.fromObject(object.databaseConfig); + } + if (object.webServerConfig != null) { + if (typeof object.webServerConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerConfig: object expected"); + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.fromObject(object.webServerConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.maintenanceWindow != null) { + if (typeof object.maintenanceWindow !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.maintenanceWindow: object expected"); + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.fromObject(object.maintenanceWindow); + } + if (object.workloadsConfig != null) { + if (typeof object.workloadsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.workloadsConfig: object expected"); + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.fromObject(object.workloadsConfig); + } + switch (object.environmentSize) { default: - if (typeof object.connectionType === "number") { - message.connectionType = object.connectionType; + if (typeof object.environmentSize === "number") { + message.environmentSize = object.environmentSize; break; } break; - case "CONNECTION_TYPE_UNSPECIFIED": + case "ENVIRONMENT_SIZE_UNSPECIFIED": case 0: - message.connectionType = 0; + message.environmentSize = 0; break; - case "VPC_PEERING": + case "ENVIRONMENT_SIZE_SMALL": case 1: - message.connectionType = 1; + message.environmentSize = 1; break; - case "PRIVATE_SERVICE_CONNECT": + case "ENVIRONMENT_SIZE_MEDIUM": case 2: - message.connectionType = 2; + message.environmentSize = 2; + break; + case "ENVIRONMENT_SIZE_LARGE": + case 3: + message.environmentSize = 3; break; } - return message; + if (object.airflowUri != null) + message.airflowUri = String(object.airflowUri); + if (object.airflowByoidUri != null) + message.airflowByoidUri = String(object.airflowByoidUri); + if (object.masterAuthorizedNetworksConfig != null) { + if (typeof object.masterAuthorizedNetworksConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.masterAuthorizedNetworksConfig: object expected"); + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.fromObject(object.masterAuthorizedNetworksConfig); + } + if (object.recoveryConfig != null) { + if (typeof object.recoveryConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.recoveryConfig: object expected"); + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.fromObject(object.recoveryConfig); + } + switch (object.resilienceMode) { + default: + if (typeof object.resilienceMode === "number") { + message.resilienceMode = object.resilienceMode; + break; + } + break; + case "RESILIENCE_MODE_UNSPECIFIED": + case 0: + message.resilienceMode = 0; + break; + case "HIGH_RESILIENCE": + case 1: + message.resilienceMode = 1; + break; + } + return message; }; /** - * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} message NetworkingConfig + * @param {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} message EnvironmentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NetworkingConfig.toObject = function toObject(message, options) { + EnvironmentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.connectionType = options.enums === String ? "CONNECTION_TYPE_UNSPECIFIED" : 0; - if (message.connectionType != null && message.hasOwnProperty("connectionType")) - object.connectionType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] : message.connectionType; + if (options.defaults) { + object.gkeCluster = ""; + object.dagGcsPrefix = ""; + object.nodeCount = 0; + object.softwareConfig = null; + object.nodeConfig = null; + object.airflowUri = ""; + object.privateEnvironmentConfig = null; + object.webServerNetworkAccessControl = null; + object.databaseConfig = null; + object.webServerConfig = null; + object.encryptionConfig = null; + object.maintenanceWindow = null; + object.workloadsConfig = null; + object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; + object.masterAuthorizedNetworksConfig = null; + object.recoveryConfig = null; + object.resilienceMode = options.enums === String ? "RESILIENCE_MODE_UNSPECIFIED" : 0; + object.airflowByoidUri = ""; + } + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + object.gkeCluster = message.gkeCluster; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + object.dagGcsPrefix = message.dagGcsPrefix; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.toObject(message.softwareConfig, options); + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.toObject(message.nodeConfig, options); + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + object.airflowUri = message.airflowUri; + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) + object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) + object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) + object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.toObject(message.databaseConfig, options); + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) + object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.toObject(message.webServerConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) + object.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.toObject(message.maintenanceWindow, options); + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) + object.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.toObject(message.workloadsConfig, options); + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + object.environmentSize = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] === undefined ? message.environmentSize : $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] : message.environmentSize; + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) + object.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.toObject(message.masterAuthorizedNetworksConfig, options); + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) + object.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.toObject(message.recoveryConfig, options); + if (message.resilienceMode != null && message.hasOwnProperty("resilienceMode")) + object.resilienceMode = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode[message.resilienceMode] === undefined ? message.resilienceMode : $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode[message.resilienceMode] : message.resilienceMode; + if (message.airflowByoidUri != null && message.hasOwnProperty("airflowByoidUri")) + object.airflowByoidUri = message.airflowByoidUri; return object; }; /** - * Converts this NetworkingConfig to JSON. + * Converts this EnvironmentConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance * @returns {Object.} JSON object */ - NetworkingConfig.prototype.toJSON = function toJSON() { + EnvironmentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NetworkingConfig + * Gets the default type url for EnvironmentConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NetworkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NetworkingConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EnvironmentConfig"; }; /** - * ConnectionType enum. - * @name google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType + * EnvironmentSize enum. + * @name google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize * @enum {number} - * @property {number} CONNECTION_TYPE_UNSPECIFIED=0 CONNECTION_TYPE_UNSPECIFIED value - * @property {number} VPC_PEERING=1 VPC_PEERING value - * @property {number} PRIVATE_SERVICE_CONNECT=2 PRIVATE_SERVICE_CONNECT value + * @property {number} ENVIRONMENT_SIZE_UNSPECIFIED=0 ENVIRONMENT_SIZE_UNSPECIFIED value + * @property {number} ENVIRONMENT_SIZE_SMALL=1 ENVIRONMENT_SIZE_SMALL value + * @property {number} ENVIRONMENT_SIZE_MEDIUM=2 ENVIRONMENT_SIZE_MEDIUM value + * @property {number} ENVIRONMENT_SIZE_LARGE=3 ENVIRONMENT_SIZE_LARGE value */ - NetworkingConfig.ConnectionType = (function() { + EnvironmentConfig.EnvironmentSize = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONNECTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VPC_PEERING"] = 1; - values[valuesById[2] = "PRIVATE_SERVICE_CONNECT"] = 2; + values[valuesById[0] = "ENVIRONMENT_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENVIRONMENT_SIZE_SMALL"] = 1; + values[valuesById[2] = "ENVIRONMENT_SIZE_MEDIUM"] = 2; + values[valuesById[3] = "ENVIRONMENT_SIZE_LARGE"] = 3; return values; })(); - return NetworkingConfig; + /** + * ResilienceMode enum. + * @name google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.ResilienceMode + * @enum {number} + * @property {number} RESILIENCE_MODE_UNSPECIFIED=0 RESILIENCE_MODE_UNSPECIFIED value + * @property {number} HIGH_RESILIENCE=1 HIGH_RESILIENCE value + */ + EnvironmentConfig.ResilienceMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESILIENCE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH_RESILIENCE"] = 1; + return values; + })(); + + return EnvironmentConfig; })(); - v1.PrivateEnvironmentConfig = (function() { + v1.WebServerNetworkAccessControl = (function() { /** - * Properties of a PrivateEnvironmentConfig. + * Properties of a WebServerNetworkAccessControl. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IPrivateEnvironmentConfig - * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment - * @property {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig - * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock - * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock - * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange - * @property {string|null} [cloudComposerNetworkIpv4CidrBlock] PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock - * @property {string|null} [cloudComposerNetworkIpv4ReservedRange] PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange - * @property {boolean|null} [enablePrivatelyUsedPublicIps] PrivateEnvironmentConfig enablePrivatelyUsedPublicIps - * @property {string|null} [cloudComposerConnectionSubnetwork] PrivateEnvironmentConfig cloudComposerConnectionSubnetwork - * @property {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null} [networkingConfig] PrivateEnvironmentConfig networkingConfig + * @interface IWebServerNetworkAccessControl + * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges */ /** - * Constructs a new PrivateEnvironmentConfig. + * Constructs a new WebServerNetworkAccessControl. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a PrivateEnvironmentConfig. - * @implements IPrivateEnvironmentConfig + * @classdesc Represents a WebServerNetworkAccessControl. + * @implements IWebServerNetworkAccessControl * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set */ - function PrivateEnvironmentConfig(properties) { + function WebServerNetworkAccessControl(properties) { + this.allowedIpRanges = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6406,517 +6551,525 @@ } /** - * PrivateEnvironmentConfig enablePrivateEnvironment. - * @member {boolean} enablePrivateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * WebServerNetworkAccessControl allowedIpRanges. + * @member {Array.} allowedIpRanges + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @instance */ - PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; + WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; /** - * PrivateEnvironmentConfig privateClusterConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null|undefined} privateClusterConfig - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance + * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance */ - PrivateEnvironmentConfig.prototype.privateClusterConfig = null; + WebServerNetworkAccessControl.create = function create(properties) { + return new WebServerNetworkAccessControl(properties); + }; /** - * PrivateEnvironmentConfig webServerIpv4CidrBlock. - * @member {string} webServerIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; + WebServerNetworkAccessControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedIpRanges != null && message.allowedIpRanges.length) + for (var i = 0; i < message.allowedIpRanges.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. - * @member {string} cloudSqlIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; + WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * PrivateEnvironmentConfig webServerIpv4ReservedRange. - * @member {string} webServerIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; + WebServerNetworkAccessControl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedIpRanges && message.allowedIpRanges.length)) + message.allowedIpRanges = []; + message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. - * @member {string} cloudComposerNetworkIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4CidrBlock = ""; - - /** - * PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. - * @member {string} cloudComposerNetworkIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4ReservedRange = ""; - - /** - * PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. - * @member {boolean} enablePrivatelyUsedPublicIps - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.enablePrivatelyUsedPublicIps = false; - - /** - * PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. - * @member {string} cloudComposerConnectionSubnetwork - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.cloudComposerConnectionSubnetwork = ""; - - /** - * PrivateEnvironmentConfig networkingConfig. - * @member {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null|undefined} networkingConfig - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.networkingConfig = null; - - /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance - */ - PrivateEnvironmentConfig.create = function create(properties) { - return new PrivateEnvironmentConfig(properties); - }; - - /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrivateEnvironmentConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); - if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) - $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); - if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); - if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); - if (message.enablePrivatelyUsedPublicIps != null && Object.hasOwnProperty.call(message, "enablePrivatelyUsedPublicIps")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enablePrivatelyUsedPublicIps); - if (message.cloudComposerNetworkIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4CidrBlock")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudComposerNetworkIpv4CidrBlock); - if (message.cloudComposerNetworkIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4ReservedRange")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudComposerNetworkIpv4ReservedRange); - if (message.cloudComposerConnectionSubnetwork != null && Object.hasOwnProperty.call(message, "cloudComposerConnectionSubnetwork")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.cloudComposerConnectionSubnetwork); - if (message.networkingConfig != null && Object.hasOwnProperty.call(message, "networkingConfig")) - $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.encode(message.networkingConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrivateEnvironmentConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.enablePrivateEnvironment = reader.bool(); - break; - } - case 2: { - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.webServerIpv4CidrBlock = reader.string(); - break; - } - case 4: { - message.cloudSqlIpv4CidrBlock = reader.string(); - break; - } - case 5: { - message.webServerIpv4ReservedRange = reader.string(); - break; - } - case 7: { - message.cloudComposerNetworkIpv4CidrBlock = reader.string(); - break; - } - case 8: { - message.cloudComposerNetworkIpv4ReservedRange = reader.string(); - break; - } - case 6: { - message.enablePrivatelyUsedPublicIps = reader.bool(); - break; - } - case 9: { - message.cloudComposerConnectionSubnetwork = reader.string(); - break; - } - case 10: { - message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateEnvironmentConfig message. + * Verifies a WebServerNetworkAccessControl message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateEnvironmentConfig.verify = function verify(message) { + WebServerNetworkAccessControl.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - if (typeof message.enablePrivateEnvironment !== "boolean") - return "enablePrivateEnvironment: boolean expected"; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify(message.privateClusterConfig); - if (error) - return "privateClusterConfig." + error; - } - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - if (!$util.isString(message.webServerIpv4CidrBlock)) - return "webServerIpv4CidrBlock: string expected"; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - if (!$util.isString(message.cloudSqlIpv4CidrBlock)) - return "cloudSqlIpv4CidrBlock: string expected"; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - if (!$util.isString(message.webServerIpv4ReservedRange)) - return "webServerIpv4ReservedRange: string expected"; - if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) - if (!$util.isString(message.cloudComposerNetworkIpv4CidrBlock)) - return "cloudComposerNetworkIpv4CidrBlock: string expected"; - if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) - if (!$util.isString(message.cloudComposerNetworkIpv4ReservedRange)) - return "cloudComposerNetworkIpv4ReservedRange: string expected"; - if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) - if (typeof message.enablePrivatelyUsedPublicIps !== "boolean") - return "enablePrivatelyUsedPublicIps: boolean expected"; - if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) - if (!$util.isString(message.cloudComposerConnectionSubnetwork)) - return "cloudComposerConnectionSubnetwork: string expected"; - if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify(message.networkingConfig); - if (error) - return "networkingConfig." + error; + if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { + if (!Array.isArray(message.allowedIpRanges)) + return "allowedIpRanges: array expected"; + for (var i = 0; i < message.allowedIpRanges.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); + if (error) + return "allowedIpRanges." + error; + } } return null; }; /** - * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl */ - PrivateEnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig) + WebServerNetworkAccessControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); - if (object.enablePrivateEnvironment != null) - message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); - if (object.privateClusterConfig != null) { - if (typeof object.privateClusterConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.fromObject(object.privateClusterConfig); - } - if (object.webServerIpv4CidrBlock != null) - message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); - if (object.cloudSqlIpv4CidrBlock != null) - message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); - if (object.webServerIpv4ReservedRange != null) - message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); - if (object.cloudComposerNetworkIpv4CidrBlock != null) - message.cloudComposerNetworkIpv4CidrBlock = String(object.cloudComposerNetworkIpv4CidrBlock); - if (object.cloudComposerNetworkIpv4ReservedRange != null) - message.cloudComposerNetworkIpv4ReservedRange = String(object.cloudComposerNetworkIpv4ReservedRange); - if (object.enablePrivatelyUsedPublicIps != null) - message.enablePrivatelyUsedPublicIps = Boolean(object.enablePrivatelyUsedPublicIps); - if (object.cloudComposerConnectionSubnetwork != null) - message.cloudComposerConnectionSubnetwork = String(object.cloudComposerConnectionSubnetwork); - if (object.networkingConfig != null) { - if (typeof object.networkingConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.networkingConfig: object expected"); - message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.fromObject(object.networkingConfig); + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); + if (object.allowedIpRanges) { + if (!Array.isArray(object.allowedIpRanges)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); + message.allowedIpRanges = []; + for (var i = 0; i < object.allowedIpRanges.length; ++i) { + if (typeof object.allowedIpRanges[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); + message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); + } } return message; }; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static - * @param {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivateEnvironmentConfig.toObject = function toObject(message, options) { + WebServerNetworkAccessControl.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.enablePrivateEnvironment = false; - object.privateClusterConfig = null; - object.webServerIpv4CidrBlock = ""; - object.cloudSqlIpv4CidrBlock = ""; - object.webServerIpv4ReservedRange = ""; - object.enablePrivatelyUsedPublicIps = false; - object.cloudComposerNetworkIpv4CidrBlock = ""; - object.cloudComposerNetworkIpv4ReservedRange = ""; - object.cloudComposerConnectionSubnetwork = ""; - object.networkingConfig = null; + if (options.arrays || options.defaults) + object.allowedIpRanges = []; + if (message.allowedIpRanges && message.allowedIpRanges.length) { + object.allowedIpRanges = []; + for (var j = 0; j < message.allowedIpRanges.length; ++j) + object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); } - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - object.enablePrivateEnvironment = message.enablePrivateEnvironment; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) - object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; - if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) - object.enablePrivatelyUsedPublicIps = message.enablePrivatelyUsedPublicIps; - if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) - object.cloudComposerNetworkIpv4CidrBlock = message.cloudComposerNetworkIpv4CidrBlock; - if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) - object.cloudComposerNetworkIpv4ReservedRange = message.cloudComposerNetworkIpv4ReservedRange; - if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) - object.cloudComposerConnectionSubnetwork = message.cloudComposerConnectionSubnetwork; - if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) - object.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.toObject(message.networkingConfig, options); return object; }; /** - * Converts this PrivateEnvironmentConfig to JSON. + * Converts this WebServerNetworkAccessControl to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @instance * @returns {Object.} JSON object */ - PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { + WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateEnvironmentConfig + * Gets the default type url for WebServerNetworkAccessControl * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl"; }; - return PrivateEnvironmentConfig; - })(); + WebServerNetworkAccessControl.AllowedIpRange = (function() { - v1.WorkloadsConfig = (function() { + /** + * Properties of an AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @interface IAllowedIpRange + * @property {string|null} [value] AllowedIpRange value + * @property {string|null} [description] AllowedIpRange description + */ - /** - * Properties of a WorkloadsConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IWorkloadsConfig - * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null} [scheduler] WorkloadsConfig scheduler - * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null} [webServer] WorkloadsConfig webServer - * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null} [worker] WorkloadsConfig worker - */ + /** + * Constructs a new AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @classdesc Represents an AllowedIpRange. + * @implements IAllowedIpRange + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + */ + function AllowedIpRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new WorkloadsConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a WorkloadsConfig. - * @implements IWorkloadsConfig - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set - */ - function WorkloadsConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * AllowedIpRange value. + * @member {string} value + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.value = ""; - /** - * WorkloadsConfig scheduler. - * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null|undefined} scheduler - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.scheduler = null; + /** + * AllowedIpRange description. + * @member {string} description + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.description = ""; - /** - * WorkloadsConfig webServer. - * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null|undefined} webServer - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.webServer = null; + /** + * Creates a new AllowedIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance + */ + AllowedIpRange.create = function create(properties) { + return new AllowedIpRange(properties); + }; - /** - * WorkloadsConfig worker. - * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null|undefined} worker - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.worker = null; + /** + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; - /** - * Creates a new WorkloadsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig instance - */ - WorkloadsConfig.create = function create(properties) { - return new WorkloadsConfig(properties); - }; + /** + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkloadsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduler != null && Object.hasOwnProperty.call(message, "scheduler")) - $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.encode(message.scheduler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.webServer != null && Object.hasOwnProperty.call(message, "webServer")) - $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.encode(message.webServer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.worker != null && Object.hasOwnProperty.call(message, "worker")) - $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.encode(message.worker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Decodes an AllowedIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + /** + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedIpRange message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + */ + AllowedIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); + if (object.value != null) + message.value = String(object.value); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.description = ""; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AllowedIpRange to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + * @returns {Object.} JSON object + */ + AllowedIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedIpRange + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange"; + }; + + return AllowedIpRange; + })(); + + return WebServerNetworkAccessControl; + })(); + + v1.DatabaseConfig = (function() { + + /** + * Properties of a DatabaseConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IDatabaseConfig + * @property {string|null} [machineType] DatabaseConfig machineType + */ + + /** + * Constructs a new DatabaseConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a DatabaseConfig. + * @implements IDatabaseConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set + */ + function DatabaseConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatabaseConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @instance + */ + DatabaseConfig.prototype.machineType = ""; + + /** + * Creates a new DatabaseConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig instance + */ + DatabaseConfig.create = function create(properties) { + return new DatabaseConfig(properties); + }; + + /** + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WorkloadsConfig.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WorkloadsConfig message from the specified reader or buffer. + * Decodes a DatabaseConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkloadsConfig.decode = function decode(reader, length) { + DatabaseConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.decode(reader, reader.uint32()); - break; - } - case 2: { - message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.decode(reader, reader.uint32()); + message.machineType = reader.string(); break; } default: @@ -6928,1184 +7081,6319 @@ }; /** - * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkloadsConfig.decodeDelimited = function decodeDelimited(reader) { + DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WorkloadsConfig message. + * Verifies a DatabaseConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WorkloadsConfig.verify = function verify(message) { + DatabaseConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scheduler != null && message.hasOwnProperty("scheduler")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify(message.scheduler); - if (error) - return "scheduler." + error; - } - if (message.webServer != null && message.hasOwnProperty("webServer")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify(message.webServer); - if (error) - return "webServer." + error; - } - if (message.worker != null && message.hasOwnProperty("worker")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify(message.worker); - if (error) - return "worker." + error; - } + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; return null; }; /** - * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig */ - WorkloadsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig) + DatabaseConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); - if (object.scheduler != null) { - if (typeof object.scheduler !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.scheduler: object expected"); - message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.fromObject(object.scheduler); - } - if (object.webServer != null) { - if (typeof object.webServer !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.webServer: object expected"); - message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.fromObject(object.webServer); - } - if (object.worker != null) { - if (typeof object.worker !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.worker: object expected"); - message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.fromObject(object.worker); - } + var message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); return message; }; /** - * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} message WorkloadsConfig + * @param {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} message DatabaseConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WorkloadsConfig.toObject = function toObject(message, options) { + DatabaseConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.scheduler = null; - object.webServer = null; - object.worker = null; - } - if (message.scheduler != null && message.hasOwnProperty("scheduler")) - object.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.toObject(message.scheduler, options); - if (message.webServer != null && message.hasOwnProperty("webServer")) - object.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.toObject(message.webServer, options); - if (message.worker != null && message.hasOwnProperty("worker")) - object.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.toObject(message.worker, options); + if (options.defaults) + object.machineType = ""; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; return object; }; /** - * Converts this WorkloadsConfig to JSON. + * Converts this DatabaseConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @instance * @returns {Object.} JSON object */ - WorkloadsConfig.prototype.toJSON = function toJSON() { + DatabaseConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WorkloadsConfig + * Gets the default type url for DatabaseConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WorkloadsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseConfig"; }; - WorkloadsConfig.SchedulerResource = (function() { + return DatabaseConfig; + })(); - /** - * Properties of a SchedulerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @interface ISchedulerResource - * @property {number|null} [cpu] SchedulerResource cpu - * @property {number|null} [memoryGb] SchedulerResource memoryGb - * @property {number|null} [storageGb] SchedulerResource storageGb - * @property {number|null} [count] SchedulerResource count - */ + v1.WebServerConfig = (function() { - /** - * Constructs a new SchedulerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @classdesc Represents a SchedulerResource. - * @implements ISchedulerResource - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set - */ - function SchedulerResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a WebServerConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IWebServerConfig + * @property {string|null} [machineType] WebServerConfig machineType + */ - /** - * SchedulerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @instance - */ - SchedulerResource.prototype.cpu = 0; + /** + * Constructs a new WebServerConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a WebServerConfig. + * @implements IWebServerConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set + */ + function WebServerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * SchedulerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @instance - */ - SchedulerResource.prototype.memoryGb = 0; + /** + * WebServerConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @instance + */ + WebServerConfig.prototype.machineType = ""; - /** - * SchedulerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @instance - */ - SchedulerResource.prototype.storageGb = 0; + /** + * Creates a new WebServerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig instance + */ + WebServerConfig.create = function create(properties) { + return new WebServerConfig(properties); + }; - /** - * SchedulerResource count. - * @member {number} count - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @instance - */ - SchedulerResource.prototype.count = 0; + /** + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + return writer; + }; - /** - * Creates a new SchedulerResource instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource instance - */ - SchedulerResource.create = function create(properties) { - return new SchedulerResource(properties); - }; + /** + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulerResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); - return writer; - }; + /** + * Decodes a WebServerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulerResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SchedulerResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulerResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpu = reader.float(); - break; - } - case 2: { - message.memoryGb = reader.float(); - break; - } - case 3: { - message.storageGb = reader.float(); - break; - } - case 4: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a WebServerConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; - /** - * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulerResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + */ + WebServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; - /** - * Verifies a SchedulerResource message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SchedulerResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpu != null && message.hasOwnProperty("cpu")) - if (typeof message.cpu !== "number") - return "cpu: number expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (typeof message.memoryGb !== "number") - return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; + /** + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerConfig} message WebServerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.machineType = ""; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; - /** - * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource - */ - SchedulerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); - if (object.cpu != null) - message.cpu = Number(object.cpu); - if (object.memoryGb != null) - message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - if (object.count != null) - message.count = object.count | 0; - return message; - }; + /** + * Converts this WebServerConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @instance + * @returns {Object.} JSON object + */ + WebServerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} message SchedulerResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SchedulerResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpu = 0; - object.memoryGb = 0; - object.storageGb = 0; - object.count = 0; - } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; + /** + * Gets the default type url for WebServerConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerConfig"; + }; - /** - * Converts this SchedulerResource to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @instance - * @returns {Object.} JSON object - */ - SchedulerResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return WebServerConfig; + })(); - /** - * Gets the default type url for SchedulerResource - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchedulerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource"; - }; + v1.EncryptionConfig = (function() { - return SchedulerResource; - })(); + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ - WorkloadsConfig.WebServerResource = (function() { + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a WebServerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @interface IWebServerResource - * @property {number|null} [cpu] WebServerResource cpu - * @property {number|null} [memoryGb] WebServerResource memoryGb - * @property {number|null} [storageGb] WebServerResource storageGb - */ - - /** - * Constructs a new WebServerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @classdesc Represents a WebServerResource. - * @implements IWebServerResource - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set - */ - function WebServerResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebServerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.cpu = 0; - - /** - * WebServerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.memoryGb = 0; - - /** - * WebServerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.storageGb = 0; + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; - /** - * Creates a new WebServerResource instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource instance - */ - WebServerResource.create = function create(properties) { - return new WebServerResource(properties); - }; + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; - /** - * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - return writer; - }; + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; - /** - * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a WebServerResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpu = reader.float(); - break; - } - case 2: { - message.memoryGb = reader.float(); - break; - } - case 3: { - message.storageGb = reader.float(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a WebServerResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a WebServerResource message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebServerResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpu != null && message.hasOwnProperty("cpu")) - if (typeof message.cpu !== "number") - return "cpu: number expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (typeof message.memoryGb !== "number") - return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - return null; - }; + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource - */ - WebServerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); - if (object.cpu != null) - message.cpu = Number(object.cpu); - if (object.memoryGb != null) - message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - return message; - }; + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; - /** - * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} message WebServerResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebServerResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpu = 0; - object.memoryGb = 0; - object.storageGb = 0; - } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig) return object; - }; + var message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; - /** - * Converts this WebServerResource to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @instance - * @returns {Object.} JSON object - */ - WebServerResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; - /** - * Gets the default type url for WebServerResource - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebServerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource"; - }; + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return WebServerResource; - })(); + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EncryptionConfig"; + }; - WorkloadsConfig.WorkerResource = (function() { + return EncryptionConfig; + })(); - /** - * Properties of a WorkerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @interface IWorkerResource - * @property {number|null} [cpu] WorkerResource cpu - * @property {number|null} [memoryGb] WorkerResource memoryGb - * @property {number|null} [storageGb] WorkerResource storageGb - * @property {number|null} [minCount] WorkerResource minCount - * @property {number|null} [maxCount] WorkerResource maxCount - */ + v1.MaintenanceWindow = (function() { - /** - * Constructs a new WorkerResource. - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig - * @classdesc Represents a WorkerResource. - * @implements IWorkerResource - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set - */ - function WorkerResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IMaintenanceWindow + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceWindow endTime + * @property {string|null} [recurrence] MaintenanceWindow recurrence + */ - /** - * WorkerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.cpu = 0; + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * WorkerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.memoryGb = 0; + /** + * MaintenanceWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; - /** - * WorkerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.storageGb = 0; + /** + * MaintenanceWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.endTime = null; - /** - * WorkerResource minCount. - * @member {number} minCount - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.minCount = 0; + /** + * MaintenanceWindow recurrence. + * @member {string} recurrence + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.recurrence = ""; - /** - * WorkerResource maxCount. - * @member {number} maxCount - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.maxCount = 0; + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; - /** - * Creates a new WorkerResource instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, 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.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recurrence); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $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.recurrence = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + if (!$util.isString(message.recurrence)) + return "recurrence: string expected"; + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.recurrence != null) + message.recurrence = String(object.recurrence); + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.recurrence = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + object.recurrence = message.recurrence; + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + v1.SoftwareConfig = (function() { + + /** + * Properties of a SoftwareConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface ISoftwareConfig + * @property {string|null} [imageVersion] SoftwareConfig imageVersion + * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides + * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages + * @property {Object.|null} [envVariables] SoftwareConfig envVariables + * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion + * @property {number|null} [schedulerCount] SoftwareConfig schedulerCount + */ + + /** + * Constructs a new SoftwareConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a SoftwareConfig. + * @implements ISoftwareConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set + */ + function SoftwareConfig(properties) { + this.airflowConfigOverrides = {}; + this.pypiPackages = {}; + this.envVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftwareConfig imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.imageVersion = ""; + + /** + * SoftwareConfig airflowConfigOverrides. + * @member {Object.} airflowConfigOverrides + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; + + /** + * SoftwareConfig pypiPackages. + * @member {Object.} pypiPackages + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.pypiPackages = $util.emptyObject; + + /** + * SoftwareConfig envVariables. + * @member {Object.} envVariables + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.envVariables = $util.emptyObject; + + /** + * SoftwareConfig pythonVersion. + * @member {string} pythonVersion + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.pythonVersion = ""; + + /** + * SoftwareConfig schedulerCount. + * @member {number} schedulerCount + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.schedulerCount = 0; + + /** + * Creates a new SoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig instance + */ + SoftwareConfig.create = function create(properties) { + return new SoftwareConfig(properties); + }; + + /** + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); + if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) + for (var keys = Object.keys(message.airflowConfigOverrides), 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.airflowConfigOverrides[keys[i]]).ldelim(); + if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) + for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); + if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) + for (var keys = Object.keys(message.envVariables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.envVariables[keys[i]]).ldelim(); + if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); + if (message.schedulerCount != null && Object.hasOwnProperty.call(message, "schedulerCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.schedulerCount); + return writer; + }; + + /** + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageVersion = reader.string(); + break; + } + case 2: { + if (message.airflowConfigOverrides === $util.emptyObject) + message.airflowConfigOverrides = {}; + 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.airflowConfigOverrides[key] = value; + break; + } + case 3: { + if (message.pypiPackages === $util.emptyObject) + message.pypiPackages = {}; + 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.pypiPackages[key] = value; + break; + } + case 4: { + if (message.envVariables === $util.emptyObject) + message.envVariables = {}; + 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.envVariables[key] = value; + break; + } + case 6: { + message.pythonVersion = reader.string(); + break; + } + case 7: { + message.schedulerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwareConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { + if (!$util.isObject(message.airflowConfigOverrides)) + return "airflowConfigOverrides: object expected"; + var key = Object.keys(message.airflowConfigOverrides); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.airflowConfigOverrides[key[i]])) + return "airflowConfigOverrides: string{k:string} expected"; + } + if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { + if (!$util.isObject(message.pypiPackages)) + return "pypiPackages: object expected"; + var key = Object.keys(message.pypiPackages); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.pypiPackages[key[i]])) + return "pypiPackages: string{k:string} expected"; + } + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!$util.isObject(message.envVariables)) + return "envVariables: object expected"; + var key = Object.keys(message.envVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.envVariables[key[i]])) + return "envVariables: string{k:string} expected"; + } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + if (!$util.isString(message.pythonVersion)) + return "pythonVersion: string expected"; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + if (!$util.isInteger(message.schedulerCount)) + return "schedulerCount: integer expected"; + return null; + }; + + /** + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + */ + SoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.airflowConfigOverrides) { + if (typeof object.airflowConfigOverrides !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.airflowConfigOverrides: object expected"); + message.airflowConfigOverrides = {}; + for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) + message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); + } + if (object.pypiPackages) { + if (typeof object.pypiPackages !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.pypiPackages: object expected"); + message.pypiPackages = {}; + for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) + message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); + } + if (object.envVariables) { + if (typeof object.envVariables !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.envVariables: object expected"); + message.envVariables = {}; + for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) + message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); + } + if (object.pythonVersion != null) + message.pythonVersion = String(object.pythonVersion); + if (object.schedulerCount != null) + message.schedulerCount = object.schedulerCount | 0; + return message; + }; + + /** + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} message SoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.airflowConfigOverrides = {}; + object.pypiPackages = {}; + object.envVariables = {}; + } + if (options.defaults) { + object.imageVersion = ""; + object.pythonVersion = ""; + object.schedulerCount = 0; + } + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + var keys2; + if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { + object.airflowConfigOverrides = {}; + for (var j = 0; j < keys2.length; ++j) + object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; + } + if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { + object.pypiPackages = {}; + for (var j = 0; j < keys2.length; ++j) + object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; + } + if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { + object.envVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + object.pythonVersion = message.pythonVersion; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + object.schedulerCount = message.schedulerCount; + return object; + }; + + /** + * Converts this SoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + SoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SoftwareConfig"; + }; + + return SoftwareConfig; + })(); + + v1.IPAllocationPolicy = (function() { + + /** + * Properties of a IPAllocationPolicy. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IIPAllocationPolicy + * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases + * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName + * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock + * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName + * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock + */ + + /** + * Constructs a new IPAllocationPolicy. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a IPAllocationPolicy. + * @implements IIPAllocationPolicy + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set + */ + function IPAllocationPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IPAllocationPolicy useIpAliases. + * @member {boolean} useIpAliases + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.useIpAliases = false; + + /** + * IPAllocationPolicy clusterSecondaryRangeName. + * @member {string|null|undefined} clusterSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.clusterSecondaryRangeName = null; + + /** + * IPAllocationPolicy clusterIpv4CidrBlock. + * @member {string|null|undefined} clusterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.clusterIpv4CidrBlock = null; + + /** + * IPAllocationPolicy servicesSecondaryRangeName. + * @member {string|null|undefined} servicesSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.servicesSecondaryRangeName = null; + + /** + * IPAllocationPolicy servicesIpv4CidrBlock. + * @member {string|null|undefined} servicesIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.servicesIpv4CidrBlock = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IPAllocationPolicy clusterIpAllocation. + * @member {"clusterSecondaryRangeName"|"clusterIpv4CidrBlock"|undefined} clusterIpAllocation + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + Object.defineProperty(IPAllocationPolicy.prototype, "clusterIpAllocation", { + get: $util.oneOfGetter($oneOfFields = ["clusterSecondaryRangeName", "clusterIpv4CidrBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * IPAllocationPolicy servicesIpAllocation. + * @member {"servicesSecondaryRangeName"|"servicesIpv4CidrBlock"|undefined} servicesIpAllocation + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + */ + Object.defineProperty(IPAllocationPolicy.prototype, "servicesIpAllocation", { + get: $util.oneOfGetter($oneOfFields = ["servicesSecondaryRangeName", "servicesIpv4CidrBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IPAllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy instance + */ + IPAllocationPolicy.create = function create(properties) { + return new IPAllocationPolicy(properties); + }; + + /** + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IPAllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); + if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); + if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); + if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); + if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); + return writer; + }; + + /** + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IPAllocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useIpAliases = reader.bool(); + break; + } + case 2: { + message.clusterSecondaryRangeName = reader.string(); + break; + } + case 4: { + message.clusterIpv4CidrBlock = reader.string(); + break; + } + case 3: { + message.servicesSecondaryRangeName = reader.string(); + break; + } + case 5: { + message.servicesIpv4CidrBlock = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IPAllocationPolicy message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IPAllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + if (typeof message.useIpAliases !== "boolean") + return "useIpAliases: boolean expected"; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { + properties.clusterIpAllocation = 1; + if (!$util.isString(message.clusterSecondaryRangeName)) + return "clusterSecondaryRangeName: string expected"; + } + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { + if (properties.clusterIpAllocation === 1) + return "clusterIpAllocation: multiple values"; + properties.clusterIpAllocation = 1; + if (!$util.isString(message.clusterIpv4CidrBlock)) + return "clusterIpv4CidrBlock: string expected"; + } + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { + properties.servicesIpAllocation = 1; + if (!$util.isString(message.servicesSecondaryRangeName)) + return "servicesSecondaryRangeName: string expected"; + } + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { + if (properties.servicesIpAllocation === 1) + return "servicesIpAllocation: multiple values"; + properties.servicesIpAllocation = 1; + if (!$util.isString(message.servicesIpv4CidrBlock)) + return "servicesIpv4CidrBlock: string expected"; + } + return null; + }; + + /** + * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + */ + IPAllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); + if (object.useIpAliases != null) + message.useIpAliases = Boolean(object.useIpAliases); + if (object.clusterSecondaryRangeName != null) + message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); + if (object.clusterIpv4CidrBlock != null) + message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); + if (object.servicesSecondaryRangeName != null) + message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); + if (object.servicesIpv4CidrBlock != null) + message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); + return message; + }; + + /** + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} message IPAllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IPAllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useIpAliases = false; + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + object.useIpAliases = message.useIpAliases; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { + object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; + if (options.oneofs) + object.clusterIpAllocation = "clusterSecondaryRangeName"; + } + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { + object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; + if (options.oneofs) + object.servicesIpAllocation = "servicesSecondaryRangeName"; + } + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { + object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; + if (options.oneofs) + object.clusterIpAllocation = "clusterIpv4CidrBlock"; + } + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { + object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; + if (options.oneofs) + object.servicesIpAllocation = "servicesIpv4CidrBlock"; + } + return object; + }; + + /** + * Converts this IPAllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + IPAllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IPAllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy"; + }; + + return IPAllocationPolicy; + })(); + + v1.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface INodeConfig + * @property {string|null} [location] NodeConfig location + * @property {string|null} [machineType] NodeConfig machineType + * @property {string|null} [network] NodeConfig network + * @property {string|null} [subnetwork] NodeConfig subnetwork + * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb + * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes + * @property {string|null} [serviceAccount] NodeConfig serviceAccount + * @property {Array.|null} [tags] NodeConfig tags + * @property {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy + * @property {boolean|null} [enableIpMasqAgent] NodeConfig enableIpMasqAgent + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + this.oauthScopes = []; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeConfig location. + * @member {string} location + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.location = ""; + + /** + * NodeConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.machineType = ""; + + /** + * NodeConfig network. + * @member {string} network + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.network = ""; + + /** + * NodeConfig subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.subnetwork = ""; + + /** + * NodeConfig diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.diskSizeGb = 0; + + /** + * NodeConfig oauthScopes. + * @member {Array.} oauthScopes + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.oauthScopes = $util.emptyArray; + + /** + * NodeConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.serviceAccount = ""; + + /** + * NodeConfig tags. + * @member {Array.} tags + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.tags = $util.emptyArray; + + /** + * NodeConfig ipAllocationPolicy. + * @member {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.ipAllocationPolicy = null; + + /** + * NodeConfig enableIpMasqAgent. + * @member {boolean} enableIpMasqAgent + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.enableIpMasqAgent = false; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); + if (message.oauthScopes != null && message.oauthScopes.length) + for (var i = 0; i < message.oauthScopes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) + $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableIpMasqAgent != null && Object.hasOwnProperty.call(message, "enableIpMasqAgent")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableIpMasqAgent); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.network = reader.string(); + break; + } + case 4: { + message.subnetwork = reader.string(); + break; + } + case 5: { + message.diskSizeGb = reader.int32(); + break; + } + case 6: { + if (!(message.oauthScopes && message.oauthScopes.length)) + message.oauthScopes = []; + message.oauthScopes.push(reader.string()); + break; + } + case 7: { + message.serviceAccount = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 9: { + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + message.enableIpMasqAgent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { + if (!Array.isArray(message.oauthScopes)) + return "oauthScopes: array expected"; + for (var i = 0; i < message.oauthScopes.length; ++i) + if (!$util.isString(message.oauthScopes[i])) + return "oauthScopes: string[] expected"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify(message.ipAllocationPolicy); + if (error) + return "ipAllocationPolicy." + error; + } + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + if (typeof message.enableIpMasqAgent !== "boolean") + return "enableIpMasqAgent: boolean expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NodeConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); + if (object.location != null) + message.location = String(object.location); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.oauthScopes) { + if (!Array.isArray(object.oauthScopes)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.oauthScopes: array expected"); + message.oauthScopes = []; + for (var i = 0; i < object.oauthScopes.length; ++i) + message.oauthScopes[i] = String(object.oauthScopes[i]); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.ipAllocationPolicy != null) { + if (typeof object.ipAllocationPolicy !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.ipAllocationPolicy: object expected"); + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); + } + if (object.enableIpMasqAgent != null) + message.enableIpMasqAgent = Boolean(object.enableIpMasqAgent); + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.oauthScopes = []; + object.tags = []; + } + if (options.defaults) { + object.location = ""; + object.machineType = ""; + object.network = ""; + object.subnetwork = ""; + object.diskSizeGb = 0; + object.serviceAccount = ""; + object.ipAllocationPolicy = null; + object.enableIpMasqAgent = false; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.oauthScopes && message.oauthScopes.length) { + object.oauthScopes = []; + for (var j = 0; j < message.oauthScopes.length; ++j) + object.oauthScopes[j] = message.oauthScopes[j]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) + object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + object.enableIpMasqAgent = message.enableIpMasqAgent; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NodeConfig"; + }; + + return NodeConfig; + })(); + + v1.PrivateClusterConfig = (function() { + + /** + * Properties of a PrivateClusterConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IPrivateClusterConfig + * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint + * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock + * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange + */ + + /** + * Constructs a new PrivateClusterConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a PrivateClusterConfig. + * @implements IPrivateClusterConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set + */ + function PrivateClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateClusterConfig enablePrivateEndpoint. + * @member {boolean} enablePrivateEndpoint + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.enablePrivateEndpoint = false; + + /** + * PrivateClusterConfig masterIpv4CidrBlock. + * @member {string} masterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; + + /** + * PrivateClusterConfig masterIpv4ReservedRange. + * @member {string} masterIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; + + /** + * Creates a new PrivateClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig instance + */ + PrivateClusterConfig.create = function create(properties) { + return new PrivateClusterConfig(properties); + }; + + /** + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); + if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); + if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); + return writer; + }; + + /** + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enablePrivateEndpoint = reader.bool(); + break; + } + case 2: { + message.masterIpv4CidrBlock = reader.string(); + break; + } + case 3: { + message.masterIpv4ReservedRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateClusterConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + if (typeof message.enablePrivateEndpoint !== "boolean") + return "enablePrivateEndpoint: boolean expected"; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + if (!$util.isString(message.masterIpv4CidrBlock)) + return "masterIpv4CidrBlock: string expected"; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + if (!$util.isString(message.masterIpv4ReservedRange)) + return "masterIpv4ReservedRange: string expected"; + return null; + }; + + /** + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + */ + PrivateClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); + if (object.enablePrivateEndpoint != null) + message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); + if (object.masterIpv4CidrBlock != null) + message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); + if (object.masterIpv4ReservedRange != null) + message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); + return message; + }; + + /** + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} message PrivateClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePrivateEndpoint = false; + object.masterIpv4CidrBlock = ""; + object.masterIpv4ReservedRange = ""; + } + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + object.enablePrivateEndpoint = message.enablePrivateEndpoint; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; + return object; + }; + + /** + * Converts this PrivateClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @instance + * @returns {Object.} JSON object + */ + PrivateClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateClusterConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig"; + }; + + return PrivateClusterConfig; + })(); + + v1.NetworkingConfig = (function() { + + /** + * Properties of a NetworkingConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface INetworkingConfig + * @property {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null} [connectionType] NetworkingConfig connectionType + */ + + /** + * Constructs a new NetworkingConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a NetworkingConfig. + * @implements INetworkingConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set + */ + function NetworkingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkingConfig connectionType. + * @member {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType} connectionType + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @instance + */ + NetworkingConfig.prototype.connectionType = 0; + + /** + * Creates a new NetworkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig instance + */ + NetworkingConfig.create = function create(properties) { + return new NetworkingConfig(properties); + }; + + /** + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.connectionType); + return writer; + }; + + /** + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connectionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkingConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + switch (message.connectionType) { + default: + return "connectionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig + */ + NetworkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); + switch (object.connectionType) { + default: + if (typeof object.connectionType === "number") { + message.connectionType = object.connectionType; + break; + } + break; + case "CONNECTION_TYPE_UNSPECIFIED": + case 0: + message.connectionType = 0; + break; + case "VPC_PEERING": + case 1: + message.connectionType = 1; + break; + case "PRIVATE_SERVICE_CONNECT": + case 2: + message.connectionType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} message NetworkingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.connectionType = options.enums === String ? "CONNECTION_TYPE_UNSPECIFIED" : 0; + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + object.connectionType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] : message.connectionType; + return object; + }; + + /** + * Converts this NetworkingConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkingConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NetworkingConfig"; + }; + + /** + * ConnectionType enum. + * @name google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType + * @enum {number} + * @property {number} CONNECTION_TYPE_UNSPECIFIED=0 CONNECTION_TYPE_UNSPECIFIED value + * @property {number} VPC_PEERING=1 VPC_PEERING value + * @property {number} PRIVATE_SERVICE_CONNECT=2 PRIVATE_SERVICE_CONNECT value + */ + NetworkingConfig.ConnectionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VPC_PEERING"] = 1; + values[valuesById[2] = "PRIVATE_SERVICE_CONNECT"] = 2; + return values; + })(); + + return NetworkingConfig; + })(); + + v1.PrivateEnvironmentConfig = (function() { + + /** + * Properties of a PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IPrivateEnvironmentConfig + * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment + * @property {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig + * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock + * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock + * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange + * @property {string|null} [cloudComposerNetworkIpv4CidrBlock] PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock + * @property {string|null} [cloudComposerNetworkIpv4ReservedRange] PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange + * @property {boolean|null} [enablePrivatelyUsedPublicIps] PrivateEnvironmentConfig enablePrivatelyUsedPublicIps + * @property {string|null} [cloudComposerConnectionSubnetwork] PrivateEnvironmentConfig cloudComposerConnectionSubnetwork + * @property {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null} [networkingConfig] PrivateEnvironmentConfig networkingConfig + */ + + /** + * Constructs a new PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a PrivateEnvironmentConfig. + * @implements IPrivateEnvironmentConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set + */ + function PrivateEnvironmentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateEnvironmentConfig enablePrivateEnvironment. + * @member {boolean} enablePrivateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; + + /** + * PrivateEnvironmentConfig privateClusterConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null|undefined} privateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.privateClusterConfig = null; + + /** + * PrivateEnvironmentConfig webServerIpv4CidrBlock. + * @member {string} webServerIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. + * @member {string} cloudSqlIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig webServerIpv4ReservedRange. + * @member {string} webServerIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; + + /** + * PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. + * @member {string} cloudComposerNetworkIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. + * @member {string} cloudComposerNetworkIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4ReservedRange = ""; + + /** + * PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. + * @member {boolean} enablePrivatelyUsedPublicIps + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.enablePrivatelyUsedPublicIps = false; + + /** + * PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. + * @member {string} cloudComposerConnectionSubnetwork + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerConnectionSubnetwork = ""; + + /** + * PrivateEnvironmentConfig networkingConfig. + * @member {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null|undefined} networkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.networkingConfig = null; + + /** + * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance + */ + PrivateEnvironmentConfig.create = function create(properties) { + return new PrivateEnvironmentConfig(properties); + }; + + /** + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateEnvironmentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); + if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) + $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); + if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); + if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); + if (message.enablePrivatelyUsedPublicIps != null && Object.hasOwnProperty.call(message, "enablePrivatelyUsedPublicIps")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enablePrivatelyUsedPublicIps); + if (message.cloudComposerNetworkIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4CidrBlock")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudComposerNetworkIpv4CidrBlock); + if (message.cloudComposerNetworkIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4ReservedRange")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudComposerNetworkIpv4ReservedRange); + if (message.cloudComposerConnectionSubnetwork != null && Object.hasOwnProperty.call(message, "cloudComposerConnectionSubnetwork")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cloudComposerConnectionSubnetwork); + if (message.networkingConfig != null && Object.hasOwnProperty.call(message, "networkingConfig")) + $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.encode(message.networkingConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateEnvironmentConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enablePrivateEnvironment = reader.bool(); + break; + } + case 2: { + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.webServerIpv4CidrBlock = reader.string(); + break; + } + case 4: { + message.cloudSqlIpv4CidrBlock = reader.string(); + break; + } + case 5: { + message.webServerIpv4ReservedRange = reader.string(); + break; + } + case 7: { + message.cloudComposerNetworkIpv4CidrBlock = reader.string(); + break; + } + case 8: { + message.cloudComposerNetworkIpv4ReservedRange = reader.string(); + break; + } + case 6: { + message.enablePrivatelyUsedPublicIps = reader.bool(); + break; + } + case 9: { + message.cloudComposerConnectionSubnetwork = reader.string(); + break; + } + case 10: { + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateEnvironmentConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateEnvironmentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + if (typeof message.enablePrivateEnvironment !== "boolean") + return "enablePrivateEnvironment: boolean expected"; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify(message.privateClusterConfig); + if (error) + return "privateClusterConfig." + error; + } + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + if (!$util.isString(message.webServerIpv4CidrBlock)) + return "webServerIpv4CidrBlock: string expected"; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + if (!$util.isString(message.cloudSqlIpv4CidrBlock)) + return "cloudSqlIpv4CidrBlock: string expected"; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + if (!$util.isString(message.webServerIpv4ReservedRange)) + return "webServerIpv4ReservedRange: string expected"; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + if (!$util.isString(message.cloudComposerNetworkIpv4CidrBlock)) + return "cloudComposerNetworkIpv4CidrBlock: string expected"; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + if (!$util.isString(message.cloudComposerNetworkIpv4ReservedRange)) + return "cloudComposerNetworkIpv4ReservedRange: string expected"; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + if (typeof message.enablePrivatelyUsedPublicIps !== "boolean") + return "enablePrivatelyUsedPublicIps: boolean expected"; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + if (!$util.isString(message.cloudComposerConnectionSubnetwork)) + return "cloudComposerConnectionSubnetwork: string expected"; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify(message.networkingConfig); + if (error) + return "networkingConfig." + error; + } + return null; + }; + + /** + * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + */ + PrivateEnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); + if (object.enablePrivateEnvironment != null) + message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); + if (object.privateClusterConfig != null) { + if (typeof object.privateClusterConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.fromObject(object.privateClusterConfig); + } + if (object.webServerIpv4CidrBlock != null) + message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); + if (object.cloudSqlIpv4CidrBlock != null) + message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); + if (object.webServerIpv4ReservedRange != null) + message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); + if (object.cloudComposerNetworkIpv4CidrBlock != null) + message.cloudComposerNetworkIpv4CidrBlock = String(object.cloudComposerNetworkIpv4CidrBlock); + if (object.cloudComposerNetworkIpv4ReservedRange != null) + message.cloudComposerNetworkIpv4ReservedRange = String(object.cloudComposerNetworkIpv4ReservedRange); + if (object.enablePrivatelyUsedPublicIps != null) + message.enablePrivatelyUsedPublicIps = Boolean(object.enablePrivatelyUsedPublicIps); + if (object.cloudComposerConnectionSubnetwork != null) + message.cloudComposerConnectionSubnetwork = String(object.cloudComposerConnectionSubnetwork); + if (object.networkingConfig != null) { + if (typeof object.networkingConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.networkingConfig: object expected"); + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.fromObject(object.networkingConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateEnvironmentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePrivateEnvironment = false; + object.privateClusterConfig = null; + object.webServerIpv4CidrBlock = ""; + object.cloudSqlIpv4CidrBlock = ""; + object.webServerIpv4ReservedRange = ""; + object.enablePrivatelyUsedPublicIps = false; + object.cloudComposerNetworkIpv4CidrBlock = ""; + object.cloudComposerNetworkIpv4ReservedRange = ""; + object.cloudComposerConnectionSubnetwork = ""; + object.networkingConfig = null; + } + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + object.enablePrivateEnvironment = message.enablePrivateEnvironment; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) + object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + object.enablePrivatelyUsedPublicIps = message.enablePrivatelyUsedPublicIps; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + object.cloudComposerNetworkIpv4CidrBlock = message.cloudComposerNetworkIpv4CidrBlock; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + object.cloudComposerNetworkIpv4ReservedRange = message.cloudComposerNetworkIpv4ReservedRange; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + object.cloudComposerConnectionSubnetwork = message.cloudComposerConnectionSubnetwork; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) + object.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.toObject(message.networkingConfig, options); + return object; + }; + + /** + * Converts this PrivateEnvironmentConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance + * @returns {Object.} JSON object + */ + PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateEnvironmentConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig"; + }; + + return PrivateEnvironmentConfig; + })(); + + v1.WorkloadsConfig = (function() { + + /** + * Properties of a WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IWorkloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null} [scheduler] WorkloadsConfig scheduler + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null} [webServer] WorkloadsConfig webServer + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null} [worker] WorkloadsConfig worker + */ + + /** + * Constructs a new WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a WorkloadsConfig. + * @implements IWorkloadsConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set + */ + function WorkloadsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkloadsConfig scheduler. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null|undefined} scheduler + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.scheduler = null; + + /** + * WorkloadsConfig webServer. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null|undefined} webServer + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.webServer = null; + + /** + * WorkloadsConfig worker. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null|undefined} worker + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.worker = null; + + /** + * Creates a new WorkloadsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig instance + */ + WorkloadsConfig.create = function create(properties) { + return new WorkloadsConfig(properties); + }; + + /** + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduler != null && Object.hasOwnProperty.call(message, "scheduler")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.encode(message.scheduler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.webServer != null && Object.hasOwnProperty.call(message, "webServer")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.encode(message.webServer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.worker != null && Object.hasOwnProperty.call(message, "worker")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.encode(message.worker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadsConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkloadsConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkloadsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduler != null && message.hasOwnProperty("scheduler")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify(message.scheduler); + if (error) + return "scheduler." + error; + } + if (message.webServer != null && message.hasOwnProperty("webServer")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify(message.webServer); + if (error) + return "webServer." + error; + } + if (message.worker != null && message.hasOwnProperty("worker")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify(message.worker); + if (error) + return "worker." + error; + } + return null; + }; + + /** + * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig + */ + WorkloadsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); + if (object.scheduler != null) { + if (typeof object.scheduler !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.scheduler: object expected"); + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.fromObject(object.scheduler); + } + if (object.webServer != null) { + if (typeof object.webServer !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.webServer: object expected"); + message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.fromObject(object.webServer); + } + if (object.worker != null) { + if (typeof object.worker !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.worker: object expected"); + message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.fromObject(object.worker); + } + return message; + }; + + /** + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} message WorkloadsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkloadsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduler = null; + object.webServer = null; + object.worker = null; + } + if (message.scheduler != null && message.hasOwnProperty("scheduler")) + object.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.toObject(message.scheduler, options); + if (message.webServer != null && message.hasOwnProperty("webServer")) + object.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.toObject(message.webServer, options); + if (message.worker != null && message.hasOwnProperty("worker")) + object.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.toObject(message.worker, options); + return object; + }; + + /** + * Converts this WorkloadsConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + * @returns {Object.} JSON object + */ + WorkloadsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkloadsConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkloadsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig"; + }; + + WorkloadsConfig.SchedulerResource = (function() { + + /** + * Properties of a SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface ISchedulerResource + * @property {number|null} [cpu] SchedulerResource cpu + * @property {number|null} [memoryGb] SchedulerResource memoryGb + * @property {number|null} [storageGb] SchedulerResource storageGb + * @property {number|null} [count] SchedulerResource count + */ + + /** + * Constructs a new SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a SchedulerResource. + * @implements ISchedulerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + */ + function SchedulerResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchedulerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.cpu = 0; + + /** + * SchedulerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.memoryGb = 0; + + /** + * SchedulerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.storageGb = 0; + + /** + * SchedulerResource count. + * @member {number} count + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.count = 0; + + /** + * Creates a new SchedulerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource instance + */ + SchedulerResource.create = function create(properties) { + return new SchedulerResource(properties); + }; + + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); + return writer; + }; + + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + */ + SchedulerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} message SchedulerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.count = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this SchedulerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + * @returns {Object.} JSON object + */ + SchedulerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource"; + }; + + return SchedulerResource; + })(); + + WorkloadsConfig.WebServerResource = (function() { + + /** + * Properties of a WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface IWebServerResource + * @property {number|null} [cpu] WebServerResource cpu + * @property {number|null} [memoryGb] WebServerResource memoryGb + * @property {number|null} [storageGb] WebServerResource storageGb + */ + + /** + * Constructs a new WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a WebServerResource. + * @implements IWebServerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + */ + function WebServerResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebServerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.cpu = 0; + + /** + * WebServerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.memoryGb = 0; + + /** + * WebServerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.storageGb = 0; + + /** + * Creates a new WebServerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource instance + */ + WebServerResource.create = function create(properties) { + return new WebServerResource(properties); + }; + + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + return writer; + }; + + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebServerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + return null; + }; + + /** + * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + */ + WebServerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + return message; + }; + + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} message WebServerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + return object; + }; + + /** + * Converts this WebServerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + * @returns {Object.} JSON object + */ + WebServerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebServerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource"; + }; + + return WebServerResource; + })(); + + WorkloadsConfig.WorkerResource = (function() { + + /** + * Properties of a WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface IWorkerResource + * @property {number|null} [cpu] WorkerResource cpu + * @property {number|null} [memoryGb] WorkerResource memoryGb + * @property {number|null} [storageGb] WorkerResource storageGb + * @property {number|null} [minCount] WorkerResource minCount + * @property {number|null} [maxCount] WorkerResource maxCount + */ + + /** + * Constructs a new WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a WorkerResource. + * @implements IWorkerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + */ + function WorkerResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.cpu = 0; + + /** + * WorkerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.memoryGb = 0; + + /** + * WorkerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.storageGb = 0; + + /** + * WorkerResource minCount. + * @member {number} minCount + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.minCount = 0; + + /** + * WorkerResource maxCount. + * @member {number} maxCount + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.maxCount = 0; + + /** + * Creates a new WorkerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource instance + */ + WorkerResource.create = function create(properties) { + return new WorkerResource(properties); + }; + + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minCount); + if (message.maxCount != null && Object.hasOwnProperty.call(message, "maxCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxCount); + return writer; + }; + + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.minCount = reader.int32(); + break; + } + case 5: { + message.maxCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.minCount != null && message.hasOwnProperty("minCount")) + if (!$util.isInteger(message.minCount)) + return "minCount: integer expected"; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + if (!$util.isInteger(message.maxCount)) + return "maxCount: integer expected"; + return null; + }; + + /** + * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + */ + WorkerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.minCount != null) + message.minCount = object.minCount | 0; + if (object.maxCount != null) + message.maxCount = object.maxCount | 0; + return message; + }; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} message WorkerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.minCount = 0; + object.maxCount = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.minCount != null && message.hasOwnProperty("minCount")) + object.minCount = message.minCount; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + object.maxCount = message.maxCount; + return object; + }; + + /** + * Converts this WorkerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + * @returns {Object.} JSON object + */ + WorkerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource"; + }; + + return WorkerResource; + })(); + + return WorkloadsConfig; + })(); + + v1.RecoveryConfig = (function() { + + /** + * Properties of a RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IRecoveryConfig + * @property {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null} [scheduledSnapshotsConfig] RecoveryConfig scheduledSnapshotsConfig + */ + + /** + * Constructs a new RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a RecoveryConfig. + * @implements IRecoveryConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set + */ + function RecoveryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecoveryConfig scheduledSnapshotsConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null|undefined} scheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @instance + */ + RecoveryConfig.prototype.scheduledSnapshotsConfig = null; + + /** + * Creates a new RecoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig instance + */ + RecoveryConfig.create = function create(properties) { + return new RecoveryConfig(properties); + }; + + /** + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledSnapshotsConfig != null && Object.hasOwnProperty.call(message, "scheduledSnapshotsConfig")) + $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.encode(message.scheduledSnapshotsConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecoveryConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify(message.scheduledSnapshotsConfig); + if (error) + return "scheduledSnapshotsConfig." + error; + } + return null; + }; + + /** + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + */ + RecoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig(); + if (object.scheduledSnapshotsConfig != null) { + if (typeof object.scheduledSnapshotsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.RecoveryConfig.scheduledSnapshotsConfig: object expected"); + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.fromObject(object.scheduledSnapshotsConfig); + } + return message; + }; + + /** + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} message RecoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.scheduledSnapshotsConfig = null; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) + object.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.toObject(message.scheduledSnapshotsConfig, options); + return object; + }; + + /** + * Converts this RecoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @instance + * @returns {Object.} JSON object + */ + RecoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecoveryConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.RecoveryConfig"; + }; + + return RecoveryConfig; + })(); + + v1.ScheduledSnapshotsConfig = (function() { + + /** + * Properties of a ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IScheduledSnapshotsConfig + * @property {boolean|null} [enabled] ScheduledSnapshotsConfig enabled + * @property {string|null} [snapshotLocation] ScheduledSnapshotsConfig snapshotLocation + * @property {string|null} [snapshotCreationSchedule] ScheduledSnapshotsConfig snapshotCreationSchedule + * @property {string|null} [timeZone] ScheduledSnapshotsConfig timeZone + */ + + /** + * Constructs a new ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a ScheduledSnapshotsConfig. + * @implements IScheduledSnapshotsConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set + */ + function ScheduledSnapshotsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduledSnapshotsConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.enabled = false; + + /** + * ScheduledSnapshotsConfig snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.snapshotLocation = ""; + + /** + * ScheduledSnapshotsConfig snapshotCreationSchedule. + * @member {string} snapshotCreationSchedule + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.snapshotCreationSchedule = ""; + + /** + * ScheduledSnapshotsConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.timeZone = ""; + + /** + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig instance + */ + ScheduledSnapshotsConfig.create = function create(properties) { + return new ScheduledSnapshotsConfig(properties); + }; + + /** + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledSnapshotsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.snapshotCreationSchedule != null && Object.hasOwnProperty.call(message, "snapshotCreationSchedule")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotCreationSchedule); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.snapshotLocation); + return writer; + }; + + /** + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledSnapshotsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledSnapshotsConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 6: { + message.snapshotLocation = reader.string(); + break; + } + case 3: { + message.snapshotCreationSchedule = reader.string(); + break; + } + case 5: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledSnapshotsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduledSnapshotsConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledSnapshotsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + if (!$util.isString(message.snapshotCreationSchedule)) + return "snapshotCreationSchedule: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + */ + ScheduledSnapshotsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); + if (object.snapshotCreationSchedule != null) + message.snapshotCreationSchedule = String(object.snapshotCreationSchedule); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} message ScheduledSnapshotsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledSnapshotsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.snapshotCreationSchedule = ""; + object.timeZone = ""; + object.snapshotLocation = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + object.snapshotCreationSchedule = message.snapshotCreationSchedule; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; + return object; + }; + + /** + * Converts this ScheduledSnapshotsConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + * @returns {Object.} JSON object + */ + ScheduledSnapshotsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduledSnapshotsConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduledSnapshotsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig"; + }; + + return ScheduledSnapshotsConfig; + })(); + + v1.MasterAuthorizedNetworksConfig = (function() { + + /** + * Properties of a MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IMasterAuthorizedNetworksConfig + * @property {boolean|null} [enabled] MasterAuthorizedNetworksConfig enabled + * @property {Array.|null} [cidrBlocks] MasterAuthorizedNetworksConfig cidrBlocks + */ + + /** + * Constructs a new MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a MasterAuthorizedNetworksConfig. + * @implements IMasterAuthorizedNetworksConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + */ + function MasterAuthorizedNetworksConfig(properties) { + this.cidrBlocks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MasterAuthorizedNetworksConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @instance + */ + MasterAuthorizedNetworksConfig.prototype.enabled = false; + + /** + * MasterAuthorizedNetworksConfig cidrBlocks. + * @member {Array.} cidrBlocks + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @instance + */ + MasterAuthorizedNetworksConfig.prototype.cidrBlocks = $util.emptyArray; + + /** + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig instance + */ + MasterAuthorizedNetworksConfig.create = function create(properties) { + return new MasterAuthorizedNetworksConfig(properties); + }; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasterAuthorizedNetworksConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.cidrBlocks != null && message.cidrBlocks.length) + for (var i = 0; i < message.cidrBlocks.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.encode(message.cidrBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasterAuthorizedNetworksConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasterAuthorizedNetworksConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + if (!(message.cidrBlocks && message.cidrBlocks.length)) + message.cidrBlocks = []; + message.cidrBlocks.push($root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasterAuthorizedNetworksConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MasterAuthorizedNetworksConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MasterAuthorizedNetworksConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.cidrBlocks != null && message.hasOwnProperty("cidrBlocks")) { + if (!Array.isArray(message.cidrBlocks)) + return "cidrBlocks: array expected"; + for (var i = 0; i < message.cidrBlocks.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify(message.cidrBlocks[i]); + if (error) + return "cidrBlocks." + error; + } + } + return null; + }; + + /** + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + */ + MasterAuthorizedNetworksConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.cidrBlocks) { + if (!Array.isArray(object.cidrBlocks)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: array expected"); + message.cidrBlocks = []; + for (var i = 0; i < object.cidrBlocks.length; ++i) { + if (typeof object.cidrBlocks[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: object expected"); + message.cidrBlocks[i] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.fromObject(object.cidrBlocks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MasterAuthorizedNetworksConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cidrBlocks = []; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.cidrBlocks && message.cidrBlocks.length) { + object.cidrBlocks = []; + for (var j = 0; j < message.cidrBlocks.length; ++j) + object.cidrBlocks[j] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.toObject(message.cidrBlocks[j], options); + } + return object; + }; + + /** + * Converts this MasterAuthorizedNetworksConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @instance + * @returns {Object.} JSON object + */ + MasterAuthorizedNetworksConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MasterAuthorizedNetworksConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MasterAuthorizedNetworksConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig"; + }; + + MasterAuthorizedNetworksConfig.CidrBlock = (function() { + + /** + * Properties of a CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @interface ICidrBlock + * @property {string|null} [displayName] CidrBlock displayName + * @property {string|null} [cidrBlock] CidrBlock cidrBlock + */ + + /** + * Constructs a new CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @classdesc Represents a CidrBlock. + * @implements ICidrBlock + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set + */ + function CidrBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CidrBlock displayName. + * @member {string} displayName + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + */ + CidrBlock.prototype.displayName = ""; + + /** + * CidrBlock cidrBlock. + * @member {string} cidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + */ + CidrBlock.prototype.cidrBlock = ""; + + /** + * Creates a new CidrBlock instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource instance + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock instance */ - WorkerResource.create = function create(properties) { - return new WorkerResource(properties); + CidrBlock.create = function create(properties) { + return new CidrBlock(properties); + }; + + /** + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CidrBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cidrBlock != null && Object.hasOwnProperty.call(message, "cidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cidrBlock); + return writer; + }; + + /** + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CidrBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CidrBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CidrBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cidrBlock = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CidrBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CidrBlock message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CidrBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + if (!$util.isString(message.cidrBlock)) + return "cidrBlock: string expected"; + return null; + }; + + /** + * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + */ + CidrBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cidrBlock != null) + message.cidrBlock = String(object.cidrBlock); + return message; + }; + + /** + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} message CidrBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CidrBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.cidrBlock = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + object.cidrBlock = message.cidrBlock; + return object; + }; + + /** + * Converts this CidrBlock to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + * @returns {Object.} JSON object + */ + CidrBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CidrBlock + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CidrBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock"; }; - /** - * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minCount); - if (message.maxCount != null && Object.hasOwnProperty.call(message, "maxCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxCount); - return writer; - }; + return CidrBlock; + })(); + + return MasterAuthorizedNetworksConfig; + })(); + + v1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null} [config] Environment config + * @property {string|null} [uuid] Environment uuid + * @property {google.cloud.orchestration.airflow.service.v1.Environment.State|null} [state] Environment state + * @property {google.protobuf.ITimestamp|null} [createTime] Environment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @property {Object.|null} [labels] Environment labels + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment config. + * @member {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null|undefined} config + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.config = null; + + /** + * Environment uuid. + * @member {string} uuid + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.uuid = ""; + + /** + * Environment state. + * @member {google.cloud.orchestration.airflow.service.v1.Environment.State} state + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.state = 0; + + /** + * Environment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.createTime = null; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Environment labels. + * @member {Object.} labels + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + */ + Environment.prototype.labels = $util.emptyObject; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.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.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uuid); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.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(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.uuid = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.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.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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"; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.Environment) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.config: object expected"); + message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.fromObject(object.config); + } + if (object.uuid != null) + message.uuid = String(object.uuid); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "ERROR": + case 5: + message.state = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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.orchestration.airflow.service.v1.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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]]); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {google.cloud.orchestration.airflow.service.v1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + object.uuid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.toObject(message.config, options); + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.Environment"; + }; + + /** + * State enum. + * @name google.cloud.orchestration.airflow.service.v1.Environment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} ERROR=5 ERROR value + */ + Environment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "ERROR"] = 5; + return values; + })(); + + return Environment; + })(); + + v1.CheckUpgradeResponse = (function() { + + /** + * Properties of a CheckUpgradeResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface ICheckUpgradeResponse + * @property {string|null} [buildLogUri] CheckUpgradeResponse buildLogUri + * @property {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null} [containsPypiModulesConflict] CheckUpgradeResponse containsPypiModulesConflict + * @property {string|null} [pypiConflictBuildLogExtract] CheckUpgradeResponse pypiConflictBuildLogExtract + * @property {string|null} [imageVersion] CheckUpgradeResponse imageVersion + * @property {Object.|null} [pypiDependencies] CheckUpgradeResponse pypiDependencies + */ + + /** + * Constructs a new CheckUpgradeResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a CheckUpgradeResponse. + * @implements ICheckUpgradeResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set + */ + function CheckUpgradeResponse(properties) { + this.pypiDependencies = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckUpgradeResponse buildLogUri. + * @member {string} buildLogUri + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.buildLogUri = ""; + + /** + * CheckUpgradeResponse containsPypiModulesConflict. + * @member {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult} containsPypiModulesConflict + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.containsPypiModulesConflict = 0; + + /** + * CheckUpgradeResponse pypiConflictBuildLogExtract. + * @member {string} pypiConflictBuildLogExtract + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.pypiConflictBuildLogExtract = ""; + + /** + * CheckUpgradeResponse imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.imageVersion = ""; + + /** + * CheckUpgradeResponse pypiDependencies. + * @member {Object.} pypiDependencies + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.pypiDependencies = $util.emptyObject; + + /** + * Creates a new CheckUpgradeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse instance + */ + CheckUpgradeResponse.create = function create(properties) { + return new CheckUpgradeResponse(properties); + }; + + /** + * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckUpgradeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buildLogUri != null && Object.hasOwnProperty.call(message, "buildLogUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildLogUri); + if (message.pypiConflictBuildLogExtract != null && Object.hasOwnProperty.call(message, "pypiConflictBuildLogExtract")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pypiConflictBuildLogExtract); + if (message.containsPypiModulesConflict != null && Object.hasOwnProperty.call(message, "containsPypiModulesConflict")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.containsPypiModulesConflict); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.imageVersion); + if (message.pypiDependencies != null && Object.hasOwnProperty.call(message, "pypiDependencies")) + for (var keys = Object.keys(message.pypiDependencies), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiDependencies[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckUpgradeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckUpgradeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckUpgradeResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.buildLogUri = reader.string(); + break; + } + case 4: { + message.containsPypiModulesConflict = reader.int32(); + break; + } + case 3: { + message.pypiConflictBuildLogExtract = reader.string(); + break; + } + case 5: { + message.imageVersion = reader.string(); + break; + } + case 6: { + if (message.pypiDependencies === $util.emptyObject) + message.pypiDependencies = {}; + 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.pypiDependencies[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckUpgradeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckUpgradeResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckUpgradeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) + if (!$util.isString(message.buildLogUri)) + return "buildLogUri: string expected"; + if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) + switch (message.containsPypiModulesConflict) { + default: + return "containsPypiModulesConflict: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) + if (!$util.isString(message.pypiConflictBuildLogExtract)) + return "pypiConflictBuildLogExtract: string expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.pypiDependencies != null && message.hasOwnProperty("pypiDependencies")) { + if (!$util.isObject(message.pypiDependencies)) + return "pypiDependencies: object expected"; + var key = Object.keys(message.pypiDependencies); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.pypiDependencies[key[i]])) + return "pypiDependencies: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + */ + CheckUpgradeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(); + if (object.buildLogUri != null) + message.buildLogUri = String(object.buildLogUri); + switch (object.containsPypiModulesConflict) { + default: + if (typeof object.containsPypiModulesConflict === "number") { + message.containsPypiModulesConflict = object.containsPypiModulesConflict; + break; + } + break; + case "CONFLICT_RESULT_UNSPECIFIED": + case 0: + message.containsPypiModulesConflict = 0; + break; + case "CONFLICT": + case 1: + message.containsPypiModulesConflict = 1; + break; + case "NO_CONFLICT": + case 2: + message.containsPypiModulesConflict = 2; + break; + } + if (object.pypiConflictBuildLogExtract != null) + message.pypiConflictBuildLogExtract = String(object.pypiConflictBuildLogExtract); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.pypiDependencies) { + if (typeof object.pypiDependencies !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.pypiDependencies: object expected"); + message.pypiDependencies = {}; + for (var keys = Object.keys(object.pypiDependencies), i = 0; i < keys.length; ++i) + message.pypiDependencies[keys[i]] = String(object.pypiDependencies[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} message CheckUpgradeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckUpgradeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.pypiDependencies = {}; + if (options.defaults) { + object.buildLogUri = ""; + object.pypiConflictBuildLogExtract = ""; + object.containsPypiModulesConflict = options.enums === String ? "CONFLICT_RESULT_UNSPECIFIED" : 0; + object.imageVersion = ""; + } + if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) + object.buildLogUri = message.buildLogUri; + if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) + object.pypiConflictBuildLogExtract = message.pypiConflictBuildLogExtract; + if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) + object.containsPypiModulesConflict = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] === undefined ? message.containsPypiModulesConflict : $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] : message.containsPypiModulesConflict; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + var keys2; + if (message.pypiDependencies && (keys2 = Object.keys(message.pypiDependencies)).length) { + object.pypiDependencies = {}; + for (var j = 0; j < keys2.length; ++j) + object.pypiDependencies[keys2[j]] = message.pypiDependencies[keys2[j]]; + } + return object; + }; + + /** + * Converts this CheckUpgradeResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + * @returns {Object.} JSON object + */ + CheckUpgradeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckUpgradeResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckUpgradeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse"; + }; + + /** + * ConflictResult enum. + * @name google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult + * @enum {number} + * @property {number} CONFLICT_RESULT_UNSPECIFIED=0 CONFLICT_RESULT_UNSPECIFIED value + * @property {number} CONFLICT=1 CONFLICT value + * @property {number} NO_CONFLICT=2 NO_CONFLICT value + */ + CheckUpgradeResponse.ConflictResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFLICT"] = 1; + values[valuesById[2] = "NO_CONFLICT"] = 2; + return values; + })(); + + return CheckUpgradeResponse; + })(); - /** - * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.OperationMetadata = (function() { - /** - * Decodes a WorkerResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpu = reader.float(); - break; - } - case 2: { - message.memoryGb = reader.float(); - break; - } - case 3: { - message.storageGb = reader.float(); - break; - } - case 4: { - message.minCount = reader.int32(); - break; - } - case 5: { - message.maxCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IOperationMetadata + * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null} [operationType] OperationMetadata operationType + * @property {string|null} [resource] OperationMetadata resource + * @property {string|null} [resourceUuid] OperationMetadata resourceUuid + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + */ - /** - * Decodes a WorkerResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.orchestration.airflow.service.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]]; + } - /** - * Verifies a WorkerResource message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpu != null && message.hasOwnProperty("cpu")) - if (typeof message.cpu !== "number") - return "cpu: number expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (typeof message.memoryGb !== "number") - return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - if (message.minCount != null && message.hasOwnProperty("minCount")) - if (!$util.isInteger(message.minCount)) - return "minCount: integer expected"; - if (message.maxCount != null && message.hasOwnProperty("maxCount")) - if (!$util.isInteger(message.maxCount)) - return "maxCount: integer expected"; - return null; - }; + /** + * OperationMetadata state. + * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State} state + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; - /** - * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource - */ - WorkerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); - if (object.cpu != null) - message.cpu = Number(object.cpu); - if (object.memoryGb != null) - message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - if (object.minCount != null) - message.minCount = object.minCount | 0; - if (object.maxCount != null) - message.maxCount = object.maxCount | 0; - return message; - }; + /** + * OperationMetadata operationType. + * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type} operationType + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.operationType = 0; - /** - * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} message WorkerResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpu = 0; - object.memoryGb = 0; - object.storageGb = 0; - object.minCount = 0; - object.maxCount = 0; - } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; - if (message.minCount != null && message.hasOwnProperty("minCount")) - object.minCount = message.minCount; - if (message.maxCount != null && message.hasOwnProperty("maxCount")) - object.maxCount = message.maxCount; - return object; - }; + /** + * OperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.resource = ""; - /** - * Converts this WorkerResource to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @instance - * @returns {Object.} JSON object - */ - WorkerResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * OperationMetadata resourceUuid. + * @member {string} resourceUuid + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.resourceUuid = ""; - /** - * Gets the default type url for WorkerResource - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource"; - }; + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; - return WorkerResource; - })(); + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; - return WorkloadsConfig; - })(); + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; - v1.RecoveryConfig = (function() { + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {google.cloud.orchestration.airflow.service.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operationType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.resourceUuid != null && Object.hasOwnProperty.call(message, "resourceUuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUuid); + 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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; /** - * Properties of a RecoveryConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IRecoveryConfig - * @property {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null} [scheduledSnapshotsConfig] RecoveryConfig scheduledSnapshotsConfig + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {google.cloud.orchestration.airflow.service.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(); + }; /** - * Constructs a new RecoveryConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a RecoveryConfig. - * @implements IRecoveryConfig - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function RecoveryConfig(properties) { - if (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.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.operationType = reader.int32(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.resourceUuid = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * RecoveryConfig scheduledSnapshotsConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null|undefined} scheduledSnapshotsConfig - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @instance + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecoveryConfig.prototype.scheduledSnapshotsConfig = null; + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Creates a new RecoveryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static - * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig instance + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecoveryConfig.create = function create(properties) { - return new RecoveryConfig(properties); + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 3: + case 4: + break; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) + if (!$util.isString(message.resourceUuid)) + return "resourceUuid: 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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); + 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 "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "SUCCESSFUL": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + } + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "CREATE": + case 1: + message.operationType = 1; + break; + case "DELETE": + case 2: + message.operationType = 2; + break; + case "UPDATE": + case 3: + message.operationType = 3; + break; + case "CHECK": + case 4: + message.operationType = 4; + break; + case "SAVE_SNAPSHOT": + case 5: + message.operationType = 5; + break; + case "LOAD_SNAPSHOT": + case 6: + message.operationType = 6; + break; + case "DATABASE_FAILOVER": + case 7: + message.operationType = 7; + break; + } + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceUuid != null) + message.resourceUuid = String(object.resourceUuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; }; /** - * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static - * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * @param {google.cloud.orchestration.airflow.service.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - RecoveryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduledSnapshotsConfig != null && Object.hasOwnProperty.call(message, "scheduledSnapshotsConfig")) - $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.encode(message.scheduledSnapshotsConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.operationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.resource = ""; + object.resourceUuid = ""; + object.createTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] : message.state; + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] === undefined ? message.operationType : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] : message.operationType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) + object.resourceUuid = message.resourceUuid; + 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); + return object; }; /** - * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object */ - RecoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Decodes a RecoveryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - RecoveryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - return message; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.OperationMetadata"; }; /** - * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * State enum. + * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} SUCCESSFUL=3 SUCCESSFUL value + * @property {number} FAILED=4 FAILED value */ - RecoveryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values["SUCCESSFUL"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); /** - * Verifies a RecoveryConfig message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Type enum. + * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} DELETE=2 DELETE value + * @property {number} UPDATE=3 UPDATE value + * @property {number} CHECK=4 CHECK value + * @property {number} SAVE_SNAPSHOT=5 SAVE_SNAPSHOT value + * @property {number} LOAD_SNAPSHOT=6 LOAD_SNAPSHOT value + * @property {number} DATABASE_FAILOVER=7 DATABASE_FAILOVER value */ - RecoveryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify(message.scheduledSnapshotsConfig); - if (error) - return "scheduledSnapshotsConfig." + error; - } - return null; - }; + OperationMetadata.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "UPDATE"] = 3; + values[valuesById[4] = "CHECK"] = 4; + values[valuesById[5] = "SAVE_SNAPSHOT"] = 5; + values[valuesById[6] = "LOAD_SNAPSHOT"] = 6; + values[valuesById[7] = "DATABASE_FAILOVER"] = 7; + return values; + })(); + + return OperationMetadata; + })(); + + v1.ImageVersions = (function() { /** - * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + * Constructs a new ImageVersions service. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an ImageVersions + * @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 */ - RecoveryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig(); - if (object.scheduledSnapshotsConfig != null) { - if (typeof object.scheduledSnapshotsConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.RecoveryConfig.scheduledSnapshotsConfig: object expected"); - message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.fromObject(object.scheduledSnapshotsConfig); - } - return message; - }; + function ImageVersions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageVersions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageVersions; /** - * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * Creates new ImageVersions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions * @static - * @param {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} message RecoveryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @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 {ImageVersions} RPC service. Useful where requests and/or responses are streamed. */ - RecoveryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.scheduledSnapshotsConfig = null; - if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) - object.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.toObject(message.scheduledSnapshotsConfig, options); - return object; + ImageVersions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Converts this RecoveryConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @typedef ListImageVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} [response] ListImageVersionsResponse + */ + + /** + * Calls ListImageVersions. + * @function listImageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions * @instance - * @returns {Object.} JSON object + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback} callback Node-style callback called with the error, if any, and ListImageVersionsResponse + * @returns {undefined} + * @variation 1 */ - RecoveryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(ImageVersions.prototype.listImageVersions = function listImageVersions(request, callback) { + return this.rpcCall(listImageVersions, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, request, callback); + }, "name", { value: "ListImageVersions" }); /** - * Gets the default type url for RecoveryConfig - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls ListImageVersions. + * @function listImageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - RecoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.RecoveryConfig"; - }; - return RecoveryConfig; + return ImageVersions; })(); - v1.ScheduledSnapshotsConfig = (function() { + v1.ListImageVersionsRequest = (function() { /** - * Properties of a ScheduledSnapshotsConfig. + * Properties of a ListImageVersionsRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IScheduledSnapshotsConfig - * @property {boolean|null} [enabled] ScheduledSnapshotsConfig enabled - * @property {string|null} [snapshotLocation] ScheduledSnapshotsConfig snapshotLocation - * @property {string|null} [snapshotCreationSchedule] ScheduledSnapshotsConfig snapshotCreationSchedule - * @property {string|null} [timeZone] ScheduledSnapshotsConfig timeZone + * @interface IListImageVersionsRequest + * @property {string|null} [parent] ListImageVersionsRequest parent + * @property {number|null} [pageSize] ListImageVersionsRequest pageSize + * @property {string|null} [pageToken] ListImageVersionsRequest pageToken + * @property {boolean|null} [includePastReleases] ListImageVersionsRequest includePastReleases */ /** - * Constructs a new ScheduledSnapshotsConfig. + * Constructs a new ListImageVersionsRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a ScheduledSnapshotsConfig. - * @implements IScheduledSnapshotsConfig + * @classdesc Represents a ListImageVersionsRequest. + * @implements IListImageVersionsRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set */ - function ScheduledSnapshotsConfig(properties) { + function ListImageVersionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8113,117 +13401,117 @@ } /** - * ScheduledSnapshotsConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * ListImageVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - ScheduledSnapshotsConfig.prototype.enabled = false; + ListImageVersionsRequest.prototype.parent = ""; /** - * ScheduledSnapshotsConfig snapshotLocation. - * @member {string} snapshotLocation - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * ListImageVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - ScheduledSnapshotsConfig.prototype.snapshotLocation = ""; + ListImageVersionsRequest.prototype.pageSize = 0; /** - * ScheduledSnapshotsConfig snapshotCreationSchedule. - * @member {string} snapshotCreationSchedule - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * ListImageVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - ScheduledSnapshotsConfig.prototype.snapshotCreationSchedule = ""; + ListImageVersionsRequest.prototype.pageToken = ""; /** - * ScheduledSnapshotsConfig timeZone. - * @member {string} timeZone - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * ListImageVersionsRequest includePastReleases. + * @member {boolean} includePastReleases + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - ScheduledSnapshotsConfig.prototype.timeZone = ""; + ListImageVersionsRequest.prototype.includePastReleases = false; /** - * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * Creates a new ListImageVersionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest instance */ - ScheduledSnapshotsConfig.create = function create(properties) { - return new ScheduledSnapshotsConfig(properties); + ListImageVersionsRequest.create = function create(properties) { + return new ListImageVersionsRequest(properties); }; /** - * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ScheduledSnapshotsConfig.encode = function encode(message, writer) { + ListImageVersionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.snapshotCreationSchedule != null && Object.hasOwnProperty.call(message, "snapshotCreationSchedule")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotCreationSchedule); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); - if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.snapshotLocation); + 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.includePastReleases != null && Object.hasOwnProperty.call(message, "includePastReleases")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includePastReleases); return writer; }; /** - * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ScheduledSnapshotsConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListImageVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ScheduledSnapshotsConfig.decode = function decode(reader, length) { + ListImageVersionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); + message.parent = reader.string(); break; } - case 6: { - message.snapshotLocation = reader.string(); + case 2: { + message.pageSize = reader.int32(); break; } case 3: { - message.snapshotCreationSchedule = reader.string(); + message.pageToken = reader.string(); break; } - case 5: { - message.timeZone = reader.string(); + case 4: { + message.includePastReleases = reader.bool(); break; } default: @@ -8235,149 +13523,149 @@ }; /** - * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ScheduledSnapshotsConfig.decodeDelimited = function decodeDelimited(reader) { + ListImageVersionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ScheduledSnapshotsConfig message. + * Verifies a ListImageVersionsRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ScheduledSnapshotsConfig.verify = function verify(message) { + ListImageVersionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - if (!$util.isString(message.snapshotLocation)) - return "snapshotLocation: string expected"; - if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) - if (!$util.isString(message.snapshotCreationSchedule)) - return "snapshotCreationSchedule: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string 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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) + if (typeof message.includePastReleases !== "boolean") + return "includePastReleases: boolean expected"; return null; }; /** - * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest */ - ScheduledSnapshotsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.snapshotLocation != null) - message.snapshotLocation = String(object.snapshotLocation); - if (object.snapshotCreationSchedule != null) - message.snapshotCreationSchedule = String(object.snapshotCreationSchedule); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); + ListImageVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); + 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.includePastReleases != null) + message.includePastReleases = Boolean(object.includePastReleases); return message; }; /** - * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} message ScheduledSnapshotsConfig + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} message ListImageVersionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ScheduledSnapshotsConfig.toObject = function toObject(message, options) { + ListImageVersionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.enabled = false; - object.snapshotCreationSchedule = ""; - object.timeZone = ""; - object.snapshotLocation = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.includePastReleases = false; } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) - object.snapshotCreationSchedule = message.snapshotCreationSchedule; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - object.snapshotLocation = message.snapshotLocation; + 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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) + object.includePastReleases = message.includePastReleases; return object; }; /** - * Converts this ScheduledSnapshotsConfig to JSON. + * Converts this ListImageVersionsRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance * @returns {Object.} JSON object */ - ScheduledSnapshotsConfig.prototype.toJSON = function toJSON() { + ListImageVersionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ScheduledSnapshotsConfig + * Gets the default type url for ListImageVersionsRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ScheduledSnapshotsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListImageVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest"; }; - return ScheduledSnapshotsConfig; + return ListImageVersionsRequest; })(); - v1.MasterAuthorizedNetworksConfig = (function() { + v1.ListImageVersionsResponse = (function() { /** - * Properties of a MasterAuthorizedNetworksConfig. + * Properties of a ListImageVersionsResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IMasterAuthorizedNetworksConfig - * @property {boolean|null} [enabled] MasterAuthorizedNetworksConfig enabled - * @property {Array.|null} [cidrBlocks] MasterAuthorizedNetworksConfig cidrBlocks + * @interface IListImageVersionsResponse + * @property {Array.|null} [imageVersions] ListImageVersionsResponse imageVersions + * @property {string|null} [nextPageToken] ListImageVersionsResponse nextPageToken */ /** - * Constructs a new MasterAuthorizedNetworksConfig. + * Constructs a new ListImageVersionsResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a MasterAuthorizedNetworksConfig. - * @implements IMasterAuthorizedNetworksConfig + * @classdesc Represents a ListImageVersionsResponse. + * @implements IListImageVersionsResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set */ - function MasterAuthorizedNetworksConfig(properties) { - this.cidrBlocks = []; + function ListImageVersionsResponse(properties) { + this.imageVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8385,479 +13673,251 @@ } /** - * MasterAuthorizedNetworksConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * ListImageVersionsResponse imageVersions. + * @member {Array.} imageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @instance */ - MasterAuthorizedNetworksConfig.prototype.enabled = false; + ListImageVersionsResponse.prototype.imageVersions = $util.emptyArray; /** - * MasterAuthorizedNetworksConfig cidrBlocks. - * @member {Array.} cidrBlocks - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * ListImageVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @instance */ - MasterAuthorizedNetworksConfig.prototype.cidrBlocks = $util.emptyArray; + ListImageVersionsResponse.prototype.nextPageToken = ""; /** - * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. + * Creates a new ListImageVersionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse instance */ - MasterAuthorizedNetworksConfig.create = function create(properties) { - return new MasterAuthorizedNetworksConfig(properties); + ListImageVersionsResponse.create = function create(properties) { + return new ListImageVersionsResponse(properties); }; /** - * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MasterAuthorizedNetworksConfig.encode = function encode(message, writer) { + ListImageVersionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.cidrBlocks != null && message.cidrBlocks.length) - for (var i = 0; i < message.cidrBlocks.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.encode(message.cidrBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageVersions != null && message.imageVersions.length) + for (var i = 0; i < message.imageVersions.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.encode(message.imageVersions[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 MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MasterAuthorizedNetworksConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListImageVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. + * Decodes a ListImageVersionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MasterAuthorizedNetworksConfig.decode = function decode(reader, length) { + ListImageVersionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - if (!(message.cidrBlocks && message.cidrBlocks.length)) - message.cidrBlocks = []; - message.cidrBlocks.push($root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MasterAuthorizedNetworksConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MasterAuthorizedNetworksConfig message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MasterAuthorizedNetworksConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.cidrBlocks != null && message.hasOwnProperty("cidrBlocks")) { - if (!Array.isArray(message.cidrBlocks)) - return "cidrBlocks: array expected"; - for (var i = 0; i < message.cidrBlocks.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify(message.cidrBlocks[i]); - if (error) - return "cidrBlocks." + error; - } - } - return null; - }; - - /** - * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig - */ - MasterAuthorizedNetworksConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.cidrBlocks) { - if (!Array.isArray(object.cidrBlocks)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: array expected"); - message.cidrBlocks = []; - for (var i = 0; i < object.cidrBlocks.length; ++i) { - if (typeof object.cidrBlocks[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: object expected"); - message.cidrBlocks[i] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.fromObject(object.cidrBlocks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MasterAuthorizedNetworksConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cidrBlocks = []; - if (options.defaults) - object.enabled = false; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - if (message.cidrBlocks && message.cidrBlocks.length) { - object.cidrBlocks = []; - for (var j = 0; j < message.cidrBlocks.length; ++j) - object.cidrBlocks[j] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.toObject(message.cidrBlocks[j], options); + if (!(message.imageVersions && message.imageVersions.length)) + message.imageVersions = []; + message.imageVersions.push($root.google.cloud.orchestration.airflow.service.v1.ImageVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - return object; + return message; }; /** - * Converts this MasterAuthorizedNetworksConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @instance - * @returns {Object.} JSON object + * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MasterAuthorizedNetworksConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + ListImageVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; /** - * Gets the default type url for MasterAuthorizedNetworksConfig - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * Verifies a ListImageVersionsResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MasterAuthorizedNetworksConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + ListImageVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageVersions != null && message.hasOwnProperty("imageVersions")) { + if (!Array.isArray(message.imageVersions)) + return "imageVersions: array expected"; + for (var i = 0; i < message.imageVersions.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.verify(message.imageVersions[i]); + if (error) + return "imageVersions." + error; + } } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; }; - MasterAuthorizedNetworksConfig.CidrBlock = (function() { - - /** - * Properties of a CidrBlock. - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @interface ICidrBlock - * @property {string|null} [displayName] CidrBlock displayName - * @property {string|null} [cidrBlock] CidrBlock cidrBlock - */ - - /** - * Constructs a new CidrBlock. - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig - * @classdesc Represents a CidrBlock. - * @implements ICidrBlock - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set - */ - function CidrBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CidrBlock displayName. - * @member {string} displayName - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @instance - */ - CidrBlock.prototype.displayName = ""; - - /** - * CidrBlock cidrBlock. - * @member {string} cidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @instance - */ - CidrBlock.prototype.cidrBlock = ""; - - /** - * Creates a new CidrBlock instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock instance - */ - CidrBlock.create = function create(properties) { - return new CidrBlock(properties); - }; - - /** - * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CidrBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.cidrBlock != null && Object.hasOwnProperty.call(message, "cidrBlock")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cidrBlock); - return writer; - }; - - /** - * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CidrBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CidrBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CidrBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.cidrBlock = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CidrBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CidrBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CidrBlock message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CidrBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) - if (!$util.isString(message.cidrBlock)) - return "cidrBlock: string expected"; - return null; - }; - - /** - * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock - */ - CidrBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.cidrBlock != null) - message.cidrBlock = String(object.cidrBlock); - return message; - }; - - /** - * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} message CidrBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CidrBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.cidrBlock = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) - object.cidrBlock = message.cidrBlock; + /** + * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + */ + ListImageVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) return object; - }; + var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); + if (object.imageVersions) { + if (!Array.isArray(object.imageVersions)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: array expected"); + message.imageVersions = []; + for (var i = 0; i < object.imageVersions.length; ++i) { + if (typeof object.imageVersions[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: object expected"); + message.imageVersions[i] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.fromObject(object.imageVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this CidrBlock to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @instance - * @returns {Object.} JSON object - */ - CidrBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} message ListImageVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImageVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.imageVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.imageVersions && message.imageVersions.length) { + object.imageVersions = []; + for (var j = 0; j < message.imageVersions.length; ++j) + object.imageVersions[j] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.toObject(message.imageVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Gets the default type url for CidrBlock - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CidrBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock"; - }; + /** + * Converts this ListImageVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListImageVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CidrBlock; - })(); + /** + * Gets the default type url for ListImageVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListImageVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse"; + }; - return MasterAuthorizedNetworksConfig; + return ListImageVersionsResponse; })(); - v1.Environment = (function() { + v1.ImageVersion = (function() { /** - * Properties of an Environment. + * Properties of an ImageVersion. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEnvironment - * @property {string|null} [name] Environment name - * @property {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null} [config] Environment config - * @property {string|null} [uuid] Environment uuid - * @property {google.cloud.orchestration.airflow.service.v1.Environment.State|null} [state] Environment state - * @property {google.protobuf.ITimestamp|null} [createTime] Environment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime - * @property {Object.|null} [labels] Environment labels + * @interface IImageVersion + * @property {string|null} [imageVersionId] ImageVersion imageVersionId + * @property {boolean|null} [isDefault] ImageVersion isDefault + * @property {Array.|null} [supportedPythonVersions] ImageVersion supportedPythonVersions + * @property {google.type.IDate|null} [releaseDate] ImageVersion releaseDate + * @property {boolean|null} [creationDisabled] ImageVersion creationDisabled + * @property {boolean|null} [upgradeDisabled] ImageVersion upgradeDisabled */ /** - * Constructs a new Environment. + * Constructs a new ImageVersion. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an Environment. - * @implements IEnvironment + * @classdesc Represents an ImageVersion. + * @implements IImageVersion * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set */ - function Environment(properties) { - this.labels = {}; + function ImageVersion(properties) { + this.supportedPythonVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8865,179 +13925,148 @@ } /** - * Environment name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1.Environment - * @instance - */ - Environment.prototype.name = ""; - - /** - * Environment config. - * @member {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null|undefined} config - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion imageVersionId. + * @member {string} imageVersionId + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.config = null; + ImageVersion.prototype.imageVersionId = ""; /** - * Environment uuid. - * @member {string} uuid - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion isDefault. + * @member {boolean} isDefault + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.uuid = ""; + ImageVersion.prototype.isDefault = false; /** - * Environment state. - * @member {google.cloud.orchestration.airflow.service.v1.Environment.State} state - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion supportedPythonVersions. + * @member {Array.} supportedPythonVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.state = 0; + ImageVersion.prototype.supportedPythonVersions = $util.emptyArray; /** - * Environment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion releaseDate. + * @member {google.type.IDate|null|undefined} releaseDate + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.createTime = null; + ImageVersion.prototype.releaseDate = null; /** - * Environment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion creationDisabled. + * @member {boolean} creationDisabled + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.updateTime = null; + ImageVersion.prototype.creationDisabled = false; /** - * Environment labels. - * @member {Object.} labels - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * ImageVersion upgradeDisabled. + * @member {boolean} upgradeDisabled + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - Environment.prototype.labels = $util.emptyObject; + ImageVersion.prototype.upgradeDisabled = false; /** - * Creates a new Environment instance using the specified properties. + * Creates a new ImageVersion instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment instance + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion instance */ - Environment.create = function create(properties) { - return new Environment(properties); + ImageVersion.create = function create(properties) { + return new ImageVersion(properties); }; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encode = function encode(message, writer) { + ImageVersion.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.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uuid); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.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.imageVersionId != null && Object.hasOwnProperty.call(message, "imageVersionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersionId); + if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isDefault); + if (message.supportedPythonVersions != null && message.supportedPythonVersions.length) + for (var i = 0; i < message.supportedPythonVersions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.supportedPythonVersions[i]); + if (message.releaseDate != null && Object.hasOwnProperty.call(message, "releaseDate")) + $root.google.type.Date.encode(message.releaseDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.creationDisabled != null && Object.hasOwnProperty.call(message, "creationDisabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.creationDisabled); + if (message.upgradeDisabled != null && Object.hasOwnProperty.call(message, "upgradeDisabled")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.upgradeDisabled); return writer; }; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { + ImageVersion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes an ImageVersion message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decode = function decode(reader, length) { + ImageVersion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.imageVersionId = reader.string(); break; } case 2: { - message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.decode(reader, reader.uint32()); + message.isDefault = reader.bool(); break; } case 3: { - message.uuid = reader.string(); + if (!(message.supportedPythonVersions && message.supportedPythonVersions.length)) + message.supportedPythonVersions = []; + message.supportedPythonVersions.push(reader.string()); break; } case 4: { - message.state = reader.int32(); + message.releaseDate = $root.google.type.Date.decode(reader, reader.uint32()); break; } case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.creationDisabled = reader.bool(); break; } case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.upgradeDisabled = reader.bool(); break; } default: @@ -9049,1163 +14078,1127 @@ }; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes an ImageVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decodeDelimited = function decodeDelimited(reader) { + ImageVersion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Environment message. + * Verifies an ImageVersion message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Environment.verify = function verify(message) { + ImageVersion.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.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) + if (!$util.isString(message.imageVersionId)) + return "imageVersionId: string expected"; + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + if (typeof message.isDefault !== "boolean") + return "isDefault: boolean expected"; + if (message.supportedPythonVersions != null && message.hasOwnProperty("supportedPythonVersions")) { + if (!Array.isArray(message.supportedPythonVersions)) + return "supportedPythonVersions: array expected"; + for (var i = 0; i < message.supportedPythonVersions.length; ++i) + if (!$util.isString(message.supportedPythonVersions[i])) + return "supportedPythonVersions: string[] expected"; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) { + var error = $root.google.type.Date.verify(message.releaseDate); if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; + return "releaseDate." + error; } + if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) + if (typeof message.creationDisabled !== "boolean") + return "creationDisabled: boolean expected"; + if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) + if (typeof message.upgradeDisabled !== "boolean") + return "upgradeDisabled: boolean expected"; return null; }; /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.Environment) + ImageVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ImageVersion) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.config: object expected"); - message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.fromObject(object.config); - } - if (object.uuid != null) - message.uuid = String(object.uuid); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "ERROR": - case 5: - message.state = 5; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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.orchestration.airflow.service.v1.Environment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); + if (object.imageVersionId != null) + message.imageVersionId = String(object.imageVersionId); + if (object.isDefault != null) + message.isDefault = Boolean(object.isDefault); + if (object.supportedPythonVersions) { + if (!Array.isArray(object.supportedPythonVersions)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.supportedPythonVersions: array expected"); + message.supportedPythonVersions = []; + for (var i = 0; i < object.supportedPythonVersions.length; ++i) + message.supportedPythonVersions[i] = String(object.supportedPythonVersions[i]); } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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.releaseDate != null) { + if (typeof object.releaseDate !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.releaseDate: object expected"); + message.releaseDate = $root.google.type.Date.fromObject(object.releaseDate); } + if (object.creationDisabled != null) + message.creationDisabled = Boolean(object.creationDisabled); + if (object.upgradeDisabled != null) + message.upgradeDisabled = Boolean(object.upgradeDisabled); return message; }; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. + * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1.Environment} message Environment + * @param {google.cloud.orchestration.airflow.service.v1.ImageVersion} message ImageVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Environment.toObject = function toObject(message, options) { + ImageVersion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; + if (options.arrays || options.defaults) + object.supportedPythonVersions = []; if (options.defaults) { - object.name = ""; - object.config = null; - object.uuid = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; + object.imageVersionId = ""; + object.isDefault = false; + object.releaseDate = null; + object.creationDisabled = false; + object.upgradeDisabled = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.toObject(message.config, options); - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) + object.imageVersionId = message.imageVersionId; + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + object.isDefault = message.isDefault; + if (message.supportedPythonVersions && message.supportedPythonVersions.length) { + object.supportedPythonVersions = []; + for (var j = 0; j < message.supportedPythonVersions.length; ++j) + object.supportedPythonVersions[j] = message.supportedPythonVersions[j]; } + if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) + object.releaseDate = $root.google.type.Date.toObject(message.releaseDate, options); + if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) + object.creationDisabled = message.creationDisabled; + if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) + object.upgradeDisabled = message.upgradeDisabled; return object; }; /** - * Converts this Environment to JSON. + * Converts this ImageVersion to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance * @returns {Object.} JSON object */ - Environment.prototype.toJSON = function toJSON() { + ImageVersion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Environment + * Gets the default type url for ImageVersion * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImageVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.Environment"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ImageVersion"; }; + return ImageVersion; + })(); + + return v1; + })(); + + service.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.orchestration.airflow.service + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Environments = (function() { + /** - * State enum. - * @name google.cloud.orchestration.airflow.service.v1.Environment.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} UPDATING=3 UPDATING value - * @property {number} DELETING=4 DELETING value - * @property {number} ERROR=5 ERROR value + * Constructs a new Environments service. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an Environments + * @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 */ - Environment.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "ERROR"] = 5; - return values; - })(); + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - return Environment; - })(); + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; - v1.CheckUpgradeResponse = (function() { + /** + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @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 {Environments} RPC service. Useful where requests and/or responses are streamed. + */ + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef CreateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { + return this.rpcCall(createEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEnvironment" }); + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} [response] Environment + */ + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef UpdateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { + return this.rpcCall(updateEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEnvironment" }); + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef DeleteEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { + return this.rpcCall(deleteEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEnvironment" }); + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef RestartWebServerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartWebServer. + * @function restartWebServer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.restartWebServer = function restartWebServer(request, callback) { + return this.rpcCall(restartWebServer, $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartWebServer" }); /** - * Properties of a CheckUpgradeResponse. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ICheckUpgradeResponse - * @property {string|null} [buildLogUri] CheckUpgradeResponse buildLogUri - * @property {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null} [containsPypiModulesConflict] CheckUpgradeResponse containsPypiModulesConflict - * @property {string|null} [pypiConflictBuildLogExtract] CheckUpgradeResponse pypiConflictBuildLogExtract - * @property {string|null} [imageVersion] CheckUpgradeResponse imageVersion - * @property {Object.|null} [pypiDependencies] CheckUpgradeResponse pypiDependencies + * Calls RestartWebServer. + * @function restartWebServer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new CheckUpgradeResponse. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a CheckUpgradeResponse. - * @implements ICheckUpgradeResponse - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef CheckUpgradeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function CheckUpgradeResponse(properties) { - this.pypiDependencies = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * CheckUpgradeResponse buildLogUri. - * @member {string} buildLogUri - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * Calls CheckUpgrade. + * @function checkUpgrade + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.prototype.buildLogUri = ""; + Object.defineProperty(Environments.prototype.checkUpgrade = function checkUpgrade(request, callback) { + return this.rpcCall(checkUpgrade, $root.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CheckUpgrade" }); /** - * CheckUpgradeResponse containsPypiModulesConflict. - * @member {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult} containsPypiModulesConflict - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * Calls CheckUpgrade. + * @function checkUpgrade + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CheckUpgradeResponse.prototype.containsPypiModulesConflict = 0; /** - * CheckUpgradeResponse pypiConflictBuildLogExtract. - * @member {string} pypiConflictBuildLogExtract - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @instance + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|executeAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef ExecuteAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} [response] ExecuteAirflowCommandResponse */ - CheckUpgradeResponse.prototype.pypiConflictBuildLogExtract = ""; /** - * CheckUpgradeResponse imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * Calls ExecuteAirflowCommand. + * @function executeAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest} request ExecuteAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.ExecuteAirflowCommandCallback} callback Node-style callback called with the error, if any, and ExecuteAirflowCommandResponse + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.prototype.imageVersion = ""; + Object.defineProperty(Environments.prototype.executeAirflowCommand = function executeAirflowCommand(request, callback) { + return this.rpcCall(executeAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse, request, callback); + }, "name", { value: "ExecuteAirflowCommand" }); /** - * CheckUpgradeResponse pypiDependencies. - * @member {Object.} pypiDependencies - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * Calls ExecuteAirflowCommand. + * @function executeAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest} request ExecuteAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CheckUpgradeResponse.prototype.pypiDependencies = $util.emptyObject; /** - * Creates a new CheckUpgradeResponse instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse instance + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|stopAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef StopAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} [response] StopAirflowCommandResponse */ - CheckUpgradeResponse.create = function create(properties) { - return new CheckUpgradeResponse(properties); - }; /** - * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls StopAirflowCommand. + * @function stopAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest} request StopAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.StopAirflowCommandCallback} callback Node-style callback called with the error, if any, and StopAirflowCommandResponse + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.buildLogUri != null && Object.hasOwnProperty.call(message, "buildLogUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildLogUri); - if (message.pypiConflictBuildLogExtract != null && Object.hasOwnProperty.call(message, "pypiConflictBuildLogExtract")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pypiConflictBuildLogExtract); - if (message.containsPypiModulesConflict != null && Object.hasOwnProperty.call(message, "containsPypiModulesConflict")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.containsPypiModulesConflict); - if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.imageVersion); - if (message.pypiDependencies != null && Object.hasOwnProperty.call(message, "pypiDependencies")) - for (var keys = Object.keys(message.pypiDependencies), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiDependencies[keys[i]]).ldelim(); - return writer; - }; + Object.defineProperty(Environments.prototype.stopAirflowCommand = function stopAirflowCommand(request, callback) { + return this.rpcCall(stopAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse, request, callback); + }, "name", { value: "StopAirflowCommand" }); /** - * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls StopAirflowCommand. + * @function stopAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest} request StopAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CheckUpgradeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|pollAirflowCommand}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef PollAirflowCommandCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} [response] PollAirflowCommandResponse */ - CheckUpgradeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.buildLogUri = reader.string(); - break; - } - case 4: { - message.containsPypiModulesConflict = reader.int32(); - break; - } - case 3: { - message.pypiConflictBuildLogExtract = reader.string(); - break; - } - case 5: { - message.imageVersion = reader.string(); - break; - } - case 6: { - if (message.pypiDependencies === $util.emptyObject) - message.pypiDependencies = {}; - 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.pypiDependencies[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls PollAirflowCommand. + * @function pollAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest} request PollAirflowCommandRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.PollAirflowCommandCallback} callback Node-style callback called with the error, if any, and PollAirflowCommandResponse + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(Environments.prototype.pollAirflowCommand = function pollAirflowCommand(request, callback) { + return this.rpcCall(pollAirflowCommand, $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse, request, callback); + }, "name", { value: "PollAirflowCommand" }); /** - * Verifies a CheckUpgradeResponse message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CheckUpgradeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) - if (!$util.isString(message.buildLogUri)) - return "buildLogUri: string expected"; - if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) - switch (message.containsPypiModulesConflict) { - default: - return "containsPypiModulesConflict: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) - if (!$util.isString(message.pypiConflictBuildLogExtract)) - return "pypiConflictBuildLogExtract: string expected"; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - if (!$util.isString(message.imageVersion)) - return "imageVersion: string expected"; - if (message.pypiDependencies != null && message.hasOwnProperty("pypiDependencies")) { - if (!$util.isObject(message.pypiDependencies)) - return "pypiDependencies: object expected"; - var key = Object.keys(message.pypiDependencies); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.pypiDependencies[key[i]])) - return "pypiDependencies: string{k:string} expected"; - } - return null; - }; + * Calls PollAirflowCommand. + * @function pollAirflowCommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest} request PollAirflowCommandRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef SaveSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CheckUpgradeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(); - if (object.buildLogUri != null) - message.buildLogUri = String(object.buildLogUri); - switch (object.containsPypiModulesConflict) { - default: - if (typeof object.containsPypiModulesConflict === "number") { - message.containsPypiModulesConflict = object.containsPypiModulesConflict; - break; - } - break; - case "CONFLICT_RESULT_UNSPECIFIED": - case 0: - message.containsPypiModulesConflict = 0; - break; - case "CONFLICT": - case 1: - message.containsPypiModulesConflict = 1; - break; - case "NO_CONFLICT": - case 2: - message.containsPypiModulesConflict = 2; - break; - } - if (object.pypiConflictBuildLogExtract != null) - message.pypiConflictBuildLogExtract = String(object.pypiConflictBuildLogExtract); - if (object.imageVersion != null) - message.imageVersion = String(object.imageVersion); - if (object.pypiDependencies) { - if (typeof object.pypiDependencies !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.pypiDependencies: object expected"); - message.pypiDependencies = {}; - for (var keys = Object.keys(object.pypiDependencies), i = 0; i < keys.length; ++i) - message.pypiDependencies[keys[i]] = String(object.pypiDependencies[keys[i]]); - } - return message; - }; /** - * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} message CheckUpgradeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.pypiDependencies = {}; - if (options.defaults) { - object.buildLogUri = ""; - object.pypiConflictBuildLogExtract = ""; - object.containsPypiModulesConflict = options.enums === String ? "CONFLICT_RESULT_UNSPECIFIED" : 0; - object.imageVersion = ""; - } - if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) - object.buildLogUri = message.buildLogUri; - if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) - object.pypiConflictBuildLogExtract = message.pypiConflictBuildLogExtract; - if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) - object.containsPypiModulesConflict = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] === undefined ? message.containsPypiModulesConflict : $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] : message.containsPypiModulesConflict; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - object.imageVersion = message.imageVersion; - var keys2; - if (message.pypiDependencies && (keys2 = Object.keys(message.pypiDependencies)).length) { - object.pypiDependencies = {}; - for (var j = 0; j < keys2.length; ++j) - object.pypiDependencies[keys2[j]] = message.pypiDependencies[keys2[j]]; - } - return object; - }; + Object.defineProperty(Environments.prototype.saveSnapshot = function saveSnapshot(request, callback) { + return this.rpcCall(saveSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SaveSnapshot" }); /** - * Converts this CheckUpgradeResponse to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance - * @returns {Object.} JSON object + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CheckUpgradeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for CheckUpgradeResponse - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef LoadSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - CheckUpgradeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse"; - }; /** - * ConflictResult enum. - * @name google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult - * @enum {number} - * @property {number} CONFLICT_RESULT_UNSPECIFIED=0 CONFLICT_RESULT_UNSPECIFIED value - * @property {number} CONFLICT=1 CONFLICT value - * @property {number} NO_CONFLICT=2 NO_CONFLICT value + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - CheckUpgradeResponse.ConflictResult = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONFLICT_RESULT_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONFLICT"] = 1; - values[valuesById[2] = "NO_CONFLICT"] = 2; - return values; - })(); - - return CheckUpgradeResponse; - })(); - - v1.OperationMetadata = (function() { + Object.defineProperty(Environments.prototype.loadSnapshot = function loadSnapshot(request, callback) { + return this.rpcCall(loadSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LoadSnapshot" }); /** - * Properties of an OperationMetadata. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IOperationMetadata - * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null} [state] OperationMetadata state - * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null} [operationType] OperationMetadata operationType - * @property {string|null} [resource] OperationMetadata resource - * @property {string|null} [resourceUuid] OperationMetadata resourceUuid - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|databaseFailover}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef DatabaseFailoverCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - 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 state. - * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State} state - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * Calls DatabaseFailover. + * @function databaseFailover + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest} request DatabaseFailoverRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.DatabaseFailoverCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - OperationMetadata.prototype.state = 0; + Object.defineProperty(Environments.prototype.databaseFailover = function databaseFailover(request, callback) { + return this.rpcCall(databaseFailover, $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DatabaseFailover" }); /** - * OperationMetadata operationType. - * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type} operationType - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * Calls DatabaseFailover. + * @function databaseFailover + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest} request DatabaseFailoverRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OperationMetadata.prototype.operationType = 0; /** - * OperationMetadata resource. - * @member {string} resource - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|fetchDatabaseProperties}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef FetchDatabasePropertiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} [response] FetchDatabasePropertiesResponse + */ + + /** + * Calls FetchDatabaseProperties. + * @function fetchDatabaseProperties + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest} request FetchDatabasePropertiesRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.FetchDatabasePropertiesCallback} callback Node-style callback called with the error, if any, and FetchDatabasePropertiesResponse + * @returns {undefined} + * @variation 1 */ - OperationMetadata.prototype.resource = ""; + Object.defineProperty(Environments.prototype.fetchDatabaseProperties = function fetchDatabaseProperties(request, callback) { + return this.rpcCall(fetchDatabaseProperties, $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse, request, callback); + }, "name", { value: "FetchDatabaseProperties" }); /** - * OperationMetadata resourceUuid. - * @member {string} resourceUuid - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * Calls FetchDatabaseProperties. + * @function fetchDatabaseProperties + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest} request FetchDatabasePropertiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - OperationMetadata.prototype.resourceUuid = ""; + + return Environments; + })(); + + v1beta1.CreateEnvironmentRequest = (function() { /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * Properties of a CreateEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ICreateEnvironmentRequest + * @property {string|null} [parent] CreateEnvironmentRequest parent + * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] CreateEnvironmentRequest environment + */ + + /** + * Constructs a new CreateEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a CreateEnvironmentRequest. + * @implements ICreateEnvironmentRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set + */ + function CreateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEnvironmentRequest parent. + * @member {string} parent + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @instance */ - OperationMetadata.prototype.createTime = null; + CreateEnvironmentRequest.prototype.parent = ""; /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * CreateEnvironmentRequest environment. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @instance */ - OperationMetadata.prototype.endTime = null; + CreateEnvironmentRequest.prototype.environment = null; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new CreateEnvironmentRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + CreateEnvironmentRequest.create = function create(properties) { + return new CreateEnvironmentRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + CreateEnvironmentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operationType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); - if (message.resourceUuid != null && Object.hasOwnProperty.call(message, "resourceUuid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUuid); - 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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest * @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) { + CreateEnvironmentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + message.parent = reader.string(); break; } case 2: { - message.operationType = reader.int32(); - break; - } - case 3: { - message.resource = reader.string(); - break; - } - case 4: { - message.resourceUuid = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - 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.orchestration.airflow.service.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.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.orchestration.airflow.service.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 3: - case 4: - break; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) - if (!$util.isString(message.resourceUuid)) - return "resourceUuid: 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.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); - 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 "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "SUCCESSFUL": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - } - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "CREATE": - case 1: - message.operationType = 1; - break; - case "DELETE": - case 2: - message.operationType = 2; - break; - case "UPDATE": - case 3: - message.operationType = 3; - break; - case "CHECK": - case 4: - message.operationType = 4; - break; - case "SAVE_SNAPSHOT": - case 5: - message.operationType = 5; - break; - case "LOAD_SNAPSHOT": - case 6: - message.operationType = 6; - break; - } - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceUuid != null) - message.resourceUuid = String(object.resourceUuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + return message; + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnvironmentRequest.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.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + */ + CreateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); } return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} message CreateEnvironmentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + CreateEnvironmentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.operationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.resource = ""; - object.resourceUuid = ""; - object.createTime = null; - object.endTime = null; + object.parent = ""; + object.environment = null; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] : message.state; - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] === undefined ? message.operationType : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] : message.operationType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) - object.resourceUuid = message.resourceUuid; - 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.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this CreateEnvironmentRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + CreateEnvironmentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for CreateEnvironmentRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest"; }; + return CreateEnvironmentRequest; + })(); + + v1beta1.GetEnvironmentRequest = (function() { + /** - * State enum. - * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} SUCCESSFUL=3 SUCCESSFUL value - * @property {number} FAILED=4 FAILED value + * Properties of a GetEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name */ - OperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values["SUCCESSFUL"] = 3; - values[valuesById[4] = "FAILED"] = 4; - return values; - })(); /** - * Type enum. - * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} CREATE=1 CREATE value - * @property {number} DELETE=2 DELETE value - * @property {number} UPDATE=3 UPDATE value - * @property {number} CHECK=4 CHECK value - * @property {number} SAVE_SNAPSHOT=5 SAVE_SNAPSHOT value - * @property {number} LOAD_SNAPSHOT=6 LOAD_SNAPSHOT value + * Constructs a new GetEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set */ - OperationMetadata.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATE"] = 1; - values[valuesById[2] = "DELETE"] = 2; - values[valuesById[3] = "UPDATE"] = 3; - values[valuesById[4] = "CHECK"] = 4; - values[valuesById[5] = "SAVE_SNAPSHOT"] = 5; - values[valuesById[6] = "LOAD_SNAPSHOT"] = 6; - return values; - })(); + function GetEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return OperationMetadata; - })(); + /** + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @instance + */ + GetEnvironmentRequest.prototype.name = ""; - v1.ImageVersions = (function() { + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest instance + */ + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); + }; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); + 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; + }; /** - * Constructs a new ImageVersions service. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an ImageVersions - * @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 + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function ImageVersions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - (ImageVersions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageVersions; + /** + * Verifies a GetEnvironmentRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEnvironmentRequest.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 new ImageVersions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @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 {ImageVersions} RPC service. Useful where requests and/or responses are streamed. + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest */ - ImageVersions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + GetEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions - * @typedef ListImageVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} [response] ListImageVersionsResponse + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetEnvironmentRequest.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; + }; /** - * Calls ListImageVersions. - * @function listImageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * Converts this GetEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @instance - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback} callback Node-style callback called with the error, if any, and ListImageVersionsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ImageVersions.prototype.listImageVersions = function listImageVersions(request, callback) { - return this.rpcCall(listImageVersions, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, request, callback); - }, "name", { value: "ListImageVersions" }); + GetEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ListImageVersions. - * @function listImageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions - * @instance - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for GetEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest"; + }; - return ImageVersions; + return GetEnvironmentRequest; })(); - v1.ListImageVersionsRequest = (function() { + v1beta1.ListEnvironmentsRequest = (function() { /** - * Properties of a ListImageVersionsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IListImageVersionsRequest - * @property {string|null} [parent] ListImageVersionsRequest parent - * @property {number|null} [pageSize] ListImageVersionsRequest pageSize - * @property {string|null} [pageToken] ListImageVersionsRequest pageToken - * @property {boolean|null} [includePastReleases] ListImageVersionsRequest includePastReleases + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken */ /** - * Constructs a new ListImageVersionsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a ListImageVersionsRequest. - * @implements IListImageVersionsRequest + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set */ - function ListImageVersionsRequest(properties) { + function ListEnvironmentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10213,59 +15206,51 @@ } /** - * ListImageVersionsRequest parent. + * ListEnvironmentsRequest parent. * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance */ - ListImageVersionsRequest.prototype.parent = ""; + ListEnvironmentsRequest.prototype.parent = ""; /** - * ListImageVersionsRequest pageSize. + * ListEnvironmentsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance */ - ListImageVersionsRequest.prototype.pageSize = 0; + ListEnvironmentsRequest.prototype.pageSize = 0; /** - * ListImageVersionsRequest pageToken. + * ListEnvironmentsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest - * @instance - */ - ListImageVersionsRequest.prototype.pageToken = ""; - - /** - * ListImageVersionsRequest includePastReleases. - * @member {boolean} includePastReleases - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance */ - ListImageVersionsRequest.prototype.includePastReleases = false; + ListEnvironmentsRequest.prototype.pageToken = ""; /** - * Creates a new ListImageVersionsRequest instance using the specified properties. + * Creates a new ListEnvironmentsRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance */ - ListImageVersionsRequest.create = function create(properties) { - return new ListImageVersionsRequest(properties); + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); }; /** - * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsRequest.encode = function encode(message, writer) { + ListEnvironmentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -10274,39 +15259,37 @@ 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.includePastReleases != null && Object.hasOwnProperty.call(message, "includePastReleases")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includePastReleases); return writer; }; /** - * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsRequest.decode = function decode(reader, length) { + ListEnvironmentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10322,10 +15305,6 @@ message.pageToken = reader.string(); break; } - case 4: { - message.includePastReleases = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -10335,30 +15314,30 @@ }; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListImageVersionsRequest message. + * Verifies a ListEnvironmentsRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListImageVersionsRequest.verify = function verify(message) { + ListEnvironmentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -10370,45 +15349,40 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.includePastReleases != null && message.hasOwnProperty("includePastReleases")) - if (typeof message.includePastReleases !== "boolean") - return "includePastReleases: boolean expected"; return null; }; /** - * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest */ - ListImageVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest) + ListEnvironmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); 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.includePastReleases != null) - message.includePastReleases = Boolean(object.includePastReleases); return message; }; /** - * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} message ListImageVersionsRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListImageVersionsRequest.toObject = function toObject(message, options) { + ListEnvironmentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -10416,7 +15390,6 @@ object.parent = ""; object.pageSize = 0; object.pageToken = ""; - object.includePastReleases = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -10424,60 +15397,58 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; - if (message.includePastReleases != null && message.hasOwnProperty("includePastReleases")) - object.includePastReleases = message.includePastReleases; return object; }; /** - * Converts this ListImageVersionsRequest to JSON. + * Converts this ListEnvironmentsRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance * @returns {Object.} JSON object */ - ListImageVersionsRequest.prototype.toJSON = function toJSON() { + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListImageVersionsRequest + * Gets the default type url for ListEnvironmentsRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListImageVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest"; }; - return ListImageVersionsRequest; + return ListEnvironmentsRequest; })(); - v1.ListImageVersionsResponse = (function() { + v1beta1.ListEnvironmentsResponse = (function() { /** - * Properties of a ListImageVersionsResponse. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IListImageVersionsResponse - * @property {Array.|null} [imageVersions] ListImageVersionsResponse imageVersions - * @property {string|null} [nextPageToken] ListImageVersionsResponse nextPageToken + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken */ /** - * Constructs a new ListImageVersionsResponse. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a ListImageVersionsResponse. - * @implements IListImageVersionsResponse + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set */ - function ListImageVersionsResponse(properties) { - this.imageVersions = []; + function ListEnvironmentsResponse(properties) { + this.environments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10485,88 +15456,88 @@ } /** - * ListImageVersionsResponse imageVersions. - * @member {Array.} imageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @instance */ - ListImageVersionsResponse.prototype.imageVersions = $util.emptyArray; + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; /** - * ListImageVersionsResponse nextPageToken. + * ListEnvironmentsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @instance */ - ListImageVersionsResponse.prototype.nextPageToken = ""; + ListEnvironmentsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListImageVersionsResponse instance using the specified properties. + * Creates a new ListEnvironmentsResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance */ - ListImageVersionsResponse.create = function create(properties) { - return new ListImageVersionsResponse(properties); + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); }; /** - * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsResponse.encode = function encode(message, writer) { + ListEnvironmentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersions != null && message.imageVersions.length) - for (var i = 0; i < message.imageVersions.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.encode(message.imageVersions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environments[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 ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer. + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsResponse.decode = function decode(reader, length) { + ListEnvironmentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.imageVersions && message.imageVersions.length)) - message.imageVersions = []; - message.imageVersions.push($root.google.cloud.orchestration.airflow.service.v1.ImageVersion.decode(reader, reader.uint32())); + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32())); break; } case 2: { @@ -10582,39 +15553,39 @@ }; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListImageVersionsResponse message. + * Verifies a ListEnvironmentsResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListImageVersionsResponse.verify = function verify(message) { + ListEnvironmentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersions != null && message.hasOwnProperty("imageVersions")) { - if (!Array.isArray(message.imageVersions)) - return "imageVersions: array expected"; - for (var i = 0; i < message.imageVersions.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.verify(message.imageVersions[i]); + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environments[i]); if (error) - return "imageVersions." + error; + return "environments." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -10624,25 +15595,25 @@ }; /** - * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse */ - ListImageVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) + ListEnvironmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); - if (object.imageVersions) { - if (!Array.isArray(object.imageVersions)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: array expected"); - message.imageVersions = []; - for (var i = 0; i < object.imageVersions.length; ++i) { - if (typeof object.imageVersions[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: object expected"); - message.imageVersions[i] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.fromObject(object.imageVersions[i]); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environments[i]); } } if (object.nextPageToken != null) @@ -10651,26 +15622,26 @@ }; /** - * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} message ListImageVersionsResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListImageVersionsResponse.toObject = function toObject(message, options) { + ListEnvironmentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.imageVersions = []; + object.environments = []; if (options.defaults) object.nextPageToken = ""; - if (message.imageVersions && message.imageVersions.length) { - object.imageVersions = []; - for (var j = 0; j < message.imageVersions.length; ++j) - object.imageVersions[j] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.toObject(message.imageVersions[j], options); + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environments[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -10678,207 +15649,128 @@ }; /** - * Converts this ListImageVersionsResponse to JSON. + * Converts this ListEnvironmentsResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @instance * @returns {Object.} JSON object */ - ListImageVersionsResponse.prototype.toJSON = function toJSON() { + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListImageVersionsResponse + * Gets the default type url for ListEnvironmentsResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListImageVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse"; }; - return ListImageVersionsResponse; - })(); - - v1.ImageVersion = (function() { - - /** - * Properties of an ImageVersion. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IImageVersion - * @property {string|null} [imageVersionId] ImageVersion imageVersionId - * @property {boolean|null} [isDefault] ImageVersion isDefault - * @property {Array.|null} [supportedPythonVersions] ImageVersion supportedPythonVersions - * @property {google.type.IDate|null} [releaseDate] ImageVersion releaseDate - * @property {boolean|null} [creationDisabled] ImageVersion creationDisabled - * @property {boolean|null} [upgradeDisabled] ImageVersion upgradeDisabled - */ - - /** - * Constructs a new ImageVersion. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an ImageVersion. - * @implements IImageVersion - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set - */ - function ImageVersion(properties) { - this.supportedPythonVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImageVersion imageVersionId. - * @member {string} imageVersionId - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.imageVersionId = ""; - - /** - * ImageVersion isDefault. - * @member {boolean} isDefault - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.isDefault = false; - - /** - * ImageVersion supportedPythonVersions. - * @member {Array.} supportedPythonVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.supportedPythonVersions = $util.emptyArray; - + return ListEnvironmentsResponse; + })(); + + v1beta1.DeleteEnvironmentRequest = (function() { + /** - * ImageVersion releaseDate. - * @member {google.type.IDate|null|undefined} releaseDate - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance + * Properties of a DeleteEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IDeleteEnvironmentRequest + * @property {string|null} [name] DeleteEnvironmentRequest name */ - ImageVersion.prototype.releaseDate = null; /** - * ImageVersion creationDisabled. - * @member {boolean} creationDisabled - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance + * Constructs a new DeleteEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a DeleteEnvironmentRequest. + * @implements IDeleteEnvironmentRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set */ - ImageVersion.prototype.creationDisabled = false; + function DeleteEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ImageVersion upgradeDisabled. - * @member {boolean} upgradeDisabled - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * DeleteEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @instance */ - ImageVersion.prototype.upgradeDisabled = false; + DeleteEnvironmentRequest.prototype.name = ""; /** - * Creates a new ImageVersion instance using the specified properties. + * Creates a new DeleteEnvironmentRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance */ - ImageVersion.create = function create(properties) { - return new ImageVersion(properties); + DeleteEnvironmentRequest.create = function create(properties) { + return new DeleteEnvironmentRequest(properties); }; /** - * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageVersion.encode = function encode(message, writer) { + DeleteEnvironmentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersionId != null && Object.hasOwnProperty.call(message, "imageVersionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersionId); - if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isDefault); - if (message.supportedPythonVersions != null && message.supportedPythonVersions.length) - for (var i = 0; i < message.supportedPythonVersions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.supportedPythonVersions[i]); - if (message.releaseDate != null && Object.hasOwnProperty.call(message, "releaseDate")) - $root.google.type.Date.encode(message.releaseDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.creationDisabled != null && Object.hasOwnProperty.call(message, "creationDisabled")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.creationDisabled); - if (message.upgradeDisabled != null && Object.hasOwnProperty.call(message, "upgradeDisabled")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.upgradeDisabled); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageVersion.encodeDelimited = function encodeDelimited(message, writer) { + DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImageVersion message from the specified reader or buffer. + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageVersion.decode = function decode(reader, length) { + DeleteEnvironmentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.imageVersionId = reader.string(); - break; - } - case 2: { - message.isDefault = reader.bool(); - break; - } - case 3: { - if (!(message.supportedPythonVersions && message.supportedPythonVersions.length)) - message.supportedPythonVersions = []; - message.supportedPythonVersions.push(reader.string()); - break; - } - case 4: { - message.releaseDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 5: { - message.creationDisabled = reader.bool(); - break; - } - case 6: { - message.upgradeDisabled = reader.bool(); + message.name = reader.string(); break; } default: @@ -10890,526 +15782,589 @@ }; /** - * Decodes an ImageVersion message from the specified reader or buffer, length delimited. + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageVersion.decodeDelimited = function decodeDelimited(reader) { + DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImageVersion message. + * Verifies a DeleteEnvironmentRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImageVersion.verify = function verify(message) { + DeleteEnvironmentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) - if (!$util.isString(message.imageVersionId)) - return "imageVersionId: string expected"; - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - if (typeof message.isDefault !== "boolean") - return "isDefault: boolean expected"; - if (message.supportedPythonVersions != null && message.hasOwnProperty("supportedPythonVersions")) { - if (!Array.isArray(message.supportedPythonVersions)) - return "supportedPythonVersions: array expected"; - for (var i = 0; i < message.supportedPythonVersions.length; ++i) - if (!$util.isString(message.supportedPythonVersions[i])) - return "supportedPythonVersions: string[] expected"; - } - if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) { - var error = $root.google.type.Date.verify(message.releaseDate); - if (error) - return "releaseDate." + error; - } - if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) - if (typeof message.creationDisabled !== "boolean") - return "creationDisabled: boolean expected"; - if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) - if (typeof message.upgradeDisabled !== "boolean") - return "upgradeDisabled: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest */ - ImageVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ImageVersion) + DeleteEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); - if (object.imageVersionId != null) - message.imageVersionId = String(object.imageVersionId); - if (object.isDefault != null) - message.isDefault = Boolean(object.isDefault); - if (object.supportedPythonVersions) { - if (!Array.isArray(object.supportedPythonVersions)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.supportedPythonVersions: array expected"); - message.supportedPythonVersions = []; - for (var i = 0; i < object.supportedPythonVersions.length; ++i) - message.supportedPythonVersions[i] = String(object.supportedPythonVersions[i]); - } - if (object.releaseDate != null) { - if (typeof object.releaseDate !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.releaseDate: object expected"); - message.releaseDate = $root.google.type.Date.fromObject(object.releaseDate); - } - if (object.creationDisabled != null) - message.creationDisabled = Boolean(object.creationDisabled); - if (object.upgradeDisabled != null) - message.upgradeDisabled = Boolean(object.upgradeDisabled); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.ImageVersion} message ImageVersion + * @param {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImageVersion.toObject = function toObject(message, options) { + DeleteEnvironmentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedPythonVersions = []; - if (options.defaults) { - object.imageVersionId = ""; - object.isDefault = false; - object.releaseDate = null; - object.creationDisabled = false; - object.upgradeDisabled = false; - } - if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) - object.imageVersionId = message.imageVersionId; - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - object.isDefault = message.isDefault; - if (message.supportedPythonVersions && message.supportedPythonVersions.length) { - object.supportedPythonVersions = []; - for (var j = 0; j < message.supportedPythonVersions.length; ++j) - object.supportedPythonVersions[j] = message.supportedPythonVersions[j]; - } - if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) - object.releaseDate = $root.google.type.Date.toObject(message.releaseDate, options); - if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) - object.creationDisabled = message.creationDisabled; - if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) - object.upgradeDisabled = message.upgradeDisabled; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ImageVersion to JSON. + * Converts this DeleteEnvironmentRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @instance * @returns {Object.} JSON object */ - ImageVersion.prototype.toJSON = function toJSON() { + DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImageVersion + * Gets the default type url for DeleteEnvironmentRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImageVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ImageVersion"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest"; }; - return ImageVersion; - })(); - - return v1; - })(); - - service.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.orchestration.airflow.service - * @namespace - */ - var v1beta1 = {}; + return DeleteEnvironmentRequest; + })(); - v1beta1.Environments = (function() { + v1beta1.UpdateEnvironmentRequest = (function() { /** - * Constructs a new Environments service. + * Properties of an UpdateEnvironmentRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an Environments - * @extends $protobuf.rpc.Service + * @interface IUpdateEnvironmentRequest + * @property {string|null} [name] UpdateEnvironmentRequest name + * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + */ + + /** + * Constructs a new UpdateEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an UpdateEnvironmentRequest. + * @implements IUpdateEnvironmentRequest * @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 + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set */ - function Environments(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function UpdateEnvironmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; - /** - * Creates new Environments service using the specified rpc implementation. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @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 {Environments} RPC service. Useful where requests and/or responses are streamed. + * UpdateEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance */ - Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + UpdateEnvironmentRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef CreateEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * UpdateEnvironmentRequest environment. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance */ + UpdateEnvironmentRequest.prototype.environment = null; /** - * Calls CreateEnvironment. - * @function createEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * UpdateEnvironmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { - return this.rpcCall(createEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateEnvironment" }); + UpdateEnvironmentRequest.prototype.updateMask = null; /** - * Calls CreateEnvironment. - * @function createEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance */ + UpdateEnvironmentRequest.create = function create(properties) { + return new UpdateEnvironmentRequest(properties); + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef GetEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} [response] Environment + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateEnvironmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls GetEnvironment. - * @function getEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { - return this.rpcCall(getEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.Environment, request, callback); - }, "name", { value: "GetEnvironment" }); + UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetEnvironment. - * @function getEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.name = reader.string(); + break; + } + case 1: { + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef ListEnvironmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - * @returns {undefined} - * @variation 1 + * Verifies an UpdateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { - return this.rpcCall(listEnvironments, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, request, callback); - }, "name", { value: "ListEnvironments" }); + UpdateEnvironmentRequest.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.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest */ + UpdateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef UpdateEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + UpdateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.name = ""; + object.updateMask = null; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls UpdateEnvironment. - * @function updateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * Converts this UpdateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { - return this.rpcCall(updateEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateEnvironment" }); + UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateEnvironment. - * @function updateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for UpdateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest"; + }; - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef DeleteEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + return UpdateEnvironmentRequest; + })(); - /** - * Calls DeleteEnvironment. - * @function deleteEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { - return this.rpcCall(deleteEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteEnvironment" }); + v1beta1.RestartWebServerRequest = (function() { /** - * Calls DeleteEnvironment. - * @function deleteEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a RestartWebServerRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IRestartWebServerRequest + * @property {string|null} [name] RestartWebServerRequest name */ /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef RestartWebServerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new RestartWebServerRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a RestartWebServerRequest. + * @implements IRestartWebServerRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set */ + function RestartWebServerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls RestartWebServer. - * @function restartWebServer - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * RestartWebServerRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Environments.prototype.restartWebServer = function restartWebServer(request, callback) { - return this.rpcCall(restartWebServer, $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartWebServer" }); + RestartWebServerRequest.prototype.name = ""; /** - * Calls RestartWebServer. - * @function restartWebServer - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new RestartWebServerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest instance */ + RestartWebServerRequest.create = function create(properties) { + return new RestartWebServerRequest(properties); + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef CheckUpgradeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + RestartWebServerRequest.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; + }; /** - * Calls CheckUpgrade. - * @function checkUpgrade - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Environments.prototype.checkUpgrade = function checkUpgrade(request, callback) { - return this.rpcCall(checkUpgrade, $root.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CheckUpgrade" }); + RestartWebServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CheckUpgrade. - * @function checkUpgrade - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + RestartWebServerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); + 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; + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef SaveSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + RestartWebServerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SaveSnapshot. - * @function saveSnapshot - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Verifies a RestartWebServerRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(Environments.prototype.saveSnapshot = function saveSnapshot(request, callback) { - return this.rpcCall(saveSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SaveSnapshot" }); + RestartWebServerRequest.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; + }; /** - * Calls SaveSnapshot. - * @function saveSnapshot - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest */ + RestartWebServerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef LoadSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} message RestartWebServerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + RestartWebServerRequest.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; + }; /** - * Calls LoadSnapshot. - * @function loadSnapshot - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * Converts this RestartWebServerRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(Environments.prototype.loadSnapshot = function loadSnapshot(request, callback) { - return this.rpcCall(loadSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "LoadSnapshot" }); + RestartWebServerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls LoadSnapshot. - * @function loadSnapshot - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for RestartWebServerRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + RestartWebServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest"; + }; - return Environments; + return RestartWebServerRequest; })(); - v1beta1.CreateEnvironmentRequest = (function() { + v1beta1.ExecuteAirflowCommandRequest = (function() { /** - * Properties of a CreateEnvironmentRequest. + * Properties of an ExecuteAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ICreateEnvironmentRequest - * @property {string|null} [parent] CreateEnvironmentRequest parent - * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] CreateEnvironmentRequest environment + * @interface IExecuteAirflowCommandRequest + * @property {string|null} [environment] ExecuteAirflowCommandRequest environment + * @property {string|null} [command] ExecuteAirflowCommandRequest command + * @property {string|null} [subcommand] ExecuteAirflowCommandRequest subcommand + * @property {Array.|null} [parameters] ExecuteAirflowCommandRequest parameters */ /** - * Constructs a new CreateEnvironmentRequest. + * Constructs a new ExecuteAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a CreateEnvironmentRequest. - * @implements ICreateEnvironmentRequest + * @classdesc Represents an ExecuteAirflowCommandRequest. + * @implements IExecuteAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest=} [properties] Properties to set */ - function CreateEnvironmentRequest(properties) { + function ExecuteAirflowCommandRequest(properties) { + this.parameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11417,89 +16372,120 @@ } /** - * CreateEnvironmentRequest parent. - * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * ExecuteAirflowCommandRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @instance */ - CreateEnvironmentRequest.prototype.parent = ""; + ExecuteAirflowCommandRequest.prototype.environment = ""; /** - * CreateEnvironmentRequest environment. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * ExecuteAirflowCommandRequest command. + * @member {string} command + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @instance */ - CreateEnvironmentRequest.prototype.environment = null; + ExecuteAirflowCommandRequest.prototype.command = ""; /** - * Creates a new CreateEnvironmentRequest instance using the specified properties. + * ExecuteAirflowCommandRequest subcommand. + * @member {string} subcommand + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest + * @instance + */ + ExecuteAirflowCommandRequest.prototype.subcommand = ""; + + /** + * ExecuteAirflowCommandRequest parameters. + * @member {Array.} parameters + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest + * @instance + */ + ExecuteAirflowCommandRequest.prototype.parameters = $util.emptyArray; + + /** + * Creates a new ExecuteAirflowCommandRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest instance */ - CreateEnvironmentRequest.create = function create(properties) { - return new CreateEnvironmentRequest(properties); + ExecuteAirflowCommandRequest.create = function create(properties) { + return new ExecuteAirflowCommandRequest(properties); }; /** - * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEnvironmentRequest.encode = function encode(message, writer) { + ExecuteAirflowCommandRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.command != null && Object.hasOwnProperty.call(message, "command")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.command); + if (message.subcommand != null && Object.hasOwnProperty.call(message, "subcommand")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subcommand); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parameters[i]); return writer; }; /** - * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEnvironmentRequest.decode = function decode(reader, length) { + ExecuteAirflowCommandRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.environment = reader.string(); break; } case 2: { - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + message.command = reader.string(); + break; + } + case 3: { + message.subcommand = reader.string(); + break; + } + case 4: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push(reader.string()); break; } default: @@ -11511,136 +16497,163 @@ }; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateEnvironmentRequest message. + * Verifies an ExecuteAirflowCommandRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateEnvironmentRequest.verify = function verify(message) { + ExecuteAirflowCommandRequest.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.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); - if (error) - return "environment." + error; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.command != null && message.hasOwnProperty("command")) + if (!$util.isString(message.command)) + return "command: string expected"; + if (message.subcommand != null && message.hasOwnProperty("subcommand")) + if (!$util.isString(message.subcommand)) + return "subcommand: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) + if (!$util.isString(message.parameters[i])) + return "parameters: string[] expected"; } return null; }; /** - * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest} ExecuteAirflowCommandRequest */ - CreateEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest) + ExecuteAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.environment: object expected"); - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.command != null) + message.command = String(object.command); + if (object.subcommand != null) + message.subcommand = String(object.subcommand); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) + message.parameters[i] = String(object.parameters[i]); } return message; }; /** - * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteAirflowCommandRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} message CreateEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest} message ExecuteAirflowCommandRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateEnvironmentRequest.toObject = function toObject(message, options) { + ExecuteAirflowCommandRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; if (options.defaults) { - object.parent = ""; - object.environment = null; + object.environment = ""; + object.command = ""; + object.subcommand = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); + object.environment = message.environment; + if (message.command != null && message.hasOwnProperty("command")) + object.command = message.command; + if (message.subcommand != null && message.hasOwnProperty("subcommand")) + object.subcommand = message.subcommand; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = message.parameters[j]; + } return object; }; /** - * Converts this CreateEnvironmentRequest to JSON. + * Converts this ExecuteAirflowCommandRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @instance * @returns {Object.} JSON object */ - CreateEnvironmentRequest.prototype.toJSON = function toJSON() { + ExecuteAirflowCommandRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateEnvironmentRequest + * Gets the default type url for ExecuteAirflowCommandRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest"; }; - return CreateEnvironmentRequest; + return ExecuteAirflowCommandRequest; })(); - v1beta1.GetEnvironmentRequest = (function() { + v1beta1.ExecuteAirflowCommandResponse = (function() { /** - * Properties of a GetEnvironmentRequest. + * Properties of an ExecuteAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IGetEnvironmentRequest - * @property {string|null} [name] GetEnvironmentRequest name + * @interface IExecuteAirflowCommandResponse + * @property {string|null} [executionId] ExecuteAirflowCommandResponse executionId + * @property {string|null} [pod] ExecuteAirflowCommandResponse pod + * @property {string|null} [podNamespace] ExecuteAirflowCommandResponse podNamespace + * @property {string|null} [error] ExecuteAirflowCommandResponse error */ /** - * Constructs a new GetEnvironmentRequest. + * Constructs a new ExecuteAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a GetEnvironmentRequest. - * @implements IGetEnvironmentRequest + * @classdesc Represents an ExecuteAirflowCommandResponse. + * @implements IExecuteAirflowCommandResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set */ - function GetEnvironmentRequest(properties) { + function ExecuteAirflowCommandResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11648,75 +16661,117 @@ } /** - * GetEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * ExecuteAirflowCommandResponse executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.executionId = ""; + + /** + * ExecuteAirflowCommandResponse pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.pod = ""; + + /** + * ExecuteAirflowCommandResponse podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.podNamespace = ""; + + /** + * ExecuteAirflowCommandResponse error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @instance */ - GetEnvironmentRequest.prototype.name = ""; + ExecuteAirflowCommandResponse.prototype.error = ""; /** - * Creates a new GetEnvironmentRequest instance using the specified properties. + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse instance */ - GetEnvironmentRequest.create = function create(properties) { - return new GetEnvironmentRequest(properties); + ExecuteAirflowCommandResponse.create = function create(properties) { + return new ExecuteAirflowCommandResponse(properties); }; /** - * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEnvironmentRequest.encode = function encode(message, writer) { + ExecuteAirflowCommandResponse.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.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.podNamespace); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.error); return writer; }; /** - * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEnvironmentRequest.decode = function decode(reader, length) { + ExecuteAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.executionId = reader.string(); + break; + } + case 2: { + message.pod = reader.string(); + break; + } + case 3: { + message.podNamespace = reader.string(); + break; + } + case 4: { + message.error = reader.string(); break; } default: @@ -11728,124 +16783,151 @@ }; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetEnvironmentRequest message. + * Verifies an ExecuteAirflowCommandResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetEnvironmentRequest.verify = function verify(message) { + ExecuteAirflowCommandResponse.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.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; return null; }; /** - * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse */ - GetEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest) + ExecuteAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.error != null) + message.error = String(object.error); return message; }; /** - * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetEnvironmentRequest.toObject = function toObject(message, options) { + ExecuteAirflowCommandResponse.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; + if (options.defaults) { + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.error = ""; + } + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; return object; }; /** - * Converts this GetEnvironmentRequest to JSON. + * Converts this ExecuteAirflowCommandResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @instance * @returns {Object.} JSON object */ - GetEnvironmentRequest.prototype.toJSON = function toJSON() { + ExecuteAirflowCommandResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetEnvironmentRequest + * Gets the default type url for ExecuteAirflowCommandResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse"; }; - return GetEnvironmentRequest; + return ExecuteAirflowCommandResponse; })(); - v1beta1.ListEnvironmentsRequest = (function() { + v1beta1.StopAirflowCommandRequest = (function() { /** - * Properties of a ListEnvironmentsRequest. + * Properties of a StopAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IListEnvironmentsRequest - * @property {string|null} [parent] ListEnvironmentsRequest parent - * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize - * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + * @interface IStopAirflowCommandRequest + * @property {string|null} [environment] StopAirflowCommandRequest environment + * @property {string|null} [executionId] StopAirflowCommandRequest executionId + * @property {string|null} [pod] StopAirflowCommandRequest pod + * @property {string|null} [podNamespace] StopAirflowCommandRequest podNamespace + * @property {boolean|null} [force] StopAirflowCommandRequest force */ /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new StopAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a ListEnvironmentsRequest. - * @implements IListEnvironmentsRequest + * @classdesc Represents a StopAirflowCommandRequest. + * @implements IStopAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest=} [properties] Properties to set */ - function ListEnvironmentsRequest(properties) { + function StopAirflowCommandRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11853,103 +16935,131 @@ } /** - * ListEnvironmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * StopAirflowCommandRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @instance */ - ListEnvironmentsRequest.prototype.parent = ""; + StopAirflowCommandRequest.prototype.environment = ""; /** - * ListEnvironmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * StopAirflowCommandRequest executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @instance */ - ListEnvironmentsRequest.prototype.pageSize = 0; + StopAirflowCommandRequest.prototype.executionId = ""; /** - * ListEnvironmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * StopAirflowCommandRequest pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @instance */ - ListEnvironmentsRequest.prototype.pageToken = ""; + StopAirflowCommandRequest.prototype.pod = ""; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * StopAirflowCommandRequest podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest + * @instance + */ + StopAirflowCommandRequest.prototype.podNamespace = ""; + + /** + * StopAirflowCommandRequest force. + * @member {boolean} force + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest + * @instance + */ + StopAirflowCommandRequest.prototype.force = false; + + /** + * Creates a new StopAirflowCommandRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest} StopAirflowCommandRequest instance */ - ListEnvironmentsRequest.create = function create(properties) { - return new ListEnvironmentsRequest(properties); + StopAirflowCommandRequest.create = function create(properties) { + return new StopAirflowCommandRequest(properties); }; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * Encodes the specified StopAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest} message StopAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsRequest.encode = function encode(message, writer) { + StopAirflowCommandRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.podNamespace); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); return writer; }; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * Encodes the specified StopAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest} message StopAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + StopAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest} StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsRequest.decode = function decode(reader, length) { + StopAirflowCommandRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.environment = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.executionId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.pod = reader.string(); + break; + } + case 4: { + message.podNamespace = reader.string(); + break; + } + case 5: { + message.force = reader.bool(); break; } default: @@ -11961,141 +17071,157 @@ }; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest} StopAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + StopAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a StopAirflowCommandRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEnvironmentsRequest.verify = function verify(message) { + StopAirflowCommandRequest.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.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest} StopAirflowCommandRequest */ - ListEnvironmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest) + StopAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); - 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); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a StopAirflowCommandRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest} message StopAirflowCommandRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEnvironmentsRequest.toObject = function toObject(message, options) { + StopAirflowCommandRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.environment = ""; + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.force = false; } - 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.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this StopAirflowCommandRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @instance * @returns {Object.} JSON object */ - ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + StopAirflowCommandRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListEnvironmentsRequest + * Gets the default type url for StopAirflowCommandRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest"; }; - return ListEnvironmentsRequest; + return StopAirflowCommandRequest; })(); - v1beta1.ListEnvironmentsResponse = (function() { + v1beta1.StopAirflowCommandResponse = (function() { /** - * Properties of a ListEnvironmentsResponse. + * Properties of a StopAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IListEnvironmentsResponse - * @property {Array.|null} [environments] ListEnvironmentsResponse environments - * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + * @interface IStopAirflowCommandResponse + * @property {boolean|null} [isDone] StopAirflowCommandResponse isDone + * @property {Array.|null} [output] StopAirflowCommandResponse output */ /** - * Constructs a new ListEnvironmentsResponse. + * Constructs a new StopAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a ListEnvironmentsResponse. - * @implements IListEnvironmentsResponse + * @classdesc Represents a StopAirflowCommandResponse. + * @implements IStopAirflowCommandResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse=} [properties] Properties to set */ - function ListEnvironmentsResponse(properties) { - this.environments = []; + function StopAirflowCommandResponse(properties) { + this.output = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12103,92 +17229,92 @@ } /** - * ListEnvironmentsResponse environments. - * @member {Array.} environments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * StopAirflowCommandResponse isDone. + * @member {boolean} isDone + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @instance */ - ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + StopAirflowCommandResponse.prototype.isDone = false; /** - * ListEnvironmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * StopAirflowCommandResponse output. + * @member {Array.} output + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @instance */ - ListEnvironmentsResponse.prototype.nextPageToken = ""; + StopAirflowCommandResponse.prototype.output = $util.emptyArray; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * Creates a new StopAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} StopAirflowCommandResponse instance */ - ListEnvironmentsResponse.create = function create(properties) { - return new ListEnvironmentsResponse(properties); + StopAirflowCommandResponse.create = function create(properties) { + return new StopAirflowCommandResponse(properties); }; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * Encodes the specified StopAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse} message StopAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsResponse.encode = function encode(message, writer) { + StopAirflowCommandResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.environments != null && message.environments.length) - for (var i = 0; i < message.environments.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.isDone != null && Object.hasOwnProperty.call(message, "isDone")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isDone); + if (message.output != null && message.output.length) + for (var i = 0; i < message.output.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.output[i]); return writer; }; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * Encodes the specified StopAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse} message StopAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + StopAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsResponse.decode = function decode(reader, length) { + StopAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.environments && message.environments.length)) - message.environments = []; - message.environments.push($root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32())); + message.isDone = reader.bool(); break; } case 2: { - message.nextPageToken = reader.string(); + if (!(message.output && message.output.length)) + message.output = []; + message.output.push(reader.string()); break; } default: @@ -12200,148 +17326,147 @@ }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes a StopAirflowCommandResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} StopAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + StopAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies a StopAirflowCommandResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEnvironmentsResponse.verify = function verify(message) { + StopAirflowCommandResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!Array.isArray(message.environments)) - return "environments: array expected"; - for (var i = 0; i < message.environments.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environments[i]); - if (error) - return "environments." + error; - } + if (message.isDone != null && message.hasOwnProperty("isDone")) + if (typeof message.isDone !== "boolean") + return "isDone: boolean expected"; + if (message.output != null && message.hasOwnProperty("output")) { + if (!Array.isArray(message.output)) + return "output: array expected"; + for (var i = 0; i < message.output.length; ++i) + if (!$util.isString(message.output[i])) + return "output: string[] expected"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a StopAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} StopAirflowCommandResponse */ - ListEnvironmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) + StopAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); - if (object.environments) { - if (!Array.isArray(object.environments)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: array expected"); - message.environments = []; - for (var i = 0; i < object.environments.length; ++i) { - if (typeof object.environments[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: object expected"); - message.environments[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environments[i]); - } + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse(); + if (object.isDone != null) + message.isDone = Boolean(object.isDone); + if (object.output) { + if (!Array.isArray(object.output)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse.output: array expected"); + message.output = []; + for (var i = 0; i < object.output.length; ++i) + message.output[i] = String(object.output[i]); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a StopAirflowCommandResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse} message StopAirflowCommandResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEnvironmentsResponse.toObject = function toObject(message, options) { + StopAirflowCommandResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.environments = []; + object.output = []; if (options.defaults) - object.nextPageToken = ""; - if (message.environments && message.environments.length) { - object.environments = []; - for (var j = 0; j < message.environments.length; ++j) - object.environments[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environments[j], options); + object.isDone = false; + if (message.isDone != null && message.hasOwnProperty("isDone")) + object.isDone = message.isDone; + if (message.output && message.output.length) { + object.output = []; + for (var j = 0; j < message.output.length; ++j) + object.output[j] = message.output[j]; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this StopAirflowCommandResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @instance * @returns {Object.} JSON object */ - ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + StopAirflowCommandResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListEnvironmentsResponse + * Gets the default type url for StopAirflowCommandResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse"; }; - return ListEnvironmentsResponse; + return StopAirflowCommandResponse; })(); - v1beta1.DeleteEnvironmentRequest = (function() { + v1beta1.PollAirflowCommandRequest = (function() { /** - * Properties of a DeleteEnvironmentRequest. + * Properties of a PollAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IDeleteEnvironmentRequest - * @property {string|null} [name] DeleteEnvironmentRequest name + * @interface IPollAirflowCommandRequest + * @property {string|null} [environment] PollAirflowCommandRequest environment + * @property {string|null} [executionId] PollAirflowCommandRequest executionId + * @property {string|null} [pod] PollAirflowCommandRequest pod + * @property {string|null} [podNamespace] PollAirflowCommandRequest podNamespace + * @property {number|null} [nextLineNumber] PollAirflowCommandRequest nextLineNumber */ /** - * Constructs a new DeleteEnvironmentRequest. + * Constructs a new PollAirflowCommandRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a DeleteEnvironmentRequest. - * @implements IDeleteEnvironmentRequest + * @classdesc Represents a PollAirflowCommandRequest. + * @implements IPollAirflowCommandRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest=} [properties] Properties to set */ - function DeleteEnvironmentRequest(properties) { + function PollAirflowCommandRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12349,75 +17474,131 @@ } /** - * DeleteEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * PollAirflowCommandRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @instance */ - DeleteEnvironmentRequest.prototype.name = ""; + PollAirflowCommandRequest.prototype.environment = ""; /** - * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * PollAirflowCommandRequest executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest + * @instance + */ + PollAirflowCommandRequest.prototype.executionId = ""; + + /** + * PollAirflowCommandRequest pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest + * @instance + */ + PollAirflowCommandRequest.prototype.pod = ""; + + /** + * PollAirflowCommandRequest podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest + * @instance + */ + PollAirflowCommandRequest.prototype.podNamespace = ""; + + /** + * PollAirflowCommandRequest nextLineNumber. + * @member {number} nextLineNumber + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest + * @instance + */ + PollAirflowCommandRequest.prototype.nextLineNumber = 0; + + /** + * Creates a new PollAirflowCommandRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest} PollAirflowCommandRequest instance */ - DeleteEnvironmentRequest.create = function create(properties) { - return new DeleteEnvironmentRequest(properties); + PollAirflowCommandRequest.create = function create(properties) { + return new PollAirflowCommandRequest(properties); }; /** - * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * Encodes the specified PollAirflowCommandRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest} message PollAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEnvironmentRequest.encode = function encode(message, writer) { + PollAirflowCommandRequest.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.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.podNamespace); + if (message.nextLineNumber != null && Object.hasOwnProperty.call(message, "nextLineNumber")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.nextLineNumber); return writer; }; /** - * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * Encodes the specified PollAirflowCommandRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest} message PollAirflowCommandRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + PollAirflowCommandRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest} PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEnvironmentRequest.decode = function decode(reader, length) { + PollAirflowCommandRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.environment = reader.string(); + break; + } + case 2: { + message.executionId = reader.string(); + break; + } + case 3: { + message.pod = reader.string(); + break; + } + case 4: { + message.podNamespace = reader.string(); + break; + } + case 5: { + message.nextLineNumber = reader.int32(); break; } default: @@ -12429,124 +17610,158 @@ }; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest} PollAirflowCommandRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + PollAirflowCommandRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteEnvironmentRequest message. + * Verifies a PollAirflowCommandRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteEnvironmentRequest.verify = function verify(message) { + PollAirflowCommandRequest.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.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.nextLineNumber != null && message.hasOwnProperty("nextLineNumber")) + if (!$util.isInteger(message.nextLineNumber)) + return "nextLineNumber: integer expected"; return null; }; /** - * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest} PollAirflowCommandRequest */ - DeleteEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest) + PollAirflowCommandRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.nextLineNumber != null) + message.nextLineNumber = object.nextLineNumber | 0; return message; }; /** - * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from a PollAirflowCommandRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest} message PollAirflowCommandRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteEnvironmentRequest.toObject = function toObject(message, options) { + PollAirflowCommandRequest.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; + if (options.defaults) { + object.environment = ""; + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.nextLineNumber = 0; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.nextLineNumber != null && message.hasOwnProperty("nextLineNumber")) + object.nextLineNumber = message.nextLineNumber; return object; }; /** - * Converts this DeleteEnvironmentRequest to JSON. + * Converts this PollAirflowCommandRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @instance * @returns {Object.} JSON object */ - DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + PollAirflowCommandRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteEnvironmentRequest + * Gets the default type url for PollAirflowCommandRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PollAirflowCommandRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest"; }; - return DeleteEnvironmentRequest; + return PollAirflowCommandRequest; })(); - v1beta1.UpdateEnvironmentRequest = (function() { + v1beta1.PollAirflowCommandResponse = (function() { /** - * Properties of an UpdateEnvironmentRequest. + * Properties of a PollAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IUpdateEnvironmentRequest - * @property {string|null} [name] UpdateEnvironmentRequest name - * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + * @interface IPollAirflowCommandResponse + * @property {Array.|null} [output] PollAirflowCommandResponse output + * @property {boolean|null} [outputEnd] PollAirflowCommandResponse outputEnd + * @property {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null} [exitInfo] PollAirflowCommandResponse exitInfo */ /** - * Constructs a new UpdateEnvironmentRequest. + * Constructs a new PollAirflowCommandResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an UpdateEnvironmentRequest. - * @implements IUpdateEnvironmentRequest + * @classdesc Represents a PollAirflowCommandResponse. + * @implements IPollAirflowCommandResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set */ - function UpdateEnvironmentRequest(properties) { + function PollAirflowCommandResponse(properties) { + this.output = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12554,103 +17769,106 @@ } /** - * UpdateEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * PollAirflowCommandResponse output. + * @member {Array.} output + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @instance */ - UpdateEnvironmentRequest.prototype.name = ""; + PollAirflowCommandResponse.prototype.output = $util.emptyArray; /** - * UpdateEnvironmentRequest environment. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * PollAirflowCommandResponse outputEnd. + * @member {boolean} outputEnd + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @instance */ - UpdateEnvironmentRequest.prototype.environment = null; + PollAirflowCommandResponse.prototype.outputEnd = false; /** - * UpdateEnvironmentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * PollAirflowCommandResponse exitInfo. + * @member {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null|undefined} exitInfo + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @instance */ - UpdateEnvironmentRequest.prototype.updateMask = null; + PollAirflowCommandResponse.prototype.exitInfo = null; /** - * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * Creates a new PollAirflowCommandResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse instance */ - UpdateEnvironmentRequest.create = function create(properties) { - return new UpdateEnvironmentRequest(properties); + PollAirflowCommandResponse.create = function create(properties) { + return new PollAirflowCommandResponse(properties); }; /** - * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEnvironmentRequest.encode = function encode(message, writer) { + PollAirflowCommandResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.output != null && message.output.length) + for (var i = 0; i < message.output.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.encode(message.output[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputEnd != null && Object.hasOwnProperty.call(message, "outputEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.outputEnd); + if (message.exitInfo != null && Object.hasOwnProperty.call(message, "exitInfo")) + $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.encode(message.exitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + PollAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEnvironmentRequest.decode = function decode(reader, length) { + PollAirflowCommandResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.name = reader.string(); + case 1: { + if (!(message.output && message.output.length)) + message.output = []; + message.output.push($root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.decode(reader, reader.uint32())); break; } - case 1: { - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + case 2: { + message.outputEnd = reader.bool(); break; } case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.decode(reader, reader.uint32()); break; } default: @@ -12662,355 +17880,617 @@ }; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PollAirflowCommandResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PollAirflowCommandResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.output != null && message.hasOwnProperty("output")) { + if (!Array.isArray(message.output)) + return "output: array expected"; + for (var i = 0; i < message.output.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify(message.output[i]); + if (error) + return "output." + error; + } + } + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + if (typeof message.outputEnd !== "boolean") + return "outputEnd: boolean expected"; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify(message.exitInfo); + if (error) + return "exitInfo." + error; + } + return null; + }; + + /** + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + */ + PollAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); + if (object.output) { + if (!Array.isArray(object.output)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: array expected"); + message.output = []; + for (var i = 0; i < object.output.length; ++i) { + if (typeof object.output[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: object expected"); + message.output[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.fromObject(object.output[i]); + } + } + if (object.outputEnd != null) + message.outputEnd = Boolean(object.outputEnd); + if (object.exitInfo != null) { + if (typeof object.exitInfo !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.exitInfo: object expected"); + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.fromObject(object.exitInfo); + } + return message; + }; + + /** + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} message PollAirflowCommandResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + PollAirflowCommandResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.output = []; + if (options.defaults) { + object.outputEnd = false; + object.exitInfo = null; + } + if (message.output && message.output.length) { + object.output = []; + for (var j = 0; j < message.output.length; ++j) + object.output[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.toObject(message.output[j], options); + } + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + object.outputEnd = message.outputEnd; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) + object.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.toObject(message.exitInfo, options); + return object; }; /** - * Verifies an UpdateEnvironmentRequest message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Converts this PollAirflowCommandResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @instance + * @returns {Object.} JSON object */ - UpdateEnvironmentRequest.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.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; + PollAirflowCommandResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * Gets the default type url for PollAirflowCommandResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - UpdateEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest) + PollAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse"; + }; + + PollAirflowCommandResponse.Line = (function() { + + /** + * Properties of a Line. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @interface ILine + * @property {number|null} [lineNumber] Line lineNumber + * @property {string|null} [content] Line content + */ + + /** + * Constructs a new Line. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @classdesc Represents a Line. + * @implements ILine + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + */ + function Line(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Line lineNumber. + * @member {number} lineNumber + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.lineNumber = 0; + + /** + * Line content. + * @member {string} content + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.content = ""; + + /** + * Creates a new Line instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line instance + */ + Line.create = function create(properties) { + return new Line(properties); + }; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + return writer; + }; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Line message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lineNumber = reader.int32(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Line message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Line.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + if (!$util.isInteger(message.lineNumber)) + return "lineNumber: integer expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a Line message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + */ + Line.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); + if (object.lineNumber != null) + message.lineNumber = object.lineNumber | 0; + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} message Line + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Line.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lineNumber = 0; + object.content = ""; + } + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + object.lineNumber = message.lineNumber; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.environment: object expected"); - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + }; - /** - * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEnvironmentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.environment = null; - object.name = ""; - object.updateMask = null; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Converts this Line to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + * @returns {Object.} JSON object + */ + Line.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateEnvironmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Line + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line"; + }; - /** - * Gets the default type url for UpdateEnvironmentRequest - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest"; - }; + return Line; + })(); - return UpdateEnvironmentRequest; - })(); + PollAirflowCommandResponse.ExitInfo = (function() { - v1beta1.RestartWebServerRequest = (function() { + /** + * Properties of an ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @interface IExitInfo + * @property {number|null} [exitCode] ExitInfo exitCode + * @property {string|null} [error] ExitInfo error + */ - /** - * Properties of a RestartWebServerRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IRestartWebServerRequest - * @property {string|null} [name] RestartWebServerRequest name - */ + /** + * Constructs a new ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @classdesc Represents an ExitInfo. + * @implements IExitInfo + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set + */ + function ExitInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new RestartWebServerRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a RestartWebServerRequest. - * @implements IRestartWebServerRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set - */ - function RestartWebServerRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ExitInfo exitCode. + * @member {number} exitCode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + */ + ExitInfo.prototype.exitCode = 0; - /** - * RestartWebServerRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @instance - */ - RestartWebServerRequest.prototype.name = ""; + /** + * ExitInfo error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + */ + ExitInfo.prototype.error = ""; - /** - * Creates a new RestartWebServerRequest instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest instance - */ - RestartWebServerRequest.create = function create(properties) { - return new RestartWebServerRequest(properties); - }; + /** + * Creates a new ExitInfo instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo instance + */ + ExitInfo.create = function create(properties) { + return new ExitInfo(properties); + }; - /** - * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartWebServerRequest.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 ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); + return writer; + }; - /** - * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartWebServerRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartWebServerRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Decodes an ExitInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + case 2: { + message.error = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartWebServerRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a RestartWebServerRequest message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestartWebServerRequest.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; - }; + /** + * Verifies an ExitInfo message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; - /** - * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest - */ - RestartWebServerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest) + /** + * Creates an ExitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + */ + ExitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} message ExitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exitCode = 0; + object.error = ""; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + }; - /** - * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} message RestartWebServerRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestartWebServerRequest.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 ExitInfo to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + * @returns {Object.} JSON object + */ + ExitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this RestartWebServerRequest to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @instance - * @returns {Object.} JSON object - */ - RestartWebServerRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for ExitInfo + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo"; + }; - /** - * Gets the default type url for RestartWebServerRequest - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestartWebServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest"; - }; + return ExitInfo; + })(); - return RestartWebServerRequest; + return PollAirflowCommandResponse; })(); - v1beta1.ExecuteAirflowCommandResponse = (function() { + v1beta1.SaveSnapshotRequest = (function() { /** - * Properties of an ExecuteAirflowCommandResponse. + * Properties of a SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IExecuteAirflowCommandResponse - * @property {string|null} [executionId] ExecuteAirflowCommandResponse executionId - * @property {string|null} [pod] ExecuteAirflowCommandResponse pod - * @property {string|null} [podNamespace] ExecuteAirflowCommandResponse podNamespace - * @property {string|null} [error] ExecuteAirflowCommandResponse error + * @interface ISaveSnapshotRequest + * @property {string|null} [environment] SaveSnapshotRequest environment + * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation */ /** - * Constructs a new ExecuteAirflowCommandResponse. + * Constructs a new SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an ExecuteAirflowCommandResponse. - * @implements IExecuteAirflowCommandResponse + * @classdesc Represents a SaveSnapshotRequest. + * @implements ISaveSnapshotRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set */ - function ExecuteAirflowCommandResponse(properties) { + function SaveSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13018,117 +18498,89 @@ } /** - * ExecuteAirflowCommandResponse executionId. - * @member {string} executionId - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse - * @instance - */ - ExecuteAirflowCommandResponse.prototype.executionId = ""; - - /** - * ExecuteAirflowCommandResponse pod. - * @member {string} pod - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse - * @instance - */ - ExecuteAirflowCommandResponse.prototype.pod = ""; - - /** - * ExecuteAirflowCommandResponse podNamespace. - * @member {string} podNamespace - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * SaveSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @instance */ - ExecuteAirflowCommandResponse.prototype.podNamespace = ""; + SaveSnapshotRequest.prototype.environment = ""; /** - * ExecuteAirflowCommandResponse error. - * @member {string} error - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * SaveSnapshotRequest snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @instance */ - ExecuteAirflowCommandResponse.prototype.error = ""; + SaveSnapshotRequest.prototype.snapshotLocation = ""; /** - * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. + * Creates a new SaveSnapshotRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest instance */ - ExecuteAirflowCommandResponse.create = function create(properties) { - return new ExecuteAirflowCommandResponse(properties); + SaveSnapshotRequest.create = function create(properties) { + return new SaveSnapshotRequest(properties); }; /** - * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteAirflowCommandResponse.encode = function encode(message, writer) { + SaveSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionId); - if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pod); - if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.podNamespace); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.error); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); return writer; }; /** - * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteAirflowCommandResponse.decode = function decode(reader, length) { + SaveSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.executionId = reader.string(); + message.environment = reader.string(); break; } case 2: { - message.pod = reader.string(); - break; - } - case 3: { - message.podNamespace = reader.string(); - break; - } - case 4: { - message.error = reader.string(); + message.snapshotLocation = reader.string(); break; } default: @@ -13140,257 +18592,207 @@ }; /** - * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteAirflowCommandResponse message. + * Verifies a SaveSnapshotRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteAirflowCommandResponse.verify = function verify(message) { + SaveSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.executionId != null && message.hasOwnProperty("executionId")) - if (!$util.isString(message.executionId)) - return "executionId: string expected"; - if (message.pod != null && message.hasOwnProperty("pod")) - if (!$util.isString(message.pod)) - return "pod: string expected"; - if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) - if (!$util.isString(message.podNamespace)) - return "podNamespace: string expected"; - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; return null; }; /** - * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest */ - ExecuteAirflowCommandResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse) + SaveSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); - if (object.executionId != null) - message.executionId = String(object.executionId); - if (object.pod != null) - message.pod = String(object.pod); - if (object.podNamespace != null) - message.podNamespace = String(object.podNamespace); - if (object.error != null) - message.error = String(object.error); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); return message; }; /** - * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} message SaveSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteAirflowCommandResponse.toObject = function toObject(message, options) { + SaveSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.executionId = ""; - object.pod = ""; - object.podNamespace = ""; - object.error = ""; + object.environment = ""; + object.snapshotLocation = ""; } - if (message.executionId != null && message.hasOwnProperty("executionId")) - object.executionId = message.executionId; - if (message.pod != null && message.hasOwnProperty("pod")) - object.pod = message.pod; - if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) - object.podNamespace = message.podNamespace; - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; return object; }; /** - * Converts this ExecuteAirflowCommandResponse to JSON. + * Converts this SaveSnapshotRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @instance * @returns {Object.} JSON object */ - ExecuteAirflowCommandResponse.prototype.toJSON = function toJSON() { + SaveSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteAirflowCommandResponse + * Gets the default type url for SaveSnapshotRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest"; }; - return ExecuteAirflowCommandResponse; + return SaveSnapshotRequest; })(); - v1beta1.PollAirflowCommandResponse = (function() { + v1beta1.SaveSnapshotResponse = (function() { /** - * Properties of a PollAirflowCommandResponse. + * Properties of a SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IPollAirflowCommandResponse - * @property {Array.|null} [output] PollAirflowCommandResponse output - * @property {boolean|null} [outputEnd] PollAirflowCommandResponse outputEnd - * @property {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null} [exitInfo] PollAirflowCommandResponse exitInfo + * @interface ISaveSnapshotResponse + * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath */ /** - * Constructs a new PollAirflowCommandResponse. + * Constructs a new SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a PollAirflowCommandResponse. - * @implements IPollAirflowCommandResponse + * @classdesc Represents a SaveSnapshotResponse. + * @implements ISaveSnapshotResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set */ - function PollAirflowCommandResponse(properties) { - this.output = []; + function SaveSnapshotResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PollAirflowCommandResponse output. - * @member {Array.} output - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @instance - */ - PollAirflowCommandResponse.prototype.output = $util.emptyArray; - - /** - * PollAirflowCommandResponse outputEnd. - * @member {boolean} outputEnd - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @instance - */ - PollAirflowCommandResponse.prototype.outputEnd = false; + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * PollAirflowCommandResponse exitInfo. - * @member {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null|undefined} exitInfo - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * SaveSnapshotResponse snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @instance */ - PollAirflowCommandResponse.prototype.exitInfo = null; + SaveSnapshotResponse.prototype.snapshotPath = ""; /** - * Creates a new PollAirflowCommandResponse instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse instance */ - PollAirflowCommandResponse.create = function create(properties) { - return new PollAirflowCommandResponse(properties); + SaveSnapshotResponse.create = function create(properties) { + return new SaveSnapshotResponse(properties); }; /** - * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PollAirflowCommandResponse.encode = function encode(message, writer) { + SaveSnapshotResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.output != null && message.output.length) - for (var i = 0; i < message.output.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.encode(message.output[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputEnd != null && Object.hasOwnProperty.call(message, "outputEnd")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.outputEnd); - if (message.exitInfo != null && Object.hasOwnProperty.call(message, "exitInfo")) - $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.encode(message.exitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); return writer; }; /** - * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PollAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PollAirflowCommandResponse.decode = function decode(reader, length) { + SaveSnapshotResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.output && message.output.length)) - message.output = []; - message.output.push($root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.decode(reader, reader.uint32())); - break; - } - case 2: { - message.outputEnd = reader.bool(); - break; - } - case 3: { - message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.decode(reader, reader.uint32()); + message.snapshotPath = reader.string(); break; } default: @@ -13402,617 +18804,616 @@ }; /** - * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PollAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PollAirflowCommandResponse message. + * Verifies a SaveSnapshotResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PollAirflowCommandResponse.verify = function verify(message) { + SaveSnapshotResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.output != null && message.hasOwnProperty("output")) { - if (!Array.isArray(message.output)) - return "output: array expected"; - for (var i = 0; i < message.output.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify(message.output[i]); - if (error) - return "output." + error; - } - } - if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) - if (typeof message.outputEnd !== "boolean") - return "outputEnd: boolean expected"; - if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify(message.exitInfo); - if (error) - return "exitInfo." + error; - } + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; return null; }; /** - * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse */ - PollAirflowCommandResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse) + SaveSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); - if (object.output) { - if (!Array.isArray(object.output)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: array expected"); - message.output = []; - for (var i = 0; i < object.output.length; ++i) { - if (typeof object.output[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: object expected"); - message.output[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.fromObject(object.output[i]); - } - } - if (object.outputEnd != null) - message.outputEnd = Boolean(object.outputEnd); - if (object.exitInfo != null) { - if (typeof object.exitInfo !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.exitInfo: object expected"); - message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.fromObject(object.exitInfo); - } + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); return message; }; /** - * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} message PollAirflowCommandResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} message SaveSnapshotResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PollAirflowCommandResponse.toObject = function toObject(message, options) { + SaveSnapshotResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.output = []; - if (options.defaults) { - object.outputEnd = false; - object.exitInfo = null; - } - if (message.output && message.output.length) { - object.output = []; - for (var j = 0; j < message.output.length; ++j) - object.output[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.toObject(message.output[j], options); - } - if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) - object.outputEnd = message.outputEnd; - if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) - object.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.toObject(message.exitInfo, options); + if (options.defaults) + object.snapshotPath = ""; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; return object; }; /** - * Converts this PollAirflowCommandResponse to JSON. + * Converts this SaveSnapshotResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @instance * @returns {Object.} JSON object */ - PollAirflowCommandResponse.prototype.toJSON = function toJSON() { + SaveSnapshotResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PollAirflowCommandResponse + * Gets the default type url for SaveSnapshotResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PollAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse"; }; - PollAirflowCommandResponse.Line = (function() { - - /** - * Properties of a Line. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @interface ILine - * @property {number|null} [lineNumber] Line lineNumber - * @property {string|null} [content] Line content - */ + return SaveSnapshotResponse; + })(); - /** - * Constructs a new Line. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @classdesc Represents a Line. - * @implements ILine - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set - */ - function Line(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1beta1.LoadSnapshotRequest = (function() { - /** - * Line lineNumber. - * @member {number} lineNumber - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @instance - */ - Line.prototype.lineNumber = 0; + /** + * Properties of a LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ILoadSnapshotRequest + * @property {string|null} [environment] LoadSnapshotRequest environment + * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath + * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation + * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting + * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting + * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying + */ - /** - * Line content. - * @member {string} content - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @instance - */ - Line.prototype.content = ""; + /** + * Constructs a new LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a LoadSnapshotRequest. + * @implements ILoadSnapshotRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set + */ + function LoadSnapshotRequest(properties) { + if (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 Line instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line instance - */ - Line.create = function create(properties) { - return new Line(properties); - }; + /** + * LoadSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.environment = ""; - /** - * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Line.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); - return writer; - }; + /** + * LoadSnapshotRequest snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.snapshotPath = ""; - /** - * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Line.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * LoadSnapshotRequest skipPypiPackagesInstallation. + * @member {boolean} skipPypiPackagesInstallation + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; - /** - * Decodes a Line message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Line.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.lineNumber = reader.int32(); - break; - } - case 2: { - message.content = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * LoadSnapshotRequest skipEnvironmentVariablesSetting. + * @member {boolean} skipEnvironmentVariablesSetting + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; - /** - * Decodes a Line message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Line.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * LoadSnapshotRequest skipAirflowOverridesSetting. + * @member {boolean} skipAirflowOverridesSetting + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; - /** - * Verifies a Line message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Line.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) - if (!$util.isInteger(message.lineNumber)) - return "lineNumber: integer expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - return null; - }; + /** + * LoadSnapshotRequest skipGcsDataCopying. + * @member {boolean} skipGcsDataCopying + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipGcsDataCopying = false; - /** - * Creates a Line message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line - */ - Line.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); - if (object.lineNumber != null) - message.lineNumber = object.lineNumber | 0; - if (object.content != null) - message.content = String(object.content); - return message; - }; + /** + * Creates a new LoadSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest instance + */ + LoadSnapshotRequest.create = function create(properties) { + return new LoadSnapshotRequest(properties); + }; - /** - * Creates a plain object from a Line message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} message Line - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Line.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lineNumber = 0; - object.content = ""; - } - if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) - object.lineNumber = message.lineNumber; - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - return object; - }; + /** + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); + if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); + if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); + if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); + if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); + return writer; + }; - /** - * Converts this Line to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @instance - * @returns {Object.} JSON object - */ - Line.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Gets the default type url for Line - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.snapshotPath = reader.string(); + break; + } + case 3: { + message.skipPypiPackagesInstallation = reader.bool(); + break; + } + case 4: { + message.skipEnvironmentVariablesSetting = reader.bool(); + break; + } + case 5: { + message.skipAirflowOverridesSetting = reader.bool(); + break; + } + case 6: { + message.skipGcsDataCopying = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line"; - }; + } + return message; + }; - return Line; - })(); + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - PollAirflowCommandResponse.ExitInfo = (function() { + /** + * Verifies a LoadSnapshotRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + if (typeof message.skipPypiPackagesInstallation !== "boolean") + return "skipPypiPackagesInstallation: boolean expected"; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + if (typeof message.skipEnvironmentVariablesSetting !== "boolean") + return "skipEnvironmentVariablesSetting: boolean expected"; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + if (typeof message.skipAirflowOverridesSetting !== "boolean") + return "skipAirflowOverridesSetting: boolean expected"; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + if (typeof message.skipGcsDataCopying !== "boolean") + return "skipGcsDataCopying: boolean expected"; + return null; + }; - /** - * Properties of an ExitInfo. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @interface IExitInfo - * @property {number|null} [exitCode] ExitInfo exitCode - * @property {string|null} [error] ExitInfo error - */ + /** + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + */ + LoadSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); + if (object.skipPypiPackagesInstallation != null) + message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); + if (object.skipEnvironmentVariablesSetting != null) + message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); + if (object.skipAirflowOverridesSetting != null) + message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); + if (object.skipGcsDataCopying != null) + message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); + return message; + }; - /** - * Constructs a new ExitInfo. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse - * @classdesc Represents an ExitInfo. - * @implements IExitInfo - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set - */ - function ExitInfo(properties) { - if (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 plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} message LoadSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.snapshotPath = ""; + object.skipPypiPackagesInstallation = false; + object.skipEnvironmentVariablesSetting = false; + object.skipAirflowOverridesSetting = false; + object.skipGcsDataCopying = false; } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + object.skipGcsDataCopying = message.skipGcsDataCopying; + return object; + }; - /** - * ExitInfo exitCode. - * @member {number} exitCode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @instance - */ - ExitInfo.prototype.exitCode = 0; + /** + * Converts this LoadSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + LoadSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ExitInfo error. - * @member {string} error - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @instance - */ - ExitInfo.prototype.error = ""; + /** + * Gets the default type url for LoadSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest"; + }; - /** - * Creates a new ExitInfo instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo instance - */ - ExitInfo.create = function create(properties) { - return new ExitInfo(properties); - }; + return LoadSnapshotRequest; + })(); - /** - * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExitInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); - return writer; - }; + v1beta1.LoadSnapshotResponse = (function() { - /** - * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExitInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a LoadSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ILoadSnapshotResponse + */ - /** - * Decodes an ExitInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExitInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exitCode = reader.int32(); - break; - } - case 2: { - message.error = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new LoadSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a LoadSnapshotResponse. + * @implements ILoadSnapshotResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set + */ + function LoadSnapshotResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an ExitInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExitInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new LoadSnapshotResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse instance + */ + LoadSnapshotResponse.create = function create(properties) { + return new LoadSnapshotResponse(properties); + }; - /** - * Verifies an ExitInfo message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExitInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; - return null; - }; + /** + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Creates an ExitInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo - */ - ExitInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - if (object.error != null) - message.error = String(object.error); - return message; - }; + /** + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} message ExitInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExitInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.exitCode = 0; - object.error = ""; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; - return object; - }; + } + return message; + }; - /** - * Converts this ExitInfo to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @instance - * @returns {Object.} JSON object - */ - ExitInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for ExitInfo - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo"; - }; + /** + * Verifies a LoadSnapshotResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadSnapshotResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + */ + LoadSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse) + return object; + return new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + }; + + /** + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} message LoadSnapshotResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadSnapshotResponse.toObject = function toObject() { + return {}; + }; - return ExitInfo; - })(); + /** + * Converts this LoadSnapshotResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @instance + * @returns {Object.} JSON object + */ + LoadSnapshotResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PollAirflowCommandResponse; + /** + * Gets the default type url for LoadSnapshotResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse"; + }; + + return LoadSnapshotResponse; })(); - v1beta1.SaveSnapshotRequest = (function() { + v1beta1.DatabaseFailoverRequest = (function() { /** - * Properties of a SaveSnapshotRequest. + * Properties of a DatabaseFailoverRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ISaveSnapshotRequest - * @property {string|null} [environment] SaveSnapshotRequest environment - * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation + * @interface IDatabaseFailoverRequest + * @property {string|null} [environment] DatabaseFailoverRequest environment */ /** - * Constructs a new SaveSnapshotRequest. + * Constructs a new DatabaseFailoverRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a SaveSnapshotRequest. - * @implements ISaveSnapshotRequest + * @classdesc Represents a DatabaseFailoverRequest. + * @implements IDatabaseFailoverRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest=} [properties] Properties to set */ - function SaveSnapshotRequest(properties) { + function DatabaseFailoverRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14020,80 +19421,70 @@ } /** - * SaveSnapshotRequest environment. + * DatabaseFailoverRequest environment. * @member {string} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest - * @instance - */ - SaveSnapshotRequest.prototype.environment = ""; - - /** - * SaveSnapshotRequest snapshotLocation. - * @member {string} snapshotLocation - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @instance */ - SaveSnapshotRequest.prototype.snapshotLocation = ""; + DatabaseFailoverRequest.prototype.environment = ""; /** - * Creates a new SaveSnapshotRequest instance using the specified properties. + * Creates a new DatabaseFailoverRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest} DatabaseFailoverRequest instance */ - SaveSnapshotRequest.create = function create(properties) { - return new SaveSnapshotRequest(properties); + DatabaseFailoverRequest.create = function create(properties) { + return new DatabaseFailoverRequest(properties); }; /** - * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * Encodes the specified DatabaseFailoverRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest} message DatabaseFailoverRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotRequest.encode = function encode(message, writer) { + DatabaseFailoverRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); - if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); return writer; }; /** - * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * Encodes the specified DatabaseFailoverRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest} message DatabaseFailoverRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest} DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotRequest.decode = function decode(reader, length) { + DatabaseFailoverRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14101,10 +19492,6 @@ message.environment = reader.string(); break; } - case 2: { - message.snapshotLocation = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -14114,131 +19501,121 @@ }; /** - * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest} DatabaseFailoverRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + DatabaseFailoverRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SaveSnapshotRequest message. + * Verifies a DatabaseFailoverRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SaveSnapshotRequest.verify = function verify(message) { + DatabaseFailoverRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.environment != null && message.hasOwnProperty("environment")) if (!$util.isString(message.environment)) return "environment: string expected"; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - if (!$util.isString(message.snapshotLocation)) - return "snapshotLocation: string expected"; return null; }; /** - * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest} DatabaseFailoverRequest */ - SaveSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest) + DatabaseFailoverRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest(); if (object.environment != null) message.environment = String(object.environment); - if (object.snapshotLocation != null) - message.snapshotLocation = String(object.snapshotLocation); return message; }; /** - * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseFailoverRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} message SaveSnapshotRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest} message DatabaseFailoverRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SaveSnapshotRequest.toObject = function toObject(message, options) { + DatabaseFailoverRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.environment = ""; - object.snapshotLocation = ""; - } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = message.environment; - if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) - object.snapshotLocation = message.snapshotLocation; return object; }; /** - * Converts this SaveSnapshotRequest to JSON. + * Converts this DatabaseFailoverRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @instance * @returns {Object.} JSON object */ - SaveSnapshotRequest.prototype.toJSON = function toJSON() { + DatabaseFailoverRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SaveSnapshotRequest + * Gets the default type url for DatabaseFailoverRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseFailoverRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest"; }; - return SaveSnapshotRequest; + return DatabaseFailoverRequest; })(); - v1beta1.SaveSnapshotResponse = (function() { + v1beta1.DatabaseFailoverResponse = (function() { /** - * Properties of a SaveSnapshotResponse. + * Properties of a DatabaseFailoverResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ISaveSnapshotResponse - * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath + * @interface IDatabaseFailoverResponse */ /** - * Constructs a new SaveSnapshotResponse. + * Constructs a new DatabaseFailoverResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a SaveSnapshotResponse. - * @implements ISaveSnapshotResponse + * @classdesc Represents a DatabaseFailoverResponse. + * @implements IDatabaseFailoverResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse=} [properties] Properties to set */ - function SaveSnapshotResponse(properties) { + function DatabaseFailoverResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14246,77 +19623,63 @@ } /** - * SaveSnapshotResponse snapshotPath. - * @member {string} snapshotPath - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse - * @instance - */ - SaveSnapshotResponse.prototype.snapshotPath = ""; - - /** - * Creates a new SaveSnapshotResponse instance using the specified properties. + * Creates a new DatabaseFailoverResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse} DatabaseFailoverResponse instance */ - SaveSnapshotResponse.create = function create(properties) { - return new SaveSnapshotResponse(properties); + DatabaseFailoverResponse.create = function create(properties) { + return new DatabaseFailoverResponse(properties); }; /** - * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * Encodes the specified DatabaseFailoverResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse} message DatabaseFailoverResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotResponse.encode = function encode(message, writer) { + DatabaseFailoverResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); return writer; }; /** - * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * Encodes the specified DatabaseFailoverResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse} message DatabaseFailoverResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseFailoverResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse} DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotResponse.decode = function decode(reader, length) { + DatabaseFailoverResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.snapshotPath = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -14326,248 +19689,180 @@ }; /** - * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a DatabaseFailoverResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse} DatabaseFailoverResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + DatabaseFailoverResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SaveSnapshotResponse message. + * Verifies a DatabaseFailoverResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SaveSnapshotResponse.verify = function verify(message) { + DatabaseFailoverResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - if (!$util.isString(message.snapshotPath)) - return "snapshotPath: string expected"; return null; }; /** - * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseFailoverResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse} DatabaseFailoverResponse */ - SaveSnapshotResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse) + DatabaseFailoverResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); - if (object.snapshotPath != null) - message.snapshotPath = String(object.snapshotPath); - return message; + return new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse(); }; /** - * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseFailoverResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} message SaveSnapshotResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse} message DatabaseFailoverResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SaveSnapshotResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshotPath = ""; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - object.snapshotPath = message.snapshotPath; - return object; + DatabaseFailoverResponse.toObject = function toObject() { + return {}; }; /** - * Converts this SaveSnapshotResponse to JSON. + * Converts this DatabaseFailoverResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @instance * @returns {Object.} JSON object */ - SaveSnapshotResponse.prototype.toJSON = function toJSON() { + DatabaseFailoverResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SaveSnapshotResponse + * Gets the default type url for DatabaseFailoverResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseFailoverResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse"; - }; - - return SaveSnapshotResponse; - })(); - - v1beta1.LoadSnapshotRequest = (function() { - - /** - * Properties of a LoadSnapshotRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ILoadSnapshotRequest - * @property {string|null} [environment] LoadSnapshotRequest environment - * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath - * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation - * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting - * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting - * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying - */ - - /** - * Constructs a new LoadSnapshotRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a LoadSnapshotRequest. - * @implements ILoadSnapshotRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set - */ - function LoadSnapshotRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoadSnapshotRequest environment. - * @member {string} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest - * @instance - */ - LoadSnapshotRequest.prototype.environment = ""; - - /** - * LoadSnapshotRequest snapshotPath. - * @member {string} snapshotPath - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest - * @instance - */ - LoadSnapshotRequest.prototype.snapshotPath = ""; - - /** - * LoadSnapshotRequest skipPypiPackagesInstallation. - * @member {boolean} skipPypiPackagesInstallation - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest - * @instance - */ - LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse"; + }; + + return DatabaseFailoverResponse; + })(); + + v1beta1.FetchDatabasePropertiesRequest = (function() { /** - * LoadSnapshotRequest skipEnvironmentVariablesSetting. - * @member {boolean} skipEnvironmentVariablesSetting - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest - * @instance + * Properties of a FetchDatabasePropertiesRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IFetchDatabasePropertiesRequest + * @property {string|null} [environment] FetchDatabasePropertiesRequest environment */ - LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; /** - * LoadSnapshotRequest skipAirflowOverridesSetting. - * @member {boolean} skipAirflowOverridesSetting - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest - * @instance + * Constructs a new FetchDatabasePropertiesRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a FetchDatabasePropertiesRequest. + * @implements IFetchDatabasePropertiesRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest=} [properties] Properties to set */ - LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; + function FetchDatabasePropertiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * LoadSnapshotRequest skipGcsDataCopying. - * @member {boolean} skipGcsDataCopying - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * FetchDatabasePropertiesRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @instance */ - LoadSnapshotRequest.prototype.skipGcsDataCopying = false; + FetchDatabasePropertiesRequest.prototype.environment = ""; /** - * Creates a new LoadSnapshotRequest instance using the specified properties. + * Creates a new FetchDatabasePropertiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest instance */ - LoadSnapshotRequest.create = function create(properties) { - return new LoadSnapshotRequest(properties); + FetchDatabasePropertiesRequest.create = function create(properties) { + return new FetchDatabasePropertiesRequest(properties); }; /** - * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotRequest.encode = function encode(message, writer) { + FetchDatabasePropertiesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); - if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); - if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); - if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); - if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); - if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); return writer; }; /** - * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + FetchDatabasePropertiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotRequest.decode = function decode(reader, length) { + FetchDatabasePropertiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14575,26 +19870,6 @@ message.environment = reader.string(); break; } - case 2: { - message.snapshotPath = reader.string(); - break; - } - case 3: { - message.skipPypiPackagesInstallation = reader.bool(); - break; - } - case 4: { - message.skipEnvironmentVariablesSetting = reader.bool(); - break; - } - case 5: { - message.skipAirflowOverridesSetting = reader.bool(); - break; - } - case 6: { - message.skipGcsDataCopying = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -14604,162 +19879,124 @@ }; /** - * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + FetchDatabasePropertiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LoadSnapshotRequest message. + * Verifies a FetchDatabasePropertiesRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LoadSnapshotRequest.verify = function verify(message) { + FetchDatabasePropertiesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.environment != null && message.hasOwnProperty("environment")) if (!$util.isString(message.environment)) return "environment: string expected"; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - if (!$util.isString(message.snapshotPath)) - return "snapshotPath: string expected"; - if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) - if (typeof message.skipPypiPackagesInstallation !== "boolean") - return "skipPypiPackagesInstallation: boolean expected"; - if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) - if (typeof message.skipEnvironmentVariablesSetting !== "boolean") - return "skipEnvironmentVariablesSetting: boolean expected"; - if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) - if (typeof message.skipAirflowOverridesSetting !== "boolean") - return "skipAirflowOverridesSetting: boolean expected"; - if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) - if (typeof message.skipGcsDataCopying !== "boolean") - return "skipGcsDataCopying: boolean expected"; return null; }; /** - * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest} FetchDatabasePropertiesRequest */ - LoadSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest) + FetchDatabasePropertiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest(); if (object.environment != null) message.environment = String(object.environment); - if (object.snapshotPath != null) - message.snapshotPath = String(object.snapshotPath); - if (object.skipPypiPackagesInstallation != null) - message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); - if (object.skipEnvironmentVariablesSetting != null) - message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); - if (object.skipAirflowOverridesSetting != null) - message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); - if (object.skipGcsDataCopying != null) - message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); return message; }; /** - * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * Creates a plain object from a FetchDatabasePropertiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} message LoadSnapshotRequest + * @param {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest} message FetchDatabasePropertiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LoadSnapshotRequest.toObject = function toObject(message, options) { + FetchDatabasePropertiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.environment = ""; - object.snapshotPath = ""; - object.skipPypiPackagesInstallation = false; - object.skipEnvironmentVariablesSetting = false; - object.skipAirflowOverridesSetting = false; - object.skipGcsDataCopying = false; - } if (message.environment != null && message.hasOwnProperty("environment")) object.environment = message.environment; - if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) - object.snapshotPath = message.snapshotPath; - if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) - object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; - if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) - object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; - if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) - object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; - if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) - object.skipGcsDataCopying = message.skipGcsDataCopying; return object; }; /** - * Converts this LoadSnapshotRequest to JSON. + * Converts this FetchDatabasePropertiesRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @instance * @returns {Object.} JSON object */ - LoadSnapshotRequest.prototype.toJSON = function toJSON() { + FetchDatabasePropertiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LoadSnapshotRequest + * Gets the default type url for FetchDatabasePropertiesRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FetchDatabasePropertiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest"; }; - return LoadSnapshotRequest; + return FetchDatabasePropertiesRequest; })(); - v1beta1.LoadSnapshotResponse = (function() { + v1beta1.FetchDatabasePropertiesResponse = (function() { /** - * Properties of a LoadSnapshotResponse. + * Properties of a FetchDatabasePropertiesResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ILoadSnapshotResponse + * @interface IFetchDatabasePropertiesResponse + * @property {string|null} [primaryGceZone] FetchDatabasePropertiesResponse primaryGceZone + * @property {string|null} [secondaryGceZone] FetchDatabasePropertiesResponse secondaryGceZone + * @property {boolean|null} [isFailoverReplicaAvailable] FetchDatabasePropertiesResponse isFailoverReplicaAvailable */ /** - * Constructs a new LoadSnapshotResponse. + * Constructs a new FetchDatabasePropertiesResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a LoadSnapshotResponse. - * @implements ILoadSnapshotResponse + * @classdesc Represents a FetchDatabasePropertiesResponse. + * @implements IFetchDatabasePropertiesResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse=} [properties] Properties to set */ - function LoadSnapshotResponse(properties) { + function FetchDatabasePropertiesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14767,63 +20004,105 @@ } /** - * Creates a new LoadSnapshotResponse instance using the specified properties. + * FetchDatabasePropertiesResponse primaryGceZone. + * @member {string} primaryGceZone + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse + * @instance + */ + FetchDatabasePropertiesResponse.prototype.primaryGceZone = ""; + + /** + * FetchDatabasePropertiesResponse secondaryGceZone. + * @member {string} secondaryGceZone + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse + * @instance + */ + FetchDatabasePropertiesResponse.prototype.secondaryGceZone = ""; + + /** + * FetchDatabasePropertiesResponse isFailoverReplicaAvailable. + * @member {boolean} isFailoverReplicaAvailable + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse + * @instance + */ + FetchDatabasePropertiesResponse.prototype.isFailoverReplicaAvailable = false; + + /** + * Creates a new FetchDatabasePropertiesResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse instance */ - LoadSnapshotResponse.create = function create(properties) { - return new LoadSnapshotResponse(properties); + FetchDatabasePropertiesResponse.create = function create(properties) { + return new FetchDatabasePropertiesResponse(properties); }; /** - * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotResponse.encode = function encode(message, writer) { + FetchDatabasePropertiesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.primaryGceZone != null && Object.hasOwnProperty.call(message, "primaryGceZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryGceZone); + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secondaryGceZone); + if (message.isFailoverReplicaAvailable != null && Object.hasOwnProperty.call(message, "isFailoverReplicaAvailable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFailoverReplicaAvailable); return writer; }; /** - * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * Encodes the specified FetchDatabasePropertiesResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + FetchDatabasePropertiesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotResponse.decode = function decode(reader, length) { + FetchDatabasePropertiesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.primaryGceZone = reader.string(); + break; + } + case 2: { + message.secondaryGceZone = reader.string(); + break; + } + case 3: { + message.isFailoverReplicaAvailable = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -14833,89 +20112,119 @@ }; /** - * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * Decodes a FetchDatabasePropertiesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + FetchDatabasePropertiesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LoadSnapshotResponse message. + * Verifies a FetchDatabasePropertiesResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LoadSnapshotResponse.verify = function verify(message) { + FetchDatabasePropertiesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.primaryGceZone != null && message.hasOwnProperty("primaryGceZone")) + if (!$util.isString(message.primaryGceZone)) + return "primaryGceZone: string expected"; + if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (!$util.isString(message.secondaryGceZone)) + return "secondaryGceZone: string expected"; + if (message.isFailoverReplicaAvailable != null && message.hasOwnProperty("isFailoverReplicaAvailable")) + if (typeof message.isFailoverReplicaAvailable !== "boolean") + return "isFailoverReplicaAvailable: boolean expected"; return null; }; /** - * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * Creates a FetchDatabasePropertiesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @returns {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} FetchDatabasePropertiesResponse */ - LoadSnapshotResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse) + FetchDatabasePropertiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse) return object; - return new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse(); + if (object.primaryGceZone != null) + message.primaryGceZone = String(object.primaryGceZone); + if (object.secondaryGceZone != null) + message.secondaryGceZone = String(object.secondaryGceZone); + if (object.isFailoverReplicaAvailable != null) + message.isFailoverReplicaAvailable = Boolean(object.isFailoverReplicaAvailable); + return message; }; /** - * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * Creates a plain object from a FetchDatabasePropertiesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} message LoadSnapshotResponse + * @param {google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse} message FetchDatabasePropertiesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LoadSnapshotResponse.toObject = function toObject() { - return {}; + FetchDatabasePropertiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primaryGceZone = ""; + object.secondaryGceZone = ""; + object.isFailoverReplicaAvailable = false; + } + if (message.primaryGceZone != null && message.hasOwnProperty("primaryGceZone")) + object.primaryGceZone = message.primaryGceZone; + if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + object.secondaryGceZone = message.secondaryGceZone; + if (message.isFailoverReplicaAvailable != null && message.hasOwnProperty("isFailoverReplicaAvailable")) + object.isFailoverReplicaAvailable = message.isFailoverReplicaAvailable; + return object; }; /** - * Converts this LoadSnapshotResponse to JSON. + * Converts this FetchDatabasePropertiesResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @instance * @returns {Object.} JSON object */ - LoadSnapshotResponse.prototype.toJSON = function toJSON() { + FetchDatabasePropertiesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LoadSnapshotResponse + * Gets the default type url for FetchDatabasePropertiesResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @memberof google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FetchDatabasePropertiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse"; }; - return LoadSnapshotResponse; + return FetchDatabasePropertiesResponse; })(); v1beta1.EnvironmentConfig = (function() { @@ -14941,6 +20250,7 @@ * @property {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize * @property {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig|null} [masterAuthorizedNetworksConfig] EnvironmentConfig masterAuthorizedNetworksConfig * @property {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null} [recoveryConfig] EnvironmentConfig recoveryConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode|null} [resilienceMode] EnvironmentConfig resilienceMode */ /** @@ -15094,6 +20404,14 @@ */ EnvironmentConfig.prototype.recoveryConfig = null; + /** + * EnvironmentConfig resilienceMode. + * @member {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode} resilienceMode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.resilienceMode = 0; + /** * Creates a new EnvironmentConfig instance using the specified properties. * @function create @@ -15150,6 +20468,8 @@ $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.encode(message.masterAuthorizedNetworksConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); if (message.recoveryConfig != null && Object.hasOwnProperty.call(message, "recoveryConfig")) $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.encode(message.recoveryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.resilienceMode != null && Object.hasOwnProperty.call(message, "resilienceMode")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.resilienceMode); if (message.airflowByoidUri != null && Object.hasOwnProperty.call(message, "airflowByoidUri")) writer.uint32(/* id 21, wireType 2 =*/170).string(message.airflowByoidUri); return writer; @@ -15254,6 +20574,10 @@ message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.decode(reader, reader.uint32()); break; } + case 20: { + message.resilienceMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -15369,6 +20693,14 @@ if (error) return "recoveryConfig." + error; } + if (message.resilienceMode != null && message.hasOwnProperty("resilienceMode")) + switch (message.resilienceMode) { + default: + return "resilienceMode: enum value expected"; + case 0: + case 1: + break; + } return null; }; @@ -15473,6 +20805,22 @@ throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.recoveryConfig: object expected"); message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.fromObject(object.recoveryConfig); } + switch (object.resilienceMode) { + default: + if (typeof object.resilienceMode === "number") { + message.resilienceMode = object.resilienceMode; + break; + } + break; + case "RESILIENCE_MODE_UNSPECIFIED": + case 0: + message.resilienceMode = 0; + break; + case "HIGH_RESILIENCE": + case 1: + message.resilienceMode = 1; + break; + } return message; }; @@ -15506,6 +20854,7 @@ object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; object.masterAuthorizedNetworksConfig = null; object.recoveryConfig = null; + object.resilienceMode = options.enums === String ? "RESILIENCE_MODE_UNSPECIFIED" : 0; object.airflowByoidUri = ""; } if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) @@ -15540,6 +20889,8 @@ object.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.toObject(message.masterAuthorizedNetworksConfig, options); if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) object.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.toObject(message.recoveryConfig, options); + if (message.resilienceMode != null && message.hasOwnProperty("resilienceMode")) + object.resilienceMode = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode[message.resilienceMode] === undefined ? message.resilienceMode : $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode[message.resilienceMode] : message.resilienceMode; if (message.airflowByoidUri != null && message.hasOwnProperty("airflowByoidUri")) object.airflowByoidUri = message.airflowByoidUri; return object; @@ -15589,6 +20940,20 @@ return values; })(); + /** + * ResilienceMode enum. + * @name google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.ResilienceMode + * @enum {number} + * @property {number} RESILIENCE_MODE_UNSPECIFIED=0 RESILIENCE_MODE_UNSPECIFIED value + * @property {number} HIGH_RESILIENCE=1 HIGH_RESILIENCE value + */ + EnvironmentConfig.ResilienceMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESILIENCE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH_RESILIENCE"] = 1; + return values; + })(); + return EnvironmentConfig; })(); @@ -22849,6 +28214,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.resource != null && message.hasOwnProperty("resource")) @@ -22945,6 +28311,10 @@ case 6: message.operationType = 6; break; + case "DATABASE_FAILOVER": + case 7: + message.operationType = 7; + break; } if (object.resource != null) message.resource = String(object.resource); @@ -23056,6 +28426,7 @@ * @property {number} CHECK=4 CHECK value * @property {number} SAVE_SNAPSHOT=5 SAVE_SNAPSHOT value * @property {number} LOAD_SNAPSHOT=6 LOAD_SNAPSHOT value + * @property {number} DATABASE_FAILOVER=7 DATABASE_FAILOVER value */ OperationMetadata.Type = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -23066,6 +28437,7 @@ values[valuesById[4] = "CHECK"] = 4; values[valuesById[5] = "SAVE_SNAPSHOT"] = 5; values[valuesById[6] = "LOAD_SNAPSHOT"] = 6; + values[valuesById[7] = "DATABASE_FAILOVER"] = 7; return values; })(); diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.json b/packages/google-cloud-orchestration-airflow-service/protos/protos.json index 9d1141b47452..eb0c3530530d 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.json +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.json @@ -142,6 +142,54 @@ } ] }, + "ExecuteAirflowCommand": { + "requestType": "ExecuteAirflowCommandRequest", + "responseType": "ExecuteAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand", + "body": "*" + } + } + ] + }, + "StopAirflowCommand": { + "requestType": "StopAirflowCommandRequest", + "responseType": "StopAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand", + "body": "*" + } + } + ] + }, + "PollAirflowCommand": { + "requestType": "PollAirflowCommandRequest", + "responseType": "PollAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand", + "body": "*" + } + } + ] + }, "SaveSnapshot": { "requestType": "SaveSnapshotRequest", "responseType": "google.longrunning.Operation", @@ -189,6 +237,44 @@ } } ] + }, + "DatabaseFailover": { + "requestType": "DatabaseFailoverRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:databaseFailover", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:databaseFailover", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse", + "metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + } + } + ] + }, + "FetchDatabaseProperties": { + "requestType": "FetchDatabasePropertiesRequest", + "responseType": "FetchDatabasePropertiesResponse", + "options": { + "(google.api.http).get": "/v1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + } + } + ] } } }, @@ -265,6 +351,151 @@ } } }, + "ExecuteAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "command": { + "type": "string", + "id": 2 + }, + "subcommand": { + "type": "string", + "id": 3 + }, + "parameters": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "ExecuteAirflowCommandResponse": { + "fields": { + "executionId": { + "type": "string", + "id": 1 + }, + "pod": { + "type": "string", + "id": 2 + }, + "podNamespace": { + "type": "string", + "id": 3 + }, + "error": { + "type": "string", + "id": 4 + } + } + }, + "StopAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "executionId": { + "type": "string", + "id": 2 + }, + "pod": { + "type": "string", + "id": 3 + }, + "podNamespace": { + "type": "string", + "id": 4 + }, + "force": { + "type": "bool", + "id": 5 + } + } + }, + "StopAirflowCommandResponse": { + "fields": { + "isDone": { + "type": "bool", + "id": 1 + }, + "output": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "PollAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "executionId": { + "type": "string", + "id": 2 + }, + "pod": { + "type": "string", + "id": 3 + }, + "podNamespace": { + "type": "string", + "id": 4 + }, + "nextLineNumber": { + "type": "int32", + "id": 5 + } + } + }, + "PollAirflowCommandResponse": { + "fields": { + "output": { + "rule": "repeated", + "type": "Line", + "id": 1 + }, + "outputEnd": { + "type": "bool", + "id": 2 + }, + "exitInfo": { + "type": "ExitInfo", + "id": 3 + } + }, + "nested": { + "Line": { + "fields": { + "lineNumber": { + "type": "int32", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + } + } + }, + "ExitInfo": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + }, + "error": { + "type": "string", + "id": 2 + } + } + } + } + }, "SaveSnapshotRequest": { "fields": { "environment": { @@ -316,6 +547,45 @@ "LoadSnapshotResponse": { "fields": {} }, + "DatabaseFailoverRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + } + } + }, + "DatabaseFailoverResponse": { + "fields": {} + }, + "FetchDatabasePropertiesRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "composer.googleapis.com/Environment" + } + } + } + }, + "FetchDatabasePropertiesResponse": { + "fields": { + "primaryGceZone": { + "type": "string", + "id": 1 + }, + "secondaryGceZone": { + "type": "string", + "id": 2 + }, + "isFailoverReplicaAvailable": { + "type": "bool", + "id": 3 + } + } + }, "EnvironmentConfig": { "fields": { "gkeCluster": { @@ -415,6 +685,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "resilienceMode": { + "type": "ResilienceMode", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -425,6 +702,12 @@ "ENVIRONMENT_SIZE_MEDIUM": 2, "ENVIRONMENT_SIZE_LARGE": 3 } + }, + "ResilienceMode": { + "values": { + "RESILIENCE_MODE_UNSPECIFIED": 0, + "HIGH_RESILIENCE": 1 + } } } }, @@ -1104,7 +1387,8 @@ "UPDATE": 3, "CHECK": 4, "SAVE_SNAPSHOT": 5, - "LOAD_SNAPSHOT": 6 + "LOAD_SNAPSHOT": 6, + "DATABASE_FAILOVER": 7 } } } @@ -1379,6 +1663,54 @@ } ] }, + "ExecuteAirflowCommand": { + "requestType": "ExecuteAirflowCommandRequest", + "responseType": "ExecuteAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand", + "body": "*" + } + } + ] + }, + "StopAirflowCommand": { + "requestType": "StopAirflowCommandRequest", + "responseType": "StopAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand", + "body": "*" + } + } + ] + }, + "PollAirflowCommand": { + "requestType": "PollAirflowCommandRequest", + "responseType": "PollAirflowCommandResponse", + "options": { + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand", + "body": "*" + } + } + ] + }, "SaveSnapshot": { "requestType": "SaveSnapshotRequest", "responseType": "google.longrunning.Operation", @@ -1426,6 +1758,44 @@ } } ] + }, + "DatabaseFailover": { + "requestType": "DatabaseFailoverRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:databaseFailover", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:databaseFailover", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse", + "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + } + } + ] + }, + "FetchDatabaseProperties": { + "requestType": "FetchDatabasePropertiesRequest", + "responseType": "FetchDatabasePropertiesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties" + } + } + ] } } }, @@ -1513,6 +1883,27 @@ } } }, + "ExecuteAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "command": { + "type": "string", + "id": 2 + }, + "subcommand": { + "type": "string", + "id": 3 + }, + "parameters": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, "ExecuteAirflowCommandResponse": { "fields": { "executionId": { @@ -1533,6 +1924,67 @@ } } }, + "StopAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "executionId": { + "type": "string", + "id": 2 + }, + "pod": { + "type": "string", + "id": 3 + }, + "podNamespace": { + "type": "string", + "id": 4 + }, + "force": { + "type": "bool", + "id": 5 + } + } + }, + "StopAirflowCommandResponse": { + "fields": { + "isDone": { + "type": "bool", + "id": 1 + }, + "output": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "PollAirflowCommandRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "executionId": { + "type": "string", + "id": 2 + }, + "pod": { + "type": "string", + "id": 3 + }, + "podNamespace": { + "type": "string", + "id": 4 + }, + "nextLineNumber": { + "type": "int32", + "id": 5 + } + } + }, "PollAirflowCommandResponse": { "fields": { "output": { @@ -1627,6 +2079,45 @@ "LoadSnapshotResponse": { "fields": {} }, + "DatabaseFailoverRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + } + } + }, + "DatabaseFailoverResponse": { + "fields": {} + }, + "FetchDatabasePropertiesRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "composer.googleapis.com/Environment" + } + } + } + }, + "FetchDatabasePropertiesResponse": { + "fields": { + "primaryGceZone": { + "type": "string", + "id": 1 + }, + "secondaryGceZone": { + "type": "string", + "id": 2 + }, + "isFailoverReplicaAvailable": { + "type": "bool", + "id": 3 + } + } + }, "EnvironmentConfig": { "fields": { "gkeCluster": { @@ -1735,6 +2226,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "resilienceMode": { + "type": "ResilienceMode", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1745,6 +2243,12 @@ "ENVIRONMENT_SIZE_MEDIUM": 2, "ENVIRONMENT_SIZE_LARGE": 3 } + }, + "ResilienceMode": { + "values": { + "RESILIENCE_MODE_UNSPECIFIED": 0, + "HIGH_RESILIENCE": 1 + } } } }, @@ -2523,7 +3027,8 @@ "UPDATE": 3, "CHECK": 4, "SAVE_SNAPSHOT": 5, - "LOAD_SNAPSHOT": 6 + "LOAD_SNAPSHOT": 6, + "DATABASE_FAILOVER": 7 } } } diff --git a/packages/google-cloud-orchestration-airflow-service/samples/README.md b/packages/google-cloud-orchestration-airflow-service/samples/README.md index 2e506e5dd4e9..e6d1f0d95fee 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/README.md +++ b/packages/google-cloud-orchestration-airflow-service/samples/README.md @@ -13,25 +13,34 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Environments.create_environment](#environments.create_environment) + * [Environments.database_failover](#environments.database_failover) * [Environments.delete_environment](#environments.delete_environment) + * [Environments.execute_airflow_command](#environments.execute_airflow_command) + * [Environments.fetch_database_properties](#environments.fetch_database_properties) * [Environments.get_environment](#environments.get_environment) * [Environments.list_environments](#environments.list_environments) * [Environments.load_snapshot](#environments.load_snapshot) + * [Environments.poll_airflow_command](#environments.poll_airflow_command) * [Environments.save_snapshot](#environments.save_snapshot) + * [Environments.stop_airflow_command](#environments.stop_airflow_command) * [Environments.update_environment](#environments.update_environment) * [Image_versions.list_image_versions](#image_versions.list_image_versions) * [Environments.check_upgrade](#environments.check_upgrade) * [Environments.create_environment](#environments.create_environment) + * [Environments.database_failover](#environments.database_failover) * [Environments.delete_environment](#environments.delete_environment) + * [Environments.execute_airflow_command](#environments.execute_airflow_command) + * [Environments.fetch_database_properties](#environments.fetch_database_properties) * [Environments.get_environment](#environments.get_environment) * [Environments.list_environments](#environments.list_environments) * [Environments.load_snapshot](#environments.load_snapshot) + * [Environments.poll_airflow_command](#environments.poll_airflow_command) * [Environments.restart_web_server](#environments.restart_web_server) * [Environments.save_snapshot](#environments.save_snapshot) + * [Environments.stop_airflow_command](#environments.stop_airflow_command) * [Environments.update_environment](#environments.update_environment) * [Image_versions.list_image_versions](#image_versions.list_image_versions) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -65,6 +74,23 @@ __Usage:__ +### Environments.database_failover + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js` + + +----- + + + + ### Environments.delete_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js). @@ -82,6 +108,40 @@ __Usage:__ +### Environments.execute_airflow_command + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js` + + +----- + + + + +### Environments.fetch_database_properties + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js` + + +----- + + + + ### Environments.get_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js). @@ -133,6 +193,23 @@ __Usage:__ +### Environments.poll_airflow_command + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js` + + +----- + + + + ### Environments.save_snapshot View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js). @@ -150,6 +227,23 @@ __Usage:__ +### Environments.stop_airflow_command + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js` + + +----- + + + + ### Environments.update_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js). @@ -218,6 +312,23 @@ __Usage:__ +### Environments.database_failover + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js` + + +----- + + + + ### Environments.delete_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js). @@ -235,6 +346,40 @@ __Usage:__ +### Environments.execute_airflow_command + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js` + + +----- + + + + +### Environments.fetch_database_properties + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js` + + +----- + + + + ### Environments.get_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js). @@ -286,6 +431,23 @@ __Usage:__ +### Environments.poll_airflow_command + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js). + +[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js` + + +----- + + + + ### Environments.restart_web_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js). @@ -320,16 +482,16 @@ __Usage:__ -### Environments.update_environment +### Environments.stop_airflow_command -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js). -[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js,samples/README.md) __Usage:__ -`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js` +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js` ----- @@ -337,16 +499,16 @@ __Usage:__ -### Image_versions.list_image_versions +### Environments.update_environment -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js). -[![Open in Cloud 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-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js,samples/README.md) __Usage:__ -`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js` +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js` ----- @@ -354,16 +516,16 @@ __Usage:__ -### Quickstart +### Image_versions.list_image_versions -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_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-orchestration-airflow-service/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js,samples/README.md) __Usage:__ -`node packages/google-cloud-orchestration-airflow-service/samples/quickstart.js` +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js` ----- @@ -373,14 +535,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/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-orchestration-airflow-service/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-orchestration-airflow-service/samples/quickstart.js,samples/README.md) __Usage:__ -`node packages/google-cloud-orchestration-airflow-service/samples/test/quickstart.js` +`node packages/google-cloud-orchestration-airflow-service/samples/quickstart.js` diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.js new file mode 100644 index 000000000000..fa2c0df10a5a --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.database_failover.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() { + // [START composer_v1_generated_Environments_DatabaseFailover_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. + */ + /** + * Target environment: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callDatabaseFailover() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.databaseFailover(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDatabaseFailover(); + // [END composer_v1_generated_Environments_DatabaseFailover_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.js new file mode 100644 index 000000000000..2914c88d4404 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.execute_airflow_command.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() { + // [START composer_v1_generated_Environments_ExecuteAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + */ + // const environment = 'abc123' + /** + * Airflow command. + */ + // const command = 'abc123' + /** + * Airflow subcommand. + */ + // const subcommand = 'abc123' + /** + * Parameters for the Airflow command/subcommand as an array of arguments. + * It may contain positional arguments like `["my-dag-id"]`, key-value + * parameters like `["--foo=bar"]` or `["--foo","bar"]`, + * or other flags like `["-f"]`. + */ + // const parameters = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callExecuteAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.executeAirflowCommand(request); + console.log(response); + } + + callExecuteAirflowCommand(); + // [END composer_v1_generated_Environments_ExecuteAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.js new file mode 100644 index 000000000000..53391a937d23 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.fetch_database_properties.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(environment) { + // [START composer_v1_generated_Environments_FetchDatabaseProperties_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the environment, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callFetchDatabaseProperties() { + // Construct request + const request = { + environment, + }; + + // Run request + const response = await serviceClient.fetchDatabaseProperties(request); + console.log(response); + } + + callFetchDatabaseProperties(); + // [END composer_v1_generated_Environments_FetchDatabaseProperties_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js new file mode 100644 index 000000000000..13f8af79815c --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.poll_airflow_command.js @@ -0,0 +1,77 @@ +// 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() { + // [START composer_v1_generated_Environments_PollAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * The unique ID of the command execution. + */ + // const executionId = 'abc123' + /** + * The name of the pod where the command is executed. + */ + // const pod = 'abc123' + /** + * The namespace of the pod where the command is executed. + */ + // const podNamespace = 'abc123' + /** + * Line number from which new logs should be fetched. + */ + // const nextLineNumber = 1234 + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callPollAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.pollAirflowCommand(request); + console.log(response); + } + + callPollAirflowCommand(); + // [END composer_v1_generated_Environments_PollAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js new file mode 100644 index 000000000000..82973bd018b5 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.stop_airflow_command.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START composer_v1_generated_Environments_StopAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + */ + // const environment = 'abc123' + /** + * The unique ID of the command execution. + */ + // const executionId = 'abc123' + /** + * The name of the pod where the command is executed. + */ + // const pod = 'abc123' + /** + * The namespace of the pod where the command is executed. + */ + // const podNamespace = 'abc123' + /** + * If true, the execution is terminated forcefully (SIGKILL). If false, the + * execution is stopped gracefully, giving it time for cleanup. + */ + // const force = true + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callStopAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.stopAirflowCommand(request); + console.log(response); + } + + callStopAirflowCommand(); + // [END composer_v1_generated_Environments_StopAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json index 2574653386d6..4d67751b1e09 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json @@ -231,6 +231,170 @@ } } }, + { + "regionTag": "composer_v1_generated_Environments_ExecuteAirflowCommand_async", + "title": "Environments executeAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Executes Airflow CLI command.", + "canonical": true, + "file": "environments.execute_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ExecuteAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "command", + "type": "TYPE_STRING" + }, + { + "name": "subcommand", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "ExecuteAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ExecuteAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_StopAirflowCommand_async", + "title": "Environments stopAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Stops Airflow CLI command execution.", + "canonical": true, + "file": "environments.stop_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.StopAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "execution_id", + "type": "TYPE_STRING" + }, + { + "name": "pod", + "type": "TYPE_STRING" + }, + { + "name": "pod_namespace", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "StopAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.StopAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_PollAirflowCommand_async", + "title": "Environments pollAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Polls Airflow CLI command execution and fetches logs.", + "canonical": true, + "file": "environments.poll_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PollAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.PollAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "execution_id", + "type": "TYPE_STRING" + }, + { + "name": "pod", + "type": "TYPE_STRING" + }, + { + "name": "pod_namespace", + "type": "TYPE_STRING" + }, + { + "name": "next_line_number", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "PollAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.PollAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, { "regionTag": "composer_v1_generated_Environments_SaveSnapshot_async", "title": "Environments saveSnapshot Sample", @@ -335,6 +499,86 @@ } } }, + { + "regionTag": "composer_v1_generated_Environments_DatabaseFailover_async", + "title": "Environments databaseFailover Sample", + "origin": "API_DEFINITION", + "description": " Triggers database failover (only for highly resilient environments).", + "canonical": true, + "file": "environments.database_failover.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DatabaseFailover", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DatabaseFailover", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "DatabaseFailover", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DatabaseFailover", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_FetchDatabaseProperties_async", + "title": "Environments fetchDatabaseProperties Sample", + "origin": "API_DEFINITION", + "description": " Fetches database properties.", + "canonical": true, + "file": "environments.fetch_database_properties.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDatabaseProperties", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.FetchDatabaseProperties", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "FetchDatabaseProperties", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.FetchDatabaseProperties", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, { "regionTag": "composer_v1_generated_ImageVersions_ListImageVersions_async", "title": "Environments listImageVersions Sample", diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.js new file mode 100644 index 000000000000..bb558fa65044 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.database_failover.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() { + // [START composer_v1beta1_generated_Environments_DatabaseFailover_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. + */ + /** + * Target environment: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callDatabaseFailover() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.databaseFailover(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDatabaseFailover(); + // [END composer_v1beta1_generated_Environments_DatabaseFailover_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.js new file mode 100644 index 000000000000..811d32751c3c --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.execute_airflow_command.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() { + // [START composer_v1beta1_generated_Environments_ExecuteAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + */ + // const environment = 'abc123' + /** + * Airflow command. + */ + // const command = 'abc123' + /** + * Airflow subcommand. + */ + // const subcommand = 'abc123' + /** + * Parameters for the Airflow command/subcommand as an array of arguments. + * It may contain positional arguments like `["my-dag-id"]`, key-value + * parameters like `["--foo=bar"]` or `["--foo","bar"]`, + * or other flags like `["-f"]`. + */ + // const parameters = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callExecuteAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.executeAirflowCommand(request); + console.log(response); + } + + callExecuteAirflowCommand(); + // [END composer_v1beta1_generated_Environments_ExecuteAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.js new file mode 100644 index 000000000000..29d78af48ca2 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.fetch_database_properties.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(environment) { + // [START composer_v1beta1_generated_Environments_FetchDatabaseProperties_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the environment, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callFetchDatabaseProperties() { + // Construct request + const request = { + environment, + }; + + // Run request + const response = await serviceClient.fetchDatabaseProperties(request); + console.log(response); + } + + callFetchDatabaseProperties(); + // [END composer_v1beta1_generated_Environments_FetchDatabaseProperties_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js new file mode 100644 index 000000000000..45909ccfdbc0 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.poll_airflow_command.js @@ -0,0 +1,77 @@ +// 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() { + // [START composer_v1beta1_generated_Environments_PollAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * The unique ID of the command execution. + */ + // const executionId = 'abc123' + /** + * The name of the pod where the command is executed. + */ + // const pod = 'abc123' + /** + * The namespace of the pod where the command is executed. + */ + // const podNamespace = 'abc123' + /** + * Line number from which new logs should be fetched. + */ + // const nextLineNumber = 1234 + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callPollAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.pollAirflowCommand(request); + console.log(response); + } + + callPollAirflowCommand(); + // [END composer_v1beta1_generated_Environments_PollAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js new file mode 100644 index 000000000000..5a2140f7fef6 --- /dev/null +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.stop_airflow_command.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START composer_v1beta1_generated_Environments_StopAirflowCommand_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. + */ + /** + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + */ + // const environment = 'abc123' + /** + * The unique ID of the command execution. + */ + // const executionId = 'abc123' + /** + * The name of the pod where the command is executed. + */ + // const pod = 'abc123' + /** + * The namespace of the pod where the command is executed. + */ + // const podNamespace = 'abc123' + /** + * If true, the execution is terminated forcefully (SIGKILL). If false, the + * execution is stopped gracefully, giving it time for cleanup. + */ + // const force = true + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callStopAirflowCommand() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.stopAirflowCommand(request); + console.log(response); + } + + callStopAirflowCommand(); + // [END composer_v1beta1_generated_Environments_StopAirflowCommand_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json index 94d4af180169..e200cc716440 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json @@ -315,6 +315,170 @@ } } }, + { + "regionTag": "composer_v1beta1_generated_Environments_ExecuteAirflowCommand_async", + "title": "Environments executeAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Executes Airflow CLI command.", + "canonical": true, + "file": "environments.execute_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ExecuteAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "command", + "type": "TYPE_STRING" + }, + { + "name": "subcommand", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "ExecuteAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ExecuteAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_StopAirflowCommand_async", + "title": "Environments stopAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Stops Airflow CLI command execution.", + "canonical": true, + "file": "environments.stop_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.StopAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "execution_id", + "type": "TYPE_STRING" + }, + { + "name": "pod", + "type": "TYPE_STRING" + }, + { + "name": "pod_namespace", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "StopAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.StopAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_PollAirflowCommand_async", + "title": "Environments pollAirflowCommand Sample", + "origin": "API_DEFINITION", + "description": " Polls Airflow CLI command execution and fetches logs.", + "canonical": true, + "file": "environments.poll_airflow_command.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PollAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.PollAirflowCommand", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "execution_id", + "type": "TYPE_STRING" + }, + { + "name": "pod", + "type": "TYPE_STRING" + }, + { + "name": "pod_namespace", + "type": "TYPE_STRING" + }, + { + "name": "next_line_number", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "PollAirflowCommand", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.PollAirflowCommand", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, { "regionTag": "composer_v1beta1_generated_Environments_SaveSnapshot_async", "title": "Environments saveSnapshot Sample", @@ -419,6 +583,86 @@ } } }, + { + "regionTag": "composer_v1beta1_generated_Environments_DatabaseFailover_async", + "title": "Environments databaseFailover Sample", + "origin": "API_DEFINITION", + "description": " Triggers database failover (only for highly resilient environments).", + "canonical": true, + "file": "environments.database_failover.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DatabaseFailover", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DatabaseFailover", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "DatabaseFailover", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DatabaseFailover", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_FetchDatabaseProperties_async", + "title": "Environments fetchDatabaseProperties Sample", + "origin": "API_DEFINITION", + "description": " Fetches database properties.", + "canonical": true, + "file": "environments.fetch_database_properties.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDatabaseProperties", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.FetchDatabaseProperties", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "FetchDatabaseProperties", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.FetchDatabaseProperties", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, { "regionTag": "composer_v1beta1_generated_ImageVersions_ListImageVersions_async", "title": "Environments listImageVersions Sample", diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts index 81e1926e66fd..3c1329b188f9 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts @@ -255,6 +255,12 @@ export class EnvironmentsClient { const loadSnapshotMetadata = protoFilesRoot.lookup( '.google.cloud.orchestration.airflow.service.v1.OperationMetadata' ) as gax.protobuf.Type; + const databaseFailoverResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse' + ) as gax.protobuf.Type; + const databaseFailoverMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEnvironment: new this._gaxModule.LongrunningDescriptor( @@ -282,6 +288,11 @@ export class EnvironmentsClient { loadSnapshotResponse.decode.bind(loadSnapshotResponse), loadSnapshotMetadata.decode.bind(loadSnapshotMetadata) ), + databaseFailover: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + databaseFailoverResponse.decode.bind(databaseFailoverResponse), + databaseFailoverMetadata.decode.bind(databaseFailoverMetadata) + ), }; // Put together the default options sent with requests. @@ -340,8 +351,13 @@ export class EnvironmentsClient { 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', + 'executeAirflowCommand', + 'stopAirflowCommand', + 'pollAirflowCommand', 'saveSnapshot', 'loadSnapshot', + 'databaseFailover', + 'fetchDatabaseProperties', ]; for (const methodName of environmentsStubMethods) { const callPromise = this.environmentsStub.then( @@ -526,6 +542,428 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.getEnvironment(request, options, callback); } + /** + * Executes Airflow CLI command. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + * @param {string} request.command + * Airflow command. + * @param {string} request.subcommand + * Airflow subcommand. + * @param {string[]} request.parameters + * Parameters for the Airflow command/subcommand as an array of arguments. + * It may contain positional arguments like `["my-dag-id"]`, key-value + * parameters like `["--foo=bar"]` or `["--foo","bar"]`, + * or other flags like `["-f"]`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse | ExecuteAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/environments.execute_airflow_command.js + * region_tag:composer_v1_generated_Environments_ExecuteAirflowCommand_async + */ + executeAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + executeAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executeAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executeAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.executeAirflowCommand(request, options, callback); + } + /** + * Stops Airflow CLI command execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + * @param {string} request.executionId + * The unique ID of the command execution. + * @param {string} request.pod + * The name of the pod where the command is executed. + * @param {string} request.podNamespace + * The namespace of the pod where the command is executed. + * @param {boolean} request.force + * If true, the execution is terminated forcefully (SIGKILL). If false, the + * execution is stopped gracefully, giving it time for cleanup. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1.StopAirflowCommandResponse | StopAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/environments.stop_airflow_command.js + * region_tag:composer_v1_generated_Environments_StopAirflowCommand_async + */ + stopAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + stopAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopAirflowCommand(request, options, callback); + } + /** + * Polls Airflow CLI command execution and fetches logs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.executionId + * The unique ID of the command execution. + * @param {string} request.pod + * The name of the pod where the command is executed. + * @param {string} request.podNamespace + * The namespace of the pod where the command is executed. + * @param {number} request.nextLineNumber + * Line number from which new logs should be fetched. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1.PollAirflowCommandResponse | PollAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/environments.poll_airflow_command.js + * region_tag:composer_v1_generated_Environments_PollAirflowCommand_async + */ + pollAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + pollAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pollAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pollAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.pollAirflowCommand(request, options, callback); + } + /** + * Fetches database properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. The resource name of the environment, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse | FetchDatabasePropertiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/environments.fetch_database_properties.js + * region_tag:composer_v1_generated_Environments_FetchDatabaseProperties_async + */ + fetchDatabaseProperties( + request?: protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | undefined + ), + {} | undefined + ] + >; + fetchDatabaseProperties( + request: protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDatabaseProperties( + request: protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDatabaseProperties( + request?: protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.fetchDatabaseProperties( + request, + options, + callback + ); + } /** * Create a new environment. @@ -1375,6 +1813,145 @@ export class EnvironmentsClient { protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata >; } + /** + * Triggers database failover (only for highly resilient environments). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Target environment: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/environments.database_failover.js + * region_tag:composer_v1_generated_Environments_DatabaseFailover_async + */ + databaseFailover( + request?: protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + databaseFailover( + request: protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + databaseFailover( + request: protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + databaseFailover( + request?: protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.databaseFailover(request, options, callback); + } + /** + * Check the status of the long running operation returned by `databaseFailover()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/environments.database_failover.js + * region_tag:composer_v1_generated_Environments_DatabaseFailover_async + */ + async checkDatabaseFailoverProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.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.databaseFailover, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata + >; + } /** * List environments. * diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json index 2f3d92af1f0f..f6e68e307179 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json @@ -40,6 +40,18 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ExecuteAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PollAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "SaveSnapshot": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" @@ -47,6 +59,14 @@ "LoadSnapshot": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "DatabaseFailover": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchDatabaseProperties": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json b/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json index 0bb4722298e6..0ab43de4e608 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json @@ -15,6 +15,26 @@ "getEnvironment" ] }, + "ExecuteAirflowCommand": { + "methods": [ + "executeAirflowCommand" + ] + }, + "StopAirflowCommand": { + "methods": [ + "stopAirflowCommand" + ] + }, + "PollAirflowCommand": { + "methods": [ + "pollAirflowCommand" + ] + }, + "FetchDatabaseProperties": { + "methods": [ + "fetchDatabaseProperties" + ] + }, "CreateEnvironment": { "methods": [ "createEnvironment" @@ -40,6 +60,11 @@ "loadSnapshot" ] }, + "DatabaseFailover": { + "methods": [ + "databaseFailover" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -57,6 +82,26 @@ "getEnvironment" ] }, + "ExecuteAirflowCommand": { + "methods": [ + "executeAirflowCommand" + ] + }, + "StopAirflowCommand": { + "methods": [ + "stopAirflowCommand" + ] + }, + "PollAirflowCommand": { + "methods": [ + "pollAirflowCommand" + ] + }, + "FetchDatabaseProperties": { + "methods": [ + "fetchDatabaseProperties" + ] + }, "CreateEnvironment": { "methods": [ "createEnvironment" @@ -82,6 +127,11 @@ "loadSnapshot" ] }, + "DatabaseFailover": { + "methods": [ + "databaseFailover" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts index 254f808b2c31..ed06642600fe 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts @@ -267,6 +267,12 @@ export class EnvironmentsClient { const loadSnapshotMetadata = protoFilesRoot.lookup( '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata' ) as gax.protobuf.Type; + const databaseFailoverResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse' + ) as gax.protobuf.Type; + const databaseFailoverMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEnvironment: new this._gaxModule.LongrunningDescriptor( @@ -304,6 +310,11 @@ export class EnvironmentsClient { loadSnapshotResponse.decode.bind(loadSnapshotResponse), loadSnapshotMetadata.decode.bind(loadSnapshotMetadata) ), + databaseFailover: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + databaseFailoverResponse.decode.bind(databaseFailoverResponse), + databaseFailoverMetadata.decode.bind(databaseFailoverMetadata) + ), }; // Put together the default options sent with requests. @@ -364,8 +375,13 @@ export class EnvironmentsClient { 'deleteEnvironment', 'restartWebServer', 'checkUpgrade', + 'executeAirflowCommand', + 'stopAirflowCommand', + 'pollAirflowCommand', 'saveSnapshot', 'loadSnapshot', + 'databaseFailover', + 'fetchDatabaseProperties', ]; for (const methodName of environmentsStubMethods) { const callPromise = this.environmentsStub.then( @@ -550,6 +566,428 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.getEnvironment(request, options, callback); } + /** + * Executes Airflow CLI command. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + * @param {string} request.command + * Airflow command. + * @param {string} request.subcommand + * Airflow subcommand. + * @param {string[]} request.parameters + * Parameters for the Airflow command/subcommand as an array of arguments. + * It may contain positional arguments like `["my-dag-id"]`, key-value + * parameters like `["--foo=bar"]` or `["--foo","bar"]`, + * or other flags like `["-f"]`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse | ExecuteAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.execute_airflow_command.js + * region_tag:composer_v1beta1_generated_Environments_ExecuteAirflowCommand_async + */ + executeAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + executeAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executeAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + executeAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.executeAirflowCommand(request, options, callback); + } + /** + * Stops Airflow CLI command execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}". + * @param {string} request.executionId + * The unique ID of the command execution. + * @param {string} request.pod + * The name of the pod where the command is executed. + * @param {string} request.podNamespace + * The namespace of the pod where the command is executed. + * @param {boolean} request.force + * If true, the execution is terminated forcefully (SIGKILL). If false, the + * execution is stopped gracefully, giving it time for cleanup. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse | StopAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.stop_airflow_command.js + * region_tag:composer_v1beta1_generated_Environments_StopAirflowCommand_async + */ + stopAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + stopAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopAirflowCommand(request, options, callback); + } + /** + * Polls Airflow CLI command execution and fetches logs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.executionId + * The unique ID of the command execution. + * @param {string} request.pod + * The name of the pod where the command is executed. + * @param {string} request.podNamespace + * The namespace of the pod where the command is executed. + * @param {number} request.nextLineNumber + * Line number from which new logs should be fetched. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse | PollAirflowCommandResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.poll_airflow_command.js + * region_tag:composer_v1beta1_generated_Environments_PollAirflowCommand_async + */ + pollAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | undefined + ), + {} | undefined + ] + >; + pollAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pollAirflowCommand( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pollAirflowCommand( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.pollAirflowCommand(request, options, callback); + } + /** + * Fetches database properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. The resource name of the environment, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse | FetchDatabasePropertiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.fetch_database_properties.js + * region_tag:composer_v1beta1_generated_Environments_FetchDatabaseProperties_async + */ + fetchDatabaseProperties( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | undefined + ), + {} | undefined + ] + >; + fetchDatabaseProperties( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDatabaseProperties( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDatabaseProperties( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse, + ( + | protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesRequest + | 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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.fetchDatabaseProperties( + request, + options, + callback + ); + } /** * Create a new environment. @@ -1727,6 +2165,145 @@ export class EnvironmentsClient { protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata >; } + /** + * Triggers database failover (only for highly resilient environments). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Target environment: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.database_failover.js + * region_tag:composer_v1beta1_generated_Environments_DatabaseFailover_async + */ + databaseFailover( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + databaseFailover( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + databaseFailover( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + databaseFailover( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.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({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.databaseFailover(request, options, callback); + } + /** + * Check the status of the long running operation returned by `databaseFailover()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/environments.database_failover.js + * region_tag:composer_v1beta1_generated_Environments_DatabaseFailover_async + */ + async checkDatabaseFailoverProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.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.databaseFailover, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata + >; + } /** * List environments. * diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json index f31d666bb58c..2e42d5f60013 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json @@ -48,6 +48,18 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ExecuteAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PollAirflowCommand": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "SaveSnapshot": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" @@ -55,6 +67,14 @@ "LoadSnapshot": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "DatabaseFailover": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchDatabaseProperties": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json index 7dfe380be56f..2271ff732a2e 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json @@ -15,6 +15,26 @@ "getEnvironment" ] }, + "ExecuteAirflowCommand": { + "methods": [ + "executeAirflowCommand" + ] + }, + "StopAirflowCommand": { + "methods": [ + "stopAirflowCommand" + ] + }, + "PollAirflowCommand": { + "methods": [ + "pollAirflowCommand" + ] + }, + "FetchDatabaseProperties": { + "methods": [ + "fetchDatabaseProperties" + ] + }, "CreateEnvironment": { "methods": [ "createEnvironment" @@ -50,6 +70,11 @@ "loadSnapshot" ] }, + "DatabaseFailover": { + "methods": [ + "databaseFailover" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -67,6 +92,26 @@ "getEnvironment" ] }, + "ExecuteAirflowCommand": { + "methods": [ + "executeAirflowCommand" + ] + }, + "StopAirflowCommand": { + "methods": [ + "stopAirflowCommand" + ] + }, + "PollAirflowCommand": { + "methods": [ + "pollAirflowCommand" + ] + }, + "FetchDatabaseProperties": { + "methods": [ + "fetchDatabaseProperties" + ] + }, "CreateEnvironment": { "methods": [ "createEnvironment" @@ -102,6 +147,11 @@ "loadSnapshot" ] }, + "DatabaseFailover": { + "methods": [ + "databaseFailover" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", diff --git a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts index 8ab036d94b1b..0af0ce5ba2f1 100644 --- a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts +++ b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts @@ -387,6 +387,542 @@ describe('v1.EnvironmentsClient', () => { }); }); + describe('executeAirflowCommand', () => { + it('invokes executeAirflowCommand without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse() + ); + client.innerApiCalls.executeAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.executeAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse() + ); + client.innerApiCalls.executeAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1.IExecuteAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.executeAirflowCommand(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.executeAirflowCommand(request), + expectedError + ); + }); + }); + + describe('stopAirflowCommand', () => { + it('invokes stopAirflowCommand without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse() + ); + client.innerApiCalls.stopAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.stopAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse() + ); + client.innerApiCalls.stopAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1.IStopAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.stopAirflowCommand(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopAirflowCommand(request), expectedError); + }); + }); + + describe('pollAirflowCommand', () => { + it('invokes pollAirflowCommand without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse() + ); + client.innerApiCalls.pollAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.pollAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse() + ); + client.innerApiCalls.pollAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pollAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1.IPollAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pollAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.pollAirflowCommand(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pollAirflowCommand(request), expectedError); + }); + }); + + describe('fetchDatabaseProperties', () => { + it('invokes fetchDatabaseProperties without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse() + ); + client.innerApiCalls.fetchDatabaseProperties = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchDatabaseProperties(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse() + ); + client.innerApiCalls.fetchDatabaseProperties = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDatabaseProperties( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1.IFetchDatabasePropertiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDatabaseProperties = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.fetchDatabaseProperties(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties with closed client', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.fetchDatabaseProperties(request), + expectedError + ); + }); + }); + describe('createEnvironment', () => { it('invokes createEnvironment without error', async () => { const client = new environmentsModule.v1.EnvironmentsClient({ @@ -1349,6 +1885,200 @@ describe('v1.EnvironmentsClient', () => { }); }); + describe('databaseFailover', () => { + it('invokes databaseFailover without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.databaseFailover = + stubLongRunningCall(expectedResponse); + const [operation] = await client.databaseFailover(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.databaseFailover = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.databaseFailover( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.databaseFailover = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.databaseFailover(request), expectedError); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.databaseFailover = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.databaseFailover(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDatabaseFailoverProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkDatabaseFailoverProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDatabaseFailoverProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkDatabaseFailoverProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEnvironments', () => { it('invokes listEnvironments without error', async () => { const client = new environmentsModule.v1.EnvironmentsClient({ diff --git a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts index e25ceba6cbba..3a3cf6043716 100644 --- a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts +++ b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts @@ -389,6 +389,542 @@ describe('v1beta1.EnvironmentsClient', () => { }); }); + describe('executeAirflowCommand', () => { + it('invokes executeAirflowCommand without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse() + ); + client.innerApiCalls.executeAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.executeAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse() + ); + client.innerApiCalls.executeAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.executeAirflowCommand(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.executeAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.executeAirflowCommand(request), + expectedError + ); + }); + }); + + describe('stopAirflowCommand', () => { + it('invokes stopAirflowCommand without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse() + ); + client.innerApiCalls.stopAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.stopAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse() + ); + client.innerApiCalls.stopAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IStopAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.stopAirflowCommand(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopAirflowCommand(request), expectedError); + }); + }); + + describe('pollAirflowCommand', () => { + it('invokes pollAirflowCommand without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse() + ); + client.innerApiCalls.pollAirflowCommand = + stubSimpleCall(expectedResponse); + const [response] = await client.pollAirflowCommand(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse() + ); + client.innerApiCalls.pollAirflowCommand = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pollAirflowCommand( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pollAirflowCommand = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.pollAirflowCommand(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pollAirflowCommand as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pollAirflowCommand with closed client', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pollAirflowCommand(request), expectedError); + }); + }); + + describe('fetchDatabaseProperties', () => { + it('invokes fetchDatabaseProperties without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse() + ); + client.innerApiCalls.fetchDatabaseProperties = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchDatabaseProperties(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse() + ); + client.innerApiCalls.fetchDatabaseProperties = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDatabaseProperties( + request, + ( + err?: Error | null, + result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IFetchDatabasePropertiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDatabaseProperties = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.fetchDatabaseProperties(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatabaseProperties as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatabaseProperties with closed client', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.fetchDatabaseProperties(request), + expectedError + ); + }); + }); + describe('createEnvironment', () => { it('invokes createEnvironment without error', async () => { const client = new environmentsModule.v1beta1.EnvironmentsClient({ @@ -1735,6 +2271,200 @@ describe('v1beta1.EnvironmentsClient', () => { }); }); + describe('databaseFailover', () => { + it('invokes databaseFailover without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.databaseFailover = + stubLongRunningCall(expectedResponse); + const [operation] = await client.databaseFailover(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.databaseFailover = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.databaseFailover( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.IDatabaseFailoverResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.databaseFailover = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.databaseFailover(request), expectedError); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes databaseFailover with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.databaseFailover = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.databaseFailover(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.databaseFailover as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDatabaseFailoverProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkDatabaseFailoverProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDatabaseFailoverProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkDatabaseFailoverProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEnvironments', () => { it('invokes listEnvironments without error', async () => { const client = new environmentsModule.v1beta1.EnvironmentsClient({ From dbeeab9d02f246994b865691f8ee4c6d539946fd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Jun 2023 00:48:13 +0000 Subject: [PATCH 46/46] chore: release main (#4331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* ---
batch: 0.9.0 ## [0.9.0](https://togithub.com/googleapis/google-cloud-node/compare/batch-v0.8.0...batch-v0.9.0) (2023-06-14) ### Features * [batch] implement minCpuPlatform ([d4d75c6](https://togithub.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9)) * Update TaskGroup doc ([d4d75c6](https://togithub.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9)) * **v1:** [batch] Add support for scheduling_policy ([#4340](https://togithub.com/googleapis/google-cloud-node/issues/4340)) ([d4d75c6](https://togithub.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9))
dialogflow-cx: 3.6.0 ## [3.6.0](https://togithub.com/googleapis/google-cloud-node/compare/dialogflow-cx-v3.5.0...dialogflow-cx-v3.6.0) (2023-06-14) ### Features * [dialogflow-cx] add support for flexible webhook ([64af37a](https://togithub.com/googleapis/google-cloud-node/commit/64af37afa0abccf87378b4813a26fbaba3ae8bb8)) * [dialogflow-cx] add support for flexible webhook ([#4334](https://togithub.com/googleapis/google-cloud-node/issues/4334)) ([64af37a](https://togithub.com/googleapis/google-cloud-node/commit/64af37afa0abccf87378b4813a26fbaba3ae8bb8))
discoveryengine: 0.7.0 ## [0.7.0](https://togithub.com/googleapis/google-cloud-node/compare/discoveryengine-v0.6.0...discoveryengine-v0.7.0) (2023-06-14) ### âš  BREAKING CHANGES * use v1 as the default version ([#4333](https://togithub.com/googleapis/google-cloud-node/issues/4333)) * [discoveryengine] remove the summarization feature from v1 version ([#4273](https://togithub.com/googleapis/google-cloud-node/issues/4273)) ### Features * Use v1 as the default version ([#4333](https://togithub.com/googleapis/google-cloud-node/issues/4333)) ([1415f5f](https://togithub.com/googleapis/google-cloud-node/commit/1415f5f0cdbd284fb11427fe1053048e278e7546)) ### Bug Fixes * [discoveryengine] remove the summarization feature from v1 version ([#4273](https://togithub.com/googleapis/google-cloud-node/issues/4273)) ([0b9c928](https://togithub.com/googleapis/google-cloud-node/commit/0b9c928a45e5de78dd13894dc537b351f90a9d56))
orchestration-airflow: 2.5.0 ## [2.5.0](https://togithub.com/googleapis/google-cloud-node/compare/orchestration-airflow-v2.4.0...orchestration-airflow-v2.5.0) (2023-06-14) ### Features * [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties ([33373fd](https://togithub.com/googleapis/google-cloud-node/commit/33373fd503fd476ed5d5a6ced1e48d86dc0459e1)) * [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties ([#4341](https://togithub.com/googleapis/google-cloud-node/issues/4341)) ([33373fd](https://togithub.com/googleapis/google-cloud-node/commit/33373fd503fd476ed5d5a6ced1e48d86dc0459e1))
security-center: 7.5.0 ## [7.5.0](https://togithub.com/googleapis/google-cloud-node/compare/security-center-v7.4.0...security-center-v7.5.0) (2023-06-14) ### Features * [securitycenter] Add user agent and DLP parent type fields to finding's list of attributes ([#4332](https://togithub.com/googleapis/google-cloud-node/issues/4332)) ([0552bb9](https://togithub.com/googleapis/google-cloud-node/commit/0552bb983dae0d565a68fd9ab315c40492f13e46))
vmwareengine: 0.2.0 ## [0.2.0](https://togithub.com/googleapis/google-cloud-node/compare/vmwareengine-v0.1.2...vmwareengine-v0.2.0) (2023-06-14) ### Features * [vmwareengine] Adding private connection CRUD, updating management subnets and time-limited PC features ([#4328](https://togithub.com/googleapis/google-cloud-node/issues/4328)) ([f12063c](https://togithub.com/googleapis/google-cloud-node/commit/f12063c60a4c8ea05e6269babe2eaa6775974c6f))
container: 4.13.0 ## [4.13.0](https://togithub.com/googleapis/google-cloud-node/compare/container-v4.12.0...container-v4.13.0) (2023-06-14) ### Features * [container] add API for GPU driver installation config ([f5b1533](https://togithub.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) * [container] add API for GPU driver installation config ([#4330](https://togithub.com/googleapis/google-cloud-node/issues/4330)) ([f5b1533](https://togithub.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) * Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters ([f5b1533](https://togithub.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) * Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters ([f5b1533](https://togithub.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5))
alloydb: 0.2.0 ## [0.2.0](https://togithub.com/googleapis/google-cloud-node/compare/alloydb-v0.1.1...alloydb-v0.2.0) (2023-06-14) ### Features * [alloydb] Added ClusterView supporting more granular view of continuous backups ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * [alloydb] Added ClusterView supporting more granular view of continuous backups ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * [alloydb] Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([#4336](https://togithub.com/googleapis/google-cloud-node/issues/4336)) ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added cluster network config ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added cluster network config ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added fault injection API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added fault injection API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added fault injection API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added instance update policy ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added instance update policy ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added support for continuous backups ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added support for cross-region replication (secondary clusters/instances and promotion) ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added users API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added users API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Added users API ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) ### Bug Fixes * Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) * Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://togithub.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f))
rapidmigrationassessment: 0.1.0 ## 0.1.0 (2023-06-14) ### Features * Add initial files for google.cloud.rapidmigrationassessment.v1 ([#4335](https://togithub.com/googleapis/google-cloud-node/issues/4335)) ([e1211f0](https://togithub.com/googleapis/google-cloud-node/commit/e1211f0b2bc1557cca5ba63949ef1fb8cdacedf6))
--- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 19 +- changelog.json | 322 +++++++++++++++++- packages/google-cloud-alloydb/CHANGELOG.md | 30 ++ packages/google-cloud-alloydb/package.json | 2 +- ...ppet_metadata.google.cloud.alloydb.v1.json | 2 +- ...metadata.google.cloud.alloydb.v1alpha.json | 2 +- ..._metadata.google.cloud.alloydb.v1beta.json | 2 +- .../google-cloud-alloydb/samples/package.json | 2 +- packages/google-cloud-batch/CHANGELOG.md | 9 + packages/google-cloud-batch/package.json | 2 +- ...nippet_metadata.google.cloud.batch.v1.json | 2 +- ...t_metadata.google.cloud.batch.v1alpha.json | 2 +- .../google-cloud-batch/samples/package.json | 2 +- .../google-cloud-dialogflow-cx/CHANGELOG.md | 8 + .../google-cloud-dialogflow-cx/package.json | 2 +- ...etadata.google.cloud.dialogflow.cx.v3.json | 2 +- ...ta.google.cloud.dialogflow.cx.v3beta1.json | 2 +- .../samples/package.json | 2 +- .../google-cloud-discoveryengine/CHANGELOG.md | 17 + .../google-cloud-discoveryengine/package.json | 2 +- ...adata.google.cloud.discoveryengine.v1.json | 2 +- ...a.google.cloud.discoveryengine.v1beta.json | 2 +- .../samples/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- ...loud.orchestration.airflow.service.v1.json | 2 +- ...orchestration.airflow.service.v1beta1.json | 2 +- .../samples/package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- ...gle.cloud.rapidmigrationassessment.v1.json | 2 +- .../samples/package.json | 2 +- .../google-cloud-securitycenter/CHANGELOG.md | 7 + .../google-cloud-securitycenter/package.json | 2 +- ...tadata.google.cloud.securitycenter.v1.json | 2 +- ...a.google.cloud.securitycenter.v1beta1.json | 2 +- ...google.cloud.securitycenter.v1p1beta1.json | 2 +- .../samples/package.json | 2 +- .../google-cloud-vmwareengine/CHANGELOG.md | 7 + .../google-cloud-vmwareengine/package.json | 2 +- ...metadata.google.cloud.vmwareengine.v1.json | 2 +- .../samples/package.json | 2 +- packages/google-container/CHANGELOG.md | 10 + packages/google-container/package.json | 2 +- .../snippet_metadata.google.container.v1.json | 2 +- ...pet_metadata.google.container.v1beta1.json | 2 +- .../google-container/samples/package.json | 2 +- 47 files changed, 471 insertions(+), 46 deletions(-) create mode 100644 packages/google-cloud-rapidmigrationassessment/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 79951142b85d..1076d54b4073 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -15,7 +15,7 @@ "packages/google-cloud-asset": "4.6.3", "packages/google-cloud-assuredworkloads": "3.6.2", "packages/google-cloud-baremetalsolution": "0.3.2", - "packages/google-cloud-batch": "0.8.0", + "packages/google-cloud-batch": "0.9.0", "packages/google-cloud-beyondcorp-appconnections": "0.3.2", "packages/google-cloud-beyondcorp-appconnectors": "0.4.2", "packages/google-cloud-beyondcorp-appgateways": "0.3.2", @@ -47,8 +47,8 @@ "packages/google-cloud-datastream": "2.3.0", "packages/google-cloud-deploy": "2.6.0", "packages/google-cloud-dialogflow": "5.8.0", - "packages/google-cloud-dialogflow-cx": "3.5.0", - "packages/google-cloud-discoveryengine": "0.6.0", + "packages/google-cloud-dialogflow-cx": "3.6.0", + "packages/google-cloud-discoveryengine": "0.7.0", "packages/google-cloud-documentai": "7.3.1", "packages/google-cloud-domains": "2.2.2", "packages/google-cloud-essentialcontacts": "2.1.2", @@ -78,7 +78,7 @@ "packages/google-cloud-networksecurity": "1.1.2", "packages/google-cloud-notebooks": "2.1.4", "packages/google-cloud-optimization": "2.2.2", - "packages/google-cloud-orchestration-airflow-service": "2.4.0", + "packages/google-cloud-orchestration-airflow-service": "2.5.0", "packages/google-cloud-orgpolicy": "2.1.2", "packages/google-cloud-osconfig": "2.2.2", "packages/google-cloud-oslogin": "4.1.2", @@ -96,7 +96,7 @@ "packages/google-cloud-secretmanager": "4.2.2", "packages/google-cloud-security-privateca": "4.4.0", "packages/google-cloud-security-publicca": "0.1.5", - "packages/google-cloud-securitycenter": "7.4.0", + "packages/google-cloud-securitycenter": "7.5.0", "packages/google-cloud-servicedirectory": "4.0.7", "packages/google-cloud-shell": "2.1.2", "packages/google-cloud-speech": "5.5.0", @@ -111,12 +111,12 @@ "packages/google-cloud-videointelligence": "4.2.2", "packages/google-cloud-vision": "3.1.3", "packages/google-cloud-vmmigration": "2.3.2", - "packages/google-cloud-vmwareengine": "0.1.2", + "packages/google-cloud-vmwareengine": "0.2.0", "packages/google-cloud-vpcaccess": "2.2.2", "packages/google-cloud-webrisk": "3.3.0", "packages/google-cloud-websecurityscanner": "2.1.5", "packages/google-cloud-workflows-executions": "2.3.2", - "packages/google-container": "4.12.0", + "packages/google-container": "4.13.0", "packages/google-dataflow": "2.1.2", "packages/google-devtools-artifactregistry": "2.2.2", "packages/google-devtools-cloudbuild": "3.6.0", @@ -134,11 +134,12 @@ "packages/typeless-sample-bot": "1.3.3", "packages/google-cloud-advisorynotifications": "0.2.1", "packages/google-cloud-kms-inventory": "0.1.1", - "packages/google-cloud-alloydb": "0.1.1", + "packages/google-cloud-alloydb": "0.2.0", "packages/google-cloud-workstations": "0.2.0", "packages/google-cloud-confidentialcomputing": "0.1.0", "packages/google-ai-generativelanguage": "0.2.0", "packages/google-cloud-storageinsights": "0.1.1", "packages/google-maps-places": "0.1.0", - "packages/google-cloud-support": "0.1.0" + "packages/google-cloud-support": "0.1.0", + "packages/google-cloud-rapidmigrationassessment": "0.1.0" } diff --git a/changelog.json b/changelog.json index 3e6f05f6668d..19af3d97253e 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,326 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "e1211f0b2bc1557cca5ba63949ef1fb8cdacedf6", + "message": "Add initial files for google.cloud.rapidmigrationassessment.v1", + "issues": [ + "4335" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/rapidmigrationassessment", + "id": "c783f4fa-6bee-412a-b171-ddde106190e8", + "createTime": "2023-06-14T23:55:54.096Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added support for continuous backups", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added support for cross-region replication (secondary clusters/instances and promotion)", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added users API", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added fault injection API", + "issues": [] + }, + { + "type": "fix", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "[alloydb] Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY", + "issues": [ + "4336" + ] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added users API", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added fault injection API", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added instance update policy", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added cluster network config", + "issues": [] + }, + { + "type": "fix", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "[alloydb] Added ClusterView supporting more granular view of continuous backups", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added users API", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added fault injection API", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added instance update policy", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Added cluster network config", + "issues": [] + }, + { + "type": "fix", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA", + "issues": [] + }, + { + "type": "feat", + "sha": "342a28c3e06848325744e9d80a046ca1ed4dbc5f", + "message": "[alloydb] Added ClusterView supporting more granular view of continuous backups", + "issues": [] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "d30b2c5e-0fb5-4bb2-a817-3879ca86bffd", + "createTime": "2023-06-14T23:55:54.093Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f5b153353788f4df4fee6d19a6cd013fe6bb29f5", + "message": "Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters", + "issues": [] + }, + { + "type": "feat", + "sha": "f5b153353788f4df4fee6d19a6cd013fe6bb29f5", + "message": "[container] add API for GPU driver installation config", + "issues": [ + "4330" + ] + }, + { + "type": "feat", + "sha": "f5b153353788f4df4fee6d19a6cd013fe6bb29f5", + "message": "Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters", + "issues": [] + }, + { + "type": "feat", + "sha": "f5b153353788f4df4fee6d19a6cd013fe6bb29f5", + "message": "[container] add API for GPU driver installation config", + "issues": [] + } + ], + "version": "4.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "dfd03816-9f6c-41a8-824c-57e00500f8db", + "createTime": "2023-06-14T23:55:54.089Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f12063c60a4c8ea05e6269babe2eaa6775974c6f", + "message": "[vmwareengine] Adding private connection CRUD, updating management subnets and time-limited PC features", + "issues": [ + "4328" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vmwareengine", + "id": "6852a2f3-04e8-4c4e-8495-fa41f1d2de38", + "createTime": "2023-06-14T23:55:54.084Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0552bb983dae0d565a68fd9ab315c40492f13e46", + "message": "[securitycenter] Add user agent and DLP parent type fields to finding's list of attributes", + "issues": [ + "4332" + ] + } + ], + "version": "7.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-center", + "id": "3a1c2da7-5077-4944-a6ac-ece0dfd23e96", + "createTime": "2023-06-14T23:55:54.081Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "33373fd503fd476ed5d5a6ced1e48d86dc0459e1", + "message": "[orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties", + "issues": [ + "4341" + ] + }, + { + "type": "feat", + "sha": "33373fd503fd476ed5d5a6ced1e48d86dc0459e1", + "message": "[orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties", + "issues": [] + } + ], + "version": "2.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/orchestration-airflow", + "id": "67accf6e-9534-4c0d-9da3-1c428e767ba1", + "createTime": "2023-06-14T23:55:54.078Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "1415f5f0cdbd284fb11427fe1053048e278e7546", + "message": "Use v1 as the default version", + "issues": [ + "4333" + ], + "breakingChangeNote": "use v1 as the default version ([#4333](https://github.com/googleapis/google-cloud-node/issues/4333))" + }, + { + "type": "fix", + "sha": "0b9c928a45e5de78dd13894dc537b351f90a9d56", + "message": "[discoveryengine] remove the summarization feature from v1 version", + "issues": [ + "4273" + ], + "breakingChangeNote": "[discoveryengine] remove the summarization feature from v1 version ([#4273](https://github.com/googleapis/google-cloud-node/issues/4273))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/discoveryengine", + "id": "42a546c9-32bf-4ba2-a467-a4c43ed44ece", + "createTime": "2023-06-14T23:55:54.075Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "64af37afa0abccf87378b4813a26fbaba3ae8bb8", + "message": "[dialogflow-cx] add support for flexible webhook", + "issues": [ + "4334" + ] + }, + { + "type": "feat", + "sha": "64af37afa0abccf87378b4813a26fbaba3ae8bb8", + "message": "[dialogflow-cx] add support for flexible webhook", + "issues": [] + } + ], + "version": "3.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dialogflow-cx", + "id": "b5e1cd3f-0558-4e70-b404-36bc8c6d6a55", + "createTime": "2023-06-14T23:55:54.071Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d4d75c629a19649256072d29766e2e692c771ee9", + "message": "[batch] Add support for scheduling_policy", + "issues": [ + "4340" + ], + "scope": "v1" + }, + { + "type": "feat", + "sha": "d4d75c629a19649256072d29766e2e692c771ee9", + "message": "Update TaskGroup doc", + "issues": [] + }, + { + "type": "feat", + "sha": "d4d75c629a19649256072d29766e2e692c771ee9", + "message": "[batch] implement minCpuPlatform", + "issues": [] + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/batch", + "id": "d6936598-bdc4-4429-adeb-9480e50732e2", + "createTime": "2023-06-14T23:55:54.067Z" + }, { "changes": [ { @@ -9977,5 +10297,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2023-06-06T07:04:16.853Z" + "updateTime": "2023-06-14T23:55:54.096Z" } \ No newline at end of file diff --git a/packages/google-cloud-alloydb/CHANGELOG.md b/packages/google-cloud-alloydb/CHANGELOG.md index 2ed956d11742..1c09b3982eac 100644 --- a/packages/google-cloud-alloydb/CHANGELOG.md +++ b/packages/google-cloud-alloydb/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v0.1.1...alloydb-v0.2.0) (2023-06-14) + + +### Features + +* [alloydb] Added ClusterView supporting more granular view of continuous backups ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* [alloydb] Added ClusterView supporting more granular view of continuous backups ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* [alloydb] Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([#4336](https://github.com/googleapis/google-cloud-node/issues/4336)) ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added cluster network config ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added cluster network config ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added fault injection API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added fault injection API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added fault injection API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added instance update policy ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added instance update policy ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added new SSL modes ALLOW_UNENCRYPTED_AND_ENCRYPTED, ENCRYPTED_ONLY ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added support for continuous backups ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added support for cross-region replication (secondary clusters/instances and promotion) ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added users API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added users API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Added users API ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) + + +### Bug Fixes + +* Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) +* Deprecated SSL modes SSL_MODE_ALLOW, SSL_MODE_REQUIRE, SSL_MODE_VERIFY_CA ([342a28c](https://github.com/googleapis/google-cloud-node/commit/342a28c3e06848325744e9d80a046ca1ed4dbc5f)) + ## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/alloydb-v0.1.0...alloydb-v0.1.1) (2023-04-13) diff --git a/packages/google-cloud-alloydb/package.json b/packages/google-cloud-alloydb/package.json index 996af42c5c32..cdbe72fa98b0 100644 --- a/packages/google-cloud-alloydb/package.json +++ b/packages/google-cloud-alloydb/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/alloydb", - "version": "0.1.1", + "version": "0.2.0", "description": "AlloyDB API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json index b5eaef115607..9a1d7cb57ae8 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.1", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json index 0d8ddea316d0..125ebd29198c 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.1", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json index 035e45d80cfd..658301c06ceb 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "0.1.1", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/package.json b/packages/google-cloud-alloydb/samples/package.json index a3fc2c169a9f..e64a0cbec360 100644 --- a/packages/google-cloud-alloydb/samples/package.json +++ b/packages/google-cloud-alloydb/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/alloydb": "^0.1.1" + "@google-cloud/alloydb": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-batch/CHANGELOG.md b/packages/google-cloud-batch/CHANGELOG.md index 0c8cadc43d5a..f9ebedee8f17 100644 --- a/packages/google-cloud-batch/CHANGELOG.md +++ b/packages/google-cloud-batch/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [0.9.0](https://github.com/googleapis/google-cloud-node/compare/batch-v0.8.0...batch-v0.9.0) (2023-06-14) + + +### Features + +* [batch] implement minCpuPlatform ([d4d75c6](https://github.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9)) +* Update TaskGroup doc ([d4d75c6](https://github.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9)) +* **v1:** [batch] Add support for scheduling_policy ([#4340](https://github.com/googleapis/google-cloud-node/issues/4340)) ([d4d75c6](https://github.com/googleapis/google-cloud-node/commit/d4d75c629a19649256072d29766e2e692c771ee9)) + ## [0.8.0](https://github.com/googleapis/google-cloud-node/compare/batch-v0.7.1...batch-v0.8.0) (2023-05-20) diff --git a/packages/google-cloud-batch/package.json b/packages/google-cloud-batch/package.json index c65b199b5f89..e9f739b553b0 100644 --- a/packages/google-cloud-batch/package.json +++ b/packages/google-cloud-batch/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/batch", - "version": "0.8.0", + "version": "0.9.0", "description": "Batch client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json index e54e6b7f46b3..1659c6fa77b1 100644 --- a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json +++ b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "0.8.0", + "version": "0.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json index a0b315e40953..b04e105dd33b 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json +++ b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "0.8.0", + "version": "0.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/package.json b/packages/google-cloud-batch/samples/package.json index d04631569fa8..4143612ea2e2 100644 --- a/packages/google-cloud-batch/samples/package.json +++ b/packages/google-cloud-batch/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/batch": "^0.8.0" + "@google-cloud/batch": "^0.9.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-dialogflow-cx/CHANGELOG.md b/packages/google-cloud-dialogflow-cx/CHANGELOG.md index 49220b088fce..456220fd59d0 100644 --- a/packages/google-cloud-dialogflow-cx/CHANGELOG.md +++ b/packages/google-cloud-dialogflow-cx/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.6.0](https://github.com/googleapis/google-cloud-node/compare/dialogflow-cx-v3.5.0...dialogflow-cx-v3.6.0) (2023-06-14) + + +### Features + +* [dialogflow-cx] add support for flexible webhook ([64af37a](https://github.com/googleapis/google-cloud-node/commit/64af37afa0abccf87378b4813a26fbaba3ae8bb8)) +* [dialogflow-cx] add support for flexible webhook ([#4334](https://github.com/googleapis/google-cloud-node/issues/4334)) ([64af37a](https://github.com/googleapis/google-cloud-node/commit/64af37afa0abccf87378b4813a26fbaba3ae8bb8)) + ## [3.5.0](https://github.com/googleapis/google-cloud-node/compare/dialogflow-cx-v3.4.2...dialogflow-cx-v3.5.0) (2023-05-11) diff --git a/packages/google-cloud-dialogflow-cx/package.json b/packages/google-cloud-dialogflow-cx/package.json index 638cc5a637db..f08914495fb3 100644 --- a/packages/google-cloud-dialogflow-cx/package.json +++ b/packages/google-cloud-dialogflow-cx/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/dialogflow-cx", - "version": "3.5.0", + "version": "3.6.0", "description": "Cx client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3/snippet_metadata.google.cloud.dialogflow.cx.v3.json b/packages/google-cloud-dialogflow-cx/samples/generated/v3/snippet_metadata.google.cloud.dialogflow.cx.v3.json index 4b7a31d54c49..25462c5166f0 100644 --- a/packages/google-cloud-dialogflow-cx/samples/generated/v3/snippet_metadata.google.cloud.dialogflow.cx.v3.json +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3/snippet_metadata.google.cloud.dialogflow.cx.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-cx", - "version": "3.5.0", + "version": "3.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json index 956dd7357453..59bca0f066f2 100644 --- a/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json +++ b/packages/google-cloud-dialogflow-cx/samples/generated/v3beta1/snippet_metadata.google.cloud.dialogflow.cx.v3beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-cx", - "version": "3.5.0", + "version": "3.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dialogflow-cx/samples/package.json b/packages/google-cloud-dialogflow-cx/samples/package.json index c63c7e42091a..ad449dca3918 100644 --- a/packages/google-cloud-dialogflow-cx/samples/package.json +++ b/packages/google-cloud-dialogflow-cx/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/dialogflow-cx": "^3.5.0", + "@google-cloud/dialogflow-cx": "^3.6.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-discoveryengine/CHANGELOG.md b/packages/google-cloud-discoveryengine/CHANGELOG.md index 2f9d8291f2a5..baec1e66ee5f 100644 --- a/packages/google-cloud-discoveryengine/CHANGELOG.md +++ b/packages/google-cloud-discoveryengine/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [0.7.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.6.0...discoveryengine-v0.7.0) (2023-06-14) + + +### âš  BREAKING CHANGES + +* use v1 as the default version ([#4333](https://github.com/googleapis/google-cloud-node/issues/4333)) +* [discoveryengine] remove the summarization feature from v1 version ([#4273](https://github.com/googleapis/google-cloud-node/issues/4273)) + +### Features + +* Use v1 as the default version ([#4333](https://github.com/googleapis/google-cloud-node/issues/4333)) ([1415f5f](https://github.com/googleapis/google-cloud-node/commit/1415f5f0cdbd284fb11427fe1053048e278e7546)) + + +### Bug Fixes + +* [discoveryengine] remove the summarization feature from v1 version ([#4273](https://github.com/googleapis/google-cloud-node/issues/4273)) ([0b9c928](https://github.com/googleapis/google-cloud-node/commit/0b9c928a45e5de78dd13894dc537b351f90a9d56)) + ## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.5.0...discoveryengine-v0.6.0) (2023-05-04) diff --git a/packages/google-cloud-discoveryengine/package.json b/packages/google-cloud-discoveryengine/package.json index 3146d42d15f7..a7dcba25122a 100644 --- a/packages/google-cloud-discoveryengine/package.json +++ b/packages/google-cloud-discoveryengine/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/discoveryengine", - "version": "0.6.0", + "version": "0.7.0", "description": "Discovery Engine API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json b/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json index 31b61379a4d4..9f2b71951ec5 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json +++ b/packages/google-cloud-discoveryengine/samples/generated/v1/snippet_metadata.google.cloud.discoveryengine.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-discoveryengine", - "version": "0.6.0", + "version": "0.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json index 2d4df227bc5c..eaaf985c0748 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json +++ b/packages/google-cloud-discoveryengine/samples/generated/v1beta/snippet_metadata.google.cloud.discoveryengine.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-discoveryengine", - "version": "0.6.0", + "version": "0.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-discoveryengine/samples/package.json b/packages/google-cloud-discoveryengine/samples/package.json index 1fed6dae5d8c..33e8cafea76e 100644 --- a/packages/google-cloud-discoveryengine/samples/package.json +++ b/packages/google-cloud-discoveryengine/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/discoveryengine": "^0.6.0" + "@google-cloud/discoveryengine": "^0.7.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-orchestration-airflow-service/CHANGELOG.md b/packages/google-cloud-orchestration-airflow-service/CHANGELOG.md index 749222da7176..5dde95835fa3 100644 --- a/packages/google-cloud-orchestration-airflow-service/CHANGELOG.md +++ b/packages/google-cloud-orchestration-airflow-service/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.5.0](https://github.com/googleapis/google-cloud-node/compare/orchestration-airflow-v2.4.0...orchestration-airflow-v2.5.0) (2023-06-14) + + +### Features + +* [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties ([33373fd](https://github.com/googleapis/google-cloud-node/commit/33373fd503fd476ed5d5a6ced1e48d86dc0459e1)) +* [orchestration] added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties ([#4341](https://github.com/googleapis/google-cloud-node/issues/4341)) ([33373fd](https://github.com/googleapis/google-cloud-node/commit/33373fd503fd476ed5d5a6ced1e48d86dc0459e1)) + ## [2.4.0](https://github.com/googleapis/google-cloud-node/compare/orchestration-airflow-v2.3.2...orchestration-airflow-v2.4.0) (2023-05-02) diff --git a/packages/google-cloud-orchestration-airflow-service/package.json b/packages/google-cloud-orchestration-airflow-service/package.json index 71f7181f3234..91770ab4c866 100644 --- a/packages/google-cloud-orchestration-airflow-service/package.json +++ b/packages/google-cloud-orchestration-airflow-service/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/orchestration-airflow", - "version": "2.4.0", + "version": "2.5.0", "description": "orchestration-airflow client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json index 4d67751b1e09..1c1444e5e21c 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-service", - "version": "2.4.0", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json index e200cc716440..3da87b1dd1a1 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-service", - "version": "2.4.0", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-orchestration-airflow-service/samples/package.json b/packages/google-cloud-orchestration-airflow-service/samples/package.json index 596f1b687f7b..adb4efa3f40d 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/package.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/orchestration-airflow": "^2.4.0" + "@google-cloud/orchestration-airflow": "^2.5.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-rapidmigrationassessment/CHANGELOG.md b/packages/google-cloud-rapidmigrationassessment/CHANGELOG.md new file mode 100644 index 000000000000..bd2d44f80745 --- /dev/null +++ b/packages/google-cloud-rapidmigrationassessment/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-06-14) + + +### Features + +* Add initial files for google.cloud.rapidmigrationassessment.v1 ([#4335](https://github.com/googleapis/google-cloud-node/issues/4335)) ([e1211f0](https://github.com/googleapis/google-cloud-node/commit/e1211f0b2bc1557cca5ba63949ef1fb8cdacedf6)) diff --git a/packages/google-cloud-rapidmigrationassessment/package.json b/packages/google-cloud-rapidmigrationassessment/package.json index d6849c20af53..636a29a1cdf1 100644 --- a/packages/google-cloud-rapidmigrationassessment/package.json +++ b/packages/google-cloud-rapidmigrationassessment/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/rapidmigrationassessment", - "version": "0.0.0", + "version": "0.1.0", "description": "Rapid Migration Assessment API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json index 8a5f913fcc34..6f0eef50bcab 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata.google.cloud.rapidmigrationassessment.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-rapidmigrationassessment", - "version": "0.0.0", + "version": "0.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-rapidmigrationassessment/samples/package.json b/packages/google-cloud-rapidmigrationassessment/samples/package.json index 5bfa9df95d89..27f8ecc5611f 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/package.json +++ b/packages/google-cloud-rapidmigrationassessment/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/rapidmigrationassessment": "0.0.0" + "@google-cloud/rapidmigrationassessment": "^0.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index eac8a0110a63..561bfa0c65aa 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [7.5.0](https://github.com/googleapis/google-cloud-node/compare/security-center-v7.4.0...security-center-v7.5.0) (2023-06-14) + + +### Features + +* [securitycenter] Add user agent and DLP parent type fields to finding's list of attributes ([#4332](https://github.com/googleapis/google-cloud-node/issues/4332)) ([0552bb9](https://github.com/googleapis/google-cloud-node/commit/0552bb983dae0d565a68fd9ab315c40492f13e46)) + ## [7.4.0](https://github.com/googleapis/google-cloud-node/compare/security-center-v7.3.0...security-center-v7.4.0) (2023-04-24) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 3b7e0946e607..d5c7c622c826 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "7.4.0", + "version": "7.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index 895ed0dbd357..7bcad6f22cd9 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "7.4.0", + "version": "7.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 7d757e91e345..d8262088f281 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "7.4.0", + "version": "7.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index 1c4161a72bce..8f1b024500be 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "7.4.0", + "version": "7.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index c07208d35945..f35426f9dacf 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^3.0.0", - "@google-cloud/security-center": "^7.4.0" + "@google-cloud/security-center": "^7.5.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-vmwareengine/CHANGELOG.md b/packages/google-cloud-vmwareengine/CHANGELOG.md index a9b5660a025d..eb65681e088a 100644 --- a/packages/google-cloud-vmwareengine/CHANGELOG.md +++ b/packages/google-cloud-vmwareengine/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/vmwareengine-v0.1.2...vmwareengine-v0.2.0) (2023-06-14) + + +### Features + +* [vmwareengine] Adding private connection CRUD, updating management subnets and time-limited PC features ([#4328](https://github.com/googleapis/google-cloud-node/issues/4328)) ([f12063c](https://github.com/googleapis/google-cloud-node/commit/f12063c60a4c8ea05e6269babe2eaa6775974c6f)) + ## [0.1.2](https://github.com/googleapis/google-cloud-node/compare/vmwareengine-v0.1.1...vmwareengine-v0.1.2) (2023-04-13) diff --git a/packages/google-cloud-vmwareengine/package.json b/packages/google-cloud-vmwareengine/package.json index 738df109bec8..d335c083f80b 100644 --- a/packages/google-cloud-vmwareengine/package.json +++ b/packages/google-cloud-vmwareengine/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/vmwareengine", - "version": "0.1.2", + "version": "0.2.0", "description": "VMware Engine API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json index aabdfea7b2e6..91335a4ae663 100644 --- a/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-vmwareengine", - "version": "0.1.2", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-vmwareengine/samples/package.json b/packages/google-cloud-vmwareengine/samples/package.json index f2d1be907098..43601bc11d53 100644 --- a/packages/google-cloud-vmwareengine/samples/package.json +++ b/packages/google-cloud-vmwareengine/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/vmwareengine": "^0.1.2" + "@google-cloud/vmwareengine": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-container/CHANGELOG.md b/packages/google-container/CHANGELOG.md index 7664f23d4fc4..c514e4979922 100644 --- a/packages/google-container/CHANGELOG.md +++ b/packages/google-container/CHANGELOG.md @@ -4,6 +4,16 @@ [1]: https://www.npmjs.com/package/@google-cloud/container?activeTab=versions +## [4.13.0](https://github.com/googleapis/google-cloud-node/compare/container-v4.12.0...container-v4.13.0) (2023-06-14) + + +### Features + +* [container] add API for GPU driver installation config ([f5b1533](https://github.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) +* [container] add API for GPU driver installation config ([#4330](https://github.com/googleapis/google-cloud-node/issues/4330)) ([f5b1533](https://github.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) +* Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters ([f5b1533](https://github.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) +* Add workloadPolicyConfig API field to allow customer enable NET_ADMIN capability for their autopilot clusters ([f5b1533](https://github.com/googleapis/google-cloud-node/commit/f5b153353788f4df4fee6d19a6cd013fe6bb29f5)) + ## [4.12.0](https://github.com/googleapis/google-cloud-node/compare/container-v4.11.0...container-v4.12.0) (2023-06-06) diff --git a/packages/google-container/package.json b/packages/google-container/package.json index 1aadb01a5398..f0b6ed4fe6b9 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/container", "description": "Google Container Engine API client for Node.js", - "version": "4.12.0", + "version": "4.13.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index 6535953f67bc..b0cac176d9ed 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "4.12.0", + "version": "4.13.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json index 3b791d163491..4582f1c4c288 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "4.12.0", + "version": "4.13.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/package.json b/packages/google-container/samples/package.json index 5ba3e341de41..bca6cff3b519 100644 --- a/packages/google-container/samples/package.json +++ b/packages/google-container/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1000000" }, "dependencies": { - "@google-cloud/container": "^4.12.0", + "@google-cloud/container": "^4.13.0", "uuid": "^9.0.0" }, "devDependencies": {